diff options
author | Miles Bader <miles@gnu.org> | 2004-06-28 07:56:49 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2004-06-28 07:56:49 +0000 |
commit | 1ec1f46d8bb0aadcd9b2352a50f0d474fd5335d7 (patch) | |
tree | d0a8b52c066bd8ba411fa1585eef63540760444d | |
parent | a1b8bed3e834b5232fd2cf4bfbe1d0bc2ee4680a (diff) | |
parent | 817e73c0bf35c607568db56649c631ef3a696b25 (diff) | |
download | emacs-1ec1f46d8bb0aadcd9b2352a50f0d474fd5335d7.tar.gz |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-15
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-218
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-220
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-221
Restore deleted tagline in etc/TUTORIAL.ru
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-222
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-228
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-229
Remove TeX output files from the archive
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-230
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-247
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-248
src/lisp.h (CYCLE_CHECK): Macro moved from xfaces.c
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-249
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-258
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-263
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-264
Update from CVS: lispref/display.texi: emacs -> Emacs.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-265
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-274
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-275
Update from CVS: man/makefile.w32-in: Revert last change
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-276
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-295
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-296
Allow restarting an existing debugger session that's exited
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-297
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-299
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-300
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-327
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-328
Update from CVS: src/.gdbinit (xsymbol): Fix last change.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-329
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-344
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-345
Tweak source regexps so that building in place won't cause problems
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-346
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-351
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-352
Update from CVS: lisp/flymake.el: New file.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-353
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-361
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-362
Support " [...]" style defaults in minibuffer-electric-default-mode
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-363
(read-number): Use canonical format for default in prompt.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-364
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-367
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-368
Improve display-supports-face-attributes-p on non-ttys
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-369
Rewrite face-differs-from-default-p
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-370
Move `display-supports-face-attributes-p' entirely into C code
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-371
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-372
Simplify face-differs-from-default-p; don't consider :stipple.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-373
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-374
(tty_supports_face_attributes_p): Ensure attributes differ from default
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-375
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-376
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-377
(Fdisplay_supports_face_attributes_p): Work around bootstrapping problem
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-378
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-380
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-381
Face merging cleanups
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-382
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-384
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-385
src/xfaces.c (push_named_merge_point): Return 0 if a cycle is detected
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-386
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-395
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-396
Tweak arch tagging to make build/install-in-place less annoying
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-397
Work around vc-arch problems when building eshell
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-398
Tweak permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-399
Tweak directory permissions
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-400
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-401
More build-in-place tweaking of arch tagging
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-402
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-403
Yet more build-in-place tweaking of arch tagging
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-404
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-409
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-410
Make sure image types are initialized for lookup too
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-411
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-416
Update from CVS
539 files changed, 43927 insertions, 14577 deletions
diff --git a/.arch-inventory b/.arch-inventory new file mode 100644 index 00000000000..8d55bbd3512 --- /dev/null +++ b/.arch-inventory @@ -0,0 +1,10 @@ +# Generated files +precious ^(config\.status|config\.cache)$ + +# Build-in-place makes these directories, so just ignore them +precious ^(info)$ + +# Install-in-place makes these directories, so just ignore them +backup ^(bin|data|lock|site-lisp)$ + +# arch-tag: 6eeeaa4e-cc7e-4b22-b3d7-1089e155da14 @@ -22,5 +22,5 @@ not part of the Emacs distribution.) (3) By hand. Do cat info/emacs* | more "+/^File: emacs, Node: Bugs," -Please first check the file etc/PROBLEMS (e.g. with C-h P in Emacs) to +Please first check the file etc/PROBLEMS (e.g. with C-h C-e in Emacs) to make sure it isn't a known issue. diff --git a/ChangeLog b/ChangeLog index db4f7a2aacd..8882deb6954 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2004-06-15 Luc Teirlinck <teirllm@auburn.edu> + + * info/dir (File): Add emacs-xtra. + * Makefile.in (install-arch-indep, uninstall): Add emacs-xtra. + +2004-06-12 Juri Linkov <juri@jurta.org> + + * info/dir: Move menu help lines from `* Menu:' to file header. + Describe the purpose of a red *. + +2004-05-04 Dave Love <fx@gnu.org> + + * configure.in: Don't use `extrasub'. + +2004-04-29 Dave Love <fx@gnu.org> + + * configure.in: Don't forget to quote args to `test'. + +2004-04-24 Thien-Thi Nguyen <ttn@gnu.org> + + * autogen.sh: Update filename in "please read" message. + +2004-04-17 Richard M. Stallman <rms@gnu.org> + + * INSTALL: Move the info about site-lisp dirs, + and say uninstalled Emacs looks there too. + 2004-04-04 Eli Zaretskii <eliz@gnu.org> * config.bat (lib-src): Recognize comment lines in Makefile.in @@ -466,17 +466,6 @@ are installed in the following directories: at the same time; in particular, you don't have to make Emacs unavailable while installing a new version. -`/usr/local/share/emacs/VERSION/site-lisp' holds the local Emacs Lisp - files installed for Emacs version VERSION only. - -`/usr/local/share/emacs/site-lisp' holds the local Emacs Lisp - files installed for all Emacs versions. - - When Emacs is installed, it searches for its Lisp files - in `/usr/local/share/emacs/VERSION/site-lisp', then in - `/usr/local/share/emacs/site-lisp', and finally in - `/usr/local/share/emacs/VERSION/lisp'. - `/usr/local/share/emacs/VERSION/etc' holds the Emacs tutorial, the DOC file, the `yow' database, and other architecture-independent files Emacs might need while @@ -506,6 +495,20 @@ are installed in the following directories: `/usr/local/man/man1' holds the man pages for the programs installed in `/usr/local/bin'. +Any version of Emacs, whether installed or not, also looks for Lisp +files in these directories. + +`/usr/local/share/emacs/VERSION/site-lisp' holds the local Emacs Lisp + files installed for Emacs version VERSION only. + +`/usr/local/share/emacs/site-lisp' holds the local Emacs Lisp + files installed for all Emacs versions. + + When Emacs is installed, it searches for its Lisp files + in `/usr/local/share/emacs/VERSION/site-lisp', then in + `/usr/local/share/emacs/site-lisp', and finally in + `/usr/local/share/emacs/VERSION/lisp'. + If these directories are not what you want, you can specify where to install Emacs's libraries and data files or where Emacs should search for its Lisp files by giving values for `make' variables as part of diff --git a/MAINTAINERS b/MAINTAINERS index c9e16c9c9a0..5b23f9af189 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19,9 +19,6 @@ maintainer has been found so far. Richard Stallman ??? -Andrew Choi - MacOS - Jason Rumney W32 @@ -73,6 +70,9 @@ Miles Bader 2. ============================================================================== +Steven Tamm + MacOS + Eli Zaretskii man/* lispref/* @@ -104,6 +104,9 @@ Miles Bader src/editfns.c lisp/textmodes/refill.el +Thien-Thi Nguyen + VMS + ============================================================================== 3. ============================================================================== diff --git a/Makefile.in b/Makefile.in index 97d9a2a1079..760f7d34f77 100644 --- a/Makefile.in +++ b/Makefile.in @@ -259,7 +259,8 @@ epaths-force: FRC -e 's;\(#.*PATH_BITMAPS\).*$$;\1 "${bitmapdir}";' \ -e 's;\(#.*PATH_X_DEFAULTS\).*$$;\1 "${x_default_search_path}";' \ -e 's;\(#.*PATH_GAME\).*$$;\1 "${gamedir}";' \ - -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";') && \ + -e 's;\(#.*PATH_DOC\).*$$;\1 "${docdir}";' \ + -e 's;/[*] *arch-tag:.*;/*;') && \ ${srcdir}/move-if-change epaths.h.$$$$ src/epaths.h # For parallel make, src should be build before leim. @@ -445,11 +446,9 @@ install-arch-indep: mkdir info if [ `(cd ./etc; /bin/pwd)` != `(cd ${docdir}; /bin/pwd)` ]; \ then \ echo "Copying etc/DOC-* to ${docdir} ..." ; \ - (cd ./etc; tar -chf - DOC* compilation.txt) \ + (cd ./etc; tar -chf - DOC*) \ |(cd ${docdir}; umask 022; tar -xvf - && cat > /dev/null) || exit 1; \ - (cd $(docdir); \ - chown $${LOGNAME:-$$USERNAME} DOC* compilation.txt; \ - chmod a+r DOC* compilation.txt; \ + (cd $(docdir); chown $${LOGNAME:-$$USERNAME} DOC*; chmod a+r DOC*; \ if test "`echo DOC-*`" != "DOC-*"; then rm DOC; fi); \ else true; fi -unset CDPATH; \ @@ -475,7 +474,7 @@ install-arch-indep: mkdir info chmod a+r ${infodir}/dir); \ fi; \ cd ${srcdir}/info ; \ - for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \ + for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-xtra* eshell* eudc* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* reftex* sc* ses* speedbar* tramp* vip* widget* woman* smtpmail*; do \ (cd $${thisdir}; \ ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ chmod a+r ${infodir}/$$f); \ @@ -485,7 +484,7 @@ install-arch-indep: mkdir info thisdir=`/bin/pwd`; \ if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ then \ - for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \ + for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc forms gnus idlwave info message mh-e pcl-cvs reftex sc ses speedbar tramp vip viper widget woman smtpmail; do \ (cd $${thisdir}; \ ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \ done; \ @@ -551,7 +550,7 @@ uninstall: done (cd ${archlibdir} && rm -f fns-*) -rm -rf ${libexecdir}/emacs/${version} - (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*) + (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*) (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext}) (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS)) @@ -755,5 +754,3 @@ bootstrap-clean-before: FRC -(cd lispref && $(MAKE) $(MFLAGS) clean) -(cd lispintro && $(MAKE) $(MFLAGS) clean) (cd leim; $(MAKE) $(MFLAGS) clean) - -# arch-tag: c1162ff6-e0a8-4366-bc1a-2eb544007156 diff --git a/admin/ChangeLog b/admin/ChangeLog index cca47783b62..d0cc63f1e97 100644 --- a/admin/ChangeLog +++ b/admin/ChangeLog @@ -1,3 +1,7 @@ +2004-05-08 Thien-Thi Nguyen <ttn@gnu.org> + + * notes/BRANCH: New file, to be maintained per CVS branch. + 2003-10-01 Miles Bader <miles@gnu.org> * quick-install-emacs: Don't use "function" keyword when defining diff --git a/admin/charsets/Makefile b/admin/charsets/Makefile deleted file mode 100644 index ceecbce8211..00000000000 --- a/admin/charsets/Makefile +++ /dev/null @@ -1,349 +0,0 @@ -# Makefile -- Makefile to generate charset maps in etc/charsets. -# Copyright (C) 2003 -# National Institute of Advanced Industrial Science and Technology (AIST) -# Registration Number H13PRO009 -# -# This file is part of GNU Emacs. - -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# Commentary - -# At first, set these environment variables: -# GLIBC_CHARMAPS -# Directory of glibc-VERSION/localedate/charmaps. -# VERSION must be 2.3 or the later. -# MISC_CHARMAPS -# Direcory containing these charmap files: -# o bulgarian-mik.txt.gz -# provided at <http://czyborra.com/charsets/> -# o PTCP154 -# provided at <http://www.iana.org/assignments/charset-reg/> -# o stdenc.txt and symbol.txt -# provided at <http://www.unicode.org/Public/MAPPINGS/> -# o cp932.txt -# provided at <http://www.unicode.org/Public/MAPPINGS/VENDERS> -# o Uni2JIS -# provided at <http://kanji.zinbun.kyoto-u.ac.jp/~yasuoka/CJK.html> -# o 720.htm and 858.htm -# provided at <http://www.microsoft.com/globaldev/reference/oem/> -# o eucJP-13th.txt, eucJP-udc.txt, eucJP-ibmext.txt -# provided at <http://www.opengroup.or.jp/jvc/cde/> -# o cns2ucsdkw.txt -# available by: -# % cvs -d :pserver:anonymous@cvs.kanji-database.sourceforge.net:\ -# /cvsroot/kanji-database login -# % cvs -d :pserver:anonymous@cvs.kanji-database.sourceforge.net:\ -# /cvsroot/kanji-database co kanji-database -# OLDEMACS -# emacs of version 21.3.50 or later -# -# Then, do this: -# % make XXX.map (or make all) -# % make install - -CHARSETS = ${ISO8859} ${IBM} ${CODEPAGE} ${CJK} ${MISC} ${MULE} - -# Note: We can not prepend "ISO-" to these map files because of file -# name limits on DOS. -ISO8859 = \ - 8859-2.map 8859-3.map 8859-4.map 8859-5.map 8859-6.map 8859-7.map \ - 8859-8.map 8859-9.map 8859-10.map 8859-11.map 8859-13.map 8859-14.map \ - 8859-15.map 8859-16.map - -IBM = \ - IBM037.map IBM038.map \ - IBM256.map IBM273.map IBM274.map IBM275.map IBM277.map IBM278.map \ - IBM280.map IBM281.map IBM284.map IBM285.map IBM290.map IBM297.map \ - IBM420.map IBM423.map IBM424.map IBM437.map IBM500.map IBM850.map \ - IBM851.map IBM852.map IBM855.map IBM856.map IBM857.map IBM860.map \ - IBM861.map IBM862.map IBM863.map IBM864.map IBM865.map IBM866.map \ - IBM868.map IBM869.map IBM870.map IBM871.map IBM874.map IBM875.map \ - IBM880.map IBM891.map IBM903.map IBM904.map IBM905.map IBM918.map \ - IBM1004.map IBM1026.map IBM1047.map - -CODEPAGE = \ - CP737.map CP775.map CP1125.map\ - CP1250.map CP1251.map CP1252.map CP1253.map CP1254.map \ - CP1255.map CP1256.map CP1257.map CP1258.map \ - CP10007.map \ - CP720.map CP858.map - -CJK = GB2312.map GBK.map GB180302.map GB180304.map \ - BIG5.map BIG5-HKSCS.map\ - CNS-1.map CNS-2.map CNS-3.map CNS-4.map CNS-5.map CNS-6.map CNS-7.map \ - CNS-F.map \ - JISX0201.map JISX0208.map JISX0212.map JISX2131.map JISX2132.map \ - JISC6226.map CP932-2BYTE.map JISX213A.map\ - KSC5601.map KSC5636.map JOHAB.map - -MISC = KOI-8.map KOI8-R.map KOI8-U.map KOI8-T.map ALTERNATIVNYJ.map \ - MIK.map PTCP154.map \ - TIS-620.map VISCII.map VSCII.map VSCII-2.map\ - KA-PS.map KA-ACADEMY.map \ - HP-ROMAN8.map NEXTSTEP.map MACINTOSH.map EBCDICUK.map EBCDICUS.map \ - stdenc.map symbol.map \ - CP949-2BYTE.map \ - BIG5-1.map BIG5-2.map - -# Emacs-mule charsets. -MULE = MULE-ethiopic.map MULE-ipa.map MULE-is13194.map \ - MULE-sisheng.map MULE-tibetan.map \ - MULE-lviscii.map MULE-uviscii.map - -TRANS_TABLE = cp51932.el eucjp-ms.el - -all: ${CHARSETS} ${TRANS_TABLE} - -AWK = gawk - -# Rules for each charset - -VSCII.map: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[0-9a-f].[ ]/' GLIBC-1 compact.awk > $@ - -VSCII-2.map: ${GLIBC_CHARMAPS}/TCVN5712-1 mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[2-7a-f].[ ]/' GLIBC-1 compact.awk \ - | sed 's/0x20-0x7F.*/0x00-0x7F 0x0000/' > $@ - -ALTERNATIVNYJ.map: IBM866.map - # Generating $@... - @echo "# Modified from ibm866 according to the chart at" > $@ - @echo "# http://www.cyrillic.com/ref/cyrillic/koi-8alt.html," >> $@ - @echo "# with guesses for the Unicodes of the glyphs." >> $@ - @sed -e '/0xF2/ s/ .*/ 0x2019/' \ - -e '/0xF3/ s/ .*/ 0x2018/' \ - -e '/0xF4/ s/ .*/ 0x0301/' \ - -e '/0xF5/ s/ .*/ 0x0300/' \ - -e '/0xF6/ s/ .*/ 0x203A/' \ - -e '/0xF7/ s/ .*/ 0x2039/' \ - -e '/0xF8/ s/ .*/ 0x2191/' \ - -e '/0xF9/ s/ .*/ 0x2193/' \ - -e '/0xFA/ s/ .*/ 0x00B1/' \ - -e '/0xFB/ s/ .*/ 0x00F7/' < $< >> $@ - -MIK.map: ${MISC_CHARMAPS}/bulgarian-mik.txt.gz mapconv compact.awk - # Generating $@... - @mapconv $< '1,$$' CZYBORRA compact.awk > $@ - -PTCP154.map: ${MISC_CHARMAPS}/PTCP154 mapconv compact.awk - # Generating $@... - @mapconv $< '/^0x/' IANA compact.awk > $@ - -stdenc.map: ${MISC_CHARMAPS}/stdenc.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@ - -symbol.map: ${MISC_CHARMAPS}/symbol.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^[0-9A-Fa-f]/' UNICODE compact.awk > $@ - -CP720.map: ${MISC_CHARMAPS}/720.htm mapconv compact.awk - # Generating $@... - @mapconv $< '/^[0-9A-F]/' MICROSOFT compact.awk > $@ - -CP858.map: ${MISC_CHARMAPS}/858.htm mapconv compact.awk - # Generating $@... - @mapconv $< '/^[0-9A-F]/' MICROSOFT compact.awk > $@ - -CP949-2BYTE.map: ${GLIBC_CHARMAPS}/CP949 mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@ - -GB2312.map: ${GLIBC_CHARMAPS}/GB2312 mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@ - -GBK.map: ${GLIBC_CHARMAPS}/GBK mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@ - -GB180302.map: ${GLIBC_CHARMAPS}/GB18030 mapconv gb180302.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x..\/x..[ ]/' GLIBC-2 gb180302.awk > $@ - -GB180304.map: GB180302.map gb180304.awk - # Generating $@... - @$(AWK) -f gb180304.awk < $< > $@ - -JISX0201.map: ${GLIBC_CHARMAPS}/JIS_X0201 mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[0-9]/' GLIBC-1 compact.awk > $@ - @echo "# Generated by hand" >> $@ - @echo "0xA1-0xDF 0xFF61" >> $@ - -JISX0208.map: ${GLIBC_CHARMAPS}/EUC-JP mapconv - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \ - | sed 's/0x2015/0x2014/' > $@ - -JISX0212.map: ${GLIBC_CHARMAPS}/EUC-JP mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 compact.awk > $@ - -JISX2131.map: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 \ - | sed -e 's/0x2015/0x2014/' -e 's/0x2299/0x29BF/' > $@ - -JISX2132.map: ${GLIBC_CHARMAPS}/EUC-JISX0213 mapconv - # Generating $@... - @mapconv $< '/^<.*[ ]\/x8f/ s,/x8f,,' GLIBC-2-7 > $@ - -JISX213A.map: - # Generating $@ - @(echo "0x2E21 0x4FF1"; \ - echo "0x2F7E 0x525D"; \ - echo "0x4F54 0x20B9F"; \ - echo "0x4F7E 0x541E"; \ - echo "0x7427 0x5653"; \ - echo "0x7E7A 0x59F8"; \ - echo "0x7E7B 0x5C5B"; \ - echo "0x7E7C 0x5E77"; \ - echo "0x7E7D 0x7626"; \ - echo "0x7E7E 0x7E6B") > $@ - -CP932-2BYTE.map: ${MISC_CHARMAPS}/cp932.txt mapconv cp932.awk - # Generating $@... - @mapconv $< '/^0x[89A-F][0-9A-F][0-9A-F]/' UNICODE2 cp932.awk > $@ - -cp51932.el: CP932-2BYTE.map cp51932.awk - @$(AWK) -f cp51932.awk < CP932-2BYTE.map > $@ - -eucjp-ms.el: ${MISC_CHARMAPS}/eucJP-13th.txt ${MISC_CHARMAPS}/eucJP-udc.txt \ - ${MISC_CHARMAPS}/eucJP-ibmext.txt eucjp-ms.awk - @(cd ${MISC_CHARMAPS}; \ - cat eucJP-13th.txt eucJP-udc.txt eucJP-ibmext.txt) \ - | $(AWK) -f eucjp-ms.awk > $@ - -JISC6226.map : ${MISC_CHARMAPS}/Uni2JIS mapconv kuten.awk - # Generating $@... - @mapconv $< '/^[^#].*0-/' YASUOKA kuten.awk > $@ - -KSC5601.map: ${GLIBC_CHARMAPS}/EUC-KR mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@ - -BIG5.map: ${GLIBC_CHARMAPS}/BIG5 mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2 > $@ - -BIG5-1.map: BIG5.map mapconv big5.awk - # Generating $@... - @echo "Generated from $<" > $@ - @sed -n -e '/0xa140/,/0xc8fe/p' < $< | gawk -f big5.awk >> $@ - -BIG5-2.map: BIG5.map mapconv big5.awk - # Generating $@... - @echo "Generated from $<" > $@ - @sed -n -e '/0xc940/,$$ p' < $< | gawk -f big5.awk >> $@ - -BIG5-HKSCS.map: ${GLIBC_CHARMAPS}/BIG5-HKSCS mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[89a-f].\//' GLIBC-2 compact.awk > $@ - -JOHAB.map: ${GLIBC_CHARMAPS}/JOHAB mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[89a-f]/' GLIBC-2 compact.awk > $@ - -CNS-1.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x[a-f]/' GLIBC-2-7 compact.awk > $@ - -# CNS-1.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk -# # Generating $@... -# @mapconv $< '/^C1/' KANJI-DATABASE compact.awk > $@ - -CNS-2.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^C2/' KANJI-DATABASE compact.awk > $@ - -CNS-3.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^C3/' KANJI-DATABASE compact.awk > $@ - -CNS-4.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^C4/' KANJI-DATABASE compact.awk > $@ - -CNS-5.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^C5/' KANJI-DATABASE compact.awk > $@ - -CNS-6.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^C6/' KANJI-DATABASE compact.awk > $@ - -CNS-7.map: ${MISC_CHARMAPS}/cns2ucsdkw.txt mapconv compact.awk - # Generating $@... - @mapconv $< '/^C7/' KANJI-DATABASE compact.awk > $@ - -CNS-F.map: ${GLIBC_CHARMAPS}/EUC-TW mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*\/x8e\/xaf/ s,/x8e/xaf,,' GLIBC-2-7 compact.awk > $@ - -# General target to produce map files for mule charsets. -MULE-%.map: mule-charsets.el - # Generating $@... - @${OLDEMACS} -batch -l ./mule-charsets.el $@ - -# General target to produce map files for ISO-8859, GEORGIAN, and -# EBCDIC charsets. We can not use the original file name because of -# file name limit on DOS. "KA" is ISO 639 language code for Georgian. - -8859-%.map: ${GLIBC_CHARMAPS}/ISO-8859-% mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ - -KA-%.map: ${GLIBC_CHARMAPS}/GEORGIAN-% mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ - -EBCDIC%.map: ${GLIBC_CHARMAPS}/EBCDIC-% mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ - -# General target to produce map files for single-byte charsets. - -%.map: ${GLIBC_CHARMAPS}/% mapconv compact.awk - # Generating $@... - @mapconv $< '/^<.*[ ]\/x/' GLIBC-1 compact.awk > $@ - -install: - @for f in ${CHARSETS}; do \ - if test -r $$f; then \ - if ! cmp -s $$f ../../etc/charsets/$$f; then \ - echo updating $$f; \ - cp $$f ../../etc/charsets; \ - fi; \ - fi; \ - done - @for f in ${TRANS_TABLE}; do \ - if test -r $$f; then \ - if ! cmp -s $$f ../../lisp/international/$$f; then \ - echo updating $$f; \ - cp $$f ../../lisp/international; \ - fi; \ - fi; \ - done - -# Clear files that are automatically generated. -clean: - rm -f ${CHARSETS} ${TRANS_TABLE} - -# arch-tag: 90b3bf30-1fef-45bf-b30c-665c30c22310 diff --git a/admin/notes/BRANCH b/admin/notes/BRANCH new file mode 100644 index 00000000000..2c343e53f15 --- /dev/null +++ b/admin/notes/BRANCH @@ -0,0 +1,18 @@ +This file describes the CVS branch in which it is maintained. +Everything below the line is branch-specific. +________________________________________________________________________ + +This is the "HEAD" branch, otherwise known as the "trunk". Its primary +purpose is to accumulate changes that are not yet partitioned into a +specific (versioned) release. When people say "use CVS emacs", this is +the branch they are talking about. Likewise, a "cvs checkout" without +the "-r" option results in this branch. + +The plans for this branch are not specified; Emacs hackers add to it +relatively free of constraint (aside from proper legal / accounting +practices), although sometimes there is related discussion on the +emacs-devel mailing list. + +The closure process for this branch is undocumented; concepts such as +"freeze", "release", or "integration with the trunk" are not applicable +to this branch. diff --git a/admin/notes/exit-value b/admin/notes/exit-value new file mode 100644 index 00000000000..e59bb614b9b --- /dev/null +++ b/admin/notes/exit-value @@ -0,0 +1,35 @@ +ttn 2004-05-09 + +The exit value of a program returning to the shell on unixoid systems is +typically 0 for success, and non-0 (such as 1) for failure. For vms it is +odd (1,3,5...) for success, even (0,2,4...) for failure. + +This holds from the point of view of the "shell" (in quotes because vms has a +different dispatch model that is not explained further here). + +From the point of view of the program, nowadays stdlib.h on both type of +systems provides macros `EXIT_SUCCESS' and `EXIT_FAILURE' that should DTRT. + +NB: The numerical values of these macros DO NOT need to fulfill the the exit +value requirements outlined in the first paragraph! That is the job of the +`exit' function. Thus, this kind of construct shows misunderstanding: + + #ifdef VMS + exit (1); + #else + exit (0); + #endif + +Values aside from EXIT_SUCCESS and EXIT_FAILURE are tricky. + + + +ttn 2004-05-12 + +Values aside from EXIT_SUCCESS and EXIT_FAILURE can be used to indicate +finer gradations of failure. If this is the only information available +to the caller, clamping such values to EXIT_FAILURE loses information. +If there are other ways to indicate the problem to the caller (such as +a message to stderr) it may be ok to clamp. In all cases, it is the +relationship between the program and its caller that must be examined. +[Insert ZAMM quote here.] diff --git a/autogen.sh b/autogen.sh index 89d6b9c4378..0fe7ef32fc2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,6 @@ #!/bin/sh -echo "Please read INSTALL-CVS for instructions on how to build Emacs from CVS." +echo "Please read INSTALL.CVS for instructions on how to build Emacs from CVS." # Exit with failure, since people may have generic build scripts that # try things like "autogen.sh && ./configure && make". diff --git a/configure b/configure index ce011807fb2..0e74a04e700 100755 --- a/configure +++ b/configure @@ -1573,15 +1573,6 @@ echo "$as_me: WARNING: The directory tree \`${srcdir}' is being used use GNU make. If you do not have GNU make, then you must now do \`make distclean' in ${srcdir}, and then run $0 again." >&2;} - -extrasub='/^VPATH[ ]*=/c\ -vpath %.c $(srcdir)\ -vpath %.h $(srcdir)\ -vpath %.y $(srcdir)\ -vpath %.l $(srcdir)\ -vpath %.s $(srcdir)\ -vpath %.in $(srcdir)\ -vpath %.texi $(srcdir)' fi #### Given the configuration name, set machfile and opsysfile to the @@ -4193,6 +4184,54 @@ then fi +late_LDFLAGS=$LDFLAGS +if test "$GCC" = yes; then + LDFLAGS="$LDFLAGS -Wl,-znocombreloc" +else + LDFLAGS="$LDFLAGS -znocombreloc" +fi + +echo "$as_me:$LINENO: checking For -znocombreloc" >&5 +echo $ECHO_N "checking For -znocombreloc... $ECHO_C" >&6 + +cat >conftest.$ac_ext <<_ACEOF +main(){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 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LDFLAGS=$late_LDFLAGS + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 diff --git a/configure.in b/configure.in index 3e89bea0c2d..b7318b8f805 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ dnl To rebuild the `configure' script from this, execute the command dnl autoconf dnl in the directory containing this script. dnl -dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003 +dnl Copyright (C) 1994, 95, 96, 1999, 2000, 01, 02, 03, 2004 dnl Free Software Foundation, Inc. dnl dnl This file is part of GNU Emacs. @@ -170,15 +170,6 @@ if test `pwd` != `(cd ${srcdir} && pwd)` \ use GNU make. If you do not have GNU make, then you must now do `make distclean' in ${srcdir}, and then run $0 again.]]) - -[extrasub='/^VPATH[ ]*=/c\ -vpath %.c $(srcdir)\ -vpath %.h $(srcdir)\ -vpath %.y $(srcdir)\ -vpath %.l $(srcdir)\ -vpath %.s $(srcdir)\ -vpath %.in $(srcdir)\ -vpath %.texi $(srcdir)'] fi #### Given the configuration name, set machfile and opsysfile to the @@ -1280,7 +1271,7 @@ dnl Treat GCC specially since it just gives a non-fatal `unrecognized option' dnl if not built to support GNU ld. late_LDFLAGS=$LDFLAGS -if test $GCC = yes; then +if test "$GCC" = yes; then LDFLAGS="$LDFLAGS -Wl,-znocombreloc" else LDFLAGS="$LDFLAGS -znocombreloc" diff --git a/etc/.arch-inventory b/etc/.arch-inventory new file mode 100644 index 00000000000..6ab642ca65c --- /dev/null +++ b/etc/.arch-inventory @@ -0,0 +1,10 @@ +# Unlike most emacs dirs, etc has a simple non-autoconf-generated makefile +source ^(Makefile)$ + +# Generated files (DOC-X is generated on windows) +backup ^(DOC(|-[0-9.]*|-X))$ + +# Install-in-place on NT makes this directory, so just ignore it +backup ^(icons)$ + +# arch-tag: 5a1d62e0-593a-48cd-8743-8d45dc58dfae diff --git a/etc/ChangeLog b/etc/ChangeLog index 580c256f12e..05c4549bee3 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,50 @@ +2004-06-10 Lars Hansen <larsh@math.ku.dk> + + * NEWS: Describe dired-omit-mode. Describe desktop package changes. + +2004-05-29 Steven Tamm <steventamm@mac.com> + + * PROBLEMS: Document the workaround for the Mac OS X port not + picking up the environment variables from dotfiles. + +2004-05-16 Juri Linkov <juri@jurta.org> + + * TUTORIAL.pt_BR: Add coding: latin-1, sentence-end-double-space: nil. + + * ru-refcard.tex: Add C-u and RET to `C-h t Russian'. + +2004-05-15 Alex Ott <ott@jet.msk.su> + + * ru-refcard.tex, ru-refcard.ps: New files. + +2004-05-14 David Ponce <david@dponce.com> + + * tree-widget: New directory containing tree-widget themes and + images. + +2004-04-13 Marcelo Toledo <marcelo@marcelotoledo.org> + + * TUTORIAL.pt_BR: initial check-in. + +2004-05-06 Dave Love <fx@gnu.org> + + * emacs.py: New file for python-mode's internal use. + +2004-04-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * TODO: Use outline mode. Remove compile.el entry (done). + +2004-04-18 Juri Linkov <juri@jurta.org> + + * TUTORIAL.fr, TUTORIAL.pl, TUTORIAL.ru, TUTORIAL.sl, TUTORIAL.sv + * TUTORIAL.th: Add sentence-end-double-space: nil. + + * TUTORIAL.it, TUTORIAL.nl, TUTORIAL.sv: Add coding: latin-1. + +2004-04-16 David Kastrup <dak@gnu.org> + + * TUTORIAL.ru: Changes by Alex Ott checked in. + 2004-04-14 Jan Nieuwenhuizen <janneke@gnu.org> * TUTORIAL.nl: Update Delete/Delback translation. diff --git a/etc/FOR-RELEASE b/etc/FOR-RELEASE new file mode 100644 index 00000000000..b36632b092b --- /dev/null +++ b/etc/FOR-RELEASE @@ -0,0 +1,13 @@ +Tasks needed before the next release. + +** Test the mbox branch of Rmail. + +** Install the mbox branch of Rmail. + +** Finish updating the Emacs Lisp manual. + +** Finish checking the Emacs Lisp manual. + +** Update the Emacs Manual. + +** Check the Emacs Lisp manual. @@ -4,6 +4,8 @@ See the end for copying conditions. Please send Emacs bug reports to bug-gnu-emacs@gnu.org. For older news, see the file ONEWS +You can narrow news to the specific version by calling +`view-emacs-news' with a prefix argument or by typing C-u C-h C-n. Temporary note: +++ indicates that the appropriate manual has already been updated. @@ -89,6 +91,11 @@ eight-bit-control/eight-bit-graphic charsets aren't now in the range * Installation Changes in Emacs 21.4 +** Emacs includes now support for loading image libraries on demand. +(Currently this feature is only used on MS Windows.) You can configure +the supported image types and their associated dynamic libraries by +setting the variable `image-library-alist'. + --- ** A Bulgarian translation of the Emacs Tutorial is available. @@ -163,6 +170,72 @@ types any more. Add -DUSE_LISP_UNION_TYPE if you want union types. * Changes in Emacs 21.4 +** Passing resources on the command line now works on MS Windows. +You can use --xrm to pass resource settings to Emacs, overriding any +existing values. For example: + + emacs --xrm "Emacs.Background:red" --xrm "Emacs.Geometry:100x20" + +will start up Emacs on an initial frame of 100x20 with red background, +irrespective of geometry or background setting on the Windows registry. + +** New features in evaluation commands + ++++ +*** The function `eval-defun' (C-M-x) called on defface reinitializes +the face to the value specified in the defface expression. + +*** Typing C-x C-e twice prints the value of the integer result +in additional formats (octal, hexadecimal, character) specified +by the new function `eval-expression-print-format'. The same +function also defines the result format for `eval-expression' (M-:), +`eval-print-last-sexp' (C-j) and some edebug evaluation functions. + +** New input method chinese-sisheng for inputting Chinese Pinyin +characters. + +** New command quail-show-key shows what key (or key sequence) to type +in the current input method to input a character at point. + +** Convenient commands to switch buffers in a cyclic order are C-x <left> +(prev-buffer) and C-x <right> (next-buffer). + +** Commands winner-redo and winner-undo, from winner.el, are now bound to +C-c <left> and C-c <right>, respectively. This is an incompatible change. + +** Help commands `describe-function' and `describe-key' now show function +arguments in lowercase italics on displays that support it. To change the +default, customize face `help-argument-name' or redefine the function +`help-default-arg-highlight'. + +--- +** The comint prompt can now be made read-only, using the new user +option `comint-prompt-read-only'. This is not enabled by default, +except in IELM buffers. The read-only status of IELM prompts can be +controlled with the new user option `ielm-prompt-read-only', which +overrides `comint-prompt-read-only'. + +The new commands `comint-kill-whole-line' and `comint-kill-region' +support editing comint buffers with read-only prompts. + +`comint-kill-whole-line' is like `kill-whole-line', but ignores both +read-only and field properties. Hence, it will always kill entire +lines, including any prompts. + +`comint-kill-region' is like `kill-region', except that it ignores +read-only properties, if it is safe to do so. This means that if any +part of a prompt is deleted, then the entire prompt must be deleted +and that all prompts must stay at the beginning of a line. If this is +not the case, then `comint-kill-region' behaves just like +`kill-region' if read-only are involved: it copies the text to the +kill-ring, but does not delete it. + +** You can now use next-error (C-x `) and previous-error to advance to +the next/previous matching line found by M-x occur. + +** Telnet will now prompt you for a port number with C-u M-x telnet. + ++++ ** New command line option -Q. This is like using -q --no-site-file, but in addition it also disables @@ -239,6 +312,37 @@ This is like `strokes-global-set-stroke', but it allows you to bind the stroke directly to a string to insert. This is convenient for using strokes as an input method. ++++ +** Desktop package + +*** Desktop saving is now a minor mode, desktop-save-mode. Variable +desktop-enable is obsolete. Customize desktop-save-mode to enable desktop +saving. + +*** Buffers are saved in the desktop file in the same order as that in the +buffer list. + +*** New commands: + - desktop-revert reverts to the last loaded desktop. + - desktop-change-dir kills current desktop and loads a new. + - desktop-save-in-desktop-dir saves desktop in the directory from which + it was loaded. + +*** New customizable variables: + - desktop-save. Determins whether the desktop should be saved when it is + killed. + - desktop-file-name-format. + - desktop-path. List of directories in which to lookup the desktop file. + - desktop-locals-to-save. + - desktop-globals-to-clear. + - desktop-clear-preserve-buffers-regexp. + +*** New command line option --no-desktop + +*** New hooks: + - desktop-after-read-hook run after a desktop is loaded. + - desktop-no-desktop-file-hook run when no desktop file is found. + --- ** The saveplace.el package now filters out unreadable files. When you exit Emacs, the saved positions in visited files no longer @@ -353,13 +457,15 @@ The technique of setting `sql-mode-font-lock-defaults' directly in your .emacs will no longer establish the default highlighting -- Use `sql-product' to accomplish this. +ANSI keywords are always highlighted. + *** The function `sql-add-product-keywords' can be used to add font-lock rules to the product specific rules. For example, to have all identifiers ending in "_t" under MS SQLServer treated as a type, you would use the following line in your .emacs file: (sql-add-product-keywords 'ms - '("\\<\\w+_t\\>" . font-lock-type-face)) + '(("\\<\\w+_t\\>" . font-lock-type-face))) *** Oracle support includes keyword highlighting for Oracle 9i. Most SQL and PL/SQL keywords are implemented. SQL*Plus commands are @@ -376,6 +482,13 @@ If the username and password are not provided to `sql-ms', osql is called with the -E command line argument to use the operating system credentials to authenticate the user. +*** Postgres support is enhanced. +Keyword highlighting of Postgres 7.3 is implemented. Prompting for +the username and the pgsql `-U' option is added. + +*** MySQL support is enhanced. +Keyword higlighting of MySql 4.0 is implemented. + *** Imenu support has been enhanced to locate tables, views, indexes, packages, procedures, functions, triggers, sequences, rules, and defaults. @@ -413,14 +526,24 @@ restores the previous value of `buffer-invisibility-spec'. ** New command `kill-whole-line' kills an entire line at once. By default, it is bound to C-S-<backspace>. +** New commands to operate on pairs of open and close characters: +`insert-pair', `delete-pair', `raise-sexp'. + +** A prefix argument of C-M-q in Emacs Lisp mode pretty-printifies the +list starting after point. + ** Dired mode: *** New faces dired-header, dired-mark, dired-marked, dired-flagged, dired-ignored, dired-directory, dired-symlink, dired-warning introduced for Dired mode instead of font-lock faces. -*** New Dired command `dired-compare-directories' to mark files with -different file attributes in two dired buffers. +*** New Dired command `dired-compare-directories' marks files +with different file attributes in two dired buffers. + ++++ +*** New Dired command `dired-do-touch' (bound to T) changes timestamps +of marked files with the value entered in the minibuffer. +++ *** In Dired's ! command (dired-do-shell-command), `*' and `?' now @@ -436,17 +559,54 @@ types of files. The variable `dired-view-command-alist' controls what external viewers to use and when. *** In Dired, the w command now copies the current line's file name -into the kill ring. +into the kill ring. With a zero prefix arg, copies absolute file names. + ++++ +** Dired-x: + +*** Omitting files is now a minor mode, dired-omit-mode. The mode toggling +command is bound to M-o. A new command dired-mark-omitted, bound to M-O, +marks omitted files. The variable dired-omit-files-p is obsoleted, use the +mode toggling function instead. ** Info mode: + +*** A numeric prefix argument of `info' selects an Info buffer +with the number appended to the *info* buffer name. + +*** New command `Info-history' (bound to L) displays a menu of visited nodes. + +*** New command `Info-toc' (bound to T) creates a node with table of contents +from the tree structure of menus of the current Info file. + +*** New command `info-apropos' searches the indices of the known +Info files on your system for a string, and builds a menu of the +possible matches. + +*** New command `Info-copy-current-node-name' (bound to w) copies +the current Info node name into the kill ring. With a zero prefix +arg, puts the node name inside the `info' function call. + +*** New command `Info-search-case-sensitively' (bound to S). + +*** New command `Info-search-next' (unbound) repeats the last search +without prompting for a new search string. + +*** New face `info-xref-visited' distinguishes visited nodes from unvisited +and a new option `Info-fontify-visited-nodes' to control this. + +*** http and ftp links in Info are now operational: they look like cross +references and following them calls `browse-url'. + +++ *** Info now hides node names in menus and cross references by default. If you prefer the old behavior, you can set the new user option `Info-hide-note-references' to nil. -*** The new command `info-apropos' searches the indices of the known -Info files on your system for a string, and builds a menu of the -possible matches. +*** Images in Info pages are supported. +Info pages show embedded images, in Emacs frames with image support. +Info documentation that includes images, processed with makeinfo +version 4.7 or newer, compiles to Info pages with embedded images. +++ *** The default value for `Info-scroll-prefer-subnodes' is now nil. @@ -458,6 +618,8 @@ possible matches. 'sql-sqlite'. ** BibTeX mode: +*** The new command bibtex-entry-update (bound to C-c C-u) updates +an existing BibTeX entry. *** New `bibtex-entry-format' option `required-fields', enabled by default. *** bibtex-maintain-sorted-entries can take values `plain', `crossref', and `entry-class' which control the sorting scheme used @@ -670,11 +832,12 @@ and windows-1251 are preloaded since the former is so common and the latter is used by GNU locales. ** The utf-8/16 coding systems have been enhanced. -By default, untranslatable utf-8 sequences (mostly representing CJK -characters) are simply composed into single quasi-characters. User -option `utf-translate-cjk' arranges to translate many utf-8 CJK -character sequences into real Emacs characters in a similar way to the -Mule-UCS system. This uses significant space, so is not the default. +By default, untranslatable utf-8 sequences are simply composed into +single quasi-characters. User option `utf-translate-cjk-mode' (it is +turned on by default) arranges to translate many utf-8 CJK character +sequences into real Emacs characters in a similar way to the Mule-UCS +system. As this loads a fairly big data on demand, people who are not +interested in CJK characters may want to customize it to nil. You can augment/amend the CJK translation via hash tables `ucs-mule-cjk-to-unicode' and `ucs-unicode-to-mule-cjk'. The utf-8 coding system now also encodes characters from most of Emacs's @@ -814,9 +977,9 @@ to give it focus. +++ ** The new command `describe-char' (C-u C-x =) pops up a buffer with description various information about a character, including its -encodings and syntax, its text properties, overlays, and widgets at -point. You can get more information about some of them, by clicking -on mouse-sensitive areas or moving there and pressing RET. +encodings and syntax, its text properties, how to input, overlays, and +widgets at point. You can get more information about some of them, by +clicking on mouse-sensitive areas or moving there and pressing RET. +++ ** The new command `multi-occur' is just like `occur', except it can @@ -832,6 +995,10 @@ can optionally enable mouse highlighting only after you move the mouse, so that highlighting disappears when you press a key. You can also disable mouse highlighting. +** You can now customize if selecting a region by dragging the mouse +shall not copy the selected text to the kill-ring by setting the new +variable mouse-drag-copy-region to nil. + +++ ** font-lock: in modes like C and Lisp where the fontification assumes that an open-paren in column 0 is always outside of any string or comment, @@ -1054,6 +1221,12 @@ counter to the specified source line (the one where point is). Minor Improvements +*** The STARTTLS elisp wrapper (starttls.el) can now use GNUTLS +instead of the OpenSSL based "starttls" tool. For backwards +compatibility, it will prefer "starttls", but you can toggle +`starttls-use-gnutls' to switch to GNUTLS (or simply remove the +"starttls" tool). + *** Do not allow debugger output history variable to grow without bounds. +++ @@ -1200,6 +1373,13 @@ the new function `appt-activate'. The new variable `appt-display-format' controls how reminders are displayed, replacing appt-issue-message, appt-visible, and appt-msg-window. +** The new functions `diary-from-outlook', `diary-from-outlook-gnus', +and `diary-from-outlook-rmail' can be used to import diary entries +from Outlook-format appointments in mail messages. The variable +`diary-outlook-formats' can be customized to recognize additional +formats. + + ** VC Changes *** The key C-x C-q no longer checks files in or out, it only changes @@ -1652,6 +1832,10 @@ Lines that match are never indented, and are given distinctive font-locking. ** F90 mode has new navigation commands `f90-end-of-block', `f90-beginning-of-block', `f90-next-block', `f90-previous-block'. +** F90 mode now has support for hs-minor-mode (hideshow). +It cannot deal with every code format, but ought to handle a sizeable +majority. + --- ** Prolog mode has a new variable `prolog-font-lock-keywords' to support use of font-lock. @@ -1679,13 +1863,19 @@ candidate is a directory. to the text before point. If there is text in the buffer after point, it remains unchanged. -** Visual feedback of *Completions* buffer is enhanced. -Faces are put on the common prefix substrings and the first uncommon -charachters of each completion candidate in the *Completions* buffer. -`completion-de-emphasis' is put on the common prefix substrings as the -face; and `completion-emphasis' is put on the first uncommon -charachters. By default `completion-de-emphasis' is inherited from -`default' face. `completion-emphasis' is inherited from `bold' face. +** Enhanced visual feedback in *Completions* buffer. + +Completions lists use faces to highlight what all completions +have in common and where they begin to differ. + +The common prefix shared by all possible completions uses the face +`completions-common-part', while the first character that isn't the +same uses the face `completions-first-difference'. By default, +`completions-common-part' inherits from `default', and +`completions-first-difference' inherits from `bold'. The idea of +`completions-common-part' is that you can use it to make the common +parts less visible than normal, so that the rest of the differing +parts is, by contrast, slightly highlighted. +++ ** New user option `inhibit-startup-buffer-menu'. @@ -1738,7 +1928,7 @@ depend on external libraries. All of these libraries have been ported to Windows, and can be found in both source and binary form at http://gnuwin32.sourceforge.net/. Note that libpng also depends on zlib, and tiff depends on the version of jpeg that it was compiled -against. +against. For additional information, see nt/INSTALL. --- ** Sound is now supported on MS Windows. @@ -1790,9 +1980,25 @@ to view diffs or log entries directly from vc-annotate-mode: D: shows the diff of the revision at line with its previous revision L: shows the log of the revision at line W: annotates the workfile (most up to date) version + ++++ +** In pcl-cvs mode, there is a new `d y' command to view the diffs +between the local version of the file and yesterday's head revision +in the repository. + * New modes and packages in Emacs 21.4 +** The new package flymake.el does on-the-fly syntax checking of program +source files. See the Flymake's Info manual for more details. + +** The library tree-widget.el provides a new widget to display a set +of hierarchical data as an outline. For example, the tree-widget is +well suited to display a hierarchy of directories and files. + +** The wdired.el package allows you to use normal editing commands on dired +buffers to change filenames, permissions, etc... + ** The new python.el package is used to edit Python and Jython programs. ** The URL package (which had been part of W3) is now part of Emacs. @@ -1880,6 +2086,7 @@ where the keys work like (shifted) arrow keys, home/end, etc., and are left unspecified and can be bound individually through the global or local keymaps. ++++ ** The new kmacro package provides a simpler user interface to emacs' keyboard macro facilities. @@ -2018,9 +2225,106 @@ configuration files. * Lisp Changes in Emacs 21.4 +** If a command sets transient-mark-mode to `only', that +enables Transient Mark mode for the following command, only. + ++++ +** Cleaner way to enter key sequences. + +You can enter a constant key sequence in a more natural format, the +same one used for saving keyboard macros, using the macro `kbd'. For +example, + +(kbd "C-x C-f") => "\^x\^f" + +** The sentinel is now called when a network process is deleted with +delete-process. The status message passed to the sentinel for a +deleted network process is "deleted". The message passed to the +sentinel when the connection is closed by the remote peer has been +changed to "connection broken by remote peer". + +** If the buffer's undo list for the current command gets longer than +undo-outer-limit, garbage collection empties it. This is to prevent +it from using up the available memory and choking Emacs. + +--- +** New function quail-find-key returns a list of keys to type in the +current input method to input a character. + ++++ +** New functions posn-at-point and posn-at-x-y return +click-event-style position information for a given visible buffer +position or for a given window pixel coordinate. + +** skip-chars-forward and skip-chars-backward now handle +character classes such as [:alpha:], along with individual characters +and ranges. + +** Function pos-visible-in-window-p now returns the pixel coordinates +and partial visiblity state of the corresponding row, if the PARTIALLY +arg is non-nil. + +** The function `eql' is now available without requiring the CL package. + ++++ +** The new primitive `set-file-times' sets a file's access and +modification times. Magic file name handlers can handle this +operation. + ** The display space :width and :align-to text properties are now supported on text terminals. +** Support for displaying image slices + +*** New display property (slice X Y WIDTH HEIGHT) may be used with +an image property to display only a specific slice of the image. + +*** Function insert-image has new optional fourth arg to +specify image slice (X Y WIDTH HEIGHT). + +*** New function insert-sliced-image inserts a given image as a +specified number of evenly sized slices (rows x columns). + +** New line-height and line-spacing properties for newline characters + +A newline may now have line-height and line-spacing text or overlay +properties that control the height of the corresponding display row. + +If the line-height property value is 0, the newline does not +contribute to the height of the display row; instead the height of the +newline glyph is reduced. Also, a line-spacing property on this +newline is ignored. This can be used to tile small images or image +slices without adding blank areas between the images. + +If the line-height property value is a positive integer, the value +specifies the minimum line height in pixels. If necessary, the line +height it increased by increasing the line's ascent. + +If the line-height property value is a float, the minimum line height +is calculated by multiplying the default frame line height by the +given value. + +If the line-height property value is a cons (RATIO . FACE), the +minimum line height is calculated as RATIO * height of named FACE. +RATIO is int or float. If FACE is t, it specifies the current face. + +If the line-spacing property value is an positive integer, the value +is used as additional pixels to insert after the display line; this +overrides the default frame line-spacing and any buffer local value of +the line-spacing variable. + +If the line-spacing property may be a float or cons, the line spacing +is calculated as specified above for the line-height property. + +If the line-spacing value is a cons (total . SPACING) where SPACING is +any of the forms described above, the value of SPACING is used as the +total height of the line, i.e. a varying number of pixels are inserted +after each line to make each line exactly that many pixels high. + + +** The buffer local line-spacing variable may now have a float value, +which is used as a height relative to the default frame line height. + ** Enhancements to stretch display properties The display property stretch specification form `(space PROPS)', where @@ -2139,6 +2443,12 @@ number of corresponding line in current buffer. variable `sentence-end-without-space' which contains such characters that end a sentence without following spaces. +** The function `sentence-end' should be used to obtain the value of +the variable `sentence-end'. If the variable `sentence-end' is nil, +then this function returns the regexp constructed from the variables +`sentence-end-without-period', `sentence-end-double-space' and +`sentence-end-without-space'. + +++ ** The flags, width, and precision options for %-specifications in function `format' are now documented. Some flags that were accepted but not @@ -2929,6 +3239,10 @@ A new predicate `supports' has also been added to the `defface' face specification language, which can be used to do this test for faces defined with defface. +** The function face-differs-from-default-p now truly checks whether the +given face displays differently from the default face or not (previously +it did only a very cursory check). + +++ ** face-attribute, face-foreground, face-background, and face-stipple now accept a new optional argument, INHERIT, which controls how face @@ -2938,6 +3252,13 @@ inheritance is used when determining the value of a face attribute. ** New functions face-attribute-relative-p and merge-face-attribute help with handling relative face attributes. +** The priority of faces in an :inherit attribute face-list is reversed. +If a face contains an :inherit attribute with a list of faces, earlier +faces in the list override later faces in the list; in previous releases +of Emacs, the order was the opposite. This change was made so that +:inherit face-lists operate identically to face-lists in text `face' +properties. + +++ ** Enhancements to process support @@ -3403,6 +3724,9 @@ using the text properties (esp. the face) of the prompt string. ** New function x-send-client-message sends a client message when running under X. +** Arguments for remove-overlays are now optional, so that you can remove +all overlays in the buffer by just calling (remove-overlay). + ** New packages: *** The new package gdb-ui.el provides an enhanced graphical interface to @@ -3443,10 +3767,7 @@ been added. with Custom. ** UTF-16 coding systems are available, encoding the same characters -as mule-utf-8. Coding system `utf-16-le-dos' is useful as the value -of `selection-coding-system' in MS Windows, allowing you to paste -multilingual text from the clipboard. Set it interactively with -C-x RET x or in .emacs with `(set-selection-coding-system 'utf-16-le-dos)'. +as mule-utf-8. ** There is a new language environment for UTF-8 (set up automatically in UTF-8 locales). diff --git a/etc/PROBLEMS b/etc/PROBLEMS index c3e9ce2a16a..4ff8d50c8ae 100644 --- a/etc/PROBLEMS +++ b/etc/PROBLEMS @@ -5,6 +5,18 @@ in compiling, installing and running GNU Emacs. It's completely redundant now, as far as we know. +* Environment Variables from dotfiles are ignored with Mac OS X (Carbon). + +When starting Emacs from the Dock or the Finder on Mac OS X, the +environment variables that are set up in dotfiles, such as .cshrc or +.profile, are ignored. This is because the Finder and Dock are not +started from a shell, but instead from the Window Manager itself. + +The workaround for this is to create a .MacOSX/environment.plist file to +setup these environment variables. These environment variables will +apply to all processes regardless of where they are started. +For me information, see http://developer.apple.com/qa/qa2001/qa1067.html. + * Segfault on GNU/Linux using certain recent versions of the Linux kernel. With certain recent Linux kernels (like the one of Redhat Fedora Core @@ -225,6 +237,12 @@ __MSVCRT__, like so: configure --with-gcc --cflags -mwin32 --cflags -D__MSVCRT__ +* Building the MS-Windows port fails with a CreateProcess failure. + +Some versions of mingw32 make on some versions of Windows do not seem +to detect the shell correctly. Try "make SHELL=cmd.exe", or if that +fails, try running make from Cygwin bash instead. + * Building the MS-Windows port with Leim fails in the `leim' directory. The error message might be something like this: @@ -578,11 +596,6 @@ ought to recognize the Windows language-change event and set up the appropriate keyboard encoding automatically, but it doesn't do that yet.) -Windows uses UTF-16 encoding to deal with multilingual text (text not -encodable in the `system codepage') in the clipboard. To deal with -this, load the library `utf-16' and use `set-selection-coding-system' -to set the clipboard coding system to `utf-16-le-with-signature-dos'. - The %b specifier for format-time-string does not produce abbreviated month names with consistent widths for some locales on some versions of Windows. This is caused by a deficiency in the underlying system @@ -1,4 +1,4 @@ - -*-text-*- + -*-outline-*- If you are ready to start working on any of these TODO items, we appreciate your help; please write to emacs-devel@gnu.org so we can be @@ -7,51 +7,48 @@ it best. Since Emacs is an FSF-copyrighted package, please be prepared to sign legal papers to transfer the copyright on your work to the FSF. -Small but important fixes needed in existing features: +* Small but important fixes needed in existing features: -* Make compile.el record the markers that point to error loci - on text properties in the error message lines. - -* Fix the kill/yank treatment of invisible text. At the moment, +** Fix the kill/yank treatment of invisible text. At the moment, invisible text is placed in the kill-ring, so that the contents of the ring may not correspond to the text as displayed to the user. It ought to be possible to omit text which is invisible (due to a text-property, overlay, or selective display) from the kill-ring. -Important features: +* Important features: -* Provide user-friendly ways to list all available font families, +** Provide user-friendly ways to list all available font families, display a font as a sample, etc. [fx is looking at multilingual font selection for Emacs 22.] -* Program Enriched mode to read and save in RTF. [Is there actually a +** Program Enriched mode to read and save in RTF. [Is there actually a decent single definition of RTF? Maybe see info at http://latex2rtf.sourceforge.net/.] -* Implement something better than the current Refill mode. This +** Implement something better than the current Refill mode. This probably needs some primitive support. -* Implement primitive and higher-level functions to allow filling +** Implement primitive and higher-level functions to allow filling properly with variable-pitch faces. -* Implement a smoother vertical scroll facility, one that allows +** Implement a smoother vertical scroll facility, one that allows C-v to scroll through a tall image. -* Implement other text formatting properties. -** Footnotes that can appear either in place or at the end of the page. -** text property that says "don't break line in middle of this". +** Implement other text formatting properties. +*** Footnotes that can appear either in place or at the end of the page. +*** text property that says "don't break line in middle of this". Don't break the line between two characters that have the same value of this property. -** Discretionary hyphens that are not visible when they are at end of line. +*** Discretionary hyphens that are not visible when they are at end of line. -* Make movemail work with IMAP. +** Make movemail work with IMAP. -* Internationalize Emacs's messages. [Note that this is of limited +** Internationalize Emacs's messages. [Note that this is of limited use until the menus can display multilingual text. It also doesn't address important issues like using the names of symbols essentially as documentation, e.g. in command names and Custom. -- fx] -* Make the Lucid menu widget display multilingual text. [This +** Make the Lucid menu widget display multilingual text. [This probably needs to be done from actual Emacs buffers, either directly in the menu or by rendering in an unmapped window and copying the pixels. Note that the relevant Xlib functions assume a specific @@ -60,48 +57,63 @@ Important features: port now displays multilingual text in menus, but only insofar as Emacs can encode it as utf-8 and gtk can display the result.] -* Remove the limitation that window and frame widths and heights can +** Remove the limitation that window and frame widths and heights can be only full columns/lines. -Other features we would like: +* Other features we would like: + +** Ability to map a key, including all modified-combinations. + E.g map mouse-4 to wheel-up as well as M-mouse-4 -> M-wheel-up + M-C-mouse-4 -> M-C-wheel-up, H-S-C-M-s-double-mouse-4 -> + H-S-C-M-s-double-wheel-up, ... -* Have a command suggestion help system that recognizes patterns +** Beefed-up syntax-tables. +*** recognize multi-character syntactic entities like `begin' and `end'. +*** nested string-delimiters (for Postscript's (foo(bar)baz) strings). +*** support for infix operators (with precedence). +*** support for the $ (paired delimiter) in parse-partial-sexp. +*** support for hook-chars whose effect on the parsing-state is specified + by elisp code. Thus a char could both close a string and open a comment + at the same time and do it in a context-sensitive way. +*** ability to add mode-specific data to the partial-parse-state. + +** Have a command suggestion help system that recognizes patterns of commands which could be replaced with a simpler common command. It should not make more than one suggestion per 10 minutes. -* Add a way to define input methods by computing them (when first used) +** Add a way to define input methods by computing them (when first used) from other input methods. Then redefine C-x 8 to use a user-selected input method, with the default being the union of latin-1-prefix and latin-1-postfix. -* Implement a clean way to use different major modes for +** Implement a clean way to use different major modes for different parts of a buffer. -* Give start-process the ability to direct standard-error +** Give start-process the ability to direct standard-error output to a different filter. -* Make desktop.el save the "frame configuration" of Emacs (in some +** Make desktop.el save the "frame configuration" of Emacs (in some useful sense). -* Give desktop.el a feature to switch between different named +** Give desktop.el a feature to switch between different named desktops. -* Replace finder.el with something that generates an Info file +** Replace finder.el with something that generates an Info file which gives the same information through a menu structure. [Dave Love started on this.] -* Implement a variant of uncompress.el or jka-compr.el that works with +** Implement a variant of uncompress.el or jka-compr.el that works with GNU Privacy Guard for encryption. [Code exists but isn't assigned. See the Gnus development sources for assigned code concerning GPG use with mail, which is probably a good start.] -* Save undo information in files, and reload it when needed +** Save undo information in files, and reload it when needed for undoing. -* Merge the Emacs regex.c with the Glibc regex.c. +** Merge the Emacs regex.c with the Glibc regex.c. They split off a few years ago through negligence. -* Change the Windows NT menu code +** Change the Windows NT menu code so that it handles the deep_p argument and avoids regenerating the whole menu bar menu tree except when the user tries to use the menubar. @@ -111,84 +123,80 @@ Other features we would like: thread has processed the MENU_BAR_ACTIVATE_EVENT and regenerated the whole menu bar. In the mean time, it should process other messages. -* Get some major packages installed: W3/url (development version needs +** Get some major packages installed: W3 (development version needs significant work), PSGML. Check the assignments file for other packages which might go in and have been missed. -* Make keymaps a first-class Lisp object (this means a rewrite of +** Make keymaps a first-class Lisp object (this means a rewrite of keymap.c). What should it do apart from being opaque ? multiple inheritance ? faster where-is ? no more fix_submap_inheritance ? what else ? -* Provide real menus on ttys. The MS-DOS implementation can serve as +** Provide real menus on ttys. The MS-DOS implementation can serve as an example how to do part of this. -* Implement popular parts of the rest of the CL functions as compiler +** Implement popular parts of the rest of the CL functions as compiler macros in cl-macs. -* Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA, +** Highlight rectangles (`mouse-track-rectangle-p' in XEmacs). Already in CUA, but it's a valuable feature worth making more general. -* Support simultaneous tty and X frames. +** Support simultaneous tty and X frames. -* Provide MIME support for Rmail using the Gnus MIME library. [Maybe +** Provide MIME support for Rmail using the Gnus MIME library. [Maybe not now feasible, given Gnus maintenance decisions. fx looked at this and can say where some of the problems are.] -* Eliminate the storm of warnings concerning char/unsigned char +** Eliminate the storm of warnings concerning char/unsigned char mismatches that we get with proprietary compilers on various systems. They make it difficult to spot the important warnings. -* Fix anything necessary to use `long long' EMACS_INTs with GCC. +** Fix anything necessary to use `long long' EMACS_INTs with GCC. -* Split out parts of lisp.h and generate Makefile dependencies +** Split out parts of lisp.h and generate Makefile dependencies automatically. -* Update the FAQ. +** Update the FAQ. -* Allow auto-compression-mode to use zlib calls if zlib is available. +** Allow auto-compression-mode to use zlib calls if zlib is available. [It's required for PNG, so may be linked anyhow.] -* Add a --pristine startup flag which does -q --no-site-file plus +** Add a --pristine startup flag which does -q --no-site-file plus ignoring X resources (Doze equivalents?) and most of the environment. What should not be ignored needs consideration. -* Investigate using the language environment (or locale?) to set up +** Investigate using the language environment (or locale?) to set up more things, such as the default Ispell dictionary, calendar holidays, quoting characters?,... -* Improve the GC (generational, incremental). (We may be able to use +** Improve the GC (generational, incremental). (We may be able to use the Boehm collector.) [See the Boehm-GC branch in CVS for work on this.] -* Check what hooks would help Emacspeak -- see the defadvising in W3. +** Check what hooks would help Emacspeak -- see the defadvising in W3. -* Add horizontal scroll bars. +** Add horizontal scroll bars. -* Provide an optional feature which computes a scroll bar slider's +** Provide an optional feature which computes a scroll bar slider's size and its position from lines instead of characters. -* Make the Custom themes support do useful things. - -* Investigate using GNU Lightning or similar system for incremental - compilation of selected bytecode functions to subrs. Converting CCL - programs to native code is probably the first thing to try, though. +** Make the Custom themes support do useful things. -* Add support for SVG (Scalable Vector Graphics) rendering to +** Add support for SVG (Scalable Vector Graphics) rendering to Emacs. -* Allow unknown image types to be rendered via an external program +** Allow unknown image types to be rendered via an external program converting them to, say, PBM (in the same way as PostScript?). -* Allow displaying an X window from an external program in a buffer, +** Allow displaying an X window from an external program in a buffer, e.g. to render graphics from Java applets. [gerd and/or wmperry thought this was feasible.] -* Allow images (not just text) in the margin to be mouse-sensitive. +** Allow images (not just text) in the margin to be mouse-sensitive. (Requires recursing through display properties). Provide some way to simulate mouse-clicks on marginal text without a mouse. -* Implement Lisp functions to determine properly whether a character +** Implement Lisp functions to determine properly whether a character is displayable (particularly needed in XFree 4, sigh). Use it to define useful glyphs that may be displayed as images or unicodes (with ASCIIfied fallback via latin1-disp). Examples include @@ -196,40 +204,33 @@ Other features we would like: tree displays generally, mode-line mail indicator. [See work done already for Emacs 22 and consult fx.] -* Do something to make rms happy with fx's dynamic loading, and use it +** Do something to make rms happy with fx's dynamic loading, and use it to implement things like auto-loaded buffer parsers and database access in cases which need more than Lisp. -* Extend ps-print to deal with multiple font sizes, images, and extra +** Extend ps-print to deal with multiple font sizes, images, and extra encodings. -* Provide portable undumping using mmap (per gerd design). - -* Replace gmalloc.c with the modified Doug Lea code from the current - GNU libc so that the special mmapping of buffers can be removed -- - that apparently loses under Solaris, at least. [fx has mostly done - this.] +** Provide portable undumping using mmap (per gerd design). -* Use the XIE X extension, if available, for image display. +** Use the XIE X extension, if available, for image display. -* Make monochrome images display using the foreground and background +** Make monochrome images display using the foreground and background colors of the applicable faces. -* Add support for rendering antialiased text, probably using +** Add support for rendering antialiased text, probably using XRender/Freetype. -* Rewrite make-docfile to be clean and maintainable. - -* Port the conservative stack marking code of Emacs' garbage collector +** Port the conservative stack marking code of Emacs' garbage collector to more systems, so that we can completely get rid of GCPROs. -* Reorder defcustom's in each package so that the more important +** Reorder defcustom's in each package so that the more important options come first in the Customize buffers. This could be done by either rearranging the file (since options are shown in the order they appear in the *.el files), or by adding a few :set-after attributes. -* Maybe document the features of libraries missing from the manual (or +** Maybe document the features of libraries missing from the manual (or ancillary manuals, including the Lisp manual in some cases). This is not worth doing for all of these packages and we need not aim for completeness, but some may be worth documenting. @@ -250,21 +251,21 @@ Other features we would like: cvs-status (should be described in PCL-CVS manual); other progmodes, probably in separate manual. -* Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap +** Convert the XPM bitmaps to PPM, replace the PBMs with them and scrap the XPMs so that the colour versions work generally. (Requires care with the colour used for the transparent regions.) -* Convenient access to the `values' variable. It would be nice to have an +** Convenient access to the `values' variable. It would be nice to have an interface that would show you the printed reps of the elements of the list in a menu, let you select one of the values, and put it into some other variable, without changing the value of `values'. -* Fix skip-chars-{for,back}ward to allow character classes. +** Fix skip-chars-{for,back}ward to allow character classes. -* (Controlled by a flag) make open and close syntax match exactly, +** (Controlled by a flag) make open and close syntax match exactly, i.e. `(' doesn't match `]'. -* Specify parameter ID-FORMAT in all calls to `file-attributes' and +** Specify parameter ID-FORMAT in all calls to `file-attributes' and `directory-files-and-attributes' where attributes UID or GID are used. Whenever possible, use value 'string. When done, change meaning of default value from 'integer to 'string. @@ -272,4 +273,18 @@ Other features we would like: the definition of `file-attributes' and `directory-files-and-attributes' and from the calls. +* Internal changes + +** Replace gmalloc.c with the modified Doug Lea code from the current + GNU libc so that the special mmapping of buffers can be removed -- + that apparently loses under Solaris, at least. [fx has mostly done + this.] + +** Rewrite make-docfile to be clean and maintainable. + +** Add an inferior-comint-minor-mode to capture the common set of operations + offered by major modes that offer an associated inferior + comint-derived mode. I.e. basically make cmuscheme.el generic. + For use by sml-mode, python-mode, tex-mode, scheme-mode, ... + ;;; arch-tag: b0a3e40b-726a-457d-9999-ba848321b036 diff --git a/etc/TUTORIAL.fr b/etc/TUTORIAL.fr index 953e9edb649..ae88ff4a242 100644 --- a/etc/TUTORIAL.fr +++ b/etc/TUTORIAL.fr @@ -1197,6 +1197,7 @@ Cette traduction française a été effectuée par Éric Jacoboni ;;; Local Variables: ;;; coding: latin-1 +;;; sentence-end-double-space: nil ;;; End: ;;; arch-tag: f6c5c2ff-bf24-477c-bd18-32f76f51ba65 diff --git a/etc/TUTORIAL.it b/etc/TUTORIAL.it index 7936bbd298f..02a91045d0e 100644 --- a/etc/TUTORIAL.it +++ b/etc/TUTORIAL.it @@ -1114,4 +1114,8 @@ copie di GNU Emacs ai vostri amici. Aiutateci a combattere l'ostruzionismo al software ("la proprietà") usando, scrivendo e condividendo software libero! +;;; Local Variables: +;;; coding: latin-1 +;;; End: + ;;; arch-tag: c6f7079d-8032-473d-91d4-36754af15719 diff --git a/etc/TUTORIAL.nl b/etc/TUTORIAL.nl index b4f21f1e1c5..989f8334fd1 100644 --- a/etc/TUTORIAL.nl +++ b/etc/TUTORIAL.nl @@ -830,8 +830,7 @@ het zoeken. zien wat er met de cursor gebeurt. Je hebt nu eenmaal naar het woord `cursor' gezocht. >> Type nogmaals C-s, om het volgende woord `cursor' te zoeken - -> Type nu viermaal <Delback> en let op de cursorbewegingen. +>> Type nu viermaal <Delback> en let op de cursorbewegingen. >> Type <RET> om het zoeken te beëindigen. Zag je wat er gebeurde? Tijdens incrementeel zoeken probeert Emacs naar @@ -1093,4 +1092,8 @@ same spirit. Please read the file COPYING and then do give copies of GNU Emacs to your friends. Help stamp out software obstructionism ("ownership") by using, writing, and sharing free software!) +;;; Local Variables: +;;; coding: latin-1 +;;; End: + ;;; arch-tag: 3399e308-e605-4125-8fbb-b2fe91ac3149 diff --git a/etc/TUTORIAL.pl b/etc/TUTORIAL.pl index 012cd143c45..501df8f6521 100644 --- a/etc/TUTORIAL.pl +++ b/etc/TUTORIAL.pl @@ -1239,13 +1239,10 @@ z t± ide±. Proszê, przeczytaj plik COPYING, po czym rozdaj swoim znajomym kopie Emacsa. Pomó¿ têpiæ obstrukcjonizm w informatyce, u¿ywaj±c, tworz±c i dziel±c siê oprogramowaniem swobodnym. - ;;; Local Variables: ;;; mode: fundamental ;;; coding: latin-2 +;;; sentence-end-double-space: nil ;;; End: - - - ;;; arch-tag: 6c6b7445-4cd5-44ca-a101-7f4697b92f60 diff --git a/etc/TUTORIAL.pt_BR b/etc/TUTORIAL.pt_BR new file mode 100644 index 00000000000..58101c28edb --- /dev/null +++ b/etc/TUTORIAL.pt_BR @@ -0,0 +1,1089 @@ +Copyright (c) 2004 Free Software Foundation, Inc; Veja no fim as +condições. + +Os comandos do Emacs geralmente envolvem a tecla CONTROL (algumas vezes +nomeada CTRL ou CTL) ou a tecla META (algumas vezes nomeada EDIT ou +ALT). Antes de escrever isso tudo toda vez, usaremos as seguintes +abreviações: + + C-<chr> Significa pressionar a tecla CONTROL enquanto digitar o + caracter <chr> + Assim, C-f seria: Pressionar a tecla CONTROL e digitar f. + M-<chr> Significa pressionar a tecla META, EDIT ou ALT enquanto + digitar <chr>. + Se não tiver META, EDIT ou ALT, no lugar digite ESC e depois + <chr>. Escrevemos <ESC> para tecla ESC. + + +Nota importante: para terminar a seção do Emacs, digite C-x C-c. (Dois +caracteres.) Os caracteres ">>" na margem esquerda indicam direções para +você tentar usar um comando. Por exemplo: +<<Linhas vazias inseridas ao redor da linha seguinte por +ajuda-com-tutorial>> +[Metade da página em branco para propósitos didáticos. O texto continua +abaixo] +>> Agora digite C-v (Ver próxima tela) para ir para próxima tela. + (vá em frente, faça isso pressionando a tecla CONTROL enquanto + digitar v). + De agora em diante, você deve fazer isso de novo sempre que você + terminar de ler a tela. + +Note que tem uma sobreposição de duas linhas quando você move de tela em +tela; isso fornece uma continuidade para que você continue lendo o +texto. + +A primeira coisa que você precisa saber é como se mover de um lugar a +outro no texto. Você já sabe como se mover para próxima tela, com +C-v. Para se mover para trás uma tela, digite M-v (pressione a tecla +META enquanto digita v, ou digite <ESC>v se você não tiver a tecla META, +EDIT ou ALT). + +>> Tente digitar M-v e depois C-v, algumas vezes. + + +* SUMÁRIO +--------- + +Os comandos a seguir são úteis para visualizar telas inteiras + + C-v Move para tela inteira posterior + M-x Move para tela inteira anterior + C-l Limpa a tela e re-mostra todo o texto, movendo o texto ao + redor do cursor para o centro da tela. (Isso é + control-L, não control-1.) + +>> Encontre o cursor, e note o texto que está perto dele. + Digite C-l. + Encontre o cursor novamente e perceba que o mesmo texto continua + perto do cursor. + + +* CONTROLE BÁSICO DO CURSOR +--------------------------- + +Movendo de uma tela inteira para outra tela cheia é útil, mas como você +move para um lugar especifico com o mesmo texto na tela? + +Existem diversas maneiras para você poder fazer isso. A maneira mais +básica é utilizar os comandos C-p, C-b, C-f e C-n. Cada um desses +comandos movem o cursor uma linha ou coluna na tela em uma direção +particular. Aqui está uma tabela mostrando esses quatro comandos e as +direções que eles movem: + + Linha anterior, C-p + : + : + Traz, C-b .... Posição corrente do cursor .... Frente, C-f + : + : + Linha posterior, C-n + +>> Mova o cursor para a linha no meio do diagrama acima utilizando C-n + ou C-p. Digite C-l para ver o diagrama inteiro centralizado na tela. + +Você provavelmente achará isso fácil pensando neles pela letra: P para +Previous (anterior), N para Next (Posterior), B para Backward (trás) e F +para forward (frente). Estes são os comandos básicos de posicionamento +de cursor e você estará utilizando eles a TODO tempo, então seria ótimo +se você os aprendesse agora. + +>> Faça alguns C-n's para trazer o cursor abaixo desta linha. + +>> Mova para a linha com C-f's e depois para cima com C-p's. + Veja o que C-p faz quando o cursor está no meio da linha. + +Cada linha de texto termina com um caractere de nova linha, que serve +para separar da próxima linha. No fim da ultima linha deve ter um +caractere de nova linha (mas não é exigido pelo Emacs). + +>> Tente digitar C-b no começo da linha. O cursor deve mover para o fim + da linha anterior. Isso acontece por que ele se moveu para trás + através do caractere de nova linha. + +C-f pode mover o cursor através de uma Nova linha do mesmo jeito que + C-b. + +>> Faça mais alguns C-b's, assim você percebe onde o está o cursor. + Depois alguns C-f's para retornar para o fim da linha. + Depois mais um C-f para mover para linha seguinte. + +Quando você move o cursor passando o topo ou o rodapé da tela, o próximo +texto além da borda desloca-se na tela. Isso é chamado rolagem. Isso +ativa o Emacs para mover o cursor para o lugar especificado no texto sem +move-lo fora da tela. + +>> Tente mover o cursor fora do rodapé da tela com C-n, e veja o que + acontece. + +Se mover por caracteres é muito lento, você pode se mover por +palavras. M-f (Meta-f) move uma palavra para frente e M-b uma palavra +para trás. + +>> Digite alguns M-f's e M-b's + +Quando você está no meio de uma palavra, M-f move o cursor para o fim da +mesma. Quando você está em um espaço em branco no meio de duas palavras, +M-f move o cursor para o fim da palavra seguinte. M-b funciona do mesmo +jeito na direção contraria. + +>> Digite M-f e M-b algumas vezes, intercalado com C-f's e C-b's assim + você pode observar a ação do M-f e M-b de varias lugares dentro e no + meio de palavras. + +Observe o paralelismo entre C-f e C-b em uma mão, e M-f e M-b na +outra. Muito freqüentemente os caracteres Meta são usados para operações +relacionadas com as unidades definidas pela linguagem (palavras, +sentenças, parágrafos), enquanto caracteres Control operam nas unidades +básicas que são independente do que você está editando (caracteres, +linhas, etc). + +Esse paralelismo aplica-se entre linhas e sentenças: C-a e C-e move o +cursor para o começo ou fim da linha, e M-a e M-e move o cursor para o +começo ou fim da sentença. + +>> Tente alguns C-a's, e depois alguns C-e's. + Tente alguns M-a's, e depois alguns M-e's. + +Veja como repetidos C-a's fazem nada, mas repetidos M-a's mantém movendo +mais uma sentença. Embora estes não sejam completamente análogos, cada +um parece natural. + +A posição do cursor no texto é também chamado "ponto" (point). Para +parafrasear, o cursor mostra na tela onde o ponto é encontrado no texto. + +Aqui está um simples sumário das operações de movimento de cursor, +incluindo comandos de movimento de palavra e sentença. + + C-f Move o cursor um caractere para frente + C-b Move o cursor um caractere para trás + + M-f Move o cursor uma palavra para frente + M-b Move o cursor uma palavra para trás + + C-n Move o cursor para linha posterior + C-p Move o cursor para linha anterior + + C-a Move o cursor para o começo da linha + C-e Move o cursor para o fim da linha + + M-a Move o cursor para trás no começo da sentença + M-e Move o cursor para frente no fim da sentença + +>> Tente agora todos estes comandos algumas vezes para praticar. + Estes são os comandos mais utilizados. + +Outros dois comandos de movimento de cursor importantes são M-< (Meta +Menor-que), o qual move o cursor para o começo de todo o texto, e M-> +(Meta Maior-que), o qual move para o fim de todo o texto. + +Na maioria dos terminais, o "<" é acima da vírgula, então você precisa +utilizar a tecla shift para digita-la. Nestes terminais você precisa +utilizar a tecla shift para digitar M-< também; sem a tecla shift, você +estaria teclando M-virgula. + +>> Tente agora M-<, para mover o cursor ao começo do tutorial. + Use então C-v repetidamente para trazer o cursor novamente aqui. + +>> Tente agora M->, para mover o cursor ao fim do tutorial. + Use então M-v repetidamente para trazer o cursor novamente aqui. + +Você também pode mover o cursor com as setas, se o seu terminal tem +teclas com setas. Nós recomendamos aprender C-b, C-f, C-n e C-p por três +razões. Primeira, elas funcionam em todos os terminais. Segunda, uma vez +que você ganhar prática usando o Emacs, você descobrirá que digitar +nestes caracteres Control é mais rápido do que digitar nas setas (porque +você não tem que mover suas mãos tão longe da posição de +digitação). Terceira, uma vez que você tiver o hábito de utilizar estes +comandos de caracteres Control, você pode facilmente aprender como usar +outros comandos avançados de movimentação do cursor. + +A maioria dos comandos do Emacs aceitam argumentos numéricos; para +maioria dos comandos, isso serve como um fator de repetição. A maneira +que você da a um comando uma repetição teclando C-u e depois os dígitos +antes de digitar o comando. Se você tem o META (EDIT ou ALT), tem outra +alternativa para digitar um argumento numérico: digite os dígitos +enquanto pressionando a tecla META. Nós recomendamos aprender o método +C-u porque funciona em todos os terminais. O argumento numérico também é +chamado de "argumento prefixo", porque você digita o argumento antes do +comando que ele se aplica. + +Por exemplo, C-u 8 C-f move o cursor oito caracteres para frente + +>> Tente usar C-n ou C-p com um argumento numérico, para mover o + cursor para um linha perto dessa com um único comando. + +A maioria dos comandos usam o argumento numérico para um fator de +repetição, mas alguns comandos usam isso de outra maneira. Diversos +comandos (mas nenhum daqueles comandos que você tenha aprendido até +agora) usam isso como uma marca -- a presença de um argumento prefixo, +independente do seu valor, faz o comando fazer alguma coisa diferente. + +C-v e M-v são outro tipo de exceção. Quando você da um argumento, eles +rolam a tela para cima ou para baixo por aquele número de linhas, de +preferência com a tela cheia. Por exemplo, C-u 8 C-v rola a tela 8 +linhas. + +>> Tente agora digitar C-u 8 C-v. + +Isso deve ter rolado a tela para cima 8 linhas. Se você quiser rolar a +tela para baixo novamente, você pode dar um argumento para o M-v. + +Se você está usando um display com janelas, como o X11 ou MS-Windows, +deve ter uma área retangular alta chamada barra de rolagem na mão +esquerda da janela do Emacs. Você pode rolar o texto clicando o mouse na +barra de rolagem. + +>> Tente pressionar o botão do meio no topo da área destacada junto a + barra de rolagem. Isso deve rolar o texto para uma determinada + posição dependendo de quão alto ou baixo você clicar. + +>> Tente mover o mouse para cima e para baixo, enquanto pressionar o + botão do meio. Você verá que o texto rolará para cima e baixo assim + que você mover o mouse. + + +* QUANDO O EMACS PARECE MORTO +----------------------------- + +Se o Emacs parar de responder os seus comandos, você pode seguramente +para-lo digitando C-g. Você pode utilizar C-g para parar um comando que +está levando muito tempo para executar. + +Você também pode utilizar C-g para interromper um argumento numérico ou +o inicio de um comando que você não quer terminar. + +>> Digite C-u 100 para fazer um argumento numérico de 100, e depois + digite C-g. Agora digite C-f. O Cursor deve mover apenas um + caractere, porque você cancelou o argumento com C-g. + +Se você digitou um <ESC> por engano, você pode sair dele com um c-g. + + +* COMANDOS DESABILITADOS +------------------------ + +Alguns comandos do Emacs são "desabilitados" para que os usuários +iniciantes não utilizem por acidente. + +Se você digita um dos comandos desabilitados, o Emacs mostrará uma +mensagem dizendo qual comando foi, e pergunta se você quer seguir e +executar o comando. + +Se você realmente quiser tentar o comando, digite Espaço na resposta da +pergunta. Normalmente, se você não quer executar o comando desabilitado, +responda a pergunta com "n". + +>> Digite C-x C-l (que é um comando desabilitado), + e então digite n para responder a pergunta. + + +* JANELAS +--------- + +O Emacs pode ter diversas janelas, cada uma mostrando seu próprio +texto. Nós vamos explicar mais tarde como utilizar estas múltiplas +janelas. Neste momento nos queremos explicar como se livrar das janelas +extras e voltar a edição básica em uma janela. É simples: + + C-x 1 Uma janela (mate todas as outras janelas). + +Isto é Control-x seguido pelo digito 1. C-x 1 expande a janela que está +com o cursor, para ocupar a tela inteira. Ela deleta todas as outras +janelas. + +>> Mova o cursor para esta linha e digite C-u 0 C-l. +>> Digite Control-h k Control-f. + Veja como esta janela diminui, enquanto uma nova aparece para mostrar + a documentação do comando Control-f. + +>> Digite C-x 1 e veja a listagem de documentação desaparecer. + +Este comando é diferente dos outros que você aprendeu por isso ele +consiste em dois caracteres. Ele inicia com o caractere Control-x. Tem +uma grande serie de comandos que iniciam com Control-x; a maioria deles +tem a ver com janelas, arquivos, buffers, e coisas relacionadas. Estes +comandos tem dois, três ou quatro caracteres de tamanho. + + +* INSERINDO E DELETANDO +----------------------- + +Se você quiser inserir um texto, apenas digite o texto. Os caracteres +que você verá, como A, 7, *, etc. são vistos pelo Emacs como texto e são +inseridos imediatamente. Digite <Return> para inserir um caractere de +nova linha. + +Você pode deletar o último caractere que você inseriu digitando +<Delete>. <Delete> é uma tecla no teclado, que está nomeado como +"Del". Em algumas casos, a tecla "Backspace" serve como o <Delete>, mas +nem sempre! + +Mas geralmente, <Delete> deleta o caractere imediatamente anterior a +posição corrente do cursor. + +>> Faça isso agora - Digite alguns caracteres, então delete eles + digitando <Delete> algumas vezes. Não se preocupe em modificar este + arquivo; você não irá alterar o arquivo principal. Esta é a sua cópia + pessoal dele. + +Quando uma linha de texto fica muito grande na tela, a linha do texto é +continuada na linha seguinte. Uma barra invertida ("\") na margem +direita indica a linha que foi continuada. + +>> Insira texto até que você alcance a margem direita, e mantenha + inserindo. Você verá a linha de continuação aparecer. + +>> Utilize <Delete> para deletar o texto até a linha caber em uma linha + novamente. A linha de continuação irá embora. + +Você pode deletar o caractere de nova linha como qualquer outro +caracter. Deletando o caractere de nova linha entre duas linhas você +juntará as duas em uma única linha. Se o resultado for muito longo para +acomodar na largura da tela, aparecerá um caractere de continuação. + +>> Mova o cursor para o inicio da linha e digite <Delete>. Isso juntará + esta linha com a anterior. + +>> Digite <Return> para re-inserir a nova linha que você deletou. + +Lembre-se que a maioria dos comandos do Emacs podem receber um número de +repetição; isso inclui texto de caracteres. Repetir um texto de +caractere o insere algumas vezes. + +>> Tente isso agora -- digite C-u 8 * para inserir ********. + +Você acabou de aprender o jeito mais simples de digitar alguma coisa no +Emacs e corrigir os erros. Você pode deletar palavras ou linhas +também. Aqui vai um sumário dos comandos de deleção: + + <Delete> deleta o caractere imediatamente antes do cursor + M-d deleta o próximo caractere apos o cursor + + M-<Delete> Mata a palavra imediatamente antes do cursor + M-d Mata a próxima palavra depois do cursor + + C-k Mata a posição do cursor até o fim da linha + M-k Mata até o fim da sentença corrente + +Note que o <Delete> e o C-d vs M-<Delete> e M-d estende o paralelo +iniciado por C-f e M-f (bem, <Delete> não é realmente um controle de +caractere, mas não vamos nos preocupar com isso). C-k e M-k são como C-e +e M-e, uma parte, nessas linhas são sentenças opostas. + +Você pode também matar parte de um buffer com um método uniforme. Mova +para o fim dessa parte, e digite C-@ ou C-SPC (um ou outro). (SPC é a +Barra de Espaço.) Mova para o outro fim dessa parte, e digite C-w. Isso +ira matar todo o texto entre as duas posições. + +>> Mova o cursor para o V no inicio do parágrafo anterior. +>> Digite C-SPC. Emacs vai mostrar a mensagem "Mark set" no rodapé da + tela. +>> Mova o cursor para o . (ponto) no "fim", na segunda linha do + parágrafo. +>> Digite C-w. Isso vai matar o texto iniciando no V, e terminando bem + antes do . (ponto). + +A diferença entra "matar" e "deletar" é que o texto "matado" pode ser +re-inserido, onde os textos "deletados" não podem ser re-inseridos. +Re-inserção de um texto matado chama-se colar (yanking). Geralmente, o +comando que pode remover bastante texto mata o texto (eles fazem com que +você possa colar (yank) o texto), enquanto os comandos que removem um +caractere, ou apenas linhas brancas ou espaços, fazem deleção (para que +você não possa colar esse texto). + +>> Mova o cursor para o inicio da linha que não esteja vazia. + Agora digite C-k para matar o texto nessa linha. +>> Digite C-k pela segunda vez. Você verá que a nova linha que segue a + linha será matada. + +Note que um simples C-k mata o conteúdo de uma linha, é um segundo C-k +mata a linha, e faz com que todas as outras linhas movam para cima. C-k +trata um argumento numérico especialmente: ele mata tantas linhas E seus +conteúdos. Isso não é uma simples repetição. C-u 2 C-k mata duas linhas +e suas novas linhas; digitar C-k duas vezes não faria isso. + +Para trazer o texto matado novamente é chamado colar "yaking". (Pense +nisso como colar, ou trazer de volta, algum texto que foi levado +embora.) Você pode colar (yank) o texto matado no mesmo lugar onde ele +foi matado, ou em qualquer outro lugar do buffer, ou ate em um arquivo +diferente. Você pode colar o texto diversas vezes, o que fará diversas +copias dele. + +O comando para colar é C-y. Ele re-insere o ultimo texto matado, na +posição corrente do cursor. + +>> Tente; digite C-y para colar o texto novamente. + +Se você fizer diversos C-k's em uma linha, todo esse texto matado será +salvo junto, então aquele C-y vai colar todas aquelas linhas de uma vez. + +>> Faca isso agora, digite C-k diversas vezes. + +Agora pegue o texto matado: + +Digite C-y. Então mova o cursor para baixo algumas linhas e digite C-y +novamente. Agora você sabe como copiar determinado texto. + +O que você faria se você tivesse determinado texto que você gostaria de +colar, e então você mata alguma outra coisa? C-y ira colar o kill mais +recente. Mas o antigo texto ainda não foi perdido. Você pode tê-lo +novamente usando o comando M-y. Depois que você der um C-y para pegar o +kill mais recente, digitar M-y troca o que você colou pelo anterior a +ele. Digitar M-y novamente e novamente traz kills anteriores e +anteriores. Quando você tiver alcançado o texto que você que esta +procurando, você não precisa fazer nada para mantê-lo. Apenas continue +com a sua edição, deixando o texto onde ele esta. + +Se você digitar M-y o suficiente, você começará do inicio novamente (o +kill mais recente). + +>> Mate uma linha, mova por ai, mate mais uma linha. + Agora digite C-y para colar a segunda linha matada. + Agora digite M-y e ele vai ser trocado pelo primeiro kill. + Faca mais alguns M-y's e veja o que você tem. Faca isso ate que o + segundo kill volte, e depois mais alguns. + Se você preferir, você pode tentar dar argumentos positivos e + negativos. + + +* DESFAZENDO (UNDO) +------------------- + +Se você fizer uma mudança no texto, e então decidir que isso foi um +erro, você pode desfazer com o comando de desfazer (undo), C-x u. + +Normalmente, C-x u desfaz as mudanças feitas por um comando; se você +repetir C-x u diversas vezes em uma linha, cada repetição irá desfazer +um comando adicional. + +Mas tem duas exceções: comandos que não trocam o texto não contam (isso +inclui o movimento do cursor e a barra de rolagem), e caracteres +auto-inseridos são usualmente cuidados em grupos de mais de 20 (Isso e +para reduzir o numero de C-x u's que você deve digitar para desfazer a +inserção de um texto.). + +>> Mate essa linha com C-k, então digite C-x u e isso vai re-aparecer. + +C-_ é um comando alternativo para desfazer; ele funciona exatamente como +o C-x u, mas é mais fácil de digitar diversas vezes em uma linha. A +desvantagem de C-_ é que alguns teclados ele não é tão obvio para +digitar. É exatamente por isso que o C-x u é fornecido. Em alguns +terminais, você pode digitar C-_ digitando / enquanto segurando o +CONTROL. + +Um argumento numérico para C-_ ou C-x u age como um contador de +repetição. + +Você pode desfazer a deleção de texto da mesma maneira que você pode +desfazer o kill de um texto. A distinção entre matar e deletar alguma +coisa afeta se você pode colar com C-y; isso não faz diferença pro +desfazer (undo). + + +* ARQUIVOS +---------- + +Para poder fazer o texto que você edita permanente, você precisa +coloca-lo em um arquivo. Ou então, isso será perdido quando o seu Emacs +for fechado. Para colocar seu texto em um arquivo, você precisa +"encontrar" o arquivo antes de digitar o texto (Isso também é chamado +"visitar" um arquivo.). + +Encontrando um arquivo significa que você verá o conteúdo de um arquivo +com o Emacs. De diversas maneiras, isso é como se você estivesse +editando o arquivo. De qualquer maneira, as mudanças que você fizer +utilizando o Emacs não se tornarão permanente ate que você "salve" o +arquivo. Isso e para que você evite deixar um arquivo meio-modificado no +sistema enquanto você não quer isso. Mesmo quando você salva, o Emacs +deixa o arquivo original sobre um arquivo de nome alterado no caso que +você mais tarde decida que aquelas mudanças foram um erro. + +Se você olhar no rodapé da tela você verá a linha que começa e termina +com traços e inicia com "--:-- TUTORIAL.pt_BR" ou algo parecido com +isso. Essa parte da tela normalmente mostra o nome do arquivo que você +esta visitando. Agora mesmo, você esta visitando um arquivo chamado +"TUTORIAL.pt_BR" que é sua própria copia do tutorial do Emacs. Quando +você encontra um arquivo com o Emacs, o nome do arquivo aparecera nesse +lugar especifico. + +Algo especial para se dizer sobre o comando de encontrar arquivo e que +você tem que dizer qual nome do arquivo você quer. Dizemos que o comando +"lê um argumento do terminal" (nesse caso, o argumento e o nome do +arquivo). Depois que você digitar o comando + + C-x C-f Encontrar um arquivo + +O Emacs pede para você digitar o nome do arquivo. O nome do arquivo +aparece no rodapé da tela. A linha de rodapé é chamada de minibuffer +quando é utilizada para esse tipo de introdução de dados. Você pode +utilizar os comandos padrões do Emacs para editar o nome do arquivo. + +Enquanto você estiver digitando o nome do arquivo (ou qualquer outro +tipo de dado para o minibuffer), você pode cancelar o comando com a +tecla C-g. + +>> Digite C-x C-f, então digite C-g. Isso cancelara o minibuffer, e + também cancelara o comando C-x C-f que estava sendo utilizado no + minibuffer. Para que você não procure nenhum arquivo. + +Quando você terminar de digitar o nome do arquivo, digite <Return> para +terminar. Então o comando C-x C-f ira trabalhar, e encontrar o arquivo +que você escolheu. O minibuffer desaparece quando o comando C-x C-f e +finalizado. + +Em pouco tempo o conteúdo do arquivo aparece na tela, e você poderá +editar o conteúdo dele. Quando você terminar de fazer suas alterações +permanentes digite o comando + + C-x C-s Salve o arquivo + +Isso copia o texto do Emacs para o arquivo. A primeira vez que você +fizer isso, o Emacs vai renomear o arquivo original para um novo nome +para que você não o perca. O nome novo e feito adicionando "~" no fim do +nome original do arquivo. + +Quando o salvamento for concluído, Emacs imprimira o nome do arquivo +escrito. Você deve salvar o conteúdo do seu arquivo regularmente, para +que você não perca muito trabalho caso o sistema caia por um algum +motivo. + +>> Digite C-x C-s, salvara a copia do seu tutorial. + Isso ira imprimir "Wrote ...TUTORIAL.pt_BR" no fim da tela. + +NOTA: Em alguns sistemas, digitar C-x C-s ira travar a tela e você não +verá saída do Emacs. Isso indica que um "recurso" do sistema operacional +chamado "controle de fluxo" (flow control) esta interceptando o C-s e +não deixando que passe pelo Emacs. Para destravar a tela, digite +C-q. Então, leia na seção "Spontaneous Entry to Incremental Search" no +manual do Emacs para uma dica de como lhe dar com esse "recurso". + +Você pode encontrar um arquivo já existente, para ver ou edita-lo. Você +também pode encontrar um arquivo que ainda não existe. Essa é a maneira +de criar um arquivo com o Emacs: encontre o arquivo, que ira iniciar +vazio, então inicie inserindo o texto para o arquivo. Quando você pedir +para "salvar" o arquivo, Emacs irá perguntar se você realmente quer +criar o arquivo com o texto que você acabou de inserir. De agora em +diante, você pode considerar que esta editando um arquivo já existente. + + +* BUFFERS +--------- + +Se você encontrar um segundo arquivo com C-x C-f, o primeiro continuara +dentro do Emacs. Você pode voltar para ele encontrando-o novamente com +C-x C-f. Dessa maneira você pode ter um grande numero de arquivos dentro +do Emacs. + +>> Crie um arquivo chamado "foo" digitando C-x C-f foo <Return>. + Depois digite algum texto, edite-o, e salve "foo" digitando C-x C-s. + Finalmente, digite C-x C-f TUTORIAL.pt_BR <Return> para voltar ao + tutorial. + +O Emacs guarda cada texto de um arquivo em um objeto chamado +"buffer". Encontrar um arquivo cria um novo buffer dentro do Emacs. Para +ver uma lista dos buffers que existem no serviço do seu Emacs, digite + + C-x C-b Lista os buffers + +>> Tente C-x C-b agora. + +Veja como cada buffer tem um nome, e ele também pode ter um nome de +arquivo para o conteúdo de arquivo que ele armazena. Alguns buffers não +correspondem a arquivos. Por exemplo, o buffer chamado "*Buffer List*" +não tem nenhum arquivo. Esse é o buffer que contem a lista de buffers +que foi feito com C-x C-b. QUALQUER texto que você ver numa janela do +Emacs e sempre parte de algum buffer. + +>> Digite C-x 1 para sair da lista dos buffers. + +Se você fizer mudanças no texto de um arquivo, então encontrar um novo +arquivo, isso não salva o conteúdo do primeiro arquivo. As mudanças +continuam dentro do Emacs, nos buffers de arquivo. A criação ou edição +do buffer do segundo arquivo não tem nenhum efeito no buffer do primeiro +arquivo. Isso é muito útil, mas também significa que você precisa de uma +maneira conveniente de salvar o buffer do primeiro arquivo. Seria +inconveniente ter que voltar para ele com C-x C-f para salva-lo com C-x +C-s. Por isso temos + + C-x s Salve alguns buffers + +C-x s pergunta a você sobre cada buffer que contem modificação e você +não salvou. Ele te pergunta, para cada buffer, se você quer salvar. + +>> Insira uma linha de texto, então digite C-x s. + Isso deve te perguntar se você quer salvar o buffer chamado + TUTORIAL.pt_BR. + Responda sim para a pergunta digitando "y". + + +* ESTENDENDO O COMANDO SET +-------------------------- + +Existem mais, muito mais comandos que o Emacs poderia possivelmente ser +colocado em todos os control e caracteres meta. O Emacs faz isso com o +comando X (estender). Que vem em duas versões: + + C-x Extensor de caractere. Seguido por um caractere. + M-x Extensor de nome de comando. Seguido por um longo nome. + +Esses comandos que são geralmente úteis mas pouco usados que os comandos +que você já aprendeu. Você já viu dois deles: os comandos de arquivos +C-x C-f para Encontrar e C-x C-s para Salvar. Outro exemplo de um +comando para finalizar a sessão do Emacs - esse é o comando C-x C-c (Não +se preocupe em perder as mudanças que você fez; C-x C-c oferece salvar +cada arquivo modificado antes de matar o Emacs.). + +C-z é o comando para sair do Emacs *temporariamente* - então você pode +voltar para a mesma seção do Emacs depois. + +Em sistemas que permitem isso, C-z "suspende" o Emacs; isso e, retorna +ao shell mas não destrói o Emacs. Nos shells mais comum, você pode +resumir o Emacs com o comando 'fg' ou com '%emacs'. + +Nos sistemas que não implementam suspensão, C-z cria um subshell rodando +sobre o Emacs para dar a você a chance de rodar outros programas e +retornar ao Emacs depois; isso não "sai" verdadeiramente do Emacs. Nesse +caso, o comando shell 'exit' é o comando usual para voltar ao Emacs do +subshell. + +A hora de usar o C-x C-c é quando você esta prestes a sair do sistema +operacional. É também a maneira correta de sair do Emacs quando chamado +através de um cliente de e-mail ou outros utilitários, porque eles não +controlam a suspensão do Emacs. Em outras circunstâncias, se você não +estiver saindo do sistema operacional, é melhor suspender o Emacs com +C-z ao invés de sair do Emacs. + +Existem diversos comando C-x. Aqui esta uma lista dos que você aprendeu: + + C-x C-f Encontrar arquivo. + C-x C-s Salvar arquivo. + C-x C-b Listar buffers. + C-x C-c Sair do Emacs. + C-x 1 Deletar todas menos a janela atual. + C-x u Desfazer. + +O extensor de nome de comando é usado menos ainda, ou comandos que são +usados apenas em alguns modos. Um exemplo é o comando replace-string, +que globalmente troca uma string por outra. Quando você digita M-x, o +Emacs te pergunta no rodapé da tela M-x e você deve digitar o nome do +comando; nesse caso, "replace-string". Apenas digite "repl s<TAB>" e o +Emacs ira completar o nome. (<TAB> é a tecla Tab, usualmente encontrando +abaixo do CapsLock ou Shift bem na extremidade do teclado.). Termine o +comando com <Return>. + +O comando replace-string requer dois argumentos - a string para ser +trocada, e a string que ira substitui-la. Você precisa terminar cada +argumento com <Return>. + +>> Mova o cursor para a linha branca duas linhas abaixo dessa. + Digite então M-x repl s<Return>mudou<Return>alterado<Return>. + + Note como essa linha mudou: você substituiu a palavra m-u-d-o-u por + "alterado" quando ocorreu, apos a posição inicial do cursor. + + +* SALVAMENTO AUTOMÁTICO +----------------------- + +Quando você fizer mudanças em um arquivo, mas você ainda não tiver +salvo, elas podem ser perdidas se o seu computador der pau. Para +proteger você disso, o Emacs periodicamente escreve um arquivo "auto +salvo" para cada arquivo que você estiver editando. O nome do arquivo +auto salvo tem um # no inicio e no fim; por exemplo, se o seu arquivo +tiver o nome "ola.c", o nome do arquivo auto salvo dele será +"#ola.c#". Quando você salvar o arquivo da maneira normal, o Emacs +deleta os arquivos auto salvos. + +Se o computador der pau, você pode recuperar suas modificações auto +salvas abrindo o arquivo normalmente (o arquivo que você estava +editando, não o arquivo auto-salvo) e então digitar M-x recover +file<Return>. Quando isso perguntar por confirmação, digite yes<Return> +para ir em frente e recuperar os dados auto salvos. + + +* ÁREA DE SAÍDA (ECHO AREA) +--------------------------- + +Se o Emacs ver que você esta digitando comandos multi-caractere +lentamente, ele os mostrara para você no fim da tela numa área chamada +Área de Saída ou Echo Área. A área de saída contem a linha de rodapé da +tela. + + +* MODE LINE +----------- + +A linha imediatamente acima da área de saída é chamada de "mode line". O +mode line diz algo algo mais ou menos assim: + +--:** TUTORIAL.pt_BR (Fundamental)--L670--58%---------------- + +Essa linha da informações úteis sobre o status do Emacs e o texto que +você esta editando. + +Você já sabe o que o nome do arquivo significa -- é o arquivo que você +encontrou. -NN%-- indica sua posição no arquivo texto; significa que NN +percento do texto esta acima do topo da tela. Se o topo do arquivo +estiver na tela, ele dirá --Top-- ao invés de --00%--. Se o rodapé do +texto estiver na tela, ele mostrara --Bot--. Se você estiver olhando um +texto muito pequeno que cabe na todo na tela, o mode line ira dizer +--All--. + +O L são dígitos e indicam a posição de uma outra maneira: eles mostram a +linha corrente do ponto. + +Os asteriscos próximo ao inicio significa que você fez mudanças ao +texto. Logo após você visitar um arquivo ou salvar um arquivo, essa +parte do mode line não mostrara asteriscos, apenas traços. + +A parte do mode line dentro do parênteses lhe diz quais modos você esta +utilizando. O modo padrão é o Fundamental que é o que você esta +utilizando agora. É um exemplo de um "modo majoritário". + +O Emacs tem diversos diferentes modos majoritários. Alguns deles são +para edição de diferentes linguagens de programação e/ou tipos de texto, +como modo Lisp, modo Texto, etc. Em qualquer momento um é apenas um modo +majoritário e ativo, e seu nome pode ser encontrado no mode line +exatamente onde o "Fundamental" esta agora. + +Cada modo majoritário faz com que alguns comandos operem de modo +diferente. Por exemplo, existem comandos para criar comentários nos +programas, e desde que cada linguagem de programação tem uma idéia +diferente de como um comentário deve ser, cada modo majoritário tem que +inserir seus comentários individualmente. Cada modo majoritário é o nome +de um comando estendido, e é assim que você pode mudar para determinado +modo. Por exemplo, M-x fundamental-mode é o comando para trocar para o +modo Fundamental. + +Se você vai editar texto em Português, como neste arquivo, você pode +utilizar o modo Texto. + +>> Digite M-x text mode<Return>. + +Não se preocupe, nenhum dos comandos do Emacs que você aprendeu +mudarão. Mas você pode observar que o M-f e o M-b tratam os apóstrofos +como parte das palavras. Anteriormente, no modo Fundamental, M-f e M-b +trataram os apóstrofos como separadores de palavras. + +Modos majoritários fazem usualmente modificações como esta: a maioria +dos comandos fazem "a mesma coisa" em cada modo majoritário, mas eles +trabalham um pouquinho diferente. + +Para ver a documentação do seu modo majoritário, digite C-h m. + +>> Utilize C-u C-v uma ou mais para trazer essa linha próxima ao topo da + tela. +>> Digite C-h m, para ver como o modo texto difere do modo Fundamental. +>> Digite C-x 1 para remover a documentação da tela. + +Modos majoritários são chamados de majoritários porque também existem +modos minoritários. Modos minoritários não são alternativos aos modos +majoritários, apenas uma modificação minoritária deles. Cada modo +minoritário pode ser ligado ou desligado por ele mesmo, independente de +todos os outros modos minoritários, é independente do modo +majoritário. Então você pode não utilizar modos minoritários, ou um modo +minoritário, ou qualquer combinação de modos minoritários. + +Um modo minoritário que é bastante útil, especialmente para editar texto +em Português, é o modo Auto Fill. Quando ele esta ligado, o Emacs quebra +a linha entre as palavras automaticamente quando você inserir um texto e +criar uma linha muito comprida. + +Você pode ligar o modo Auto Fill fazendo M-x auto fill +mode<Return>. Quando o modo estiver ligado, você pode desliga-lo +novamente fazendo M-x auto fill mode<Return>. Se o modo estiver +desligado, esse comando o liga, e se ele estiver ligado, este comando o +desligara. Nos dizemos que o comando inverte seu status. + +>> Digite M-x auto fill mode<Return> agora. Então insira uma linha de + "asdf " diversas vezes ate que você veja dividir em duas linhas. Você + precisa colocar espaços entre as palavras porque o modo Auto Fill + quebra apenas nos espaços. + +A margem é usualmente definida com 70 caracteres, mas você pode +modifica-la com o comando C-x f. Você deve dar a margem que você quer +como um argumento numérico. + +>> Digite C-x f com um argumento de 20. (C-u 20 C-x f). + Então digite algum texto e veja o Emacs encher linhas com ate 20 + caracteres. Então, volte a definir a margem para 70 utilizando C-x f. + +Se você fizer uma mudança no meio de um parágrafo, o modo Auto Fill não +ira re-preencher para você. Para re-preencher o parágrafo, digite M-q +(Meta-q) com o cursor dentro do parágrafo. + +>> Mova o cursor dentro do parágrafo anterior e digite M-q. + + +* PESQUISANDO +------------- + +O Emacs pode fazer pesquisas por strings (esses sao grupos de caracteres +ligados ou palavras) tanto para frente do texto ou para traz. Pesquisar +por uma string e um comando de movimento do cursor; ele move o cursor +para o próximo lugar onde a string aparece. + +O comando de pesquisa do Emacs é diferente dos comandos de pesquisa da +maioria dos editores, porque é uma pesquisa "incremental". Isso +significa que a pesquisa acontece enquanto você digita uma string para +pesquisar. + +O comando para iniciar a pesquisa é C-s para pesquisa para frente ou C-r +para pesquisa inversa. MAS ESPERE! Não tente fazer agora. + +Quando você digitar C-s você percebera que uma string "I-search" +aparecera como prompt na área de saída. Isso diz para você que o Emacs +esta no que chamamos de pesquisa incremental esperando que você digite o +que você quer procurar. <Return> termina a pesquisa. + +>> Agora digite C-s para iniciar a pesquisa. DEVAGAR, uma letra por vez, + digite o caractere 'cursor', pausando cada vez que você digitar um + caractere, perceba o que acontece com o cursor. Agora que você + pesquisou por "cursor", uma vez. +>> Digite C-s novamente, para pesquisa a próxima ocorrência de "cursor". +>> Agora digite <Delete> quatro vezes e veja como o cursor move. +>> Digite <Return> para terminar a pesquisa. + +Você viu o que aconteceu? O Emacs, em uma pesquisa incremental, tenta ir +para a ocorrência que você digitou ate o momento. Para ir para próxima +ocorrência de 'cursor' apenas digite C-s novamente. Se nenhuma +ocorrência existir, o Emacs bipa e te diz que a pesquisa atual +falhou. C-g também termina a pesquisa. + +NOTA: Em alguns sistemas, digitar C-s ira travar a tela e você não verá +saída do Emacs. Isso indica que um "recurso" do sistema operacional +chamado "controle de fluxo" (flow control) esta interceptando o C-s e +não deixando que passe pelo Emacs. Para destravar a tela, digite +C-q. Então, leia na seção "Spontaneous Entry to Incremental Search" no +manual do Emacs para uma dica de como lhe dar com esse "recurso". + +Se você estiver no meio de uma pesquisa incremental e digitar <Delete>, +você percebera que o ultimo caractere da pesquisa será apagado e a +pesquisa voltara para o ultimo lugar da pesquisa. Por instancia, imagine +que você tenha digitado "c", para pesquisar a primeira ocorrência de +"c". Agora se você digitar "u", o cursor ira mover para a primeira +ocorrência de "cu". Agora digite <Delete>. Isso ira apagar o "u" da +string de pesquisa, e o cursor movera de volta para a primeira +ocorrência de "c". + +Se você estiver no meio de uma pesquisa e digitar um caractere control +ou meta (com algumas exceções--caracteres que são especiais em uma +pesquisa, como C-s e C-r), a pesquisa é terminada. + +O C-s inicia uma pesquisa que procura por qualquer ocorrência da string +de pesquisa APÓS a posição corrente do cursor. Se você quiser pesquisar +por alguma coisa anterior no texto, digite C-r ao invés. Tudo que nos +dissemos sobre C-s também implica para C-r, tirando a direção da +pesquisa que é reversa. + + +* MÚLTIPLAS JANELAS +------------------- + +Um dos recursos mais interessantes do Emacs é que você pode mostrar mais +de uma janela na tela ao mesmo tempo. + +>> Mova o cursor para essa linha e digite C-u 0 C-l (isso é control-L, + não control-1). + +>> Agora digite C-x 2 que vai dividir a tela em duas janelas. + As duas janelas vão mostrar esse tutorial. O cursor fica na janela + do topo. + +>> Digite C-M-v para rolar para o fim da janela. + (Se você não tiver uma tecla Meta de verdade, digite ESC C-v.). + +>> Digite C-x o ("o" para "outra") para mover o cursor para o rodapé + da janela. +>> Use C-v e M-v no rodapé da janela para roda-la. + Continue lendo essas direções na janela do topo. + +>> Digite C-x o novamente para mover o cursor de volta para a janela + do topo. + O cursor na janela do topo esta exatamente como estava antes. + +Você pode continuar usando C-x o para alternar entre as janelas. Cada +janela tem sua própria posição de cursor, mas apenas uma janela mostra o +cursor. Todos os comandos mais comuns de edição aplicam para a janela +que o cursor esta. Chamamos isso de "janela selecionada". + +O comando C-M-v é muito útil para quando você estiver editando o texto +em uma janela e utilizando a outra janela para referencia. Você pode +manter o cursor sempre na janela que você estiver editando, e avançar +pela outra janela seqüencialmente utilizando C-M-v. + +C-M-v é um exemplo de um caractere CONTROL-META. Se você tiver uma tecla +META real, você pode digitar C-M-v segurando ambos CONTROL e META +enquanto digitar v. Não importa se CONTROL ou META "vem primeiro," +porque ambas as teclas agem modificando o caractere que você digita. + +Se você não tiver um tecla META real, você pode utilizar ESC ao invés, a +ordem não importa: você precisa digitar ESC seguido por Control-v, +porque Control-ESC v não ira funcionar. Isso porque ESC é um caractere +com seu próprio direito, não é uma tecla de modificação. + +>> Digite C-x 1 (na janela do topo) para fugir da janela do rodapé. + +(Se você tivesse digitado C-x 1 na janela do rodapé, você fugiria da +janela do topo. Pense neste comando como "Mantenha apenas uma janela--a +janela que estou dentro.") + +Você não precisa mostrar o mesmo buffer nas duas janelas. Se você +utilizar C-x C-f para encontrar um arquivo em outra janela, a outra +janela não mudara. Você pode encontrar um arquivo em cada janela +independentemente. + +Aqui esta uma maneira de utilizar duas janelas para mostrar coisas +diferentes: + +>> Digite C-x 4 C-f seguido pelo nome de um dos seus arquivos. + Termine com <Return>. Veja o arquivo especificado aparece na janela + do rodapé. O cursor ira para lá, também. + +>> Digite C-x o para voltar a janela do topo, e C-x1 para deletar a + janela de rodapé. + + +* NÍVEIS RECURSIVOS DE EDIÇÃO +----------------------------- + +Algumas vezes você entrara no que chamamos de "nível de edição +recursiva". Isso é indicado por colchetes no mode line, envolvendo os +parênteses em volta do nome do modo majoritário. Por exemplo, você pode +ver [(Fundamental)] ao invés de (Fundamental). + +Para sair desses níveis recorríveis de edição, digite ESC ESC ESC. Isso +e um comando de todos os propósitos "saia". Você pode também utilizar +para eliminar janelas extras, e sair de um minibuffer. + +>> Digite M-x para entrar no minibuffer; então digite ESC ESC ESC para + sair. + +Você não pode utilizar C-g para sair de um nível de edição +recursiva. Isso porque o C-g é utilizado para cancelar comandos e +argumentos COM o nível de edição recursiva. + + +* CONSEGUINDO MAIS AJUDA +------------------------ + +Neste tutorial nos tentamos suprimir informações suficientes para que +você comece a utilizar o Emacs. Existe tanto disponível sobre Emacs que +seria impossível explicar tudo aqui. De qualquer maneira, você pode +querer aprender mais sobre Emacs mesmo porque ele tem muitos outros +recursos úteis. O Emacs proporciona comandos para leitura de +documentação sobre comandos do Emacs. Esses comandos de "ajuda" iniciam +com o caractere Control-h, que é chamado de "o caractere de ajuda". + +Para utilizar os recursos de ajuda, digite o caractere C-h, e então um +caractere dizendo que tipo de ajuda você quer. Se você REALMENTE estiver +perdido, digite C-h ? e o Emacs ira te dizer que tipo de ajuda ele pode +te dar. Se você digitar C-h e decidir que você não quer nenhuma ajuda, +apenas digite C-g para cancelar. + +(Alguns sistemas mudam o significado do caractere C-h. Eles não deveriam +fazer isso para todos os usuários, então você tem muito a reclamar com o +administrador do sistema. Enquanto isso, se C-h não mostrar a mensagem +sobre ajuda no rodapé da tela, tente digitar a tecla F1 ou M-x help +<Return> ao invés.) + +O recurso de ajuda mais básico é o C-h c. Digite C-h, e o caractere c, é +um comando de caractere ou seqüência; então o Emacs mostrara uma breve +descrição do comando. + +>> Digite C-h c C-p + A mensagem deve ser algo assim + + C-p roda o comando linha-anterior + +Isso diz a você "o nome da função". Nome de funções são utilizados +basicamente para personalizar o estender o Emacs. Mas desde que nomes de +funções são utilizados para indicar que o que o comando faz, eles podem +servir também como uma breve documentação--suficiente para lembrar você +os comandos que você já aprendeu. + +Comandos multi-caractere como C-x C-s e (se você não tiver a tecla META +ou EDIT ou ALT) <ESC>v é também permitido depois de C-h c. + +Para ter mais informação sobre um comando, utilize C-h k ao invés de C-h +c. + +>> Digite C-h k C-p. + +Isso mostra a documentação da função, assim como seu nome, em uma janela +do Emacs. Quando você terminar de ler a saída, digite C-x 1 para sair da +saída do texto de ajuda. Você não precisa fazer isso imediatamente +apos. Você pode fazer alguma edição enquanto utilizando como referencia +o texto de ajuda, e então digite C-x 1. + +Aqui estão algumas outras opções úteis do comando C-h: + + C-h f Descreve a função. Digite o nome da função. + +>> Tente digitar C-h f previous-line<Return> + Isso ira imprimir toda informação que o Emacs tem sobre a função que + implementa o comando C-p. + + C-h a Comando Apropos. Digite uma palavra chave e o Emacs ira + listar todos os comandos que o nome contem essa + palavra. Esses comandos podem ser chamados com + Meta-x. Para alguns comandos, o comando Apropos ira + também listar um ou dois caracteres de seqüência que + roda o mesmo comando. + +>> Digite C-h a file<Return>. + +Isso mostra em uma outra janela a lista de todos os comandos M-x com +"arquivo" em seus nomes. Você Vera comandos-caractere como C-x C-f +listados ao lado do comando correspondente assim como o find-file. + +>> Digite C-M-v para rolar a janela de ajuda. Faca isso algumas vezes. + +>> Digite C-x 1 para deletar a janela de ajuda. + + +* CONCLUSÃO +----------- + +Lembre, para sair permanentemente do Emacs utilize C-x C-c. Para sair +para um shell temporariamente, para que você possa voltar ao Emacs mais +tarde, utilize C-z. + +Esse tutorial foi feito para ser entendível para todos os novos +usuários, então se você encontrou algo que parece não estar claro, não +sente e se culpe - reclame! + + +* CÓPIA +------- + +Esse tutorial descende de uma longa linha de tutoriais do Emacs +iniciando com um escrito por Stuart Cracraft para o Emacs original. + +Essa versão do tutorial foi originalmente traduzida por Marcelo Toledo +<marcelo@marcelotoledo.org> e como o GNU Emacs, tem um copyright, e vem +com uma permissão de distribuição de cópias nas seguintes condições: + +Copyright (c) 1985, 1996 Free Software Foundation + + Permissão é garantida a qualquer um para fazer ou distribuir copias + integrais deste documento como recebido, em qualquer meio, deixando + disponível e preservados o aviso de copyright e o aviso de permissão, + e o distribuidor garante que a permissão para distribuições + posteriores permitam o mesmo que esta nota. + + Permissão garantida para distribuir versões modificadas deste + documento, ou partes dele, sobre as condições acima, sempre que elas + tenham uma nota visível de quem foi o ultimo a alterar-lo. + +As condições para copiar o Emacs especificamente são mais complexas, mas +no mesmo espírito. Por favor, leia o arquivo COPYING e dê copias do GNU +Emacs para seus amigos. Ajude a erradicar o obstrucionismo de software +("proprietário") usando, escrevendo, e compartilhando software livre! + +;;; Local Variables: +;;; coding: latin-1 +;;; sentence-end-double-space: nil +;;; End: + +;;; arch-tag: 8ea256d6-2c4a-49ee-ac08-0ea6ef25bf8d diff --git a/etc/TUTORIAL.ru b/etc/TUTORIAL.ru index bb7480d913f..84f4b4c6c82 100644 --- a/etc/TUTORIAL.ru +++ b/etc/TUTORIAL.ru @@ -1,43 +1,41 @@ -;; -*- coding: cyrillic-koi8; -*- -Copyright (c) 1985, 1996 Free Software Foundation, Inc. See end for conditions. - -÷Ù ÞÉÔÁÅÔÅ ÕÞÅÂÎÉË Emacs. +÷Ù ÞÉÔÁÅÔÅ ÕÞÅÂÎÉË Emacs. õÓÌÏ×ÉÑ ËÏÐÉÒÏ×ÁÎÉÑ × ËÏÎÃÅ ÆÁÊÌÁ. +Copyright (c) 1985, 1996, 2004 Free Software Foundation, Inc. äÌÑ ÕÐÒÁ×ÌÅÎÉÑ Emacs ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÅÔÓÑ ËÌÀÞ (ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ ËÌÁ×ÉÁÔÕÒÙ -É/ÉÌÉ ËÎÏÐÏË ÍÙÛÉ), ×ËÌÀÞÁÀÝÉÊ × ÓÅÂÑ ËÌÁ×ÉÛÕ CONTROL (ÉÎÏÇÄÁ ÏÔÍÅÞÁÅÍÁÑ ËÁË -CTRL ÉÌÉ CTL) ÉÌÉ ËÌÁ×ÉÛÕ META (ÉÎÏÇÄÁ ÐÏÍÅÞÅÎÎÕÀ ËÁË ALT ÉÌÉ EDIT). ÷ -ÄÁÌØÎÅÊÛÅÍ ×ÍÅÓÔÏ ÔÏÇÏ, ÞÔÏÂÙ ËÁÖÄÙÊ ÒÁÚ ÐÉÓÁÔØ META ÉÌÉ CONTROL ÍÙ ÂÕÄÅÍ +É/ÉÌÉ ËÎÏÐÏË ÍÙÛÉ), ×ËÌÀÞÁÀÝÉÊ × ÓÅÂÑ ËÌÁ×ÉÛÕ CONTROL (ÉÎÏÇÄÁ ÏÔÍÅÞÁÅÍÁÑ +ËÁË CTRL ÉÌÉ CTL) ÉÌÉ ËÌÁ×ÉÛÕ META (ÉÎÏÇÄÁ ÐÏÍÅÞÅÎÎÕÀ ËÁË ALT ÉÌÉ EDIT). ÷ +ÄÁÌØÎÅÊÛÅÍ ×ÍÅÓÔÏ ÔÏÇÏ, ÞÔÏÂÙ ËÁÖÄÙÊ ÒÁÚ ÐÉÓÁÔØ META ÉÌÉ CONTROL, ÍÙ ÂÕÄÅÍ ÉÓÐÏÌØÚÏ×ÁÔØ ÓÌÅÄÕÀÝÅÅ ÓÏËÒÁÝÅÎÉÅ: - C-<chr> ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ CONTROL ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ <chr> + C-<chr> ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ CONTROL, ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ <chr>. ôÁË, C-f ÄÏÌÖÎÏ ÏÚÎÁÞÁÔØ: ÎÁÖÁÔØ ËÌÁ×ÉÛÕ CONTROL É f. - M-<chr> ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ META ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ <chr>. åÓÌÉ + M-<chr> ÓÌÅÄÕÅÔ ÕÄÅÒÖÉ×ÁÔØ ËÌÁ×ÉÛÕ META, ÐÏËÁ ÎÁÂÉÒÁÅÔÓÑ ÓÉÍ×ÏÌ <chr>. åÓÌÉ ÎÅÔ ËÌÁ×ÉÛÉ META, ALT ÉÌÉ EDIT, ÔÏ ÎÁÖÍÉÔÅ <ESC>, ÏÔÐÕÓÔÉÔÅ ÅÅ, Á ÐÏÔÏÍ ÎÁÂÅÒÉÔÅ ÓÉÍ×ÏÌ <chr>. -÷ÁÖÎÏÅ ÚÁÍÅÞÁÎÉÅ: ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÓÅÁÎÓÁ Emacs, ÎÁÂÅÒÉÔÅ C-x C-c. (ä×Á +÷ÁÖÎÏÅ ÚÁÍÅÞÁÎÉÅ: ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÓÅÁÎÓÁ Emacs, ÎÁÂÅÒÉÔÅ C-x C-c. (ä×Á ÓÉÍ×ÏÌÁ). óÉÍ×ÏÌÙ ">>" Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÕËÁÚÙ×ÁÀÔ, ÞÔÏ ×ÁÍ ÎÕÖÎÏ ÄÅÌÁÔØ, -ÞÔÏÂÙ ÐÒÉÍÅÎÉÔØ ËÏÍÁÎÄÕ. îÁÐÒÉÍÅÒ: -<<óÅÒÅÄÉÎÁ ÓÔÒÁÎÉÃÙ ÏÓÔÁ×ÌÅÎÁ ÐÕÓÔÏÊ ÄÌÑ ÕÞÅÂÎÙÈ ÃÅÌÅÊ. ôÅËÓÔ ÐÒÄÏÌÖÁÅÔÓÑ ÎÉÖÅ>> +ÞÔÏÂÙ ÐÒÉÍÅÎÉÔØ ËÏÍÁÎÄÕ. îÁÐÒÉÍÅÒ: +<<óÅÒÅÄÉÎÁ ÓÔÒÁÎÉÃÙ ÏÓÔÁ×ÌÅÎÁ ÐÕÓÔÏÊ ÄÌÑ ÕÞÅÂÎÙÈ ÃÅÌÅÊ. ôÅËÓÔ ÐÒÏÄÏÌÖÁÅÔÓÑ ÎÉÖÅ>> >> ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-v (ðÒÏÓÍÏÔÒ ÓÌÅÄÕÀÝÅÇÏ ÜËÒÁÎÁ) ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ ÓÌÅÄÕÀÝÉÊ ÜËÒÁÎ. (÷ÙÐÏÌÎÉÔÅ ÜÔÏ, ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ CONTROL ÎÁÖÉÍÁÑ v). ôÅÐÅÒØ ×Ù ÄÏÌÖÎÙ ÜÔÏ ÓÄÅÌÁÔØ ÅÝÅ ÒÁÚ, ËÏÇÄÁ ÚÁËÏÎÞÉÔÅ ÞÉÔÁÔØ ÜËÒÁÎ. ïÂÒÁÔÉÔÅ ×ÎÉÍÁÎÉÅ ÎÁ ÔÏ, ÞÔÏ, ÐÏËÁ ×Ù Ä×ÉÖÅÔÅÓØ Ó ÜËÒÁÎÁ ÎÁ ÜËÒÁÎ, -ÐÅÒÅËÒÙ×ÁÀÔÓÑ Ä×Å ÓÔÒÏÞËÉ; ÜÔÏ ÏÂÅÓÐÅÞÉ×ÁÅÔ ÎÅËÏÔÏÒÕÀ ÎÅÐÒÅÒÙ×ÎÏÓÔØ, ÔÁË ÞÔÏ -×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÉÔØ ÞÉÔÁÔØ ÔÅËÓÔ. +ÐÅÒÅËÒÙ×ÁÀÔÓÑ Ä×Å ÓÔÒÏÞËÉ; ÜÔÏ ÏÂÅÓÐÅÞÉ×ÁÅÔ ÎÅËÏÔÏÒÕÀ ÎÅÐÒÅÒÙ×ÎÏÓÔØ, ÔÁË +ÞÔÏ ×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÉÔØ ÞÉÔÁÔØ ÔÅËÓÔ. -ðÅÒ×ÏÅ ÞÔÏ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÚÎÁÔØ -- ËÁË ÐÅÒÅÄ×ÉÇÁÔØÓÑ ÐÏ ÔÅËÓÔÕ ÉÚ ÏÄÎÏÇÏ +ðÅÒ×ÏÅ, ÞÔÏ ×ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÚÎÁÔØ -- ËÁË ÐÅÒÅÄ×ÉÇÁÔØÓÑ ÐÏ ÔÅËÓÔÕ ÉÚ ÏÄÎÏÇÏ ÍÅÓÔÁ × ÄÒÕÇÏÅ. ÷Ù ÕÖÅ ÚÎÁÅÔÅ, ËÁË ÐÅÒÅÍÅÓÔÉÔØÓÑ ×ÐÅÒÅÄ ÏÄÉÎ ÜËÒÁÎ, -ÉÓÐÏÌØÚÕÑ ËÌÀÞ C-v. äÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁÚÁÄ ÎÁ ÏÄÉÎ ÜËÒÁÎ, ÎÁÖÍÉÔÅ M-v -(ÕÄÅÒÖÉ×ÁÊÔÅ ËÌÁ×ÉÛÕ META É ÎÁÂÅÒÉÔÅ v, ÉÌÉ ÎÁÖÍÉÔÅ <ESC>v ÅÓÌÉ Õ ×ÁÓ ÎÅÔ -ËÌÁ×ÉÛÅ META, EDIT, ÉÌÉ ALT). +ÉÓÐÏÌØÚÕÑ ËÌÀÞ C-v. äÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁÚÁÄ ÎÁ ÏÄÉÎ ÜËÒÁÎ, ÎÁÖÍÉÔÅ M-v +(ÕÄÅÒÖÉ×ÁÊÔÅ ËÌÁ×ÉÛÕ META É ÎÁÂÅÒÉÔÅ v, ÉÌÉ ÎÁÖÍÉÔÅ <ESC>v, ÅÓÌÉ Õ ×ÁÓ ÎÅÔ +ËÌÁ×ÉÛÙ META, EDIT, ÉÌÉ ALT). >> ÐÏÐÒÏÂÕÊÔÅ ÎÁÂÒÁÔØ M-v É ÐÏÔÏÍ C-v, ÎÅÓËÏÌØËÏ ÒÁÚ. * ëòáôëáñ ó÷ïäëá ---------- +---------------- äÌÑ ÐÒÏÓÍÏÔÒÁ ÉÓÐÏÌØÚÕÀÔÓÑ ÓÌÅÄÕÀÝÉÅ ËÏÍÁÎÄÙ: @@ -47,18 +45,18 @@ CTRL ÉÌÉ CTL) ÉÌÉ ËÌÁ×ÉÛÕ META (ÉÎÏÇÄÁ ÐÏÍÅÞÅÎÎÕÀ ËÁË ALT ÉÌÉ EDIT). ÷ ÔÅËÓÔ, ÎÁÈÏÄÑÝÉÊÓÑ ×ÏÚÌÅ ËÕÒÓÏÒÁ, × ÃÅÎÔÒÅ ÜËÒÁÎÁ. (üÔÏ CONTROL-L, Á ÎÅ CONTROL-1.) ->> îÁÊÄÉÔÅ ËÕÒÓÏÒ, É ÚÁÐÏÍÎÉÔÅ ÔÅËÓÔ ×ÏÚÌÅ ÎÅÇÏ. ðÏÔÏÍ ÎÁÖÍÉÔÅ C-l. +>> îÁÊÄÉÔÅ ËÕÒÓÏÒ, É ÚÁÐÏÍÎÉÔÅ ÔÅËÓÔ ×ÏÚÌÅ ÎÅÇÏ. ðÏÔÏÍ ÎÁÖÍÉÔÅ C-l. îÁÊÄÉÔÅ ËÕÒÓÏÒ ÓÎÏ×Á É ÕÂÅÄÉÔÅÓØ, ÞÔÏ ×ÏÚÌÅ ÎÅÇÏ ×ÓÅ ÔÏÔ ÖÅ ÔÅËÓÔ. * âáúï÷ùå ëïíáîäù õðòá÷ìåîéñ ëõòóïòïí ------------------------------ +------------------------------------- ä×ÉÖÅÎÉÅ ÏÔ ÜËÒÁÎÁ Ë ÜËÒÁÎÕ ÕÄÏÂÎÏ, ÎÏ ËÁË ÐÅÒÅÍÅÓÔÉÔØÓÑ × ÏÐÒÅÄÅÌÅÎÎÏÅ ÍÅÓÔÏ ÔÅËÓÔÁ ÎÁ ÜËÒÁÎÅ? -åÓÔØ ÎÁÓËÏÌØËÏ ÓÐÏÓÏÂÏ× ÓÄÅÌÁÔØ ÜÔÏ. ïÓÎÏ×ÎÏÊ ÓÐÏÓÏ -- ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÙ -C-p, C-b, C-f É C-n. ëÁÖÄÁÑ ÉÚ ÜÔÉÈ ËÏÍÁÎÄ ÐÅÒÅÄ×ÉÇÁÅÔ ËÕÒÓÏÒ ÎÁ ÏÄÎÕ +åÓÔØ ÎÅÓËÏÌØËÏ ÓÐÏÓÏÂÏ× ÓÄÅÌÁÔØ ÜÔÏ. ïÓÎÏ×ÎÏÊ ÓÐÏÓÏ -- ÉÓÐÏÌØÚÏ×ÁÔØ ËÏÍÁÎÄÙ +C-p, C-b, C-f É C-n. ëÁÖÄÁÑ ÉÚ ÜÔÉÈ ËÏÍÁÎÄ ÐÅÒÅÄ×ÉÇÁÅÔ ËÕÒÓÏÒ ÎÁ ÏÄÎÕ ÓÔÒÏËÕ ÉÌÉ ËÏÌÏÎËÕ ÎÁ ÜËÒÁÎÅ × ÏÐÒÅÄÅÌÅÎÎÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ. üÔÁ ÔÁÂÌÉÃÁ ÐÏËÁÚÙ×ÁÅÔ ÞÅÔÙÒÅ ËÏÍÁÎÄÙ É ÞÅÔÙÒÅ ÎÁÐÒÁ×ÌÅÎÉÑ ÉÈ Ä×ÉÖÅÎÉÑ: @@ -78,7 +76,7 @@ C-p, C-b, C-f É C-n. ëÁÖÄÁÑ ÉÚ ÜÔÉÈ ËÏÍÁÎÄ ÐÅÒÅÄ×ÉÇÁÅÔ ËÕÒÓÏÒ ÎÁ ÏÄÎÕ F-×ÐÅÒÅÄ (forward). üÔÏ ÏÓÎÏ×ÎÙÅ ËÏÍÁÎÄÙ ÐÏÚÉÃÉÏÎÉÒÏ×ÁÎÉÑ ËÕÒÓÏÒÁ, ËÏÔÏÒÙÍÉ ÷Ù ÂÕÄÅÔÅ ÐÏÌØÚÏ×ÁÔØÓÑ ÷óåçäá, ÔÁË ÞÔÏ ÂÕÄÅÔ ÎÅÐÌÏÈÏ ÉÈ ×ÙÕÞÉÔØ. ->> îÁÖÍÉÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ C-n ÞÔÏ ÏÐÕÓÔÉÔØ ËÕÒÓÏÒ ×ÎÉÚ ÎÁ ÜÔÕ ÓÔÒÏËÕ. +>> îÁÖÍÉÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ C-n, ÞÔÏÂÙ ÏÐÕÓÔÉÔØ ËÕÒÓÏÒ ×ÎÉÚ ÎÁ ÜÔÕ ÓÔÒÏËÕ. >> ðÅÒÅÍÅÓÔÉÔÅÓØ ÐÏ ÓÔÒÏËÅ, ÉÓÐÏÌØÚÕÑ C-f É ÐÏÔÏÍ ÐÏÄÎÉÍÉÔÅÓØ ××ÅÒÈ Ó ÐÏÍÏÝØÀ C-p. ðÏÓÍÏÔÒÉÔÅ, ËÁË ÉÚÍÅÎÉÌÏÓØ ÐÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ ÐÒÉ ÎÁÖÁÔÉÉ @@ -95,7 +93,7 @@ character), ËÏÔÏÒÙÊ ÏÔÄÅÌÑÅÔ ÅÅ ÏÔ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ. ðÏÓÌÅÄÎÑÑ ÓÔÒÏËÁ × C-f ÍÏÖÅÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ ÞÅÒÅÚ ÓÉÍ×ÏÌ ÐÅÒÅ×ÏÄÁ ÓÔÒÏËÉ ÔÁË ÖÅ, ËÁË É C-b. ->> ðÏÐÒÏÂÕÊÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÒÉÍÅÎÉÔØ C-b, ÔÁË ÞÔÏÂÙ ÷Ù Õ×ÉÄÅÌÉ, ËÁË +>> ðÏÐÒÏÂÕÊÔÅ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÒÉÍÅÎÉÔØ C-b ÔÁË, ÞÔÏÂÙ ÷Ù Õ×ÉÄÅÌÉ, ËÁË Ä×ÉÖÅÔÓÑ ËÕÒÓÏÒ. äÁÌÅÅ ÉÓÐÏÌØÚÕÊÔÅ C-f ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ ÎÁ ËÏÎÅà ÓÔÒÏËÉ. îÁÖÍÉÔÅ C-f ÅÝÅ ÒÁÚ, ÞÔÏÂÙ ÐÅÒÅÊÔÉ Ë ÎÁÞÁÌÕ ÓÌÅÄÕÀÝÅÊ ÓÔÒÏËÉ. @@ -130,15 +128,16 @@ Control-ÓÉÍ×ÏÌÙ ÒÁÂÏÔÁÀÔ Ó ÏÓÎÏ×ÎÙÍÉ ÅÄÉÎÉÃÁÍÉ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÞÔÏ ÷Ù ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅà ÓÔÒÏËÉ, Á M-a É M-e ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅà ÐÒÅÄÌÏÖÅÎÉÑ. ->> ðÏÐÒÏÂÕÊÔÅ ÎÁÖÁÔØ ÐÁÒÕ ÒÁÚ C-a, É ÐÏÔÏÍ ÐÁÒÕ ÒÁÚ C-e. ðÏÐÒÏÂÕÊÔÅ ÐÁÒÕ +>> ðÏÐÒÏÂÕÊÔÅ ÎÁÖÁÔØ ÐÁÒÕ ÒÁÚ C-a, É ÐÏÔÏÍ ÐÁÒÕ ÒÁÚ C-e. ðÏÐÒÏÂÕÊÔÅ ÐÁÒÕ ÒÁÚ ÎÁÖÁÔØ M-a, ÐÏÓÌÅ ÜÔÏÇÏ ÐÁÒÕ ÒÁÚ ÎÁÖÁÔØ M-e. ðÏÓÍÏÔÒÉÔÅ, ÞÔÏ ÐÏ×ÔÏÒ C-a ÎÉÞÅÇÏ ÎÅ ÉÚÍÅÎÑÅÔ, Á ÐÏ×ÔÏÒ M-a ÐÒÏÄÏÌÖÁÅÔ Ä×ÉÖÅÎÉÅ ËÕÒÓÏÒÁ Ë ÓÌÅÄÕÀÝÅÍÕ ÐÒÅÄÌÏÖÅÎÉÀ. üÔÏ ÎÅ ÓÏÈÒÁÎÑÅÔ ÁÎÁÌÏÇÉÀ, ÎÏ ×ÙÇÌÑÄÉÔ ÅÓÔÅÓÔ×ÅÎÎÏ. -ðÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ × ÔÅËÓÔÅ ÔÁËÖÅ ÎÁÚÙ×ÁÀÔ "ÔÏÞËÁ". óËÁÖÅÍ ÉÎÁÞÅ: ËÕÒÓÏÒ -ÐÏËÁÚÙ×ÁÅÔ ÍÅÓÔÏ ÎÁ ÜËÒÁÎÅ × ËÁËÏÊ ÔÏÞËÅ ÂÕÄÅÔ ÒÁÓÐÏÌÏÖÅÎ ××ÏÄÉÍÙÊ ÔÅËÓÔ. +ðÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ × ÔÅËÓÔÅ ÔÁËÖÅ ÎÁÚÙ×ÁÀÔ "ÔÏÞËÏÊ ×ÓÔÁ×ËÉ". óËÁÖÅÍ ÉÎÁÞÅ: +ËÕÒÓÏÒ ÐÏËÁÚÙ×ÁÅÔ ÍÅÓÔÏ ÎÁ ÜËÒÁÎÅ × ËÁËÏÊ ÔÏÞËÅ ÂÕÄÅÔ ÒÁÓÐÏÌÏÖÅÎ ××ÏÄÉÍÙÊ +ÔÅËÓÔ. úÄÅÓØ ÓÏÂÒÁÎÙ ÐÒÏÓÔÙÅ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ, ×ËÌÀÞÁÑ Ä×ÉÖÅÎÉÅ ÐÏ ÓÌÏ×ÁÍ É ÐÒÅÄÌÏÖÅÎÉÑÍ: @@ -166,22 +165,22 @@ Control-ÓÉÍ×ÏÌÙ ÒÁÂÏÔÁÀÔ Ó ÏÓÎÏ×ÎÙÍÉ ÅÄÉÎÉÃÁÍÉ, ÎÅÚÁ×ÉÓÉÍÏ ÏÔ ÔÏÇÏ, ÞÔÏ ÷Ù Greater-than {âÏÌØÛÅ-þÅÍ}), ËÏÔÏÒÁÑ ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ËÏÎÅà ÔÅËÓÔÁ. îÁ ÂÏÌØÛÉÎÓÔ×Å ÔÅÒÍÉÎÁÌÏ× ÚÎÁË "<" ÎÁÈÏÄÉÔÓÑ ÎÁÄ ÚÎÁËÏÍ ÔÏÞËÉ, É ÞÔÏÂÙ -ÎÁÂÒÁÔØ ÅÇÏ ×Ù ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ ËÌÁ×ÉÛÕ Shift. îÁ ÜÔÉÈ ÔÅÒÍÉÎÁÌÁÈ ×Ù ÔÁË -ÖÅ ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ Shift ÞÔÏ ÎÁÂÒÁÔØ M-<; âÅÚ ÕÄÅÒÖÁÎÉÑ ËÌÁ×ÉÛÉ Shift -×Ù ÎÁÂÅÒÅÔÅ M-ÔÏÞËÁ. +ÎÁÂÒÁÔØ ÅÇÏ, ×Ù ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ ËÌÁ×ÉÛÕ Shift. îÁ ÜÔÉÈ ÔÅÒÍÉÎÁÌÁÈ ×Ù ÔÁË +ÖÅ ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ Shift, ÞÔÏÂÙ ÎÁÂÒÁÔØ M-< (ÂÅÚ ÕÄÅÒÖÁÎÉÑ ËÌÁ×ÉÛÉ Shift +×Ù ÎÁÂÅÒÅÔÅ M-ÔÏÞËÁ). ->> óÅÊÞÁÓ ÐÏÐÒÏÂÕÊÔÅ M-<, ÞÔÏ ÐÅÒÅÍÅÓÔÉÔØÓÑ × ÎÁÞÁÌÏ ÕÞÅÂÎÉËÁ. ðÏÔÏÍ - ÉÓÐÏÌØÚÕÊÔÅ C-v ÞÔÏ ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ. +>> óÅÊÞÁÓ ÐÏÐÒÏÂÕÊÔÅ M-<, ÞÔÏÂÙ ÐÅÒÅÍÅÓÔÉÔØÓÑ × ÎÁÞÁÌÏ ÕÞÅÂÎÉËÁ. ðÏÔÏÍ + ÉÓÐÏÌØÚÕÊÔÅ C-v, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ. ->> óÅÊÞÁÓ ÐÏÐÒÏÂÕÊÔÅ M->, ÞÔÏ ÐÅÒÅÍÅÓÔÉÔØÓÑ Ë ËÏÎÃÕ ÕÞÅÂÎÉËÁ. éÓÐÏÌØÚÕÊÔÅ - M-v ÞÔÏ ×ÅÒÎÕÔØÓÑ ÓÎÏ×Á. +>> óÅÊÞÁÓ ÐÏÐÒÏÂÕÊÔÅ M->, ÞÔÏÂÙ ÐÅÒÅÍÅÓÔÉÔØÓÑ Ë ËÏÎÃÕ ÕÞÅÂÎÉËÁ. éÓÐÏÌØÚÕÊÔÅ + M-v, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ ÓÎÏ×Á. ëÕÒÓÏÒ ÍÏÖÎÏ ÐÅÒÅÍÅÝÁÔØ ËÌÁ×ÉÛÁÍÉ ÕÐÒÁ×ÌÅÎÉÑ ËÕÒÓÏÒÁ (ÓÔÒÅÌËÁÍÉ), ÅÓÌÉ ×ÁÛ ÔÅÒÍÉÎÁÌ ÏÂÏÒÕÄÏ×ÁÎ ÉÍÉ. íÙ ÒÅËÏÍÅÎÄÕÅÍ ×ÙÕÞÉÔØ C-b, C-f, C-n É C-p ÐÏ ÔÒÅÍ -ÐÒÉÞÉÎÁÍ. ÷Ï ÐÅÒ×ÙÈ, ÏÎÉ ÒÁÂÏÔÁÀÔ ÎÁ ÌÀÂÙÈ ÔÅÒÍÉÎÁÌÁÈ. ÷Ï ×ÔÏÒÙÈ, ÏÄÎÁÖÄÙ +ÐÒÉÞÉÎÁÍ. ÷Ï-ÐÅÒ×ÙÈ, ÏÎÉ ÒÁÂÏÔÁÀÔ ÎÁ ÌÀÂÙÈ ÔÅÒÍÉÎÁÌÁÈ. ÷Ï-×ÔÏÒÙÈ, ÏÄÎÁÖÄÙ ÐÏÌÕÞÉ× ÐÒÁËÔÉËÕ ÉÓÐÏÌØÚÏ×ÁÎÉÑ Emacs, ×Ù ÐÏÊÍÅÔÅ, ÞÔÏ ÉÓÐÏÌØÚÏ×ÁÔØ CTRL-ÓÉÍ×ÏÌÙ ÕÄÏÂÎÅÅ É ÂÙÓÔÒÅÅ, ÞÅÍ ËÎÏÐËÉ ÓÏ ÓÔÒÅÌÏÞËÁÍÉ (ÐÏÔÏÍÕ ÞÔÏ ×Ù ÎÅ -ÕÂÉÒÁÅÔÅ ÒÕËÉ Ó ÏÂÙÞÎÏÇÏ ÉÈ ÐÏÌÏÖÅÎÉÑ ÐÒÉ ÐÅÞÁÔÉ). ÷ ÔÒÅÔØÉÈ, ËÁË ÔÏÌØËÏ ×Ù +ÕÂÉÒÁÅÔÅ ÒÕËÉ Ó ÏÂÙÞÎÏÇÏ ÉÈ ÐÏÌÏÖÅÎÉÑ ÐÒÉ ÐÅÞÁÔÉ). ÷-ÔÒÅÔØÉÈ, ËÁË ÔÏÌØËÏ ×Ù ÐÒÉ×ÙËÎÉÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ CTRL-ÓÉÍ×ÏÌÙ, ×Ù ÓÍÏÖÅÔÅ ÔÁË ÖÅ ÌÅÇËÏ ×ÙÕÞÉÔØ É ÉÓÐÏÌØÚÏ×ÁÔØ ÄÒÕÇÉÅ, ÒÁÓÛÉÒÅÎÎÙÅ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ. @@ -192,7 +191,7 @@ CTRL-ÓÉÍ×ÏÌÙ ÕÄÏÂÎÅÅ É ÂÙÓÔÒÅÅ, ÞÅÍ ËÎÏÐËÉ ÓÏ ÓÔÒÅÌÏÞËÁÍÉ (ÐÏÔÏÍÕ ÞÔÏ ×Ù ÎÅ ÁÒÇÕÍÅÎÔ ÍÏÖÎÏ ÚÁÄÁÔØ ÄÒÕÇÉÍ ÓÐÏÓÏÂÏÍ: ÎÁÂÅÒÉÔÅ ÃÉÆÒÙ, ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ META. íÙ ÒÅËÏÍÅÎÄÕÅÍ ÏÓ×ÏÉÔØ ÉÓÐÏÌØÚÏ×ÁÎÉÅ C-u, ÐÏÓËÏÌØËÕ ÜÔÁ ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏÓÔØ ËÌÁ×ÉÛ ÒÁÂÏÔÁÅÔ ÎÁ ÌÀÂÏÍ ÔÅÒÍÉÎÁÌÅ. þÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ -ÔÁËÖÅ ÎÁÚÙ×ÁÅÔÓÑ "ÐÒÅÆÉËÓÎÙÍ ÁÒÇÕÍÅÎÔÏÍ" ÐÏÓËÏÌØËÕ ×Ù ÎÁÂÉÒÁÅÔÅ ÁÒÇÕÍÅÎÔ ÄÏ +ÔÁËÖÅ ÎÁÚÙ×ÁÅÔÓÑ "ÐÒÅÆÉËÓÎÙÍ ÁÒÇÕÍÅÎÔÏÍ", ÐÏÓËÏÌØËÕ ×Ù ÎÁÂÉÒÁÅÔÅ ÁÒÇÕÍÅÎÔ ÄÏ ×ÙÐÏÌÎÅÎÉÑ ËÏÍÁÎÄÙ. îÁÐÒÉÍÅÒ, C-u 8 C-f ÐÅÒÅÍÅÓÔÉÔ ËÕÒÓÏÒ ÎÁ ×ÏÓÅÍØ ÓÉÍ×ÏÌÏ× ×ÐÅÒÅÄ. @@ -217,7 +216,7 @@ META. íÙ ÒÅËÏÍÅÎÄÕÅÍ ÏÓ×ÏÉÔØ ÉÓÐÏÌØÚÏ×ÁÎÉÅ C-u, ÐÏÓËÏÌØËÕ ÜÔÁ ÐÒÏËÒÕÔÉÔØ ÅÇÏ ×ÎÉÚ, ÍÏÖÅÔÅ ÚÁÄÁÔØ ÁÒÇÕÍÅÎÔ ÄÌÑ M-v. åÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ ÏËÏÎÎÕÀ ÓÉÓÔÅÍÕ, ÔÁËÕÀ ËÁË X11 ÉÌÉ MS-Windows, ÄÏÌÖÎÁ -ÂÙÔØ ÐÒÑÍÏÕÇÏÌØÎÁÑ ÏÂÌÁÓÔØ ÉÍÅÎÕÅÍÁÑ ÐÏÌÏÓÏÊ ÐÒÏËÒÕÔËÉ Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÏËÎÁ +ÂÙÔØ ÐÒÑÍÏÕÇÏÌØÎÁÑ ÏÂÌÁÓÔØ, ÉÍÅÎÕÅÍÁÑ ÐÏÌÏÓÏÊ ÐÒÏËÒÕÔËÉ Ó ÌÅ×ÏÊ ÓÔÏÒÏÎÙ ÏËÎÁ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÒÏËÒÕÞÉ×ÁÔØ ÔÅËÓÔ, ÉÓÐÏÌØÚÕÑ ÍÁÎÉÐÕÌÑÔÏÒ ÍÙÛØ. >> ðÏÐÒÏÂÕÊÔÅ ÐÅÒÅÍÅÝÁÔØ ÍÙÛØ ÐÒÉ ÎÁÖÁÔÏÊ ÓÒÅÄÎÅÊ ËÎÏÐËÅ ÍÙÛÉ. ÷Ù Õ×ÉÄÉÔÅ @@ -232,7 +231,7 @@ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÒÏËÒÕÞÉ×ÁÔØ ÔÅËÓÔ, ÉÓÐÏÌØÚÕÑ ÍÁÎÉÐÕÌÑÔÏÒ ÍÙÛØ. ×ÌÅ×Ï, ×ÐÒÁ×Ï, ××ÅÒÈ É ×ÎÉÚ ÐÅÒÅÄ×ÉÇÁÀÔ ËÕÒÓÏÒ × ÏÖÉÄÁÅÍÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ; ÏÎÉ ÒÁÂÏÔÁÀÔ ÔÏÞÎÏ ÔÁËÖÅ ËÁË C-b, C-f, C-p É C-n, ÎÏ ÌÅÇÞÅ × ÎÁÂÏÒÅ É ÚÁÐÏÍÉÎÁÎÉÉ. ÷Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÓÏÞÅÔÁÎÉÑ C-left É C-right ÄÌÑ -ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÓÌÏ×ÁÍ, É C-up É C-down ÄÌÑ ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÂÌÏËÁÍ (Ô.Å., +ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÓÌÏ×ÁÍ, É C-up É C-down ÄÌÑ ÐÅÒÅÄ×ÉÖÅÎÉÑ ÐÏ ÂÌÏËÁÍ (Ô.Å. ÐÁÒÁÇÒÁÆÁÍ, ÅÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÔÅËÓÔ). åÓÌÉ Õ ×ÁÓ ÅÓÔØ ËÎÏÐËÉ ÐÏÍÅÞÅÎÎÙÅ HOME (ÉÌÉ BEGIN) ÉÌÉ END, ÔÏ ÏÎÉ ÂÕÄÕÔ ÐÅÒÅÍÅÝÁÔØ ËÕÒÓÏÒ × ÎÁÞÁÌÏ É ËÏÎÅà ÓÔÒÏËÉ, ÓÏÏÔ×ÅÔÓÔ×ÅÎÎÏ, É C-home É C-end ÂÕÄÕÔ ÐÅÒÅÍÅÝÁÔØ × ÎÁÞÁÌÏ É ËÏÎÅà @@ -249,14 +248,14 @@ CONTROL ÉÌÉ META É ÎÁÂÅÒÉÔÅ ÞÉÓÌÏ. îÁÐÒÉÍÅÒ, ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ 12 ÓÌÏ× * åóìé EMACS úá÷éó ------------------ -åÓÌÉ Emacs ÐÅÒÅÓÔÁÌ ÒÅÁÇÉÒÏ×ÁÔØ ÎÁ ×ÁÛÉ ËÏÍÁÎÄÙ, ×Ù ÍÏÖÅÔÅ ÏÓÔÁÎÏ×ÉÔØ ÜÔÏ -ÐÒÏÓÔÏ ÎÁÖÁ× C-g. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÞÔÏÂÙ ÏÓÔÁÎÏ×ÉÔØ ×ÙÐÏÌÎÅÎÉÅ -ËÏÍÁÎÄÙ ËÏÔÏÒÁÑ ÓÌÉÛËÏÍ ÄÏÌÇÏ ×ÙÐÏÌÎÑÅÔÓÑ. +åÓÌÉ Emacs ÐÅÒÅÓÔÁÌ ÒÅÁÇÉÒÏ×ÁÔØ ÎÁ ×ÁÛÉ ËÏÍÁÎÄÙ, ×Ù ÍÏÖÅÔÅ ÏÓÔÁÎÏ×ÉÔØ ÜÔÏ, +ÐÒÏÓÔÏ ÎÁÖÁ× C-g. ÷Ù ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g, ÞÔÏÂÙ ÏÓÔÁÎÏ×ÉÔØ ×ÙÐÏÌÎÅÎÉÅ +ËÏÍÁÎÄÙ, ËÏÔÏÒÁÑ ÓÌÉÛËÏÍ ÄÏÌÇÏ ×ÙÐÏÌÎÑÅÔÓÑ. -÷Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÄÌÑ ÏÔÍÅÎÙ ÃÉÆÒÏ×ÏÇÏ ÁÒÇÕÍÅÎÔÁ ÉÌÉ ÎÁÞÁÔÏÊ +÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÄÌÑ ÏÔÍÅÎÙ ÃÉÆÒÏ×ÏÇÏ ÁÒÇÕÍÅÎÔÁ ÉÌÉ ÎÁÞÁÔÏÊ ËÏÍÁÎÄÙ, ËÏÔÏÒÕÀ ×Ù ÎÅ ÈÏÔÉÔÅ ÚÁ×ÅÒÛÁÔØ. ->> îÁÂÅÒÉÔÅ C-u 100 ÄÌÑ ÚÁÄÁÎÉÑ ÁÒÇÕÍÅÎÔÁ 100, ÐÏÔÏÍ ÎÁÖÍÉÔÅ C-g. ôÅÐÅÒØ +>> îÁÂÅÒÉÔÅ C-u 100 ÄÌÑ ÚÁÄÁÎÉÑ ÁÒÇÕÍÅÎÔÁ 100, ÐÏÔÏÍ ÎÁÖÍÉÔÅ C-g. ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-f. ëÕÒÓÏÒ ÄÏÌÖÅÎ ÐÅÒÅÍÅÓÔÉÔØÓÑ ×ÓÅÇÏ ÎÁ ÏÄÉÎ ÓÉÍ×ÏÌ, ÐÏÔÏÍÕ ÞÔÏ ×Ù ÏÔÍÅÎÉÌÉ ÁÒÇÕÍÅÎÔ ÎÁÖÁÔÉÅÍ C-g. @@ -264,7 +263,7 @@ CONTROL ÉÌÉ META É ÎÁÂÅÒÉÔÅ ÞÉÓÌÏ. îÁÐÒÉÍÅÒ, ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ÎÁ 12 ÓÌÏ× ÎÁÖÁÔÉÅÍ C-g. -* úáðòåýåîîùå ëïíáîäù (DISABLED COMMANDS) +* úáðòåýåîîùå ëïíáîäù (DISABLED COMMANDS) ----------------------------------------- îÅËÏÔÏÒÙÅ ËÏÍÁÎÄÙ Emacs "ÚÁÐÒÅÝÅÎÙ", ÐÏÓËÏÌØËÕ ÎÁÞÉÎÁÀÝÉÅ ÐÏÌØÚÏ×ÁÔÅÌÉ ÍÏÇÕÔ @@ -291,7 +290,7 @@ Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. C-x 1 ïÄÎÏ ÏËÎÏ. (ÚÁËÒÙÔØ ×ÓÅ ÄÒÕÇÉÅ ÏËÎÁ). -üÔÏ CONTROL-x ÓÏ ÓÌÅÄÕÀÝÅÊ ÃÉÆÒÏÊ 1. C-x 1 ÒÁÚ×ÅÒÎÅÔ ÏËÎÏ ËÏÔÏÒÏÅ ÓÏÄÅÒÖÉÔ +üÔÏ CONTROL-x ÓÏ ÓÌÅÄÕÀÝÅÊ ÃÉÆÒÏÊ 1. C-x 1 ÒÁÚ×ÅÒÎÅÔ ÏËÎÏ, ËÏÔÏÒÏÅ ÓÏÄÅÒÖÉÔ ËÕÒÓÏÒ, ÔÁË, ÞÔÏÂÙ ÏÎÏ ÚÁÎÑÌÏ ×ÅÓØ ÜËÒÁÎ. ðÒÉ ÜÔÏÍ ÂÕÄÕÔ ÕÄÁÌÅÎÙ ×ÓÅ ÏÓÔÁÌØÎÙÅ ÏËÎÁ. @@ -301,7 +300,7 @@ Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. ðÏÓÍÏÔÒÉÔÅ, ËÁË ÔÅËÕÝÅÅ ÏËÎÏ ÓÏÖÍÅÔÓÑ, ËÏÇÄÁ ÎÏ×ÏÅ ÐÏÑ×ÉÔÓÑ É ÏÔÏÂÒÁÚÉÔ ÄÏËÕÍÅÎÔÁÃÉÀ ÎÁ ËÏÍÁÎÄÕ CONTROL-f. ->> îÁÂÅÒÉÔÅ C-x 1 É ÐÏÓÍÏÔÒÉÔÅ ËÁË ÏËÎÏ Ó ÄÏËÕÍÅÎÔÁÃÉÅÊ ÉÓÞÅÚÎÅÔ. +>> îÁÂÅÒÉÔÅ C-x 1 É ÐÏÓÍÏÔÒÉÔÅ, ËÁË ÏËÎÏ Ó ÄÏËÕÍÅÎÔÁÃÉÅÊ ÉÓÞÅÚÎÅÔ. üÔÁ ËÏÍÁÎÄÁ ÏÔÌÉÞÁÅÔÓÑ ÏÔ ÄÒÕÇÉÈ ËÏÍÁÎÄ, ËÏÔÏÒÙÅ ×Ù ÉÚÕÞÉÌÉ, ÔÅÍ, ÞÔÏ ÏÎÁ ÓÏÓÔÏÉÔ ÉÚ Ä×ÕÈ ÓÉÍ×ÏÌÏ×. ïÎÁ ÎÁÞÉÎÁÅÔÓÑ ÓÏ ÚÎÁËÁ CONTROL-x. åÓÔØ ÃÅÌÙÊ @@ -326,7 +325,7 @@ Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. ËÕÒÓÏÒÁ. >> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ ÓÅÊÞÁÓ -- ÎÁÂÅÒÉÔÅ ÎÅÓËÏÌØËÏ ÓÉÍ×ÏÌÏ×, ÐÏÔÏÍ - ÕÄÁÌÉÔÅ ÉÈ ÎÁÖÉÍÁÑ <Delete> ÎÅÓËÏÌØËÏ ÒÁÚ. îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÉÚÍÅÎÅÎÉÑÈ + ÕÄÁÌÉÔÅ ÉÈ ÎÁÖÉÍÁÑ <Delete> ÎÅÓËÏÌØËÏ ÒÁÚ. îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÉÚÍÅÎÅÎÉÑÈ ÜÔÏÇÏ ÆÁÊÌÁ; ×Ù ÎÅ ÉÚÍÅÎÑÅÔÅ ÇÌÁ×ÎÙÊ ÕÞÅÂÎÉË. üÔÏ ×ÁÛÁ ÌÉÞÎÁÑ ËÏÐÉÑ ÕÞÅÂÎÉËÁ. @@ -336,7 +335,7 @@ Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. ÓÔÒÅÌËÁ) Ó ÐÒÁ×ÏÊ ÇÒÁÎÉÃÙ ÐÏËÁÚÙ×ÁÅÔ, ÞÔÏ ÓÔÒÏËÁ ÂÕÄÅÔ ÐÒÏÄÏÌÖÅÎÁ. >> ÷×ÏÄÉÔÅ ÔÅËÓÔ, ÐÏËÁ ÎÅ ÄÏÓÔÉÇÎÉÔÅ ÐÒÁ×ÏÊ ÇÒÁÎÉÃÙ, É ÐÒÏÄÏÌÖÁÊÔÅ - ×ÓÔÁ×ËÕ. ÷Ù Õ×ÉÄÉÔÅ, ËÁË ÐÏÑ×ÉÔÓÑ ÓÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ. + ×ÓÔÁ×ËÕ. ÷Ù Õ×ÉÄÉÔÅ, ËÁË ÐÏÑ×ÉÔÓÑ ÓÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ. >> éÓÐÏÌØÚÕÊÔÅ <Delete> ÄÌÑ ÕÄÁÌÅÎÉÑ ÔÅËÓÔÁ, ÐÏËÁ ÓÔÒÏËÁ ÎÅ ÐÏÍÅÓÔÉÔÓÑ × ÜËÒÁÎ ÓÎÏ×Á. óÉÍ×ÏÌ ÐÒÏÄÏÌÖÅÎÉÑ ÓÔÒÏËÉ ÉÓÞÅÚÎÅÔ. @@ -353,13 +352,13 @@ Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. ÕÄÁÌÅÎÎÏÇÏ ×ÁÍÉ. ðÏÍÎÉÔÅ, ÞÔÏ ÍÎÏÇÉÅ ËÏÍÁÎÄÙ Emacs ÍÏÇÕÔ ÐÏÌÕÞÁÔØ ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÑ; ÐÒÏÓÔÙÅ -ÓÉÍ×ÏÌÙ ÎÅ Ñ×ÌÑÀÔÓÑ ÉÓËÌÀÞÅÎÉÅÍ. îÁÂÉÒÁÊÔÅ ÐÒÏÓÔÙÅ ÓÉÍ×ÏÌÙ ×ÓÔÁ×ÌÑÑ ÉÈ ÐÏ +ÓÉÍ×ÏÌÙ ÎÅ Ñ×ÌÑÀÔÓÑ ÉÓËÌÀÞÅÎÉÅÍ. îÁÂÉÒÁÊÔÅ ÐÒÏÓÔÙÅ ÓÉÍ×ÏÌÙ, ×ÓÔÁ×ÌÑÑ ÉÈ ÐÏ ÎÅÓËÏÌØËÏ ÚÁ ÏÄÉÎ ÒÁÚ. >> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ -- ÎÁÂÅÒÉÔÅ C-u 8 * ÄÌÑ ×ÓÔÁ×ËÉ ********. ôÅÐÅÒØ ×Ù ÎÁÕÞÉÌÉÓØ ÏÓÎÏ×ÎÏÍÕ ÓÐÏÓÏÂÕ ÎÁÂÒÁÔØ ÞÔÏ-ÎÉÂÕÄØ × Emacs É -ÉÓÐÒÁ×ÌÑÔØ ÏÛÉÂËÉ. ôÁË ÖÅ ×Ù ÍÏÖÅÔÅ ÕÄÁÌÑÔØ ÓÌÏ×Á É ÓÔÒÏËÉ. úÄÅÓØ ÓÏÂÒÁÎÙ +ÉÓÐÒÁ×ÌÑÔØ ÏÛÉÂËÉ. ôÁËÖÅ ×Ù ÍÏÖÅÔÅ ÕÄÁÌÑÔØ ÓÌÏ×Á É ÓÔÒÏËÉ. úÄÅÓØ ÓÏÂÒÁÎÙ ÏÐÅÒÁÃÉÉ ÕÄÁÌÅÎÉÑ: <Delete> ÕÄÁÌÉÔØ ÓÉÍ×ÏÌ ÐÅÒÅÄ ËÕÒÓÏÒÏÍ @@ -371,8 +370,8 @@ Emacs ÍÏÖÅÔ ÉÍÅÔØ ÎÅÓËÏÌØËÏ ÏËÏÎ, ËÁÖÄÏÅ ÉÚ ËÏÔÏÒÙÈ ÏÔÏÂÒÁÖÁÅÔ Ó×ÏÊ ÔÅËÓÔ. C-k õÂÉÔØ ×ÓÅ ÏÔ ËÕÒÓÏÒÁ ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ M-k õÂÉÔØ ×ÓÅ ÄÏ ËÏÎÃÁ ÐÒÅÄÌÏÖÅÎÉÑ -úÁÍÅÔØÔÅ, ÞÔÏ <Delete> É C-d ÐÒÏÔÉ× M-<Delete> É M-d ÒÁÓÛÉÒÑÀÔ ÐÁÒÁÌÌÅÌØ -ÎÁÞÁÔÕÀ, C-f É M-f (ÄÁ, <Delete> ÜÔÏ ÎÅ ÒÅÁÌØÎÙÊ ÕÐÒÁ×ÌÑÀÝÉÊ ÓÉÍ×ÏÌ, ÎÏ ÎÅ +úÁÍÅÔØÔÅ, ÞÔÏ <Delete> É C-d ÐÒÏÔÉ× M-<Delete> É M-d ÒÁÓÛÉÒÑÀÔ ÐÁÒÁÌÌÅÌØ, +ÎÁÞÁÔÕÀ C-f É M-f (ÄÁ, <Delete> ÜÔÏ ÎÅ ÒÅÁÌØÎÙÊ ÕÐÒÁ×ÌÑÀÝÉÊ ÓÉÍ×ÏÌ, ÎÏ ÎÅ ÎÕÖÎÏ ×ÏÌÎÏ×ÁÔØÓÑ Ï ÜÔÏÍ). C-k É M-k, ËÁË É C-e É M-e, ÐÒÏ×ÏÄÑÔ ÐÁÒÁÌÌÅÌØ ÍÅÖÄÕ ÓÔÒÏËÁÍÉ É ÐÒÅÄÌÏÖÅÎÉÑÍÉ. @@ -393,13 +392,13 @@ C-SPC (ÏÄÎÕ ÉÚ ÎÉÈ). (SPC ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ). ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ ïÔÌÉÞÉÅ ÍÅÖÄÕ "ÕÂÉÔØ (killing)" É "ÕÄÁÌÉÔØ (deleting)" ÚÁËÌÀÞÁÅÔÓÑ × ÔÏÍ, ÞÔÏ "ÕÂÉÔÙÊ" ÔÅËÓÔ ÍÏÖÅÔ ÂÙÔØ ÚÁÎÏ×Ï ×ÓÔÁ×ÌÅÎ, × ÔÏ ×ÒÅÍÑ ËÁË "ÕÄÁÌÅÎÎÙÅ" ÞÁÓÔÉ ÎÅ ÍÏÇÕÔ ÂÙÔØ ×ÓÔÁ×ÌÅÎÙ. ÷ÓÔÁ×ËÁ "ÕÂÉÔÏÇÏ" ÔÅËÓÔÁ ÎÁÚÙ×ÁÅÔÓÑ -"×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ (yanking)". ÷ ÏÂÝÅÍ, ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÍÏÇÕÔ ÕÄÁÌÑÔØ ÂÏÌØÛÉÅ -ÞÁÓÔÉ ÔÅËÓÔÁ, ÕÄÁÌÑÀÔ ÜÔÏÔ ÔÅËÓÔ (ÏÎÉ ÔÁË ÎÁÓÔÒÁÉ×ÁÀÔÓÑ ÔÁË, ÞÔÏ ×Ù ÍÏÖÅÔÅ -×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ), × ÔÏ ×ÒÅÍÑ ËÁË ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÕÄÁÌÑÀÔ ÔÏÌØËÏ ÏÄÉÎ +"×ÏÓÓÔÁÎÏ×ÌÅÎÉÅ (yanking)". ÷ ÏÂÝÅÍ, ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÍÏÇÕÔ ÕÂÉÒÁÔØ ÂÏÌØÛÉÅ +ÞÁÓÔÉ ÔÅËÓÔÁ, ÕÂÉ×ÁÀÔ ÜÔÏÔ ÔÅËÓÔ (ÏÎÉ ÔÁË ÎÁÓÔÒÁÉ×ÁÀÔÓÑ ÔÁË, ÞÔÏ ×Ù ÍÏÖÅÔÅ +×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ), × ÔÏ ×ÒÅÍÑ ËÁË ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÕÂÉÒÁÀÔ ÔÏÌØËÏ ÏÄÉÎ ÓÉÍ×ÏÌ, ÉÌÉ ÔÏÌØËÏ ÐÕÓÔÙÅ ÓÔÒÏËÉ É ÐÒÏÂÅÌØÎÙÅ ÓÉÍ×ÏÌÙ, ×ÙÐÏÌÎÑÀÔ ÕÄÁÌÅÎÉÅ (ÔÁË ÞÔÏ ×Ù ÎÅ ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÔÅËÓÔ). ->> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÎÁÞÁÌÏ ÎÅÐÕÓÔÏÊ ÓÔÒÏËÉ. ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-k ÞÔÏÂÙ +>> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÎÁÞÁÌÏ ÎÅÐÕÓÔÏÊ ÓÔÒÏËÉ. ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-k, ÞÔÏÂÙ ÕÂÉÔØ ÔÅËÓÔ × ÜÔÏÊ ÓÔÒÏËÅ. >> îÁÖÍÉÔÅ C-k ÅÝÅ ÒÁÚ. ÷Ù ×ÉÄÉÔÅ, ÞÔÏ ÜÔÏ ÕÂØÅÔ ÓÉÍ×ÏÌ ÎÏ×ÏÊ ÓÔÒÏËÉ @@ -407,7 +406,7 @@ C-SPC (ÏÄÎÕ ÉÚ ÎÉÈ). (SPC ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ). ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ úÁÍÅÔØÔÅ, ÞÔÏ ÐÅÒ×ÏÅ C-k ÕÂÉ×ÁÅÔ ÓÏÄÅÒÖÉÍÏÅ ÓÔÒÏËÉ, Á ×ÔÏÒÏÅ C-k ÕÂÉ×ÁÅÔ ÓÁÍÕ ÓÔÒÏËÕ É ÐÏÄÎÉÍÁÅÔ ÄÒÕÇÉÅ ÓÔÒÏËÉ ××ÅÒÈ. C-k ÏÂÒÁÂÁÔÙ×ÁÅÔ ÞÉÓÌÏ×ÏÊ -ÁÒÇÕÍÅÎÔ ÓÐÅÃÉÁÌØÎÙÍ ÏÂÒÁÚÏÍ: ÕÂÉ×ÁÅÔ ÍÎÏÇÏ ÓÔÒÏË _é_ ÉÈ ÓÏÄÅÒÖÉÍÏÅ. üÔÏ ÎÅ +ÁÒÇÕÍÅÎÔ ÓÐÅÃÉÁÌØÎÙÍ ÏÂÒÁÚÏÍ: ÕÂÉ×ÁÅÔ ÓÔÏÌØËÏ ÓÔÒÏË _é_ ÉÈ ÓÏÄÅÒÖÉÍÏÅ. üÔÏ ÎÅ ÐÒÏÓÔÏ ÐÏ×ÔÏÒÅÎÉÅ. C-u 2 C-k ÕÄÁÌÉÔ Ä×Å ÓÔÒÏÉ É ÚÁ×ÅÒÛÁÀÝÉÅ ÉÈ ÓÉÍ×ÏÌÙ ÎÏ×ÏÊ ÓÔÒÏËÉ; ××ÏÄ C-k Ä×Á ÒÁÚÁ ÎÅ ÓÄÅÌÁÅÔ ÜÔÏÇÏ. @@ -420,10 +419,10 @@ C-SPC (ÏÄÎÕ ÉÚ ÎÉÈ). (SPC ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ). ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ ëÏÍÁÎÄÏÊ ÄÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ÔÅËÓÔÁ Ñ×ÌÑÅÔÓÑ C-y. ïÎÁ ×ÏÓÓÔÁÎÁ×ÌÉ×ÁÅÔ ÐÏÓÌÅÄÎÉÊ ÕÂÉÔÙÊ ÔÅËÓÔ × ÍÅÓÔÏ ÒÁÓÐÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ. ->> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ; ÎÁÂÅÒÉÔÅ C-y ÞÔÏ ×ÅÒÎÕÔØ ÔÅËÓÔ ÎÁÚÁÄ. +>> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ; ÎÁÂÅÒÉÔÅ C-y, ÞÔÏÂÙ ×ÅÒÎÕÔØ ÔÅËÓÔ ÎÁÚÁÄ. ðÏÍÎÉÔÅ, ÅÓÌÉ ×Ù ÉÓÐÏÌØÚÏ×ÁÌÉ ÎÅÓËÏÌØËÏ ËÏÍÁÎÄ C-k × ÓÔÒÏËÅ, ×ÓÅ ÕÂÉÔÙÅ -ÓÔÒÏËÉ ÂÕÄÕÔ ÓÏÈÒÁÎÅÎÙ ×ÍÅÓÔÅ, ÔÁË, ÞÔÏ C-y ×ÏÓÓÔÁÎÏ×ÉÔ ÉÈ ×ÍÅÓÔÅ. +ÓÔÒÏËÉ ÂÕÄÕÔ ÓÏÈÒÁÎÅÎÙ ×ÍÅÓÔÅ ÔÁË, ÞÔÏ C-y ×ÏÓÓÔÁÎÏ×ÉÔ ÉÈ ×ÍÅÓÔÅ. >> ðÏÐÒÏÂÕÊÔÅ ×ÙÐÏÌÎÉÔØ ÜÔÏ ÓÅÊÞÁÓ, ÎÁÖÍÉÔÅ C-k ÎÅÓËÏÌØËÏ ÒÁÚ. @@ -434,8 +433,8 @@ C-SPC (ÏÄÎÕ ÉÚ ÎÉÈ). (SPC ÏÂÏÚÎÁÞÁÅÔ ËÌÁ×ÉÛÕ ÐÒÏÂÅÌÁ). ðÅÒÅÍÅÓÔÉÔÅÓØ ÎÁ þÔÏ ÄÅÌÁÔØ, ÅÓÌÉ ÅÓÔØ ÎÅËÏÔÏÒÙÊ ÔÅËÓÔ, ËÏÔÏÒÙÊ ×Ù ÈÏÔÉÔÅ ×ÅÒÎÕÔØ ÎÁÚÁÄ É ÐÏÔÏÍ ÕÂÉÔØ ÞÔÏ-ÔÏ ÅÝÅ? C-y ×ÅÒÎÅÔ ÎÅ ÂÏÌÅÅ ÞÅÍ ÐÏÓÌÅÄÎÉÊ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ. -îÏ ÐÒÅÄÙÄÕÝÉÊ ÔÅËÓÔ ÎÅ ÂÕÄÅÔ ÐÏÔÅÒÑÎ. ÷Ù ÓÍÏÖÅÔÅ ÅÇÏ ×ÅÒÎÕÔØ ÎÁÚÁÄ ÉÓÐÏÌØÚÕÑ -ËÏÍÁÎÄÕ M-y. ðÏÓÌÅ ÔÏÇÏ ËÁË ×Ù ×ÅÒÎÕÌÉ ÐÏÓÌÅÄÎÉÊ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ, ÎÁÖÍÉÔÅ +îÏ ÐÒÅÄÙÄÕÝÉÊ ÔÅËÓÔ ÎÅ ÂÕÄÅÔ ÐÏÔÅÒÑÎ. ÷Ù ÓÍÏÖÅÔÅ ÅÇÏ ×ÅÒÎÕÔØ ÎÁÚÁÄ, ÉÓÐÏÌØÚÕÑ +ËÏÍÁÎÄÕ M-y. ðÏÓÌÅ ÔÏÇÏ, ËÁË ×Ù ×ÅÒÎÕÌÉ ÐÏÓÌÅÄÎÉÊ ÕÄÁÌÅÎÎÙÊ ÔÅËÓÔ, ÎÁÖÍÉÔÅ M-y, É ÚÁÍÅÎÉÔÅ ÜÔÏÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÅÍ, ËÏÔÏÒÙÊ ÂÙÌ ÕÂÉÔ ÒÁÎÅÅ. îÁÖÁÔÉÅ M-y ÓÎÏ×Á É ÓÎÏ×Á ÂÕÄÅÔ ×ÏÚ×ÒÁÝÁÔØ ÒÁÎÅÅ ÕÂÉÔÙÊ ÔÅËÓÔ. ëÏÇÄÁ ×Ù ÄÏÓÔÉÇÎÉÔÅ ÉÓËÏÍÏÇÏ ÔÅËÓÔÁ, ×ÁÍ ÎÅ ÎÕÖÎÏ ÄÅÌÁÔØ ÎÉÞÅÇÏ ÂÏÌÅÅ ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ @@ -447,7 +446,7 @@ M-y, É ÚÁÍÅÎÉÔÅ ÜÔÏÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÅÍ, ËÏÔÏÒÙÊ ÂÙÌ ÕÂÉÔ ÒÁÎÅÅ. >> õÂÅÊÔÅ ÓÔÒÏËÕ, ÐÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ×ÏËÒÕÇ ÜÔÏÊ ÔÏÞËÉ, ÐÏÔÏÍ ÕÄÁÌÉÔÅ ÅÝÅ ÏÄÎÕ ÓÔÒÏËÕ. úÁÔÅÍ ÉÓÐÏÌØÚÕÊÔÅ C-y ÄÌÑ ×ÏÓÓÔÁÎÏ×ÌÅÎÉÑ ×ÔÏÒÏÊ ÕÂÉÔÏÊ - ÓÔÒÏËÉ. úÁÔÅÍ ÉÓÐÏÌØÚÕÊÔÅ M-y É ÏÎÁ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ ÐÅÒ×ÏÊ ÕÂÉÔÏÊ + ÓÔÒÏËÉ. úÁÔÅÍ ÉÓÐÏÌØÚÕÊÔÅ M-y, É ÏÎÁ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ ÐÅÒ×ÏÊ ÕÂÉÔÏÊ ÓÔÒÏËÏÊ. îÁÖÍÉÔÅ M-y ÅÝÅ ÎÅÓËÏÌØËÏ ÒÁÚ, ÞÔÏÂÙ Õ×ÉÄÅÔØ ÐÏÌÕÞÅÎÎÙÊ ÒÅÚÕÌØÔÁÔ. ðÒÏÄÏÌÖÁÊÔÅ ÄÅÌÁÔØ ÜÔÏ, ÐÏËÁ ×ÔÏÒÁÑ ÕÂÉÔÁÑ ÓÔÒÏËÁ ÎÅ ×ÅÒÎÅÔÓÑ, É ÅÝÅ ÞÕÔØ-ÞÕÔØ. åÓÌÉ ×ÁÍ ÈÏÞÅÔÓÑ, ÔÏ ×Ù ÍÏÖÅÔÅ ÚÁÄÁ×ÁÔØ ÄÌÑ M-y @@ -463,7 +462,7 @@ M-y, É ÚÁÍÅÎÉÔÅ ÜÔÏÔ ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÔÅÍ, ËÏÔÏÒÙÊ ÂÙÌ ÕÂÉÔ ÒÁÎÅÅ. ïÂÙÞÎÏ, C-x u ÏÔÍÅÎÑÅÔ ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ ÏÄÎÏÊ ËÏÍÁÎÄÏÊ; ÅÓÌÉ ÐÏ×ÔÏÒÉÔØ C-x u ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ, ËÁÖÄÙÊ ÒÁÚ ÂÕÄÅÔ ÏÔÍÅÎÑÔØÓÑ ÅÝÅ ÏÄÎÁ ËÏÍÁÎÄÁ. -îÏ ÅÓÔØ Ä×Á ÉÓËÌÀÞÅÎÉÑ: ËÏÍÁÎÄÙ ËÏÔÏÒÙÅ ÎÅ ÉÚÍÅÎÑÀÔ ÔÅËÓÔ ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ +îÏ ÅÓÔØ Ä×Á ÉÓËÌÀÞÅÎÉÑ: ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÎÅ ÉÚÍÅÎÑÀÔ ÔÅËÓÔ, ÎÅ ÕÞÉÔÙ×ÁÀÔÓÑ (ÜÔÏ ×ËÌÀÞÁÅÔ ËÏÍÁÎÄÙ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ É ÐÒÏËÒÕÔËÉ), É ÓÁÍÏ×ÓÔÁ×ÌÑÀÝÉÅÓÑ (self-inserting) ÓÉÍ×ÏÌÙ ÏÂÒÁÂÁÔÙ×ÁÀÔÓÑ ÇÒÕÐÐÁÍÉ ÄÏ 20. (üÔÏ ÕÍÅÎØÛÁÅÔ ÞÉÓÌÏ C-x u ËÏÔÏÒÙÅ ×Ù ÍÏÖÅÔÅ ÎÁÂÒÁÔØ ÄÌÑ ÏÔÍÅÎÙ ××ÏÄÁ ÔÅËÓÔÁ). @@ -472,14 +471,14 @@ C-x u ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ, ËÁÖÄÙÊ ÒÁÚ ÂÕÄÅÔ ÏÔÍÅÎÑÔØÓÑ ÅÝÅ ÏÄÎÁ ËÏÍÁÎÄÁ. ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ. C-_ ÁÌØÔÅÒÎÁÔÉ×ÎÁÑ ËÏÍÁÎÄÁ ÏÔÍÅÎÙ; ÏÎÁ ÒÁÂÏÔÁÅÔ ÔÁËÖÅ ËÁË É C-x u, ÎÏ ÌÅÇÞÅ -× ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ. îÅÕÄÏÂÎÏÅ ÐÏÌÏÖÅÎÉÅ C-_ Á ÎÁ ÎÅËÏÔÏÒÙÈ +× ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÎÅÓËÏÌØËÏ ÒÁÚ ÐÏÄÒÑÄ. îÅÕÄÏÂÎÏÅ ÐÏÌÏÖÅÎÉÅ C-_ ÎÁ ÎÅËÏÔÏÒÙÈ ËÌÁ×ÉÁÔÕÒÁÈ ÄÅÌÁÅÔ ÎÅÏÞÅ×ÉÄÎÙÍ ÓÐÏÓÏ ÅÅ ÎÁÂÏÒÁ. ðÏÜÔÏÍÕ ÍÙ ÐÒÅÄÌÁÇÁÅÍ -ÉÓÐÏÌØÚÏ×ÁÔØ C-x u. îÁ ÎÅËÏÔÏÒÙÈ ÔÅÒÍÉÎÁÌÁÈ, ×Ù ÍÏÖÅÔÅ ÎÁÂÉÒÁÔØ C-_ ÎÁÖÉÍÁÑ +ÉÓÐÏÌØÚÏ×ÁÔØ C-x u. îÁ ÎÅËÏÔÏÒÙÈ ÔÅÒÍÉÎÁÌÁÈ, ×Ù ÍÏÖÅÔÅ ÎÁÂÉÒÁÔØ C-_, ÎÁÖÉÍÁÑ / É ÕÄÅÒÖÉ×ÁÑ ËÌÁ×ÉÛÕ CONTROL. þÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÄÌÑ C-_ ÉÌÉ C-x u ÒÁÂÏÔÁÅÔ ËÁË ÓÞÅÔÞÉË ÐÏ×ÔÏÒÅÎÉÑ. -÷Ù ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ÕÄÁÌÅÎÉÅ ÔÅËÓÔÁ ÔÏÞÎÏ ÔÁËÖÅ ËÁË ÏÔÍÅÎÕ ÕÂÉÔÉÑ +÷Ù ÍÏÖÅÔÅ ÏÔÍÅÎÉÔØ ÕÄÁÌÅÎÉÅ ÔÅËÓÔÁ ÔÏÞÎÏ ÔÁË ÖÅ, ËÁË ÏÔÍÅÎÕ ÕÂÉÔÉÑ ÔÅËÓÔÁ. ïÔÌÉÞÉÅ ÍÅÖÄÕ ÕÂÉÊÓÔ×ÏÍ É ÕÄÁÌÅÎÉÅÍ ÞÅÇÏ-ÌÉÂÏ ÚÁËÌÀÞÁÅÔÓÑ × ÔÏÍ, ÞÔÏ ×Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ÕÂÉÔÙÊ ÔÅËÓÔ Ó ÐÏÍÏÝØÀ C-y; ÎÏ ÜÔÏ ÎÅ ÄÅÌÁÅÔ ÒÁÚÌÉÞÉÊ ÄÌÑ ÏÔÍÅÎÙ. @@ -488,27 +487,27 @@ C-_ ÁÌØÔÅÒÎÁÔÉ×ÎÁÑ ËÏÍÁÎÄÁ ÏÔÍÅÎÙ; ÏÎÁ ÒÁÂÏÔÁÅÔ ÔÁËÖÅ ËÁË É C-x u, ÎÏ ÌÅÇÞÅ ------- þÔÏÂÙ ÓÏÚÄÁÎÎÙÊ ÔÅËÓÔ ÍÏÖÎÏ ÂÙÌÏ ÒÅÄÁËÔÉÒÏ×ÁÔØ ÐÏÚÖÅ, ×Ù ÄÏÌÖÎÙ ÅÇÏ -ÐÏÍÅÓÔÉÔØ × ÆÁÊÌ. éÎÁÞÅ, ÏÎ ÉÓÞÅÚÎÅÔ ËÏÇÄÁ ×Ù ×ÙÊÄÉÔÅ ÉÚ Emacs. ÷Ù ÐÏÍÅÝÁÅÔÅ -×ÁÛ ÔÅËÓÔ × ÆÁÊÌ "ÏÔËÒÙ×ÁÑ" ÆÁÊÌ. (åÝÅ ÜÔÏ ÎÁÚÙ×ÁÀÔ "ÐÏÓÅÔÉÔØ" ÆÁÊÌ.) +ÐÏÍÅÓÔÉÔØ × ÆÁÊÌ. éÎÁÞÅ, ÏÎ ÉÓÞÅÚÎÅÔ, ËÏÇÄÁ ×Ù ×ÙÊÄÉÔÅ ÉÚ Emacs. ÷Ù ÐÏÍÅÝÁÅÔÅ +×ÁÛ ÔÅËÓÔ × ÆÁÊÌ, "ÏÔËÒÙ×ÁÑ" ÆÁÊÌ. (åÝÅ ÜÔÏ ÎÁÚÙ×ÁÀÔ "ÐÏÓÅÔÉÔØ" ÆÁÊÌ.) -ïÔËÒÙÔØ ÆÁÊÌ ÏÚÎÁÞÁÅÔ ÐÏÓÍÏÔÒÅÔØ ÅÇÏ ÓÏÄÅÒÖÉÍÏÅ ÉÓÐÏÌØÚÕÑ Emacs. ÷Ï ÍÎÏÇÉÈ -ÓÌÕÞÁÑÈ, ÜÔÏ ÐÒÏÉÓÈÏÄÉÔ ËÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÆÁÊÌ ÓÁÍÉ. ïÄÎÁËÏ ×ÁÛÉ +ïÔËÒÙÔØ ÆÁÊÌ ÏÚÎÁÞÁÅÔ ÐÏÓÍÏÔÒÅÔØ ÅÇÏ ÓÏÄÅÒÖÉÍÏÅ, ÉÓÐÏÌØÚÕÑ Emacs. ÷Ï ÍÎÏÇÉÈ +ÓÌÕÞÁÑÈ, ÜÔÏ ÐÒÏÉÓÈÏÄÉÔ, ËÏÇÄÁ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÆÁÊÌ ÓÁÍÉ. ïÄÎÁËÏ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ, ÓÄÅÌÁÎÎÙÅ Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ Emacs ÎÅ ÂÕÄÕÔ ÚÁÆÉËÓÉÒÏ×ÁÎÙ, ÐÏËÁ ×Ù ÎÅ ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ. ôÁË ×Ù ÍÏÖÅÔÅ ÎÅ ÏÓÔÁ×ÌÑÔØ ÐÏÌÕÉÚÍÅÎÅÎÎÙÊ ÆÁÊÌ × ÓÉÓÔÅÍÅ, ÅÓÌÉ ×Ù ÎÅ ÈÏÔÉÔÅ ÜÔÏÇÏ. äÁÖÅ ËÏÇÄÁ ×Ù ÓÏÈÒÁÎÑÅÔÅ ÆÁÊÌ, Emacs ÏÓÔÁ×ÌÑÅÔ -ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ Ó ÉÚÍÅÎÅÎÎÙÍ ÉÍÅÎÅÍ, ÞÔÏ ×Ù ÍÏÇÌÉ ÐÏÚÖÅ ÒÅÛÉÔØ, ÞÔÏ ×ÁÛÉ +ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ Ó ÉÚÍÅÎÅÎÎÙÍ ÉÍÅÎÅÍ, ÞÔÏÂÙ ×Ù ÍÏÇÌÉ ÐÏÚÖÅ ÒÅÛÉÔØ, ÞÔÏ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ ÂÙÌÉ ÏÛÉÂÏÞÎÙ. åÓÌÉ ×Ù ÐÏÓÍÏÔÒÉÔÅ × ÎÉÖÎÀÀ ÞÁÓÔØ ÜËÒÁÎÁ, ÔÏ ×Ù Õ×ÉÄÉÔÅ ÓÔÒÏËÕ, ËÏÔÏÒÁÑ ÎÁÞÉÎÁÅÔÓÑ Ó ÔÉÒÅ É ÎÁÞÉÎÁÅÔÓÑ Ó "--:-- TUTORIAL.ru" ÉÌÉ ÞÅÇÏ-ÔÏ -ÐÏÄÏÂÎÏÇÏ. üÔÁ ÞÁÓÔØ ÜËÒÁÎÁ ×ÓÅÇÄÁ ÐÏËÁÚÙ×ÁÅÔ ÉÍÑ ÆÁÊÌÁ ËÏÔÏÒÙÊ ×Ù -ÏÔËÒÙÌÉ. éÔÁË, ÓÅÊÞÁÓ ×Ù ÏÔËÒÙÌÉ ÆÁÊÌ Ó ÉÍÅÎÅÍ "TUTORIAL.ru" ËÏÔÏÒÙÊ -Ñ×ÌÑÅÔÓÑ ×ÁÛÅÊ ÐÅÒÓÏÎÁÌØÎÏÊ ËÏÐÉÅÊ ÕÞÅÂÎÉËÁ Emacs. äÌÑ ÌÀÂÏÇÏ ÆÁÊÌÁ ËÏÔÏÒÙÊ +ÐÏÄÏÂÎÏÇÏ. üÔÁ ÞÁÓÔØ ÜËÒÁÎÁ ×ÓÅÇÄÁ ÐÏËÁÚÙ×ÁÅÔ ÉÍÑ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù +ÏÔËÒÙÌÉ. éÔÁË, ÓÅÊÞÁÓ ×Ù ÏÔËÒÙÌÉ ÆÁÊÌ Ó ÉÍÅÎÅÍ "TUTORIAL.ru", ËÏÔÏÒÙÊ +Ñ×ÌÑÅÔÓÑ ×ÁÛÅÊ ÐÅÒÓÏÎÁÌØÎÏÊ ËÏÐÉÅÊ ÕÞÅÂÎÉËÁ Emacs. äÌÑ ÌÀÂÏÇÏ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù ÏÔËÒÏÅÔÅ, ÉÍÑ ÜÔÏÇÏ ÆÁÊÌÁ ÐÏÑ×ÉÔÓÑ × ÜÔÏÍ ÍÅÓÔÅ. -ïÄÎÏÊ ÉÚ ÓÐÅÃÉÁÌØÎÙÈ ×ÅÝÅÊ, ËÏÔÏÒÕÀ ×ÁÍ ÎÕÖÎÏ ÚÎÁÔØ Ï ËÏÍÁÎÄÅ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ --- ÜÔÏ ÔÏ, ÞÔÏ ×Ù ÄÏÌÖÎÙ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ÎÕÖÎÏ ÞÉÔÁÔØ. íÙ ÜÔÏ -ÎÁÚÙ×ÁÅÍ ËÏÍÁÎÄÏÊ "ÞÉÔÁÀÝÁÑ ÁÒÇÕÍÅÎÔ Ó ÔÅÒÍÉÎÁÌÁ" (× ÜÔÏÍ ÓÌÕÞÁÅ, ÁÒÇÕÍÅÎÔÏÍ +ïÄÎÏÊ ÉÚ ÓÐÅÃÉÁÌØÎÙÈ ×ÅÝÅÊ, ËÏÔÏÒÕÀ ×ÁÍ ÎÕÖÎÏ ÚÎÁÔØ Ï ËÏÍÁÎÄÅ ÏÔËÒÙÔÉÑ ÆÁÊÌÁ, +ÜÔÏ ÔÏ, ÞÔÏ ×Ù ÄÏÌÖÎÙ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ, ËÏÔÏÒÙÊ ÎÕÖÎÏ ÞÉÔÁÔØ. íÙ ÜÔÏ +ÎÁÚÙ×ÁÅÍ ËÏÍÁÎÄÏÊ, "ÞÉÔÁÀÝÅÊ ÁÒÇÕÍÅÎÔ Ó ÔÅÒÍÉÎÁÌÁ" (× ÜÔÏÍ ÓÌÕÞÁÅ, ÁÒÇÕÍÅÎÔÏÍ Ñ×ÌÑÅÔÓÑ ÉÍÑ ÆÁÊÌÁ). ðÏÓÌÅ ××ÏÄÁ ËÏÍÁÎÄÙ C-x C-f ïÔËÒÙÔØ (ÎÁÊÔÉ) ÆÁÊÌ @@ -522,15 +521,15 @@ Emacs ÐÏÐÒÏÓÉÔ ×ÁÓ ××ÅÓÔÉ ÉÍÑ ÆÁÊÌÁ. éÍÑ ÆÁÊÌÁ ×Ù ÎÁÂÅÒÅÔÅ × ÎÉÖÎÅÊ ÓÔÒÏËÅ ÏÔÍÅÎÉÔØ ËÏÍÁÎÄÕ ÎÁÖÁ× C-g. >> îÁÖÍÉÔÅ C-x C-f, ÚÁÔÅÍ ÎÁÖÍÉÔÅ C-g. üÔÏ ÏÔÍÅÎÉÔ ÍÉÎÉ-ÂÕÆÅÒ, É ËÏÍÁÎÄÕ - C-x C-f ËÏÔÏÒÁÑ ÉÓÐÏÌØÚÏ×ÁÌÁ ÍÉÎÉ-ÂÕÆÅÒ. ÷ ÉÔÏÇÅ, ×Ù ÎÅ ÏÔËÒÙÌÉ ÎÉ ÏÄÎÏÇÏ + C-x C-f, ËÏÔÏÒÁÑ ÉÓÐÏÌØÚÏ×ÁÌÁ ÍÉÎÉ-ÂÕÆÅÒ. ÷ ÉÔÏÇÅ, ×Ù ÎÅ ÏÔËÒÙÌÉ ÎÉ ÏÄÎÏÇÏ ÆÁÊÌÁ. ëÏÇÄÁ ×Ù ÚÁ×ÅÒÛÉÔÅ ××ÏÄ ÉÍÅÎÉ ÆÁÊÌÁ, ÎÁÖÍÉÔÅ <Return>. äÁÌÅÅ ÓÒÁÂÏÔÁÅÔ -ËÏÍÁÎÄÁ C-x C-f, É ÏÔËÒÏÅÔ ÆÁÊÌ ÕËÁÚÁÎÎÙÊ ×ÁÍÉ. íÉÎÉ-ÂÕÆÅÒ ÉÓÞÅÚÎÅÔ ËÏÇÄÁ -ËÏÍÁÎÄÁ C-x C-f ÚÁ×ÅÒÛÉÔÓÑ. +ËÏÍÁÎÄÁ C-x C-f, ËÏÔÏÒÁÑ ÏÔËÒÏÅÔ ÕËÁÚÁÎÎÙÊ ×ÁÍÉ ÆÁÊÌ. íÉÎÉ-ÂÕÆÅÒ ÉÓÞÅÚÎÅÔ, +ËÏÇÄÁ ËÏÍÁÎÄÁ C-x C-f ÚÁ×ÅÒÛÉÔÓÑ. é ÍÇÎÏ×ÅÎÉÅÍ ÐÏÚÖÅ ÓÏÄÅÒÖÉÍÏÅ ÆÁÊÌÁ ÐÏÑ×ÉÔÓÑ ÎÁ ÜËÒÁÎÅ, É ×Ù ÓÍÏÖÅÔÅ ÅÇÏ -ÒÅÄÁËÔÉÒÏ×ÁÔØ. ëÏÇÄÁ ×Ù ÚÁËÏÎÞÉÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ, ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ +ÒÅÄÁËÔÉÒÏ×ÁÔØ. ëÏÇÄÁ ×Ù ÚÁËÏÎÞÉÔÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ, ÞÔÏÂÙ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ, ÎÁÂÅÒÉÔÅ ËÏÍÁÎÄÕ C-x C-s óÏÈÒÁÎÉÔØ ÆÁÊÌ @@ -541,18 +540,18 @@ Emacs ÐÅÒÅÉÍÅÎÕÅÔ ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ × ÆÁÊÌ Ó ÎÏ×ÙÍ ÉÍÅÎÅÍ, ÞÔÏÂÙ ÏÎ ÎÅ ÉÍÅÎÉ ÆÁÊÌÁ. ëÏÇÄÁ ÓÏÈÒÁÎÅÎÉÅ ÚÁ×ÅÒÛÉÔÓÑ, Emacs ÎÁÐÅÞÁÔÁÅÔ ÉÍÑ ÚÁÐÉÓÁÎÎÏÇÏ ÆÁÊÌÁ. ÷Ù -ÄÏÌÖÎÙ ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ ÄÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ, ÔÁË ÞÔÏÂÙ ÎÅ ÐÏÔÅÒÑÔØ ÍÎÏÇÏ -ÒÁÂÏÔÙ ÅÓÌÉ ×ÄÒÕÇ ÓÉÓÔÅÍÁ ÐÏÇÉÂÎÅÔ. +ÄÏÌÖÎÙ ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ ÄÏÓÔÁÔÏÞÎÏ ÞÁÓÔÏ, ÞÔÏÂÙ ÎÅ ÐÏÔÅÒÑÔØ ÍÎÏÇÏ +ÒÁÂÏÔÙ, ÅÓÌÉ ×ÄÒÕÇ ÓÉÓÔÅÍÁ ÚÁ×ÉÓÎÅÔ. >> îÁÂÅÒÉÔÅ C-x C-s, ÓÏÈÒÁÎÉÔÅ ×ÁÛÕ ËÏÐÉÀ ÕÞÅÂÎÉËÁ. ÷ ÎÉÖÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ ÄÏÌÖÎÁ ÐÏÑ×ÉÔØÓÑ ÎÁÄÐÉÓØ "Wrote ...TUTORIAL.ru". úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ, ××ÏÄ C-x C-s ÚÁÂÌÏËÉÒÕÅÔ ÜËÒÁÎ É ×Ù ÎÅ -Õ×ÉÄÉÔÅ ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. üÔÏ ÏÚÎÁÞÁÅÔ ÞÔÏ ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ -ÉÍÅÅÔ "ÏÓÏÂÅÎÎÏÓÔØ" ÉÍÅÎÕÅÍÕÀ "flow control" ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ C-s É ÎÅ +Õ×ÉÄÉÔÅ ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ +ÉÍÅÅÔ "ÏÓÏÂÅÎÎÏÓÔØ", ÉÍÅÎÕÅÍÕÀ "flow control", ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ C-s É ÎÅ ÐÒÏÐÕÓËÁÀÝÕÀ ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ ÒÁÚÂÌÏËÉÒÏ×ËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. -óÍÏÔÒÉÔÅ ÒÁÚÄÅÌ "Spontaneous Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs -ÞÔÏÂÙ ÕÚÎÁÔØ ËÁË ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ". +óÍÏÔÒÉÔÅ ÒÁÚÄÅÌ "Spontaneous Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs, +ÞÔÏÂÙ ÕÚÎÁÔØ, ËÁË ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ". ÷Ù ÍÏÖÅÔÅ ÏÔËÒÙÔØ ÓÕÝÅÓÔ×ÕÀÝÉÊ ÆÁÊÌ ÄÌÑ ÐÒÏÓÍÏÔÒÁ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÎÁÊÔÉ ÆÁÊÌ, ËÏÔÏÒÏÇÏ ÅÝÅ ÎÅ ÓÕÝÅÓÔ×ÕÅÔ. äÒÕÇÉÍÉ ÓÌÏ×ÁÍÉ -- @@ -569,45 +568,45 @@ Emacs ÐÅÒÅÉÍÅÎÕÅÔ ÏÒÉÇÉÎÁÌØÎÙÊ ÆÁÊÌ × ÆÁÊÌ Ó ÎÏ×ÙÍ ÉÍÅÎÅÍ, ÞÔÏÂÙ ÏÎ ÎÅ ×ÎÕÔÒÉ Emacs. ÷Ù ÍÏÖÅÔÅ ÐÅÒÅËÌÀÞÉÔØÓÑ ÎÁÚÁÄ, ÎÁÊÄÑ ÅÇÏ ÓÎÏ×Á C-x C-f. üÔÏ ÓÐÏÓÏ ÚÁÇÒÕÚÉÔØ ÎÅÓËÏÌØËÏ ÆÁÊÌÏ× × Emacs. ->> óÏÚÄÁÊÔÅ ÆÁÊÌ Ó ÉÍÅÎÅÍ "foo" ÎÁÂÉÒÁÑ C-x C-f foo <Return>. - ÷ÓÔÁ×ØÔÅ ËÁËÏÊ-ÎÉÂÕÄØ ÔÅËÓÔ, ÏÔÒÅÄÁËÔÉÒÕÊÔÅ ÅÇÏ, É ÓÏÈÒÁÎÉÔÅ "foo" +>> óÏÚÄÁÊÔÅ ÆÁÊÌ Ó ÉÍÅÎÅÍ "foo", ÎÁÂÉÒÁÑ C-x C-f foo <Return>. + ÷ÓÔÁ×ØÔÅ ËÁËÏÊ-ÎÉÂÕÄØ ÔÅËÓÔ, ÏÔÒÅÄÁËÔÉÒÕÊÔÅ ÅÇÏ, É ÓÏÈÒÁÎÉÔÅ "foo", ÎÁÂÒÁ× C-x C-s. - îÁËÏÎÅÃ, ÎÁÂÅÒÉÔÅ C-x C-f TUTORIAL.ru <Return> + îÁËÏÎÅÃ, ÎÁÂÅÒÉÔÅ C-x C-f TUTORIAL.ru <Return>, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ ÎÁÚÁÄ Ë ÕÞÅÂÎÉËÕ. -Emacs ÓÏÈÒÁÎÑÅÔ ÔÅËÓÔ ËÁÖÄÏÇÏ ÆÁÊÌÁ ×ÎÕÔÒÉ × ÏÂßÅËÔÅ ÎÁÚÙ×ÁÅÍÙÊ "ÂÕÆÅÒ" -("buffer"). ïÔËÒÙÔÉÅ ÆÁÊÌÁ ÓÏÚÄÁÅÔ ÎÏ×ÙÊ ÂÕÆÅÒ ×ÎÕÔÒÉ Emacs. ÞÔÏÂÙ Õ×ÉÄÅÔØ -ÓÐÉÓÏË ÂÕÆÅÒÏ× ÓÏÚÄÁÎÎÙÈ × ÔÅËÕÝÅÍ Emacs ÎÁÂÅÒÉÔÅ +Emacs ÓÏÈÒÁÎÑÅÔ ÔÅËÓÔ ËÁÖÄÏÇÏ ÆÁÊÌÁ ×ÎÕÔÒÉ × ÏÂßÅËÔÅ, ÎÁÚÙ×ÁÅÍÏÍ "ÂÕÆÅÒ" +("buffer"). ïÔËÒÙÔÉÅ ÆÁÊÌÁ ÓÏÚÄÁÅÔ ÎÏ×ÙÊ ÂÕÆÅÒ ×ÎÕÔÒÉ Emacs. þÔÏÂÙ Õ×ÉÄÅÔØ +ÓÐÉÓÏË ÂÕÆÅÒÏ×, ÓÏÚÄÁÎÎÙÈ × ÔÅËÕÝÅÍ Emacs, ÎÁÂÅÒÉÔÅ C-x C-b óÐÉÓÏË ÂÕÆÅÒÏ× >> ðÏÐÒÏÂÕÊÔÅ C-x C-b ÓÅÊÞÁÓ. -íÙ ×ÉÄÉÍ ÞÔÏ ËÁÖÄÙÊ ÂÕÆÅÒ ÉÍÅÅÔ ÉÍÑ, É ÍÏÖÅÔ ÉÍÅÔØ ÉÍÑ ÆÁÊÌÁ, ÓÏÄÅÒÖÉÍÏÅ +íÙ ×ÉÄÉÍ, ÞÔÏ ËÁÖÄÙÊ ÂÕÆÅÒ ÉÍÅÅÔ ÉÍÑ, É ÍÏÖÅÔ ÉÍÅÔØ ÉÍÑ ÆÁÊÌÁ, ÓÏÄÅÒÖÉÍÏÅ ËÏÔÏÒÏÇÏ × ÎÅÍ ÈÒÁÎÉÔÓÑ. îÅËÏÔÏÒÙÅ ÂÕÆÅÒÁ ÎÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÔ ÆÁÊÌÁÍ. îÁÐÒÉÍÅÒ, -ÂÕÆÅÒ ÎÁÚ×ÁÎÎÙÊ "*Buffer List*" ÎÅ ÓÏÄÅÒÖÉÔ ÎÉËÁËÏÇÏ ÆÁÊÌÁ. ÷ ÜÔÏÍ ÂÕÆÅÒÅ -ÓÏÄÅÒÖÉÔÓÑ ÓÐÉÓÏË ÂÕÆÅÒÏ×, ËÏÔÏÒÙÊ ÂÙÌ ÓÏÚÄÁÎ ËÏÍÁÎÄÏÊ C-x C-b. ìàâïê ÔÅËÓÔ -ËÏÔÏÒÙÊ ×É ×ÉÄÉÔÅ × ÏËÎÅ Emacs ×ÓÅÇÄÁ Ñ×ÌÑÅÔÓÑ ÞÁÓÔØÀ ËÁËÏÇÏ-ÌÉÂÏ ÂÕÆÅÒÁ. +ÂÕÆÅÒ, ÎÁÚ×ÁÎÎÙÊ "*Buffer List*", ÎÅ ÓÏÄÅÒÖÉÔ ÎÉËÁËÏÇÏ ÆÁÊÌÁ. ÷ ÜÔÏÍ ÂÕÆÅÒÅ +ÓÏÄÅÒÖÉÔÓÑ ÓÐÉÓÏË ÂÕÆÅÒÏ×, ËÏÔÏÒÙÊ ÂÙÌ ÓÏÚÄÁÎ ËÏÍÁÎÄÏÊ C-x C-b. ìàâïê ÔÅËÓÔ, +ËÏÔÏÒÙÊ ×Ù ×ÉÄÉÔÅ × ÏËÎÅ Emacs, ×ÓÅÇÄÁ Ñ×ÌÑÅÔÓÑ ÞÁÓÔØÀ ËÁËÏÇÏ-ÌÉÂÏ ÂÕÆÅÒÁ. ->> îÁÂÅÒÉÔÅ C-x 1 ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÓÐÉÓËÁ ÂÕÆÅÒÏ×. +>> îÁÂÅÒÉÔÅ C-x 1, ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÓÐÉÓËÁ ÂÕÆÅÒÏ×. åÓÌÉ ×Ù ÉÚÍÅÎÑÅÔÅ ÔÅËÓÔ ÏÄÎÏÇÏ ÆÁÊÌÁ, ÐÏÔÏÍ ÏÔËÒÙ×ÁÅÔÅ ÄÒÕÇÏÊ, ÔÏ ÐÅÒ×ÙÊ -ÏÓÔÁÅÔÓÑ ÎÅ ÓÏÈÒÁÎÅÎÎÙÍ. éÚÍÅÎÅÎÉÑ ÏÓÔÁÎÕÔÓÑ ×ÎÕÔÒÉ Emacs, × ÆÁÊÌÏ×ÏÍ -ÂÕÆÅÒÅ. óÏÚÄÁÎÉÅ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÓÌÅÄÕÀÝÅÇÏ ÆÁÊÌÏ×ÏÇÏ ÂÕÆÅÒÁ ÎÅ +ÏÓÔÁÅÔÓÑ ÎÅÓÏÈÒÁÎÅÎÎÙÍ. éÚÍÅÎÅÎÉÑ ÏÓÔÁÎÕÔÓÑ ×ÎÕÔÒÉ Emacs, × ÆÁÊÌÏ×ÏÍ +ÂÕÆÅÒÅ. óÏÚÄÁÎÉÅ ÉÌÉ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ÓÌÅÄÕÀÝÅÇÏ ÆÁÊÌÏ×ÏÇÏ ÂÕÆÅÒÁ ÎÅ ÓËÁÚÙ×ÁÅÔÓÑ ÎÁ ÐÅÒ×ÏÍ ÂÕÆÅÒÅ. üÔÏ ÏÞÅÎØ ÕÄÏÂÎÏ, ÎÏ ÉÍÅÊÔÅ × ×ÉÄÕ, ÞÔÏ ×ÁÍ ÎÕÖÎÏ ÉÍÅÔØ ÕÄÏÂÎÙÊ ÓÐÏÓÏ ÓÏÈÒÁÎÉÔØ ÐÅÒ×ÙÊ ÆÁÊÌÏ×ÙÊ ÂÕÆÅÒ. âÙÌÏ ÂÙ ÎÅÐÒÉÑÔÎÏ ËÁÖÄÙÊ ÒÁÚ ×ÏÚ×ÒÁÝÁÔØÓÑ ÎÁÚÁÄ Ó ÐÏÍÏÝØÀ C-x C-f É ÐÏÔÏÍ -ÉÓÐÏÌØÚÏ×ÁÔØ C-x C-s. ðÏÜÔÏÍÕ ÓÕÝÅÓÔ×ÕÅÔ ËÏÍÁÎÄÁ +ÉÓÐÏÌØÚÏ×ÁÔØ C-x C-s. ðÏÜÔÏÍÕ ÓÕÝÅÓÔ×ÕÅÔ ËÏÍÁÎÄÁ C-x s óÏÈÒÁÎÉÔØ ÎÅËÏÔÏÒÙÅ ÂÕÆÅÒÁ. (Save some buffers) -C-x s ÓÐÒÁÛÉ×ÁÅÔ ×ÁÓ Ï ËÁÖÄÏÍ ÂÕÆÅÒÅ, ËÏÔÏÒÙÊ ÓÏÄÅÒÖÉÔ ÎÅ ÓÏÈÒÁÎÅÎÎÙÅ -ÉÚÍÅÎÅÎÉÑ. äÌÑ ËÁÖÄÏÇÏ ÔÁËÏÇÏ ÂÕÆÅÒÁ Õ ×ÁÓ ÓÐÒÁÛÉ×ÁÀÔ ÓÏÈÒÁÎÑÔØ ÉÌÉ ÎÅ +C-x s ÓÐÒÁÛÉ×ÁÅÔ ×ÁÓ Ï ËÁÖÄÏÍ ÂÕÆÅÒÅ, ËÏÔÏÒÙÊ ÓÏÄÅÒÖÉÔ ÎÅÓÏÈÒÁÎÅÎÎÙÅ +ÉÚÍÅÎÅÎÉÑ. äÌÑ ËÁÖÄÏÇÏ ÔÁËÏÇÏ ÂÕÆÅÒÁ Õ ×ÁÓ ÓÐÒÁÛÉ×ÁÀÔ: ÓÏÈÒÁÎÑÔØ ÉÌÉ ÎÅ ÓÏÈÒÁÎÑÔØ ÉÚÍÅÎÅÎÉÑ. >> ÷ÓÔÁ×ØÔÅ ÓÔÒÏËÕ ÔÅËÓÔÁ, ÐÏÔÏÍ ÎÁÂÅÒÉÔÅ C-x s. - õ ×ÁÓ ÄÏÌÖÎÙ ÓÐÒÏÓÉÔØ ÓÏÈÒÁÎÑÔØ ÌÉ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ TUTORIAL.ru. - ïÔ×ÅÔØÔÅ ÎÁ ×ÏÐÒÏÓ ÄÁ ÎÁÂÒÁ× "y". + õ ×ÁÓ ÄÏÌÖÎÙ ÓÐÒÏÓÉÔØ, ÓÏÈÒÁÎÑÔØ ÌÉ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ TUTORIAL.ru. + ïÔ×ÅÔØÔÅ ÎÁ ×ÏÐÒÏÓ ÄÁ, ÎÁÂÒÁ× "y". * òáóûéòåîîùê îáâïò ëïíáîä @@ -624,28 +623,28 @@ C-x s ÓÐÒÁÛÉ×ÁÅÔ ×ÁÓ Ï ËÁÖÄÏÍ ÂÕÆÅÒÅ, ËÏÔÏÒÙÊ ÓÏÄÅÒÖÉÔ ÎÅ ÓÏÈÒÁÎÅÎÎÙÅ üÔÏ ËÏÍÁÎÄÙ, ËÏÔÏÒÙÅ ÏÂÙÞÎÏ ÉÓÐÏÌØÚÕÀÔÓÑ, ÎÏ ×Ù ÕÖÅ ×ÙÕÞÉÌÉ ÎÅËÏÔÏÒÙÅ ÉÚ ÎÉÈ. ÷Ù ÕÖÅ ×ÉÄÅÌÉ: ËÏÍÁÎÄÙ ÒÁÂÏÔÙ Ó ÆÁÊÌÁÍÉ C-x C-f -- ÏÔËÒÙÔØ, É C-x C-s --- ÓÏÈÒÁÎÉÔØ. äÒÕÇÏÊ ÐÒÉÍÅÒ - ÚÁ×ÅÒÛÅÎÉÑ ÒÁÂÏÔÙ Ó Emacs -- ÜÔÏ ËÏÍÁÎÄÁ C-x +-- ÓÏÈÒÁÎÉÔØ. äÒÕÇÏÊ ÐÒÉÍÅÒ - ÚÁ×ÅÒÛÅÎÉÑ ÒÁÂÏÔÙ Ó Emacs -- ÜÔÏ ËÏÍÁÎÄÁ C-x C-c. (îÅ ×ÏÌÎÕÊÔÅÓØ Ï ÔÏÍ, ÞÔÏ ×Ù ÐÏÔÅÒÑÅÔÅ ÓÄÅÌÁÎÎÙÅ ÉÚÍÅÎÅÎÉÑ, C-x C-c -ÐÒÅÄÌÁÇÁÅÔ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ ÐÅÒÅÄ ÔÅÍ ËÁË ÕÄÁÌÉÔ ÂÕÆÅÒ Emacs.) +ÐÒÅÄÌÁÇÁÅÔ ÓÏÈÒÁÎÉÔØ ÉÚÍÅÎÅÎÉÑ ÐÅÒÅÄ ÔÅÍ, ËÁË ÕÄÁÌÉÔ ÂÕÆÅÒ Emacs.) -C-z ÜÔÏ ËÏÍÁÎÄÁ *×ÒÅÍÅÎÎÏÇÏ* ×ÙÈÏÄÁ ÉÚ Emacs -- ×Ù ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÔÕÖÅ -ÓÅÓÓÉÀ Emacs ÐÏÓÌÅ. +C-z ÜÔÏ ËÏÍÁÎÄÁ *×ÒÅÍÅÎÎÏÇÏ* ×ÙÈÏÄÁ ÉÚ Emacs -- ×Ù ÍÏÖÅÔÅ ×ÅÒÎÕÔØÓÑ × ÔÕ ÖÅ +ÓÅÓÓÉÀ Emacs ÐÏÚÖÅ. -îÁ ÓÉÓÔÅÍÁÈ, ËÏÔÏÒÙÅ ÄÏÐÕÓËÁÀÔ ÜÔÏÇÏ, C-z "ÐÒÉÏÓÔÁÎÁ×ÌÉ×ÁÀÔ" ("suspends") -Emacs; ÷ÏÚ×ÒÁÝÁÀÔ × ÏÂÏÌÏÞËÕ (shell), ÎÏ ÎÅ ÚÁËÒÙ×ÁÀÔ Emacs. ÷ ÂÏÌØÛÉÎÓÔ×Å -ÏÂÏÌÏÞÅË ×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÉÔØ ÒÁÂÏÔÕ × Emacs ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ `fg' ÉÌÉ +îÁ ÓÉÓÔÅÍÁÈ, ËÏÔÏÒÙÅ ÄÏÐÕÓËÁÀÔ ÜÔÏ, C-z "ÐÒÉÏÓÔÁÎÁ×ÌÉ×ÁÀÔ" ("suspends") +Emacs; ×ÏÚ×ÒÁÝÁÀÔ × ÏÂÏÌÏÞËÕ (shell), ÎÏ ÎÅ ÚÁËÒÙ×ÁÀÔ Emacs. ÷ ÂÏÌØÛÉÎÓÔ×Å +ÏÂÏÌÏÞÅË ×Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÉÔØ ÒÁÂÏÔÕ × Emacs, ÉÓÐÏÌØÚÕÑ ËÏÍÁÎÄÕ `fg' ÉÌÉ `%emacs'. -÷ ÓÉÓÔÅÍÁÈ ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÝÉÈ ÐÒÉÏÓÔÁÎÏ×ËÕ ÐÒÏÃÅÓÓÏ×, C-z ÓÏÚÄÁÅÔ ÎÏ×ÕÀ +÷ ÓÉÓÔÅÍÁÈ, ÎÅ ÐÏÄÄÅÒÖÉ×ÁÀÝÉÈ ÐÒÉÏÓÔÁÎÏ×ËÕ ÐÒÏÃÅÓÓÏ×, C-z ÓÏÚÄÁÅÔ ÎÏ×ÕÀ ÏÂÏÌÏÞËÕ (subshell), ÚÁÐÕÝÅÎÎÕÀ ÉÚ-ÐÏÄ Emacs, ÞÔÏÂÙ ÄÁÔØ ×ÁÍ ×ÏÚÍÏÖÎÏÓÔØ -×ÙÐÏÌÎÉÔØ ÄÒÕÇÕÀ ÐÒÏÇÒÁÍÍÕ, É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ × Emacs; üÔÏ ÎÅ ÎÁÓÔÏÑÝÉÊ +×ÙÐÏÌÎÉÔØ ÄÒÕÇÕÀ ÐÒÏÇÒÁÍÍÕ, É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ × Emacs; ÜÔÏ ÎÅ ÎÁÓÔÏÑÝÉÊ ×ÙÈÏÄ ÉÚ Emacs. ÷ ÜÔÏÍ ÓÌÕÞÁÅ, ËÏÍÁÎÄÁ `exit' ×ÅÒÎÅÔ ×ÁÓ × Emacs ÉÚ ÏÂÏÌÏÞËÉ. -éÓÐÏÌØÚÕÊÔÅ C-x C-c ÅÓÌÉ ×Ù ÈÏÔÉÔÅ ×ÙÊÔÉ (log out) ÉÚ ÓÉÓÔÅÍÙ. üÔÏ ÔÁËÖÅ -ÉÓÐÏÌØÚÕÅÔÓÑ ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ Emacs ×ÙÚ×ÁÎÎÏÇÏ ÉÚ ÐÏÞÔÏ×ÏÊ ÐÒÏÇÒÁÍÍÙ, ÉÌÉ ÄÒÕÇÏÊ -ÕÔÉÌÉÔÙ, ËÏÔÏÒÁÑ ÍÏÖÅÔ ÎÅ ÚÎÁÅÔ ËÁË ÓÐÒÁ×ÉÔØÓÑ Ó ÐÒÉÏÓÔÁÎÏ×ÌÅÎÎÙÍ Emacs. -ïÂÙÞÎÏ, ÅÓÌÉ ×Ù ÎÅ ×ÙÈÏÄÉÔÅ ÉÚ ÓÉÓÔÅÍÙ, ÌÕÞÛÅ ÐÒÉÏÓÔÁÎÏ×ÉÔØ Emacs +éÓÐÏÌØÚÕÊÔÅ C-x C-c, ÅÓÌÉ ×Ù ÈÏÔÉÔÅ ×ÙÊÔÉ (log out) ÉÚ ÓÉÓÔÅÍÙ. üÔÏ ÔÁËÖÅ +ÉÓÐÏÌØÚÕÅÔÓÑ, ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ Emacs, ×ÙÚ×ÁÎÎÏÇÏ ÉÚ ÐÏÞÔÏ×ÏÊ ÐÒÏÇÒÁÍÍÙ, ÉÌÉ ÄÒÕÇÏÊ +ÕÔÉÌÉÔÙ, ËÏÔÏÒÁÑ ÍÏÖÅÔ ÎÅ ÚÎÁÔØ, ËÁË ÓÐÒÁ×ÉÔØÓÑ Ó ÐÒÉÏÓÔÁÎÏ×ÌÅÎÎÙÍ Emacs. +ïÂÙÞÎÏ, ÅÓÌÉ ×Ù ÎÅ ×ÙÈÏÄÉÔÅ ÉÚ ÓÉÓÔÅÍÙ, ÌÕÞÛÅ ÐÒÉÏÓÔÁÎÏ×ÉÔØ Emacs, ÉÓÐÏÌØÚÕÑ C-z ×ÍÅÓÔÏ ×ÙÈÏÄÁ ÉÈ ÎÅÇÏ. óÕÝÅÓÔ×ÕÅÔ ÏÞÅÎØ ÍÎÏÇÏ C-x ËÏÍÁÎÄ. üÔÉ ×Ù ÕÖÅ ×ÙÕÞÉÌÉ: @@ -661,18 +660,18 @@ Emacs; ÷ÏÚ×ÒÁÝÁÀÔ × ÏÂÏÌÏÞËÕ (shell), ÎÏ ÎÅ ÚÁËÒÙ×ÁÀÔ Emacs. ÷ ÂÏÌØÛÉÎÓÔ×Å ÔÏÌØËÏ × ÏÐÒÅÄÅÌÅÎÎÙÈ ÒÅÖÉÍÁÈ. ÷ ËÁÞÅÓÔ×Å ÐÒÉÍÅÒÁ ËÏÍÁÎÄÁ ÚÁÍÅÎÁ ÓÔÒÏËÉ, ËÏÔÏÒÁÑ ÚÁÍÅÎÑÅÔ ÏÄÎÕ ÓÔÒÏËÕ ÎÁ ÄÒÕÇÕÀ ×Ï ×ÓÅÍ ÔÅËÓÔÅ. ëÏÇÄÁ ×Ù ÎÁÂÅÒÅÔÅ M-x, Emacs ÐÒÅÄÌÏÖÉÔ ×ÁÍ ××ÅÓÔÉ ÉÍÑ ËÏÍÁÎÄÙ × ÎÉÖÎÅÊ ÓÔÒÏËÅ ÜËÒÁÎÁ; × ÎÁÛÅÍ -ÓÌÕÞÁÅ, "replace-string". ôÏÌØËÏ ÎÁÂÅÒÉÔÅ "repl s<TAB>" É Emacs ÄÏÐÏÌÎÉÔ +ÓÌÕÞÁÅ, "replace-string". ôÏÌØËÏ ÎÁÂÅÒÉÔÅ "repl s<TAB>", É Emacs ÄÏÐÏÌÎÉÔ ÉÍÑ. (<TAB> -- ÜÔÏ ËÌÁ×ÉÛÁ ÔÁÂÕÌÑÃÉÉ, ÏÂÙÞÎÏ ÎÁÈÏÄÑÝÁÑÓÑ ×ÙÛÅ ËÌÁ×ÉÛ CapsLock ÉÌÉ Shift ÓÌÅ×Á ÎÁ ËÌÁ×ÉÁÔÕÒÅ). úÁ×ÅÒÛÉÔÅ ÉÍÑ ××ÏÄÏÍ <Return>. -ëÏÍÁÎÄÁ ÚÁÍÅÎÙ ÓÔÒÏËÉ (replace-string) ÔÒÅÂÕÅÔ Ä×Á ÁÒÇÕÍÅÎÔÁ -- ÓÔÒÏËÕ -ËÏÔÏÒÁÑ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ, É ÓÔÒÏËÁ ÎÁ ËÏÔÏÒÕÀ ÎÕÖÎÏ ÚÁÍÅÎÉÔØ. ÷Ù ÄÏÌÖÎÙ +ëÏÍÁÎÄÁ ÚÁÍÅÎÙ ÓÔÒÏËÉ (replace-string) ÔÒÅÂÕÅÔ Ä×Á ÁÒÇÕÍÅÎÔÁ -- ÓÔÒÏËÕ, +ËÏÔÏÒÁÑ ÂÕÄÅÔ ÚÁÍÅÎÅÎÁ, É ÓÔÒÏËÕ, ÎÁ ËÏÔÏÒÕÀ ÎÕÖÎÏ ÚÁÍÅÎÉÔØ. ÷Ù ÄÏÌÖÎÙ ÚÁ×ÅÒÛÁÔØ ËÁÖÄÙÊ ÁÒÇÕÍÅÎÔ ××ÏÄÏÍ <Return>. >> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ Ä×Å ÐÕÓÔÙÅ ÓÔÒÏËÉ ÎÉÖÅ ÜÔÏÊ. îÁÂÅÒÉÔÅ M-x repl s<Return>changed<Return>altered<Return>. - úÁÍÅÔØÔÅ ËÁË ÜÔÁ ÓÔÒÏËÁ ÉÚÍÅÎÉÔÓÑ: ×Ù ÚÁÍÅÎÉÔÅ ÓÌÏ×Ï c-h-a-n-g-e-d + úÁÍÅÔØÔÅ, ËÁË ÜÔÁ ÓÔÒÏËÁ ÉÚÍÅÎÉÔÓÑ: ×Ù ÚÁÍÅÎÉÔÅ ÓÌÏ×Ï c-h-a-n-g-e-d ÓÌÏ×ÏÍ "altered" ×ÅÚÄÅ, ÇÄÅ ÏÎÏ ×ÓÔÒÅÔÉÔÓÑ, ÎÉÖÅ ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ. @@ -680,40 +679,40 @@ CapsLock ÉÌÉ Shift ÓÌÅ×Á ÎÁ ËÌÁ×ÉÁÔÕÒÅ). úÁ×ÅÒÛÉÔÅ ÉÍÑ ××ÏÄÏÍ <Return>. ---------------- ëÏÇÄÁ ×Ù ÉÚÍÅÎÑÅÔÅ ÆÁÊÌ, ÎÏ ÎÅ ÓÏÈÒÁÎÑÅÔÅ ÅÇÏ, ÔÏ × ÓÌÕÞÁÅ ËÒÁÈÁ ÓÉÓÔÅÍÙ -×Ù ÍÏÖÅÔÅ ÐÏÔÅÒÑÔØ ÉÎÆÏÒÍÁÃÉÀ. ÞÔÏÂÙ ÚÁÝÉÔÉÔØ ×ÁÓ ÏÔ ÜÔÏÇÏ, Emacs +×Ù ÍÏÖÅÔÅ ÐÏÔÅÒÑÔØ ÉÎÆÏÒÍÁÃÉÀ. þÔÏÂÙ ÚÁÝÉÔÉÔØ ×ÁÓ ÏÔ ÜÔÏÇÏ, Emacs ÐÅÒÉÏÄÉÞÅÓËÉ ÓÏÈÒÁÎÑÅÔ ËÁÖÄÙÊ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ. á×ÔÏÓÏÈÒÁÎÅÎÉÅ ÐÒÏÉÓÈÏÄÉÔ × ÆÁÊÌ, ÉÍÑ ËÏÔÏÒÏÇÏ ÔÁËÏÅ ÖÅ, ÎÏ ÎÁÞÉÎÁÅÔÓÑ É ÚÁËÁÎÞÉ×ÁÅÔÓÑ ÓÉÍ×ÏÌÏÍ "#"; ÎÁÐÒÉÍÅÒ, ÅÓÌÉ ×ÁÛ ÆÁÊÌ ÎÁÚÙ×ÁÅÔÓÑ "hello.c", ÔÏ Á×ÔÏÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ ÂÕÄÅÔ ÎÁÚÙ×ÁÔØÓÑ "#hello.c#". ëÏÇÄÁ ×Ù ÓÏÈÒÁÎÉÔÅ ÆÁÊÌ -ÏÂÙÞÎÙÍ ÓÐÏÓÏÂÏÍ. Emacs ÕÄÁÌÉÔ Á×ÔÏÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ. +ÏÂÙÞÎÙÍ ÓÐÏÓÏÂÏÍ, Emacs ÕÄÁÌÉÔ Á×ÔÏÓÏÈÒÁÎÅÎÎÙÊ ÆÁÊÌ. -åÓÌÉ ÓÉÓÔÅÍÁ ÐÏÄ×ÉÓÁÅÔ, ×Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ ËÏÔÏÒÙÊ ÂÙÌÉ -ÓÏÈÒÁÎÅÎÙ Á×ÔÏÍÁÔÉÞÅÓËÉ, ÐÕÔÅÍ ÏÔËÒÙÔÉÑ ÎÏÒÍÁÌØÎÏÇÏ ÆÁÊÌÁ (ÆÁÊÌÁ ËÏÔÏÒÙÊ ×Ù -ÒÅÄÁËÔÉÒÏ×ÁÌÉ, ÎÅ Á×ÔÏÓÏÈÒÁÎÅÎÎÏÇÏ) É ÚÁÔÅÍ ÎÁÂÒÁ× M-x recover-file<return>. -ëÏÇÄÁ Õ ×ÁÓ ÓÐÒÏÓÑÔ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ, ÎÁÂÅÒÉÔÅ yes<return> ÞÔÏÂÙ ×ÏÓÓÔÁÎÏ×ÉÔØ +åÓÌÉ ÓÉÓÔÅÍÁ ÚÁ×ÉÓÌÁ, ×Ù ÍÏÖÅÔÅ ×ÏÓÓÔÁÎÏ×ÉÔØ ×ÁÛÉ ÉÚÍÅÎÅÎÉÑ, ËÏÔÏÒÙÊ ÂÙÌÉ +ÓÏÈÒÁÎÅÎÙ Á×ÔÏÍÁÔÉÞÅÓËÉ, ÐÕÔÅÍ ÏÔËÒÙÔÉÑ ÎÏÒÍÁÌØÎÏÇÏ ÆÁÊÌÁ (ÆÁÊÌÁ, ËÏÔÏÒÙÊ ×Ù +ÒÅÄÁËÔÉÒÏ×ÁÌÉ, ÎÅ Á×ÔÏÓÏÈÒÁÎÅÎÎÏÇÏ), É ÚÁÔÅÍ ÎÁÂÒÁ× M-x recover-file<return>. +ëÏÇÄÁ Õ ×ÁÓ ÓÐÒÏÓÑÔ ÐÏÄÔ×ÅÒÖÄÅÎÉÅ, ÎÁÂÅÒÉÔÅ yes<return>, ÞÔÏÂÙ ×ÏÓÓÔÁÎÏ×ÉÔØ Á×ÔÏÓÏÈÒÁÎÅÎÎÙÅ ÄÁÎÎÙÅ. * ïâìáóôø üèï (ECHO AREA) ------------------------- -åÓÌÉ Emacs ×ÉÄÉÔ ÞÔÏ ×Ù ÍÅÄÌÅÎÎÏ ÎÁÂÉÒÁÅÔÅ ËÏÍÁÎÄÙ, ÏÎ ÐÏËÁÚÙ×ÁÅÔ ÉÈ ×ÁÍ +åÓÌÉ Emacs ×ÉÄÉÔ, ÞÔÏ ×Ù ÍÅÄÌÅÎÎÏ ÎÁÂÉÒÁÅÔÅ ËÏÍÁÎÄÙ, ÏÎ ÐÏËÁÚÙ×ÁÅÔ ÉÈ ×ÁÍ ×ÎÉÚÕ ÜËÒÁÎÁ, × ÏÂÌÁÓÔÉ ÎÁÚÙ×ÁÅÍÏÊ "ÏÂÌÁÓÔØ ÜÈÏ". ïÂÌÁÓÔØ ÜÈÏ -- ÜÔÏ ÓÁÍÁÑ ÎÉÖÎÑÑ ÓÔÒÏËÁ ÜËÒÁÎÁ. * óôòïëá òåöéíá ------------------- +--------------- óÔÒÏËÁ ÓÒÁÚÕ ÎÁÄ ÏÂÌÁÓÔØÀ ÜÈÏ ÎÁÚÙ×ÁÅÔÓÑ "ÓÔÒÏËÁ ÓÏÓÔÏÑÎÉÑ". ÷ÙÇÌÑÄÉÔ ÜÔÁ ÓÔÒÏËÁ ÐÒÉÍÅÒÎÏ ÔÁË: ---:** TUTORIAL (Fundamental)--L670--58%---------------- +--:** TUTORIAL.ru (Fundamental)--L670--58%---------------- üÔÁ ÓÔÒÏËÁ ÓÏÏÂÝÁÅÔ ÐÏÌÅÚÎÕÀ ÉÎÆÏÒÍÁÃÉÀ Ï ÓÏÓÔÏÑÎÉÉ Emacs É ÔÅËÓÔÁ, ËÏÔÏÒÙÊ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ. -÷Ù ÕÖÅ ÚÎÁÅÔÅ ÞÔÏ ÏÚÎÁÞÁÅÔ ÉÍÑ ÆÁÊÌÁ -- ÜÔÏ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÏÔËÒÙÌÉ. -NN%-- +÷Ù ÕÖÅ ÚÎÁÅÔÅ, ÞÔÏ ÏÚÎÁÞÁÅÔ ÉÍÑ ÆÁÊÌÁ -- ÜÔÏ ÆÁÊÌ, ËÏÔÏÒÙÊ ×Ù ÏÔËÒÙÌÉ. -NN%-- ÐÏËÁÚÙ×ÁÅÔ ÔÅËÕÝÕÀ ÐÏÚÉÃÉÀ ËÕÒÓÏÒÁ × ÔÅËÓÔÅ; ÜÔÏ ÏÚÎÁÞÁÅÔ ÞÔÏ NN ÐÒÏÃÅÎÔÏ× ÔÅËÓÔÁ ×ÙÛÅ, ÞÅÍ ÎÁÞÁÌÏ ÜËÒÁÎÁ. åÓÌÉ ÐÅÒ×ÁÑ ÓÔÒÏËÁ ÎÁÈÏÄÉÔÓÑ × ÐÅÒ×ÏÊ ÓÔÒÏËÅ ÜËÒÁÎÁ, ×Ù ÔÁÍ Õ×ÉÄÉÔÅ --Top-- ×ÍÅÓÔÏ --00%--. åÓÌÉ ÎÁ ÜËÒÁÎÅ ÏÔÏÂÒÁÖÁÅÔÓÑ @@ -744,13 +743,13 @@ Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ× ÏÚÎÁÞÁÀÔ, ÅÇÏ. îÁÐÒÉÍÅÒ, M-x fundamental-mode - ËÏÍÁÎÄÁ, ËÏÔÏÒÁÑ ÐÅÒÅËÌÀÞÁÅÔ × ÂÁÚÏ×ÙÊ (Fundamental) ÒÅÖÉÍ. -åÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÁÎÇÌÉÊÓËÉÊ ÔÅËÓÔ, ÎÁÐÒÉÍÅÒ ËÁË ÜÔÏÔ (//ËÏÎÅÞÎÏ ÎÅ ÉÍÅÎÎÏ +åÓÌÉ ×Ù ÒÅÄÁËÔÉÒÕÅÔÅ ÒÕÓÓËÉÊ ÔÅËÓÔ, ÎÁÐÒÉÍÅÒ ËÁË ÜÔÏÔ (ËÏÎÅÞÎÏ, ÎÅ ÉÍÅÎÎÏ ÜÔÏÔ, Á TUTORIAL) ÆÁÊÌ, ×Ù ×ÅÒÏÑÔÎÏ ÄÏÌÖÎÙ ÐÅÒÅËÌÀÞÉÔØÓÑ × Text-ÒÅÖÉÍ. >> îÁÂÅÒÉÔÅ M-x text mode<Return>. îÅ ×ÏÌÎÕÊÔÅÓØ, ÎÉ ÏÄÎÁ ÉÚ ×ÙÕÞÅÎÎÙÈ ×ÁÍÉ ËÏÍÁÎÄ Emacs ÎÅ ÉÚÍÅÎÉÌÁÓØ. îÏ ×Ù -ÍÏÖÉÔÅ ÚÁÍÅÔÉÔØ, ÞÔÏ M-f É M-b ÔÅÐÅÒØ ÒÁÚÌÉÞÁÔØ ÁÐÏÓÔÒÏÆÙ ËÁË ÞÁÓÔÉ ÓÌÏ×Á. +ÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ, ÞÔÏ M-f É M-b ÔÅÐÅÒØ ÒÁÚÌÉÞÁÀÔ ÁÐÏÓÔÒÏÆÙ ËÁË ÞÁÓÔÉ ÓÌÏ×Á. òÁÎÅÅ, × ÂÁÚÏ×ÏÍ ÒÅÖÉÍÅ (Fundamental mode), M-f É M-b ÐÏÎÉÍÁÌÉ ÁÐÏÓÔÒÏÆÙ ËÁË ÒÁÚÄÅÌÉÔÅÌÉ ÓÌÏ×. @@ -762,8 +761,8 @@ Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ× ÏÚÎÁÞÁÀÔ, >> éÓÐÏÌØÚÕÊÔÅ C-u C-v ÏÄÉÎ ÒÁÚ ÉÌÉ ÂÏÌÅÅ, ÞÔÏÂÙ ÒÁÓÐÏÌÏÖÉÔØ ÜÔÕ ÓÔÒÏËÕ ÂÌÉÖÅ Ë ×ÅÒÈÕ ÜËÒÁÎÁ. ->> îÁÂÅÒÉÔÅ C-h m, ÞÔÏ ÐÏÓÍÏÔÒÅÔØ ÏÔÌÉÞÉÑ Text-ÒÅÖÉÍÁ ÏÔ ÂÁÚÏ×ÏÇÏ. ->> îÁÂÅÒÉÔÅ C-x 1 ÞÔÏÂÙ ÕÂÒÁÔØ ÄÏËÕÍÅÎÔÁÃÉÀ Ó ÇÌÁÚ ÄÏÌÏÊ :) +>> îÁÂÅÒÉÔÅ C-h m, ÞÔÏÂÙ ÐÏÓÍÏÔÒÅÔØ ÏÔÌÉÞÉÑ Text-ÒÅÖÉÍÁ ÏÔ ÂÁÚÏ×ÏÇÏ. +>> îÁÂÅÒÉÔÅ C-x 1, ÞÔÏÂÙ ÕÂÒÁÔØ ÄÏËÕÍÅÎÔÁÃÉÀ Ó ÇÌÁÚ ÄÏÌÏÊ :) ïÓÎÏ×ÎÏÊ ÒÅÖÉÍ ÎÁÚÙ×ÁÅÔÓÑ ÏÓÎÏ×ÎÙÍ ÐÏÔÏÍÕ, ÞÔÏ ÅÓÔØ ÎÅÓËÏÌØËÏ ÄÏÐÏÌÎÉÔÅÌØÎÙÈ (minor) ÒÅÖÉÍÏ×. äÏÐÏÌÎÉÔÅÌØÎÙÅ ÒÅÖÉÍÙ ÎÅ Ñ×ÌÑÀÔÓÑ ÁÌØÔÅÒÎÁÔÉ×ÁÍÉ ÏÓÎÏ×ÎÙÍ, @@ -777,13 +776,13 @@ Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ× ÏÚÎÁÞÁÀÔ, ×ËÌÀÞÅÎ, Emacs ÒÁÚÒÙ×ÁÅÔ ÓÔÒÏËÉ ÍÅÖÄÕ ÓÌÏ×ÁÍÉ Á×ÔÏÍÁÔÉÞÅÓËÉ, ËÏÇÄÁ ×Ù ×ÓÔÁ×ÌÑÅÔÅ ÔÅËÓÔ É ÄÅÌÁÅÔÅ ÓÔÒÏËÉ ÓÌÉÛËÏÍ ÄÌÉÎÎÙÍÉ. -÷Ù ÍÏÖÅÔÅ ×ËÌÀÞÉÔØ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ ÎÁÂÒÁ× M-x auto fill mode<Return>. +÷Ù ÍÏÖÅÔÅ ×ËÌÀÞÉÔØ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ, ÎÁÂÒÁ× M-x auto fill mode<Return>. ëÏÇÄÁ ÜÔÏÔ ÒÅÖÉÍ ×ËÌÀÞÅÎ, ÅÇÏ ÍÏÖÎÏ ×ÙËÌÀÞÉÔØ - M-x auto fill mode<Return>. åÓÌÉ ÒÅÖÉÍ ×ËÌÀÞÅÎ -- ËÏÍÁÎÄÁ ÅÇÏ ×ÙËÌÀÞÉÔ, ÅÓÌÉ ×ÙËÌÀÞÅÎ -- ×ËÌÀÞÉÔ. íÙ ÎÁÚÙ×ÁÅÍ ÜÔÏ ËÏÍÁÎÄÏÊ "ÐÅÒÅËÌÀÞÅÎÉÑ ÒÅÖÉÍÁ". >> îÁÂÅÒÉÔÅ M-x auto fill mode<Return>. úÁÔÅÍ ××ÏÄÉÔÅ ÓÔÒÏËÕ ÉÚ ÓÌÏ× - "ÆÙ×Á " ÐÏËÁ ÎÅ Õ×ÉÄÉÔÅ ËÁË ÏÎÁ ÒÁÚÄÅÌÉÔÓÑ ÎÁ Ä×Å ÓÔÒÏËÉ. ÷Ù ÄÏÌÖÎÙ + "ÆÙ×Á " ÐÏËÁ ÎÅ Õ×ÉÄÉÔÅ, ËÁË ÏÎÁ ÒÁÚÄÅÌÉÔÓÑ ÎÁ Ä×Å ÓÔÒÏËÉ. ÷Ù ÄÏÌÖÎÙ ÐÏÍÅÝÁÔØ ÐÒÏÂÅÌÙ ÍÅÖÄÕ ÓÌÏ×ÁÍÉ, ÐÏÔÏÍÕ ÞÔÏ ÒÅÖÉÍ Á×ÔÏÚÁÐÏÌÎÅÎÉÑ ÒÁÚÄÅÌÑÅÔ ÓÔÒÏËÉ ÔÏÌØËÏ ÐÏ ÐÒÏÂÅÌÁÍ. @@ -806,22 +805,22 @@ Emacs ÉÍÅÅÔ ÍÎÏÇÏ ÒÁÚÌÉÞÎÙÈ ÏÓÎÏ×ÎÙÈ ÒÅÖÉÍÏ×. îÅËÏÔÏÒÙÅ ÉÚ ÒÅÖÉÍÏ× ÏÚÎÁÞÁÀÔ, * ðïéóë ------- -Emacs ÕÍÅÅÔ ÉÓËÁÔØ ÓÔÒÏËÉ (ÜÔÏ ÎÅÐÒÅÒÙ×ÎÙÅ ÇÒÕÐÐÙ ÓÉÍ×ÏÌÏ× ÉÌÉ ÓÌÏ×Á) ×ÐÅÒÅÄ -ÐÏ ÔÅËÓÔÕ, ÉÌÉ ÎÁÚÁÄ. ðÏÉÓË ÓÔÒÏËÉ ÜÔÏ ËÏÍÁÎÄÁ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ; ÏÎÁ +Emacs ÕÍÅÅÔ ÉÓËÁÔØ ÓÔÒÏËÉ (ÎÅÐÒÅÒÙ×ÎÙÅ ÇÒÕÐÐÙ ÓÉÍ×ÏÌÏ× ÉÌÉ ÓÌÏ×Á) ×ÐÅÒÅÄ +ÐÏ ÔÅËÓÔÕ, ÉÌÉ ÎÁÚÁÄ. ðÏÉÓË ÓÔÒÏËÉ - ÜÔÏ ËÏÍÁÎÄÁ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ; ÏÎÁ ÐÅÒÅÍÅÝÁÅÔ ËÕÒÓÏÒ × ÓÌÅÄÕÀÝÕÀ ÔÏÞËÕ, ÇÄÅ ÎÁÊÄÅÎÁ ÉÓËÏÍÁÑ ÓÔÒÏËÁ. ëÏÍÁÎÄÁ ÐÏÉÓËÁ Emacs ÏÔÌÉÞÁÀÔÓÑ ÏÔ ÁÎÁÌÏÇÉÞÎÙÈ ËÏÍÁÎÄ ÂÏÌØÛÉÎÓÔ×Á ÄÒÕÇÉÈ -ÒÅÄÁËÔÏÒÏ× ÔÅÍ, ÞÔÏ ÏÎÁ ÉÎËÒÅÍÅÎÔÁÌØÎÁÑ. üÔÏ ÏÚÎÁÞÁÅÔ ÞÔÏ ÐÏÉÓË ÐÒÏÉÓÈÏÄÉÔ ÐÏ -ÍÅÒÅ ÔÏÇÏ ËÁË ×Ù ÎÁÂÉÒÁÅÔÅ ÉÓËÏÍÕÀ ÓÔÒÏËÕ. +ÒÅÄÁËÔÏÒÏ× ÔÅÍ, ÞÔÏ ÏÎÁ ÉÎËÒÅÍÅÎÔÁÌØÎÁÑ. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÐÏÉÓË ÐÒÏÉÓÈÏÄÉÔ +ÐÏ ÍÅÒÅ, ÔÏÇÏ ËÁË ×Ù ÎÁÂÉÒÁÅÔÅ ÉÓËÏÍÕÀ ÓÔÒÏËÕ. ëÏÍÁÎÄÁ, ÎÁÞÉÎÁÀÝÁÑ ÐÏÉÓË ×ÐÅÒÅÄ -- C-s, Á C-r ÉÝÅÔ ÎÁÚÁÄ. ðïäïöäéôå! îÅ ÎÕÖÎÏ ÐÒÏÂÏ×ÁÔØ ÐÒÑÍÏ ÓÅÊÞÁÓ. -ëÏÇÄÁ ×Ù ÎÁÖÍÅÔÅ C-s ×Ù Õ×ÉÄÉÔÅ ÓÔÒÏËÕ "I-search", ÐÏÑ×É×ÛÕÀÓÑ × ÏÂÌÁÓÔÉ ÜÈÏ. -÷ÁÍ ÓÏÏÂÝÁÅÔÓÑ ÞÔÏ Emacs ÖÄÅÔ ××ÏÄÁ ÓÌÏ×Á, ËÏÔÏÒÏÅ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ. +ëÏÇÄÁ ×Ù ÎÁÖÍÅÔÅ C-s, ×Ù Õ×ÉÄÉÔÅ ÓÔÒÏËÕ "I-search", ÐÏÑ×É×ÛÕÀÓÑ × ÏÂÌÁÓÔÉ ÜÈÏ. +÷ÁÍ ÓÏÏÂÝÁÅÔÓÑ, ÞÔÏ Emacs ÖÄÅÔ ××ÏÄÁ ÓÌÏ×Á, ËÏÔÏÒÏÅ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ. <Return> ÚÁ×ÅÒÛÁÅÔ ÐÏÉÓË. ->> ôÅÐÅÒØ, ÎÁÖÍÉÔÅ C-s ÄÌÑ ÎÁÞÁÌÁ ÐÏÉÓËÁ. íÅÄÌÅÎÎÏ, ÏÄÎÕ ÂÕË×Õ ÚÁ ÏÄÉÎ ÒÁÚ, +>> ôÅÐÅÒØ ÎÁÖÍÉÔÅ C-s ÄÌÑ ÎÁÞÁÌÁ ÐÏÉÓËÁ. íÅÄÌÅÎÎÏ, ÏÄÎÕ ÂÕË×Õ ÚÁ ÏÄÉÎ ÒÁÚ, ÎÁÂÉÒÁÊÔÅ ÓÌÏ×Ï 'ËÕÒÓÏÒ', ÏÓÔÁÎÁ×ÌÉ×ÁÑÓØ ÐÏÓÌÅ ËÁÖÄÏÊ ××ÅÄÅÎÎÏÊ ÂÕË×Ù É ÚÁÍÅÞÁÑ ÞÔÏ ÐÒÏÉÓÈÏÄÉÔ Ó ËÕÒÓÏÒÏÍ. óÅÊÞÁÓ ×Ù ÎÁÛÌÉ ÐÅÒ×ÏÅ ×ÈÏÖÄÅÎÉÅ ÓÌÏ×Á "ËÕÒÓÏÒ". @@ -829,38 +828,38 @@ Emacs ÕÍÅÅÔ ÉÓËÁÔØ ÓÔÒÏËÉ (ÜÔÏ ÎÅÐÒÅÒÙ×ÎÙÅ ÇÒÕÐÐÙ ÓÉÍ×ÏÌÏ× ÉÌÉ ÓÌÏ×Á) ×ÐÅÒÅÄ >> ôÅÐÅÒØ ÎÁÖÍÉÔÅ <Delete> ÞÅÔÙÒÅ ÒÁÚÁ É ÐÒÏÓÌÅÄÉÔÅ ÚÁ ÐÅÒÅÍÅÝÅÎÉÑÍÉ ËÕÒÓÏÒÁ. >> îÁÖÍÉÔÅ <Return> ÄÌÑ ÚÁ×ÅÒÛÅÎÉÑ ÐÏÉÓËÁ. -÷Ù ×ÉÄÅÌÉ ÞÔÏ ÐÒÏÉÓÈÏÄÉÌÏ? Emacs, × ÒÅÖÉÍÅ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ, ÐÙÔÁÌÓÑ -ÐÅÒÅÈÏÄÉÔØ Ë ÓÔÒÏËÁÍ ÓÏ×ÐÁÄÁÀÝÉÍ Ó ÎÁÂÉÒÁÅÍÏÊ ×ÁÍÉ, ÐÏÄÓ×ÅÞÉ×ÁÑ ÉÈ ÄÌÑ ×ÁÓ. +÷Ù ×ÉÄÅÌÉ, ÞÔÏ ÐÒÏÉÓÈÏÄÉÌÏ? Emacs × ÒÅÖÉÍÅ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÐÙÔÁÌÓÑ +ÐÅÒÅÈÏÄÉÔØ Ë ÓÔÒÏËÁÍ, ÓÏ×ÐÁÄÁÀÝÉÍ Ó ÎÁÂÉÒÁÅÍÏÊ ×ÁÍÉ, ÐÏÄÓ×ÅÞÉ×ÁÑ ÉÈ ÄÌÑ ×ÁÓ. þÔÏÂÙ ÐÅÒÅÊÔÉ Ë ÓÌÅÄÕÀÝÅÍÕ ×ÈÏÖÄÅÎÉÑ ÓÌÏ×Á 'ËÕÒÓÏÒ' ÐÒÏÓÔÏ ÎÁÖÍÉÔÅ C-s -ÓÎÏ×Á. åÓÌÉ ÂÏÌØÛÅ ÎÅÔ ×ÈÏÖÄÅÎÉÊ, Emacs ÉÚÄÁÓÔ Ú×ÕËÏ×ÏÊ ÓÉÇÎÁÌ, É ÓÏÏÂÝÉÔ -ÞÔÏ ×ÁÛ ÐÏÉÓË ÎÅ ÕÄÁÌÓÑ ("failing"), C-g ÔÁËÖÅ ÄÏÌÖÅÎ ÏÔÍÅÎÉÔØ ÐÏÉÓË. +ÓÎÏ×Á. åÓÌÉ ÂÏÌØÛÅ ÎÅÔ ×ÈÏÖÄÅÎÉÊ, Emacs ÉÚÄÁÓÔ Ú×ÕËÏ×ÏÊ ÓÉÇÎÁÌ, É ÓÏÏÂÝÉÔ, +ÞÔÏ ×ÁÛ ÐÏÉÓË ÎÅ ÕÄÁÌÓÑ ("failing"), C-g ÔÁËÖÅ ÍÏÖÅÔ ÏÔÍÅÎÉÔØ ÐÏÉÓË. -úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ, ××ÏÄ C-s ÚÁÍÏÒÏÚÉÔ ÜËÒÁÎ É ×Ù ÎÅ Õ×ÉÄÉÔÅ -ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. üÔÏ ÏÚÎÁÞÁÅÔ ÞÔÏ ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ ÉÍÅÅÔ -"ÏÓÏÂÅÎÎÏÓÔØ" ÉÍÅÎÕÅÍÕÀ "flow control" ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ C-s É ÎÅ ÐÒÏÐÕÓËÁÀÝÕÀ -ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ ÒÁÚÍÏÒÏÚËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. óÍÏÔÒÉÔÅ ÒÁÚÄÅÌ -"Spontaneous Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs ÞÔÏÂÙ ÕÚÎÁÔØ ËÁË -ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ". +úáíåþáîéå: îÁ ÎÅËÏÔÏÒÙÈ ÓÉÓÔÅÍÁÈ ××ÏÄ C-s ÚÁÍÏÒÏÚÉÔ ÜËÒÁÎ, É ×Ù ÎÅ Õ×ÉÄÉÔÅ +ÐÏÓÌÅÄÕÀÝÅÇÏ ×Ù×ÏÄÁ Emacs`Á. üÔÏ ÏÚÎÁÞÁÅÔ, ÞÔÏ ÏÐÅÒÁÃÉÏÎÎÁÑ ÓÉÓÔÅÍÁ ÉÍÅÅÔ +"ÏÓÏÂÅÎÎÏÓÔØ", ÉÍÅÎÕÅÍÕÀ "flow control", ÐÅÒÅÈ×ÁÔÙ×ÁÀÝÕÀ C-s É ÎÅ ÐÒÏÐÕÓËÁÀÝÕÀ +ÜÔÏÔ ÓÉÍ×ÏÌ Ë Emacs`Õ. äÌÑ ÒÁÚÍÏÒÏÚËÉ ÜËÒÁÎÁ, ÎÁÖÍÉÔÅ C-q. óÍÏÔÒÉÔÅ ÒÁÚÄÅÌ +"Spontaneous Entry to Incremental Search" ÒÕËÏ×ÏÄÓÔ×Á Emacs, ÞÔÏÂÙ ÕÚÎÁÔØ, +ËÁË ÂÏÒÏÔØÓÑ Ó ÜÔÏÊ "ÏÓÏÂÅÎÎÏÓÔØÀ". -åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÎÁÖÍÅÔÅ <Delete>, ×Ù ÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ +åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÉÎËÒÅÍÅÎÔÁÌØÎÏÇÏ ÐÏÉÓËÁ ÎÁÖÍÅÔÅ <Delete>, ×Ù ÍÏÖÅÔÅ ÚÁÍÅÔÉÔØ, ÞÔÏ ÐÏÓÌÅÄÎÉÊ ÓÉÍ×ÏÌ × ÉÓËÏÍÏÊ ÓÔÒÏËÅ ÕÄÁÌÉÌÓÑ, É ÐÏÉÓË ×ÅÒÎÕÌÓÑ Ë ÐÒÅÄÙÄÕÝÅÍÕ -ÎÁÊÄÅÎÎÏÍÕ ÍÅÓÔÕ. îÁÐÒÉÍÅÒ, ÐÒÅÄÐÏÌÏÖÉÍ, ÞÔÏ ×Ù ÎÁÂÒÁÌÉ "c", ÐÏÉÓË ÐÅÒÅÊÄÅÔ Ë -ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ ÓÉÍ×ÏÌÁ "c". ôÅÐÅÒØ ÅÓÌÉ ×Ù ÎÁÂÅÒÅÔÅ "u", ËÕÒÓÏÒ ÐÅÒÅÊÄÅÔ Ë -ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "cu". îÁÖÁÔÉÅ <Delete> ÕÄÁÌÉÔ ÓÉÍ×ÏÌ "u" ÉÈ ÓÔÒÏËÉ ÐÏÉÓËÁ, É -ËÕÒÓÏÒ ×ÅÒÎÅÔÓÑ Ë ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "c". +ÎÁÊÄÅÎÎÏÍÕ ÍÅÓÔÕ. îÁÐÒÉÍÅÒ, ÐÒÅÄÐÏÌÏÖÉÍ, ÞÔÏ ×Ù ÎÁÂÒÁÌÉ "Ë", ÐÏÉÓË ÐÅÒÅÊÄÅÔ Ë +ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ ÓÉÍ×ÏÌÁ "Ë". ôÅÐÅÒØ, ÅÓÌÉ ×Ù ÎÁÂÅÒÅÔÅ "Õ", ËÕÒÓÏÒ ÐÅÒÅÊÄÅÔ Ë +ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "ËÕ". îÁÖÁÔÉÅ <Delete> ÕÄÁÌÉÔ ÓÉÍ×ÏÌ "Õ" ÉÚ ÓÔÒÏËÉ ÐÏÉÓËÁ, É +ËÕÒÓÏÒ ×ÅÒÎÅÔÓÑ Ë ÐÅÒ×ÏÍÕ ×ÈÏÖÄÅÎÉÀ "Ë". åÓÌÉ ×Ù ×Ï ×ÒÅÍÑ ÐÏÉÓËÁ ××ÅÄÅÔÅ control- ÉÌÉ meta- ÓÉÍ×ÏÌ (ÚÁ ÎÅËÏÔÏÒÙÍÉ ÉÓËÌÀÞÅÎÉÑÍÉ -- ÓÉÍ×ÏÌÙ ×ÙÚÙ×ÁÀÝÉÅ ÐÏÉÓË, Á ÉÍÅÎÎÏ C-s É C-r), ÐÏÉÓË ÐÒÅËÒÁÔÉÔÓÑ. C-s ÎÁÞÉÎÁÅÔ ÐÏÉÓË É ÓÍÏÔÒÉÔ ÎÁ ÌÀÂÙÅ ×ÈÏÖÄÅÎÉÑ ÉÓËÏÍÏÊ ÓÔÒÏËÉ ðïóìå ÔÅËÕÝÅÊ -ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ ÞÔÏ-ÔÏ ÒÁÎÅÅ × ÔÅËÓÔÅ, ÎÁÖÍÉÔÅ C-r. ÷ÓÅ -ÞÔÏ ÍÙ ÇÏ×ÏÒÉÌÉ Ï C-s ÐÒÉÍÅÎÉÍÏ É Ë C-r, ÚÁ ÉÓËÌÀÞÅÎÉÅÍ ÐÒÏÔÉ×ÏÐÏÌÏÖÎÏÇÏ +ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ. åÓÌÉ ×Ù ÈÏÔÉÔÅ ÎÁÊÔÉ ÞÔÏ-ÔÏ ÒÁÎÅÅ × ÔÅËÓÔÅ, ÎÁÖÍÉÔÅ C-r. +÷ÓÅ, ÞÔÏ ÍÙ ÇÏ×ÏÒÉÌÉ Ï C-s, ÐÒÉÍÅÎÉÍÏ É Ë C-r, ÚÁ ÉÓËÌÀÞÅÎÉÅÍ ÐÒÏÔÉ×ÏÐÏÌÏÖÎÏÇÏ ÎÁÐÒÁ×ÌÅÎÉÑ ÐÏÉÓËÁ. * íîïöåóô÷ï ïëïî (MULTIPLE WINDOWS) -------------------------------- +----------------------------------- ïÄÎÁ ÉÚ ÐÒÉÑÔÎÙÈ ÏÓÏÂÅÎÎÏÓÔÅÊ Emacs ÜÔÏ ÔÏ, ÞÔÏ ×Ù ÍÏÖÅÔÅ ÏÄÎÏ×ÒÅÍÅÎÎÏ ÏÔÏÂÒÁÖÁÔØ ÎÁ ÜËÒÁÎÅ ÂÏÌÅÅ ÞÅÍ ÏÄÎÏ ÏËÎÏ. @@ -868,7 +867,7 @@ C-s ÎÁÞÉÎÁÅÔ ÐÏÉÓË É ÓÍÏÔÒÉÔ ÎÁ ÌÀÂÙÅ ×ÈÏÖÄÅÎÉÑ ÉÓËÏÍÏÊ ÓÔÒÏËÉ ðïóìå ÔÅËÕÝÅÊ >> ðÅÒÅÍÅÓÔÉÔÅ ËÕÒÓÏÒ ÎÁ ÜÔÕ ÌÉÎÉÀ, É ÎÁÂÅÒÉÔÅ C-u 0 C-l (ÜÔÏ CONTROL-L, Á ÎÅ CONTROL-1). ->> ôÅÐÅÒØ, ÎÁÂÅÒÉÔÅ C-x 2, ÞÔÏ ÒÁÚÄÅÌÉÔ ÜËÒÁÎ ÎÁ Ä×Á ÏËÎÁ. +>> ôÅÐÅÒØ ÎÁÂÅÒÉÔÅ C-x 2, ÞÔÏ ÒÁÚÄÅÌÉÔ ÜËÒÁÎ ÎÁ Ä×Á ÏËÎÁ. ïÂÁ ÏËÎÁ ÏÔÏÂÒÁÖÁÀÔ ÕÞÅÂÎÉË. ëÕÒÓÏÒ ÏÓÔÁÌÓÑ × ×ÅÒÈÎÅÍ ÏËÎÅ. >> îÁÖÍÉÔÅ C-M-v ÄÌÑ ÐÒÏËÒÕÔËÉ ÎÉÖÎÅÇÏ ÏËÎÁ. @@ -876,10 +875,10 @@ C-s ÎÁÞÉÎÁÅÔ ÐÏÉÓË É ÓÍÏÔÒÉÔ ÎÁ ÌÀÂÙÅ ×ÈÏÖÄÅÎÉÑ ÉÓËÏÍÏÊ ÓÔÒÏËÉ ðïóìå ÔÅËÕÝÅÊ >> îÁÖÍÉÔÅ C-x o ("o" ÏÔ ÓÌÏ×Á "other" - ÄÒÕÇÏÅ) ÄÌÑ ÐÅÒÅÍÅÝÅÎÉÑ ËÕÒÓÏÒÁ × ÎÉÖÎÅÅ ÏËÎÏ. ->> éÓÐÏÌØÚÕÊÔÅ C-v É M-v × ÎÉÖÎÅÍ ÏËÎÅ ÞÔÏ ÐÒÏËÒÕÞÉ×ÁÔØ ÅÇÏ. +>> éÓÐÏÌØÚÕÊÔÅ C-v É M-v × ÎÉÖÎÅÍ ÏËÎÅ, ÞÔÏÂÙ ÐÒÏËÒÕÞÉ×ÁÔØ ÅÇÏ. ðÒÏÄÏÌÖÉÔÅ ÞÔÅÎÉÅ ÜÔÉÈ ÉÎÓÔÒÕËÃÉÊ × ×ÅÒÈÎÅÍ ÏËÎÅ. ->> îÁÖÍÉÔÅ C-x o ÓÎÏ×Á ÞÔÏÂÙ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÎÁÚÁÄ × ×ÅÒÈÎÅÅ ÏËÎÏ. +>> îÁÖÍÉÔÅ C-x o ÓÎÏ×Á, ÞÔÏÂÙ ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ ÎÁÚÁÄ × ×ÅÒÈÎÅÅ ÏËÎÏ. ëÕÒÓÏÒ × ×ÅÒÈÎÅÍ ÏËÎÅ ÔÁÍ ÖÅ, ÇÄÅ É ÂÙÌ ÄÏ ÔÏÇÏ. ÷Ù ÍÏÖÅÔÅ ÐÒÏÄÏÌÖÁÔØ ÐÅÒÅËÌÀÞÁÔØÓÑ ÍÅÖÄÕ ÏËÎÁÍÉ, ÉÓÐÏÌØÚÕÑ C-x o. ëÁÖÄÏÅ @@ -892,9 +891,9 @@ C-s ÎÁÞÉÎÁÅÔ ÐÏÉÓË É ÓÍÏÔÒÉÔ ÎÁ ÌÀÂÙÅ ×ÈÏÖÄÅÎÉÑ ÉÓËÏÍÏÊ ÓÔÒÏËÉ ðïóìå ÔÅËÕÝÅÊ × ÏËÎÅ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ É ÐÏÓÌÅÄÏ×ÁÔÅÌØÎÏ ÐÒÏÄ×ÉÇÁÔØÓÑ ×Ï ×ÔÏÒÏÍ, ÉÓÐÏÌØÚÕÑ C-M-v. -C-M-v ÐÒÉÍÅÒ CONTROL-META ÓÉÍ×ÏÌÁ. åÓÌÉ Õ ×ÁÓ ÅÓÔØ ÎÁÓÔÏÑÝÁÑ ËÎÏÐËÁ META -(Alt), ÔÏ ×Ù ÍÏÖÅÔÅ ÎÁÂÒÁÔØ C-M-v ÎÁÖÁ× ÏÄÎÏ×ÒÅÍÅÎÎÏ CONTROL É META É ÎÅ -ÏÔÐÕÓËÁÑ ÉÈ ÎÁÖÁÔØ v. é ÎÅ ×ÁÖÎÏ ËÁËÁÑ ÉÚ ËÌÁ×ÉÛ ÂÕÄÅÔ ÎÁÖÁÔÁ ÐÅÒ×ÏÊ, +C-M-v - ÐÒÉÍÅÒ CONTROL-META ÓÉÍ×ÏÌÁ. åÓÌÉ Õ ×ÁÓ ÅÓÔØ ÎÁÓÔÏÑÝÁÑ ËÎÏÐËÁ META +(Alt), ÔÏ ×Ù ÍÏÖÅÔÅ ÎÁÂÒÁÔØ C-M-v, ÎÁÖÁ× ÏÄÎÏ×ÒÅÍÅÎÎÏ CONTROL É META É, +ÎÅ ÏÔÐÕÓËÁÑ ÉÈ, ÎÁÖÁÔØ v. é ÎÅ ×ÁÖÎÏ, ËÁËÁÑ ÉÚ ËÌÁ×ÉÛ ÂÕÄÅÔ ÎÁÖÁÔÁ ÐÅÒ×ÏÊ, CONTROL ÉÌÉ META, ÐÏÓËÏÌØËÕ ÜÔÉ ËÎÏÐËÉ ÍÏÄÉÆÉÃÉÒÕÀÔ ÔÉÐ ÓÉÍ×ÏÌÁ. åÓÌÉ Õ ×ÁÓ ÎÅÔ ÎÁÓÔÏÑÝÅÊ ËÎÏÐËÉ META, É ×Ù ÉÓÐÏÌØÚÕÅÔÅ ESC ×ÍÅÓÔÏ ÎÅÅ, @@ -902,43 +901,43 @@ CONTROL ÉÌÉ META, ÐÏÓËÏÌØËÕ ÜÔÉ ËÎÏÐËÉ ÍÏÄÉÆÉÃÉÒÕÀÔ ÔÉÐ ÓÉÍ×ÏÌÁ. CONTROL-ESC v ÎÅ ÂÕÄÅÔ ÒÁÂÏÔÁÔØ. ðÏÔÏÍÕ, ÞÔÏ ESC ÉÍÅÅÔ Ó×ÏÊ ÓÏÂÓÔ×ÅÎÎÙÊ ÓÉÍ×ÏÌ -- ÜÔÏ ÎÅ ÍÏÄÉÆÉÃÉÒÕÀÝÁÑ ËÎÏÐËÁ. ->> îÁÖÍÉÔÅ C-x 1 (× ×ÅÒÈÎÅÍ ÏËÎÅ) ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÎÉÖÎÅÇÏ. +>> îÁÖÍÉÔÅ C-x 1 (× ×ÅÒÈÎÅÍ ÏËÎÅ), ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÎÉÖÎÅÇÏ. (åÓÌÉ ×Ù ÎÁÖÁÌÉ C-x 1 × ÎÉÖÎÅÍ ÏËÎÅ, ÔÏ ×Ù ÉÚÂÁ×ÉÌÉÓØ ÏÔ ×ÅÒÈÎÅÇÏ. ðÏÎÉÍÁÊÔÅ -ÜÔÕ ËÏÍÁÎÄÕ ËÁË "ïÓÔÁ×ÉÔØ ÔÏÌØËÏ ÏÄÎÏ ÏËÎÏ, ÔÏ × ËÏÔÏÒÏÍ Ñ ÓÅÊÞÁÓ ÎÁÈÏÖÕÓØ"). +ÜÔÕ ËÏÍÁÎÄÕ ËÁË "ïÓÔÁ×ÉÔØ ÔÏÌØËÏ ÏÄÎÏ ÏËÎÏ, ÔÏ, × ËÏÔÏÒÏÍ Ñ ÓÅÊÞÁÓ ÎÁÈÏÖÕÓØ"). -÷ÁÍ ÎÅ ÎÕÖÎÏ ÏÔÏÂÒÁÖÁÔØ ÏÄÉÎ É ÔÏÔ ÖÅ ÂÕÆÅÒ × ÏÂÏÉÈ ÏËÎÁÈ. åÓÌÉ ×Ù ÉÓÐÏÌØÚÕÅÔÅ -C-x C-f ÞÔÏÂÙ ÏÔËÒÙÔØ ÆÁÊÌ × ÏÄÎÏÍ ÏËÎÅ, ÄÒÕÇÏÅ ÏÓÔÁÎÅÔÓÑ ÂÅÚ ÉÚÍÅÎÅÎÉÑ. ÷Ù -ÍÏÖÅÔÅ ÏÔËÒÙ×ÁÔØ ÆÁÊÌÙ × ËÁÖÄÏÍ ÏËÎÅ ÎÅÚÁ×ÉÓÉÍÏ. +÷ÁÍ ÎÅ ÎÕÖÎÏ ÏÔÏÂÒÁÖÁÔØ ÏÄÉÎ É ÔÏÔ ÖÅ ÂÕÆÅÒ × ÏÂÏÉÈ ÏËÎÁÈ. åÓÌÉ ×Ù +ÉÓÐÏÌØÚÕÅÔÅ C-x C-f, ÞÔÏÂÙ ÏÔËÒÙÔØ ÆÁÊÌ × ÏÄÎÏÍ ÏËÎÅ, ÄÒÕÇÏÅ ÏÓÔÁÎÅÔÓÑ ÂÅÚ +ÉÚÍÅÎÅÎÉÑ. ÷Ù ÍÏÖÅÔÅ ÏÔËÒÙ×ÁÔØ ÆÁÊÌÙ × ËÁÖÄÏÍ ÏËÎÅ ÎÅÚÁ×ÉÓÉÍÏ. -åÓÔØ ÄÒÕÇÏÊ ÐÕÔØ ÉÓÐÏÌØÚÏ×ÁÔØ Ä×Á ÏËÎÁ ÏÔÏÂÒÁÖÁÀÝÉÈ ÒÁÚÎÙÅ ÆÁÊÌÙ: +åÓÔØ ÄÒÕÇÏÊ ÐÕÔØ ÉÓÐÏÌØÚÏ×ÁÔØ Ä×Á ÏËÎÁ, ÏÔÏÂÒÁÖÁÀÝÉÈ ÒÁÚÎÙÅ ÆÁÊÌÙ: ->> îÁÂÅÒÉÔÅ C-x 4 C-f ÚÁÔÅÍ ÉÍÑ ÏÄÎÏÇÏ É ×ÁÛÉÈ ÆÁÊÌÏ×. úÁ×ÅÒÛÉÔÅ <Return>. - ðÏÓÍÏÔÒÉÔÅ ÞÔÏ ×ÙÂÒÁÎÎÙÊ ÆÁÊÌ ÐÏÑ×ÉÌÓÑ × ÎÉÖÎÅÍ ÏËÎÅ. ëÕÒÓÏÒ ÐÅÒÅÛÅÌ +>> îÁÂÅÒÉÔÅ C-x 4 C-f, ÚÁÔÅÍ ÉÍÑ ÏÄÎÏÇÏ É ×ÁÛÉÈ ÆÁÊÌÏ×. úÁ×ÅÒÛÉÔÅ <Return>. + ðÏÓÍÏÔÒÉÔÅ, ÞÔÏ ×ÙÂÒÁÎÎÙÊ ÆÁÊÌ ÐÏÑ×ÉÌÓÑ × ÎÉÖÎÅÍ ÏËÎÅ. ëÕÒÓÏÒ ÐÅÒÅÛÅÌ ÔÕÄÁ ÖÅ. ->> îÁÂÅÒÉÔÅ C-x o ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ × ×ÅÒÈÎÅÅ ÏËÎÏ, É C-x 1 ÞÔÏÂÙ ÕÄÁÌÉÔØ ÎÉÖÎÅÅ - ÏËÎÏ. +>> îÁÂÅÒÉÔÅ C-x o, ÞÔÏÂÙ ×ÅÒÎÕÔØÓÑ × ×ÅÒÈÎÅÅ ÏËÎÏ, É C-x 1, ÞÔÏÂÙ ÕÄÁÌÉÔØ + ÎÉÖÎÅÅ ÏËÎÏ. * òåëõòóé÷îùå õòï÷îé òåäáëôéòï÷áîéñ (RECURSIVE EDITING LEVELS) -------------------------------------------------------------- éÎÏÇÄÁ ×Ù ÂÕÄÅÔÅ ×ËÌÀÞÁÔØ ÔÁË ÎÁÚÙ×ÁÅÍÙÅ "ÒÅËÕÒÓÉ×ÎÙÅ ÕÒÏ×ÎÉ -ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ". îÁ ÜÔÏ ÕËÁÚÙ×ÁÀÔ ÐÒÑÍÏÕÇÏÌØÎÙÅ ÓËÏÂËÉ × ÓÔÒÏËÅ -ÓÏÓÔÏÑÎÉÑ, ÏËÒÕÖÁÀÝÉÅ ÏÂÙÞÎÙÅ ÓËÏÂËÉ ×ÏËÒÕÇ ÉÍÅÎÉ ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ. îÁÐÒÉÍÅÒ -×Ù ÍÏÖÅÔÅ Õ×ÉÄÅÔØ [(Fundamental)] ×ÍÅÓÔÏ (Fundamental). +ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ". îÁ ÜÔÏ ÕËÁÚÙ×ÁÀÔ ÐÒÑÍÏÕÇÏÌØÎÙÅ ÓËÏÂËÉ × ÓÔÒÏËÅ ÓÏÓÔÏÑÎÉÑ, +ÏËÒÕÖÁÀÝÉÅ ÏÂÙÞÎÙÅ ÓËÏÂËÉ ×ÏËÒÕÇ ÉÍÅÎÉ ÏÓÎÏ×ÎÏÇÏ ÒÅÖÉÍÁ. îÁÐÒÉÍÅÒ, ×Ù ÍÏÖÅÔÅ +Õ×ÉÄÅÔØ [(Fundamental)] ×ÍÅÓÔÏ (Fundamental). -þÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, ÎÁÖÍÉÔÅ ESC ESC ESC. üÔÏ -ÍÎÏÇÏÃÅÌÅ×ÁÑ ËÏÍÁÎÄÁ "×ÙÈÏÄ". ÷Ù ÔÁË ÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÅÅ ËÁË ÄÌÑ +þÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ, ÎÁÖÍÉÔÅ ESC ESC ESC. üÔÏ +ÍÎÏÇÏÃÅÌÅ×ÁÑ ËÏÍÁÎÄÁ "×ÙÈÏÄ". ÷Ù ÔÁËÖÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ ÅÅ ËÁË ÄÌÑ ÕÎÉÞÔÏÖÅÎÉÑ ÌÉÛÎÉÈ ÏËÏÎ, ÔÁË É ÄÌÑ ×ÙÈÏÄÁ ÉÚ ÍÉÎÉ-ÂÕÆÅÒÁ. ->> îÁÖÍÉÔÅ M-x ÞÔÏÂÙ ÐÏÐÁÓÔØ × ÍÉÎÉ-ÂÕÆÅÒ; ÚÁÔÅÍ ÎÁÖÍÉÔÅ ESC ESC ESC ÞÔÏÂÙ - ÐÏËÉÎÕÔØ ÅÇÏ. +>> îÁÖÍÉÔÅ M-x, ÞÔÏÂÙ ÐÏÐÁÓÔØ × ÍÉÎÉ-ÂÕÆÅÒ; ÚÁÔÅÍ ÎÁÖÍÉÔÅ ESC ESC ESC, + ÞÔÏÂÙ ÐÏËÉÎÕÔØ ÅÇÏ. -÷Ù ÎÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ -ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ðÏÔÏÍÕ, ÞÔÏ C-g ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÏÔÍÅÎÙ ËÏÍÁÎÄÙ É ÁÒÇÕÍÅÎÔÏ× -âåú ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. +÷Ù ÎÅ ÍÏÖÅÔÅ ÉÓÐÏÌØÚÏ×ÁÔØ C-g, ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ +ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. ðÏÔÏÍÕ, ÞÔÏ C-g ÉÓÐÏÌØÚÕÅÔÓÑ ÄÌÑ ÏÔÍÅÎÙ ËÏÍÁÎÄÙ É +ÁÒÇÕÍÅÎÔÏ× âåú ÒÅËÕÒÓÉ×ÎÙÈ ÕÒÏ×ÎÅÊ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ. * ëáë ðïìõþéôø ðïíïýø (GETTING MORE HELP) @@ -953,10 +952,10 @@ C-x C-f ÞÔÏÂÙ ÏÔËÒÙÔØ ÆÁÊÌ × ÏÄÎÏÍ ÏËÎÅ, ÄÒÕÇÏÅ ÏÓÔÁÎÅÔÓÑ ÂÅÚ ÉÚÍÅÎÅÎÉÑ. ÷Ù ÐÏÍÏÝÉ". þÔÏÂÙ ÉÓÐÏÌØÚÏ×ÁÔØ ÏÓÏÂÅÎÎÏÓÔÉ ðÏÍÏÝÉ, ÎÁÖÍÉÔÅ C-h, É ÚÁÔÅÍ ÓÉÍ×ÏÌ, ËÏÔÏÒÙÊ -ÒÁÓÓËÁÖÅÔ ËÁËÏÊ ÉÍÅÎÎÏ ×ÉÄ ÐÏÍÏÝÉ ×Ù ÈÏÔÉÔÅ ÐÏÌÕÞÉÔØ. åÓÌÉ ×Ù äåêóô÷éôåìøîï -ÒÁÓÔÅÒÑÌÉÓØ, ÎÁÂÅÒÉÔÅ C-h ? É Emacs ÒÁÓÓËÁÖÅÔ ×ÁÍ ËÁËÕÀ ÐÏÍÏÝØ ÏÎ ÍÏÖÅÔ ×ÁÍ +ÒÁÓÓËÁÖÅÔ, ËÁËÏÊ ÉÍÅÎÎÏ ×ÉÄ ÐÏÍÏÝÉ ×Ù ÈÏÔÉÔÅ ÐÏÌÕÞÉÔØ. åÓÌÉ ×Ù äåêóô÷éôåìøîï +ÒÁÓÔÅÒÑÌÉÓØ, ÎÁÂÅÒÉÔÅ C-h ?, É Emacs ÒÁÓÓËÁÖÅÔ ×ÁÍ ËÁËÕÀ ÐÏÍÏÝØ ÏÎ ÍÏÖÅÔ ×ÁÍ ÐÒÅÄÏÓÔÁ×ÉÔØ. åÓÌÉ ×Ù ÎÁÖÁÌÉ C-h É ÐÅÒÅÄÕÍÁÌÉ ÏÂÒÁÝÁÔØÓÑ Ë ÐÏÍÏÝÉ, ÐÒÏÓÔÏ -ÎÁÖÍÉÔÅ C-g ÞÔÏÂÙ ÏÔÍÅÎÉÔØ ÜÔÕ ËÏÍÁÎÄÕ. +ÎÁÖÍÉÔÅ C-g, ÞÔÏÂÙ ÏÔÍÅÎÉÔØ ÜÔÕ ËÏÍÁÎÄÕ. (ëÏÅ-ÇÄÅ ÐÅÒÅÎÁÚÎÁÞÁÀÔ ÓÉÍ×ÏÌ C-h. òÅÁÌØÎÏÊ ÎÅÏÂÈÏÄÉÍÏÓÔÉ × ÜÔÏÍ ÎÅÔ, ÓÏÏÂÝÉÔÅ Ï ÎÅÊ ÓÉÓÔÅÍÎÏÍÕ ÁÄÍÉÎÉÓÔÒÁÔÏÒÕ. ôÅÍ ×ÒÅÍÅÎÅÍ, ÅÓÌÉ C-h ÎÅ ×ÙÚÙ×ÁÅÔ @@ -971,35 +970,35 @@ C-x C-f ÞÔÏÂÙ ÏÔËÒÙÔØ ÆÁÊÌ × ÏÄÎÏÍ ÏËÎÅ, ÄÒÕÇÏÅ ÏÓÔÁÎÅÔÓÑ ÂÅÚ ÉÚÍÅÎÅÎÉÑ. ÷Ù óÏÏÂÝÅÎÉÅ ÄÏÌÖÎÏ ×ÙÇÌÑÄÅÔØ ÐÒÉÍÅÒÎÏ ÔÁË C-p runs the command previous-line - (C-p ×ÙÐÏÌÎÑÅÔ ËÏÍÁÎÄÕ previous-line {ÐÒÅÄÙÄÕÝÁÑ-ÌÉÎÉÑ}) + (C-p ×ÙÐÏÌÎÑÅÔ ËÏÍÁÎÄÕ previous-line {ÐÒÅÄÙÄÕÝÁÑ-ÓÔÒÏËÁ}) -÷ÁÍ ÓÏÏÂÝÁÀÔ "ÉÍÑ ÆÕÎËÃÉÉ". éÍÅÎÁ ÆÕÎËÃÉÉ ÉÓÐÏÌØÚÕÀÔÓÑ × ÏÓÎÏ×ÎÏÍ ÄÌÑ -ÎÁÓÔÒÏÊËÉ É ÒÁÓÛÉÒÅÎÉÑ Emacs. éÍÅÎÁ ÆÕÎËÃÉÊ ×ÙÂÒÁÎÙ ÔÁË, ÞÔÏÂÙ ÐÏËÁÚÁÔØ ÞÔÏ -ÉÍÅÎÎÏ ËÏÍÁÎÄÁ ÄÅÌÁÅÔ, ÔÁË ÖÅ ÏÎÉ ÐÏÚ×ÏÌÑÀÔ Ó ÐÏÍÏÝØÀ ÜÔÏÊ ËÒÁÔËÏÊ +÷ÁÍ ÓÏÏÂÝÁÀÔ "ÉÍÑ ÆÕÎËÃÉÉ". éÍÅÎÁ ÆÕÎËÃÉÊ ÉÓÐÏÌØÚÕÀÔÓÑ × ÏÓÎÏ×ÎÏÍ ÄÌÑ +ÎÁÓÔÒÏÊËÉ É ÒÁÓÛÉÒÅÎÉÑ Emacs. éÍÅÎÁ ÆÕÎËÃÉÊ ×ÙÂÒÁÎÙ ÔÁË, ÞÔÏÂÙ ÐÏËÁÚÁÔØ, +ÞÔÏ ÉÍÅÎÎÏ ËÏÍÁÎÄÁ ÄÅÌÁÅÔ, ÔÁËÖÅ ÏÎÉ ÐÏÚ×ÏÌÑÀÔ Ó ÐÏÍÏÝØÀ ÜÔÏÊ ËÒÁÔËÏÊ ÉÎÆÏÒÍÁÃÉÉ ÌÅÇÞÅ ÚÁÐÏÍÎÉÔØ ÕÖÅ ×ÙÕÞÅÎÎÙÅ ËÏÍÁÎÄÙ. íÎÏÇÏÓÉÍ×ÏÌØÎÙÅ ËÏÍÁÎÄÙ, ÔÁËÉÅ ËÁË C-x C-s É (ÅÓÌÉ Õ ×ÁÓ ÎÅÔ ËÎÏÐËÉ META ÉÌÉ -EDIT ÉÌÉ ALT) <ESC>v ÔÁË ÖÅ ÂÕÄÕÔ ÄÏÓÔÕÐÎÙ ÐÏÓÌÅ C-h c. +EDIT ÉÌÉ ALT) <ESC>v ÔÁËÖÅ ÂÕÄÕÔ ÄÏÓÔÕÐÎÙ ÐÏÓÌÅ C-h c. ðÏÌÕÞÉÔÅ ÂÏÌØÛÅ ÉÎÆÏÒÍÁÃÉÉ Ï ËÏÍÁÎÄÅ ÉÓÐÏÌØÚÕÑ C-h k ×ÍÅÓÔÏ C-h c. >> îÁÂÅÒÉÔÅ C-h k C-p. ÷Ù Õ×ÉÄÉÔÅ ÏÐÉÓÁÎÉÅ ÆÕÎËÃÉÉ, Á ÔÁËÖÅ ÅÅ ÉÍÑ × ÏÔÄÅÌØÎÏÍ ÏËÎÅ Emacs. ëÏÇÄÁ ×Ù -ÚÁ×ÅÒÛÉÔÅ ÞÔÅÎÉÅ, ÎÁÖÍÉÔÅ C-x 1 ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÔÅËÓÔÁ ÐÏÍÏÝÉ. ÷Ù +ÚÁ×ÅÒÛÉÔÅ ÞÔÅÎÉÅ, ÎÁÖÍÉÔÅ C-x 1, ÞÔÏÂÙ ÉÚÂÁ×ÉÔØÓÑ ÏÔ ÔÅËÓÔÁ ÐÏÍÏÝÉ. ÷Ù ÍÏÖÅÔÅ ×ÙÐÏÌÎÉÔØ ËÁËÏÅ-ÔÏ ÒÅÄÁËÔÉÒÏ×ÁÎÉÅ ×Ï ×ÒÅÍÑ ÐÒÏÓÍÏÔÒÁ ÔÅËÓÔÁ ÓÐÒÁ×ËÉ, -Á ÔÏÌØËÏ ÚÁÔÅÍ ÎÁÖÁÔØ C-x 1 +Á ÔÏÌØËÏ ÚÁÔÅÍ ÎÁÖÁÔØ C-x 1. åÓÔØ ÅÝÅ ÎÅÓËÏÌØËÏ ÐÏÌÅÚÎÙÈ ÏÐÃÉÊ C-h: - C-h f ïÐÉÓÙ×ÁÅÔ ÆÕÎËÃÉÀ. ÷ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÎÁÂÒÁÔØ ÉÍÑ ÆÕÎËÃÉÉ. + C-h f ïÐÉÓÙ×ÁÅÔ ÆÕÎËÃÉÀ. ÷ÁÍ ÎÅÏÂÈÏÄÉÍÏ ÎÁÂÒÁÔØ ÉÍÑ ÆÕÎËÃÉÉ. >> ðÏÐÒÏÂÕÊÔÅ ÎÁÂÒÁÔØ C-h f previous-line<Return>. üÔÏ ÒÁÓÐÅÞÁÔÁÅÔ ÉÎÆÏÒÍÁÃÉÀ Emacs Ï ÜÔÏÊ ÆÕÎËÃÉÉ, ËÏÔÏÒÁÑ ×ÙÐÏÌÎÑÅÔÓÑ ËÏÍÁÎÄÏÊ C-p. áÎÁÌÏÇÉÞÎÁÑ ËÏÍÁÎÄÁ C-h v ÏÔÏÂÒÁÖÁÅÔ ÄÏËÕÍÅÎÔÁÃÉÀ Ï ÐÅÒÅÍÅÎÎÙÈ, ÚÎÁÞÅÎÉÅ -ËÏÔÏÒÙÈ ×Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ÄÌÑ ÎÁÓÔÒÏÊËÉ ÐÏ×ÅÄÅÎÉÑ Emacs. ÷ÙÍ ÎÕÖÎÏ ÎÁÂÒÁÔØ +ËÏÔÏÒÙÈ ×Ù ÍÏÖÅÔÅ ÉÚÍÅÎÉÔØ ÄÌÑ ÎÁÓÔÒÏÊËÉ ÐÏ×ÅÄÅÎÉÑ Emacs. ÷ÁÍ ÎÕÖÎÏ ÎÁÂÒÁÔØ ÉÍÑ ÐÅÒÅÍÅÎÎÏÊ, ËÏÇÄÁ Emacs ÚÁÐÒÏÓÉÔ ÅÇÏ. C-h a Hyper Apropos. ÷×ÅÄÉÔÅ ËÌÀÞÅ×ÏÅ ÓÌÏ×Ï É Emacs ÐÏËÁÖÅÔ ×ÁÍ @@ -1009,14 +1008,14 @@ EDIT ÉÌÉ ALT) <ESC>v ÔÁË ÖÅ ÂÕÄÕÔ ÄÏÓÔÕÐÎÙ ÐÏÓÌÅ C-h c. >> îÁÂÅÒÉÔÅ C-h a file<Return>. -ÜÔÏ ÏÔÏÂÒÁÚÉÔ ÐÏÌÎÙÊ ÓÐÉÓÏË ÆÕÎËÃÉÊ É ÐÅÒÅÍÅÎÎÙÈ ÉÍÅÎÁ ËÏÔÏÒÙÈ ÎÁÞÉÎÁÀÔÓÑ Ó -"newline". îÁÖÍÉÔÅ <Return> ÉÌÉ ËÌÉËÎÉÔÅ ÓÒÅÄÎÅÊ ËÎÏÐËÏÊ ÍÙÛËÉ ÞÔÏÂÙ -ÐÏÌÕÞÉÔØ ÂÏÌØÛÅ Ï ÆÕÎËÃÉÉ ÉÌÉ ÐÅÒÅÍÅÎÎÏÊ. îÁÖÍÉÔÅ `q' ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ -hyper-apropos. +ÜÔÏ ÏÔÏÂÒÁÚÉÔ ÐÏÌÎÙÊ ÓÐÉÓÏË ÆÕÎËÃÉÊ É ÐÅÒÅÍÅÎÎÙÈ, ÉÍÅÎÁ ËÏÔÏÒÙÈ ÎÁÞÉÎÁÀÔÓÑ +Ó "newline". îÁÖÍÉÔÅ <Return> ÉÌÉ ËÌÉËÎÉÔÅ ÓÒÅÄÎÅÊ ËÎÏÐËÏÊ ÍÙÛËÉ, ÞÔÏÂÙ +ÐÏÌÕÞÉÔØ ÂÏÌØÛÅ ÉÎÆÏÒÍÁÃÉÉ Ï ÆÕÎËÃÉÉ ÉÌÉ ÐÅÒÅÍÅÎÎÏÊ. îÁÖÍÉÔÅ `q', ÞÔÏÂÙ +×ÙÊÔÉ ÉÚ hyper-apropos. üÔÏ ÏÔÏÂÒÁÚÉÔ × ÄÒÕÇÏÍ ÏËÎÅ ÓÐÉÓÏË ×ÓÅÈ ËÏÍÁÎÄ M-x ÓÏ ÓÌÏ×ÏÍ "file" × ÉÈ -ÉÍÅÎÁÈ. ôÁËÖÅ × ÓÐÉÓËÅ, ËÒÏÍÅ ËÏÍÁÎÄ, ÔÁËÉÈ ËÁË find-file, ×Ù Õ×ÉÄÉÔÅ -ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÓÉÍ×ÏÌØÎÙÅ ËÏÍÁÎÄÙ, ÔÁËÉÅ ËÁË C-x C-f. +ÉÍÅÎÁÈ. ôÁËÖÅ × ÓÐÉÓËÅ ËÒÏÍÅ ËÏÍÁÎÄ ÔÁËÉÈ, ËÁË find-file, ×Ù Õ×ÉÄÉÔÅ +ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÓÉÍ×ÏÌØÎÙÅ ËÏÍÁÎÄÙ ÔÁËÉÅ, ËÁË C-x C-f. >> îÁÂÅÒÉÔÅ C-M-v ÄÌÑ ÐÒÏËÒÕÔËÉ ÏËÎÁ ÓÐÒÁ×ËÉ. ÷ÙÐÏÌÎÉÔÅ ÜÔÏ ÎÅÓËÏÌØËÏ ÒÁÚ. @@ -1024,29 +1023,28 @@ hyper-apropos. C-h i þÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á (a.k.a. Info). üÔÁ ËÏÍÁÎÄÁ ÐÅÒÅÈÏÄÉÔ × ÓÐÅÃÉÁÌØÎÙÊ ÂÕÆÅÒ Ó ÉÍÅÎÅÍ `*info*', ÇÄÅ ×Ù - ÍÏÖÅÔÅ ÞÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á ÄÌÑ ÐÁËÅÔÏ× + ÍÏÖÅÔÅ ÞÉÔÁÔØ ÉÎÔÅÒÁËÔÉ×ÎÙÅ ÒÕËÏ×ÏÄÓÔ×Á ÄÌÑ ÐÁËÅÔÏ×, ÕÓÔÁÎÏ×ÌÅÎÎÙÈ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. îÁÂÅÒÉÔÅ m emacs <Return> ÄÌÑ ÞÔÅÎÉÑ ÒÕËÏ×ÏÄÓÔ×Á ÐÏ Emacs. åÓÌÉ ×Ù ÎÉËÏÇÄÁ ÒÁÎÅÅ ÎÅ ÉÓÐÏÌØÚÏ×ÁÌÉ Info, ÔÏ ÎÁÂÅÒÉÔÅ ? É Emacs ÏÔËÒÏÅÔ ÕÞÅÂÎÉË ÐÏ ×ÏÚÍÏÖÎÏÓÔÑÍ ÒÅÖÉÍÁ Info. ïÄÎÁÖÄÙ ÏÚÎÁËÏÍÉ×ÛÉÓØ Ó ÜÔÉÍ ÕÞÅÂÎÉËÏÍ, ×Ù ÄÏÌÖÎÙ ÉÓÐÏÌØÚÏ×ÁÔØ ÒÕËÏ×ÏÄÓÔ×Ï Emacs Info × - ËÁÞÅÔÓ×Å ÏÓÎÏ×ÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ. - + ËÁÞÅÓÔ×Å ÏÓÎÏ×ÎÏÊ ÄÏËÕÍÅÎÔÁÃÉÉ. * úáëìàþåîéå ------------ -úÁÐÏÍÎÉÔÅ, ÞÔÏ ÞÔÏÂÙ ×ÙÊÔÉ ÉÚ Emacs ÎÁÓÏ×ÓÅÍ ÉÓÐÏÌØÚÕÅÔÓÑ ÓÏÞÅÔÁÎÉÅ C-x -C-c. á ÞÔÏÂÙ ×ÒÅÍÅÎÎÏ ×ÙÊÔÉ × ÏÂÏÌÏÞËÕ (shell) É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ ÏÂÒÁÔÎÏ, -ÉÓÐÏÌØÚÕÊÔÅ C-z. +úÁÐÏÍÎÉÔÅ, ÞÔÏÂÙ ÓÏ×ÓÅÍ ×ÙÊÔÉ ÉÚ Emacs, ÉÓÐÏÌØÚÕÅÔÓÑ ÓÏÞÅÔÁÎÉÅ ËÌÁ×ÉÛ +C-x C-c. á ÞÔÏÂÙ ×ÒÅÍÅÎÎÏ ×ÙÊÔÉ × ÏÂÏÌÏÞËÕ (shell) É ÐÏÔÏÍ ×ÅÒÎÕÔØÓÑ +ÏÂÒÁÔÎÏ, ÉÓÐÏÌØÚÕÊÔÅ C-z. -üÔÏÔ ÕÞÅÂÎÉË ÄÏÌÖÅÎ ÂÙÔØ ÐÏÎÑÔÅÎ ×ÓÅÍ ÎÏ×ÙÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ, ÅÓÌÉ ×Ù ÎÁÊÄÅÔÅ -ÞÔÏ-ÎÉÂÕÄØ ÎÅÑÓÎÏÅ, ÎÅ ÎÕÖÎÏ ÓÉÄÅÔØ É ÐÏÒÉÃÁÔØ ÓÅÂÑ -- ÖÁÌÕÊÔÅÓØ! +üÔÏÔ ÕÞÅÂÎÉË ÄÏÌÖÅÎ ÂÙÔØ ÐÏÎÑÔÅÎ ×ÓÅÍ ÎÏ×ÙÍ ÐÏÌØÚÏ×ÁÔÅÌÑÍ, ÎÏ ÅÓÌÉ ×Ù +ÎÁÊÄÅÔÅ ÞÔÏ-ÎÉÂÕÄØ ÎÅÑÓÎÏÅ, ÎÅ ÎÕÖÎÏ ÓÉÄÅÔØ É ÐÏÒÉÃÁÔØ ÓÅÂÑ -- ÖÁÌÕÊÔÅÓØ! * COPYING -------- +--------- üÔÏÔ ÕÞÅÂÎÉË ÐÒÏÉÚÏÛÅÌ ÉÚ ÄÌÉÎÎÏÊ ÓÅÒÉÉ ÕÞÅÂÎÉËÏ× Emacs, ÎÁÞÁÔÏÊ Ó ÏÄÎÁÖÄÙ ÎÁÐÉÓÁÎÎÏÇÏ by Stuart Cracraft ÄÌÑ ÏÒÉÇÉÎÁÌØÎÏÇÏ Emacs. @@ -1071,12 +1069,17 @@ Copyright (c) 1985, 1996 Free Software Foundation õÓÌÏ×ÉÑ ËÏÐÉÒÏ×ÁÎÉÑ ÓÁÍÏÇÏ Emacs ÂÏÌÅÅ ÓÌÏÖÎÙÅ, ÎÏ × ÔÏÍ ÖÅ ÄÕÈÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÒÏÞÔÉÔÅ ÆÁÊÌ COPYING É ÚÁÔÅÍ ÄÁÊÔÅ ËÏÐÉÀ GNU Emacs ×ÁÛÉÍ ÄÒÕÚØÑÍ. ðÏÍÏÇÉÔÅ ÕÎÉÞÔÏÖÉÔØ ÏÂÓÔÒÕËÃÉÏÎÉÚÍ × ÏÂÌÁÓÔÉ ÐÒÏÇÒÁÍÍÎÏÇÏ -ÏÂÅÓÐÅÞÅÎÉÑ ("×ÌÁÄÅÎÉÅ") ÉÓÐÏÌØÚÕÑ, ÓÏÚÄÁ×ÁÑ É ÒÁÓÐÒÏÓÔÒÁÎÑÑ Ó×ÏÂÏÄÎÏÅ +ÏÂÅÓÐÅÞÅÎÉÑ ("×ÌÁÄÅÎÉÅ"), ÉÓÐÏÌØÚÕÑ, ÓÏÚÄÁ×ÁÑ É ÒÁÓÐÒÏÓÔÒÁÎÑÑ Ó×ÏÂÏÄÎÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ! -// ÚÁÍÅÞÁÎÉÑ, ÉÓÐÒÁ×ÌÅÎÉÑ ÏÛÉÂÏË Ó ÎÅÔÅÒÐÅÎÉÅÍ ÖÄÕ ÐÏ ÁÄÒÅÓÕ ottalex@beep.ru +// ÚÁÍÅÞÁÎÉÑ, ÉÓÐÒÁ×ÌÅÎÉÑ ÏÛÉÂÏË Ó ÎÅÔÅÒÐÅÎÉÅÍ ÖÄÕ ÐÏ ÁÄÒÅÓÕ ottalex@narod.ru // Alex Ott. // âÏÌØÛÏÅ ÓÐÁÓÉÂÏ ÷ÌÁÄÉÍÉÒÕ âÏÒÍÏÔÏ×Õ, ÎÁ ÂÁÚÅ ÐÅÒÅ×ÏÄÁ ËÏÔÏÒÏÇÏ ÂÙÌ ÓÄÅÌÁÎ // ÜÔÏÔ ÐÅÒÅ×ÏÄ +;;; Local Variables: +;;; coding: cyrillic-koi8 +;;; sentence-end-double-space: nil +;;; End: + ;;; arch-tag: ad4e5698-ea8b-45b7-b236-ed5ad5b72d2b diff --git a/etc/TUTORIAL.sl b/etc/TUTORIAL.sl index ea901564a79..263019643db 100644 --- a/etc/TUTORIAL.sl +++ b/etc/TUTORIAL.sl @@ -1134,6 +1134,7 @@ pi¹ete in delite prosto programje! ;;; Local Variables: ;;; coding: iso-latin-2 +;;; sentence-end-double-space: nil ;;; End: ;;; arch-tag: 985059e4-44c6-4ac9-b627-46c8db57acf6 diff --git a/etc/TUTORIAL.sv b/etc/TUTORIAL.sv index f4dcc842e5d..65d1548c378 100644 --- a/etc/TUTORIAL.sv +++ b/etc/TUTORIAL.sv @@ -1089,4 +1089,9 @@ same spirit. Please read the file COPYING and then do give copies of GNU Emacs to your friends. Help stamp out software obstructionism ("ownership") by using, writing, and sharing free software! +;;; Local Variables: +;;; coding: latin-1 +;;; sentence-end-double-space: nil +;;; End: + ;;; arch-tag: b352f774-622b-4cc6-85ce-43e3baf4fc1b diff --git a/etc/TUTORIAL.th b/etc/TUTORIAL.th index a5852296323..f3708c9d60f 100644 --- a/etc/TUTORIAL.th +++ b/etc/TUTORIAL.th @@ -1005,4 +1005,8 @@ virach@nectec.or.th Translate - January 1999 by Virach Sornlertlamvanich +;;; Local Variables: +;;; sentence-end-double-space: nil +;;; End: + ;;; arch-tag: 79ad252a-448a-4dc9-a4cb-2097dd1ec014 diff --git a/etc/TUTORIAL.translators b/etc/TUTORIAL.translators index b4d26c85ca5..0e4f2d4e124 100644 --- a/etc/TUTORIAL.translators +++ b/etc/TUTORIAL.translators @@ -14,6 +14,7 @@ TUTORIAL.ko: Koaunghi Un <koaunghi@ling.cnu.ac.kr> TUTORIAL.nl: Pieter Schoenmakers <tiggr@tiggr.net> TUTORIAL.pl: BeatÄ™ WierzchoÅ‚owskÄ… <beataw@orient.uw.edu.pl> Janusz S. Bien <jsbien@mail.uw.edu.pl> +TUTORIAL.pt_BR: Marcelo Toledo <marcelo@marcelotoledo.org> TUTORIAL.ro: Tudor Hulubei <tudor@gnu.org> TUTORIAL.ru: Alex Ott <ottalex@narod.ru> TUTORIAL.sk: Miroslav VaÅ¡ko <vasko@debian.cz> diff --git a/etc/compilation.txt b/etc/compilation.txt index 6420580fe6d..ff86583299d 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -91,6 +91,16 @@ symbol: comma "src/swapping.c", line 30.34: 1506-342 (W) "/*" detected in comment. +* EDG C/C++ + +symbol: edg-1 edg-2 + +build/intel/debug/../../../struct.cpp(42): error: identifier "foo" is undefined +build/intel/debug/../../../struct.cpp(44): warning #1011: missing return statement at end of ... +build/intel/debug/../../../iptr.h(302): remark #981: operands are evaluated in unspecified order + detected during ... at line 62 of "build/intel/debug/../../../trace.h" + + * EPC F90 compiler symbol: epc @@ -120,6 +130,7 @@ foo.c(5:5) : error EDC0350: Syntax error. symbol: irix ccom: Error: foo.c, line 2: syntax error +cc: Severe: /src/Python-2.3.3/Modules/_curses_panel.c, line 17: Cannot find file <panel.h> ... cc: Info: foo.c, line 27: ... cfe: Warning 712: foo.c, line 2: illegal combination of pointer and ... cfe: Warning 600: xfe.c: 170: Not in a conditional directive while ... @@ -194,6 +205,7 @@ foo.c:8.23-9.1: message jade:dbcommon.dsl:133:17:E: missing argument for function call G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found. file:G:/cygwin/dev/build-myproj.xml:54: Compiler Adapter 'javac' can't be found. +{standard input}:27041: Warning: end of file not at end of a line; newline inserted * Lucid Compiler, lcc 3.x @@ -241,7 +253,17 @@ d:\tmp\test.c(23) : error C2143: syntax error : missing ';' before 'if' symbol: oracle +This stupid precompiler wraps lines at column 80 in the middle of a file name. +There is no obvious way of detecting this or turning it off. But if you +delete the newline, the file name will automatically be reparsed, so that you +can then go there. + Semantic error at line 528, column 5, file erosacqdb.pc: +Error at line 41, column 10 in file /usr/src/sb/ODBI_BHP.hpp +PCC-02150: error at line 49, column 27 in file /usr/src/sb/ODBI_dxfgh.pc +PCC-00003: invalid SQL Identifier at column name in line 12 of file /usr/src/sb/ODBI_BHP.hpp +PCC-00004: mismatched IF/ELSE/ENDIF block at line 27 in file /usr/src/sb/ODBI_BHP.hpp +PCC-02151: line 21 column 40 file /usr/src/sb/ODBI_BHP.hpp: * Perl @@ -298,14 +320,6 @@ symbol: sun-ada /home3/xdhar/rcds_rc/main.a, line 361, char 6:syntax error: "," inserted -* Ultrix 3.0 f77 & Some SGI cc version - -symbol: ultrix - -fort: Severe: addstf.f, line 82: Missing operator or delimiter symbol -cfe: Warning 835: foo.c, line 2: something - - * 4.3BSD grep, cc, lint symbol: 4bsd diff --git a/etc/emacs.py b/etc/emacs.py new file mode 100644 index 00000000000..d672dbf63cb --- /dev/null +++ b/etc/emacs.py @@ -0,0 +1,112 @@ +"""Definitions used by commands sent to inferior Python in python.el.""" + +# Copyright (C) 2004 Free Software Foundation, Inc. +# Author: Dave Love <d.love@dl.ac.uk> + +# This file is part of GNU Emacs. + +# GNU Emacs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +import os, sys, traceback, inspect, rlcompleter, __main__ + +__all__ = ["eexecfile", "args", "complete", "ehelp", "eimport"] + +def eexecfile (file): + """Execute FILE and then remove it. + If we get an exception, print a traceback with the top frame + (oursleves) excluded.""" + try: + try: execfile (file, globals (), globals ()) + except: + (type, value, tb) = sys.exc_info () + # Lose the stack frame for this location. + tb = tb.tb_next + if tb is None: # print_exception won't do it + print "Traceback (most recent call last):" + traceback.print_exception (type, value, tb) + finally: + os.remove (file) + +def eargs (name): + "Get arglist of NAME for Eldoc &c." + try: + parts = name.split ('.') + if len (parts) > 1: + exec 'import ' + parts[0] # might fail + func = eval (name) + if inspect.isbuiltin (func): + doc = func.__doc__ + if doc.find (' ->') != -1: + print '_emacs_out', doc.split (' ->')[0] + elif doc.find ('\n') != -1: + print '_emacs_out', doc.split ('\n')[0] + return + if inspect.ismethod (func): + func = func.im_func + if not inspect.isfunction (func): + return + (args, varargs, varkw, defaults) = inspect.getargspec (func) + # No space between name and arglist for consistency with builtins. + print '_emacs_out', \ + func.__name__ + inspect.formatargspec (args, varargs, varkw, + defaults) + except: pass + +def complete (text, namespace = None): + """Complete TEXT in NAMESPACE and print a Lisp list of completions. + NAMESPACE is currently not used.""" + if namespace is None: namespace = __main__.__dict__ + c = rlcompleter.Completer (namespace) + try: + if '.' in text: + matches = c.attr_matches (text) + else: + matches = c.global_matches (text) + print '_emacs_out (', + for elt in matches: + print '"%s"' % elt, + print ')' + except: + print '_emacs_out ()' + +def ehelp (name): + """Get help on string NAME. + First try to eval name for, e.g. user definitions where we need + the object. Otherwise try the string form.""" + try: help (eval (name)) + except: help (name) + +def eimport (mod, dir): + """Import module MOD with directory DIR at the head of the search path. + NB doesn't load from DIR if MOD shadows a system module.""" + path0 = sys.path[0] + sys.path[0] = dir + try: + try: + if globals().has_key(mod) and inspect.ismodule (eval (mod)): + reload(eval (mod)) + else: + globals ()[mod] = __import__ (mod) + except: + (type, value, tb) = sys.exc_info () + print "Traceback (most recent call last):" + traceback.print_exception (type, value, tb.tb_next) + finally: + sys.path[0] = path0 + +print '_emacs_ok' # ready for input and can call continuation + +# arch-tag: d90408f3-90e2-4de4-99c2-6eb9c7b9ca46 diff --git a/etc/ru-refcard.ps b/etc/ru-refcard.ps new file mode 100644 index 00000000000..201708fda8a --- /dev/null +++ b/etc/ru-refcard.ps @@ -0,0 +1,2087 @@ +%!PS-Adobe-2.0 +%%Creator: dvips(k) 5.92b Copyright 2002 Radical Eye Software +%%Title: ru-refcard.dvi +%%Pages: 6 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%DocumentFonts: CMSY10 CMMI10 CMSY8 +%%EndComments +%DVIPSWebPage: (www.radicaleye.com) +%DVIPSCommandLine: dvips ru-refcard.dvi +%DVIPSParameters: dpi=600, compressed +%DVIPSSource: TeX output 2004.05.16:0847 +%%BeginProcSet: texc.pro +%! +/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S +N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 +mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 +0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ +landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize +mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ +matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round +exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ +statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] +N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin +/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array +/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 +array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N +df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A +definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get +}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} +B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr +1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 +1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx +0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx +sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ +rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp +gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B +/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ +/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ +A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy +get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} +ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp +fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 +{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add +chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ +1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} +forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn +/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put +}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ +bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A +mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ +SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ +userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X +1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 +index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N +/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ +/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) +(LaserWriter 16/600)]{A length product length le{A length product exch 0 +exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse +end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask +grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} +imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round +exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto +fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p +delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} +B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ +p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S +rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end + +%%EndProcSet +%%BeginProcSet: bbad153f.enc +% Thomas Esser, Dec 2002. public domain +% +% Encoding for: +% cmsy10 cmsy5 cmsy6 cmsy7 cmsy8 cmsy9 +% +/TeXbbad153fEncoding [ +/minus /periodcentered /multiply /asteriskmath /divide /diamondmath +/plusminus /minusplus /circleplus /circleminus /circlemultiply +/circledivide /circledot /circlecopyrt /openbullet /bullet +/equivasymptotic /equivalence /reflexsubset /reflexsuperset /lessequal +/greaterequal /precedesequal /followsequal /similar /approxequal +/propersubset /propersuperset /lessmuch /greatermuch /precedes /follows +/arrowleft /arrowright /arrowup /arrowdown /arrowboth /arrownortheast +/arrowsoutheast /similarequal /arrowdblleft /arrowdblright /arrowdblup +/arrowdbldown /arrowdblboth /arrownorthwest /arrowsouthwest /proportional +/prime /infinity /element /owner /triangle /triangleinv /negationslash +/mapsto /universal /existential /logicalnot /emptyset /Rfractur /Ifractur +/latticetop /perpendicular /aleph /A /B /C /D /E /F /G /H /I /J /K +/L /M /N /O /P /Q /R /S /T /U /V /W /X /Y /Z /union /intersection +/unionmulti /logicaland /logicalor /turnstileleft /turnstileright +/floorleft /floorright /ceilingleft /ceilingright /braceleft /braceright +/angbracketleft /angbracketright /bar /bardbl /arrowbothv /arrowdblbothv +/backslash /wreathproduct /radical /coproduct /nabla /integral +/unionsq /intersectionsq /subsetsqequal /supersetsqequal /section +/dagger /daggerdbl /paragraph /club /diamond /heart /spade /arrowleft +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/minus /periodcentered /multiply /asteriskmath /divide /diamondmath +/plusminus /minusplus /circleplus /circleminus /.notdef /.notdef +/circlemultiply /circledivide /circledot /circlecopyrt /openbullet +/bullet /equivasymptotic /equivalence /reflexsubset /reflexsuperset +/lessequal /greaterequal /precedesequal /followsequal /similar +/approxequal /propersubset /propersuperset /lessmuch /greatermuch +/precedes /follows /arrowleft /spade /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +] def + +%%EndProcSet +%%BeginProcSet: aae443f0.enc +% Thomas Esser, Dec 2002. public domain +% +% Encoding for: +% cmmi10 cmmi12 cmmi5 cmmi6 cmmi7 cmmi8 cmmi9 cmmib10 +% +/TeXaae443f0Encoding [ +/Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi /Omega +/alpha /beta /gamma /delta /epsilon1 /zeta /eta /theta /iota /kappa +/lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon /phi /chi /psi +/omega /epsilon /theta1 /pi1 /rho1 /sigma1 /phi1 /arrowlefttophalf +/arrowleftbothalf /arrowrighttophalf /arrowrightbothalf /arrowhookleft +/arrowhookright /triangleright /triangleleft /zerooldstyle /oneoldstyle +/twooldstyle /threeoldstyle /fouroldstyle /fiveoldstyle /sixoldstyle +/sevenoldstyle /eightoldstyle /nineoldstyle /period /comma /less /slash +/greater /star /partialdiff /A /B /C /D /E /F /G /H /I /J /K /L /M /N +/O /P /Q /R /S /T /U /V /W /X /Y /Z /flat /natural /sharp /slurbelow +/slurabove /lscript /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o /p +/q /r /s /t /u /v /w /x /y /z /dotlessi /dotlessj /weierstrass /vector +/tie /psi /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/space /Gamma /Delta /Theta /Lambda /Xi /Pi /Sigma /Upsilon /Phi /Psi +/.notdef /.notdef /Omega /alpha /beta /gamma /delta /epsilon1 /zeta /eta +/theta /iota /kappa /lambda /mu /nu /xi /pi /rho /sigma /tau /upsilon +/phi /chi /psi /tie /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef +/.notdef /.notdef /.notdef /.notdef /.notdef +] def + +%%EndProcSet +%%BeginProcSet: texps.pro +%! +TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2 +index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll +exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]FontType 0 +ne{/Metrics exch def dict begin Encoding{exch dup type/integertype ne{ +pop pop 1 sub dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get +div def}ifelse}forall Metrics/Metrics currentdict end def}{{1 index type +/nametype eq{exit}if exch pop}loop}ifelse[2 index currentdict end +definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{dup +sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 roll +mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def dup[ +exch{dup CharStrings exch known not{pop/.notdef/Encoding true def}if} +forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def}def +end + +%%EndProcSet +%%BeginFont: CMSY8 +%!PS-AdobeFont-1.1: CMSY8 1.0 +%%CreationDate: 1991 Aug 15 07:22:10 +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. +11 dict begin +/FontInfo 7 dict dup begin +/version (1.0) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMSY8) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.035 def +/isFixedPitch false def +end readonly def +/FontName /CMSY8 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 0 /.notdef put +readonly def +/FontBBox{-30 -955 1185 779}readonly def +/UniqueID 5000818 def +currentdict end +currentfile eexec +D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964 +7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4 +A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85 +E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A +221A37D9A807DD01161779DDE7D5FC1B2109839E5B52DFBB2A7C1B5D8E7E8AA0 +5B10EA43D6A8ED61AF5B23D49920D8F79DAB6A59062134D84AC0100187A6CD1F +80F5DDD9D222ACB1C23326A7656A635C4A241CCD32CBFDF8363206B8AA36E107 +1477F5496111E055C7491002AFF272E46ECC46422F0380D093284870022523FB +DA1716CC4F2E2CCAD5F173FCBE6EDDB874AD255CD5E5C0F86214393FCB5F5C20 +9C3C2BB5886E36FC3CCC21483C3AC193485A46E9D22BD7201894E4D45ADD9BF1 +CC5CF6A5010B5654AC0BE0DA903DB563B13840BA3015F72E51E3BC80156388BA +F83C7D393392BCBC227771CDCB976E93302531886DDA73EBC9178917EFD0C20B +133F1E59A8222E5BFB551A83F4FA4E7575C4E9556A1CD08636CCD84A8CD68BC5 +B0B5FDB60A42D5268523571C380A40A2185DA33AFCEF07CF681C587F69335477 +0A535626330F01005AE0E22F4F056542904D0BC2735740435058364F3E7EAE12 +D6E8F8F33F9F6E5B5DC4B10CCE72C3A8B08746022ADDA3C1C47766E8BE936416 +3C4F26FA35AF5DA3F7D9F49E6A866FE2F2536512BF226E3CCD1C2B9ADF85B404 +6377DEB1E20508D3D0E69F244B91C1C736A1BE3815FDDAB369C55D99CDA5C82A +7873D8B378A3ED6E0D6C518B5F741029D946B0356249E3A6BCD013B7C829C503 +BA9D46A1C3CBD3FEC92F0C2D2207B273DC24E300E83AB9EED3EBBA394BE52DBA +35BA6B291F971A79BC60 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +%%EndFont +%%BeginFont: CMMI10 +%!PS-AdobeFont-1.1: CMMI10 1.100 +%%CreationDate: 1996 Jul 23 07:53:57 +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. +11 dict begin +/FontInfo 7 dict dup begin +/version (1.100) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMMI10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +end readonly def +/FontName /CMMI10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 0 /.notdef put +readonly def +/FontBBox{-32 -250 1048 750}readonly def +/UniqueID 5087385 def +currentdict end +currentfile eexec +D9D66F633B846A97B686A97E45A3D0AA0529731C99A784CCBE85B4993B2EEBDE +3B12D472B7CF54651EF21185116A69AB1096ED4BAD2F646635E019B6417CC77B +532F85D811C70D1429A19A5307EF63EB5C5E02C89FC6C20F6D9D89E7D91FE470 +B72BEFDA23F5DF76BE05AF4CE93137A219ED8A04A9D7D6FDF37E6B7FCDE0D90B +986423E5960A5D9FBB4C956556E8DF90CBFAEC476FA36FD9A5C8175C9AF513FE +D919C2DDD26BDC0D99398B9F4D03D5993DFC0930297866E1CD0A319B6B1FD958 +9E394A533A081C36D456A09920001A3D2199583EB9B84B4DEE08E3D12939E321 +990CD249827D9648574955F61BAAA11263A91B6C3D47A5190165B0C25ABF6D3E +6EC187E4B05182126BB0D0323D943170B795255260F9FD25F2248D04F45DFBFB +DEF7FF8B19BFEF637B210018AE02572B389B3F76282BEB29CC301905D388C721 +59616893E774413F48DE0B408BC66DCE3FE17CB9F84D205839D58014D6A88823 +D9320AE93AF96D97A02C4D5A2BB2B8C7925C4578003959C46E3CE1A2F0EAC4BF +8B9B325E46435BDE60BC54D72BC8ACB5C0A34413AC87045DC7B84646A324B808 +6FD8E34217213E131C3B1510415CE45420688ED9C1D27890EC68BD7C1235FAF9 +1DAB3A369DD2FC3BE5CF9655C7B7EDA7361D7E05E5831B6B8E2EEC542A7B38EE +03BE4BAC6079D038ACB3C7C916279764547C2D51976BABA94BA9866D79F13909 +95AA39B0F03103A07CBDF441B8C5669F729020AF284B7FF52A29C6255FCAACF1 +74109050FBA2602E72593FBCBFC26E726EE4AEF97B7632BC4F5F353B5C67FED2 +3EA752A4A57B8F7FEFF1D7341D895F0A3A0BE1D8E3391970457A967EFF84F6D8 +47750B1145B8CC5BD96EE7AA99DDC9E06939E383BDA41175233D58AD263EBF19 +AFC0E2F840512D321166547B306C592B8A01E1FA2564B9A26DAC14256414E4C8 +42616728D918C74D13C349F4186EC7B9708B86467425A6FDB3A396562F7EE4D8 +40B43621744CF8A23A6E532649B66C2A0002DD04F8F39618E4F572819DD34837 +B5A08E643FDCA1505AF6A1FA3DDFD1FA758013CAED8ACDDBBB334D664DFF5B53 +9560176676ABB71BBD0EE56B4CC492C0652750227CEC6CBEEE374709231B00CD +0DE83AFDE295B314F6C8B1FFD32251C1925D96A64D739FF1DA4926460B28B3DE +E949AA0BA3DDB16534FBA30C32092D5F712B5E8C8D5142F35AF2906E6C219D2C +7FD9A368C193E0EB9C7E25FF03C546B6ED993F964CEDB1B8537C617170787F37 +88D6F2AD02384B01067FE3F98257BAB958BB3BCD1001090A4502DA0638080EC6 +DB784CC8AC37CDC01B29BC481D6A05ADC6188785262358C1BF1D694BBF31C1F1 +AF117C1ACED44AAC6EB4B9A2511A6762DDE8FCCBA5 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +%%EndFont +%%BeginFont: CMSY10 +%!PS-AdobeFont-1.1: CMSY10 1.0 +%%CreationDate: 1991 Aug 15 07:20:57 +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. +11 dict begin +/FontInfo 7 dict dup begin +/version (1.0) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMSY10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.035 def +/isFixedPitch false def +end readonly def +/FontName /CMSY10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 0 /.notdef put +readonly def +/FontBBox{-29 -960 1116 775}readonly def +/UniqueID 5000820 def +currentdict end +currentfile eexec +D9D66F633B846A97B686A97E45A3D0AA052F09F9C8ADE9D907C058B87E9B6964 +7D53359E51216774A4EAA1E2B58EC3176BD1184A633B951372B4198D4E8C5EF4 +A213ACB58AA0A658908035BF2ED8531779838A960DFE2B27EA49C37156989C85 +E21B3ABF72E39A89232CD9F4237FC80C9E64E8425AA3BEF7DED60B122A52922A +221A37D9A807DD01161779DDE7D31FF2B87F97C73D63EECDDA4C49501773468A +27D1663E0B62F461F6E40A5D6676D1D12B51E641C1D4E8E2771864FC104F8CBF +5B78EC1D88228725F1C453A678F58A7E1B7BD7CA700717D288EB8DA1F57C4F09 +0ABF1D42C5DDD0C384C7E22F8F8047BE1D4C1CC8E33368FB1AC82B4E96146730 +DE3302B2E6B819CB6AE455B1AF3187FFE8071AA57EF8A6616B9CB7941D44EC7A +71A7BB3DF755178D7D2E4BB69859EFA4BBC30BD6BB1531133FD4D9438FF99F09 +4ECC068A324D75B5F696B8688EEB2F17E5ED34CCD6D047A4E3806D000C199D7C +515DB70A8D4F6146FE068DC1E5DE8BC57036431151EC603C8BCFE359BBD953AD +5F3D998C7A49AEF3CB6B1A9EB69F3CEA454AD2808F02492DD00C7050748656DA +5A3A67850F65A778D67EBCC7040722819412C6225B3188DD2D94DDE572362C17 +4F50D814C4EBB50F501DE84522460B812765DDAABC6A311FFB429457E6767CDA +983F330179AF9D598AEB9650568AD79307FB100555AB73B0929E428272550D22 +FBFA319BCE7F77420EFC9514634223E3BB29AD77E0B2A7D67B90AF5FEF8199FF +0109AF4F39A23E7860EFC6F83A1BEE01DA2F5092363C2FA05251FAB8B291517B +5806321FFA8B26906A5EECFE9CDD4949944E19B3504B268938BCAC03C2CE0CC5 +F4465CF1CF403B667113059AC5D340E30AE1825AA2829DA83196C33044E6023F +C1654A0861D138AE84F16B962C0122AC9345ED069B0D66F1B775F1D5E3CD3B +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark +%%EndFont +TeXDict begin 39158280 55380996 1000 600 600 (ru-refcard.dvi) +@start /Fa 242[71 13[{ TeXbbad153fEncoding ReEncodeFont }1 +66.4176 /CMSY8 rf +%DVIPSBitmapFont: Fb larm0800 8 56 +/Fb 56 241 df<123C127EB4FCA21380A2127F123D1201A312031300A25A1206120E5A5A +5A126009157A8714>44 D<B512C0A412047F9018>I<123C127E12FFA4127E123C08087A +8714>I<EB3FC0EBFFF03803E07C48487E48487E497E001EEB0780A2003E14C0A248EB03 +E0A500FC14F0B0007C14E0A3007E1307003E14C0A36CEB0F806C14006D5A3807C03E3803 +F0FC3800FFF0EB3FC01C2D7DAB23>48 D<130C133C137CEA03FC12FFEAFC7C1200B3B113 +FE387FFFFEA2172C7AAB23>I<EB7F803801FFF0380780FC380E003F48EB1F8048EB0FC0 +5A0060EB07E012F000FC14F07E1403A3007C1307C7FCA215E0140F15C0141F1580EC3F00 +147E147C5C495A495A495A495A011EC7FC5B5B4913305B485A4848136048C7FC000E14E0 +001FB5FC5A4814C0B6FCA21C2C7DAB23>I<EB3FC03801FFF03807C0FC380E007E487FEC +1F80003F14C0A2EB800F1300A2000C131FC7FC1580A2EC3F00143E5C5CEB03F0EBFFC014 +F0EB00FC143FEC1F8015C0140F15E0A2EC07F0A21238127C12FEA3EC0FE012F8006014C0 +0070131F6C1480001EEB3F00380780FC3801FFF038007FC01C2D7DAB23>I<000CEB0180 +380FC01F90B512005C5C14F014C0D80C7EC7FC90C8FCA8EB1FC0EB7FF8380DE07C380F80 +1F01001380000E130F000CEB07C0C713E0A2140315F0A4127812FCA448EB07E012E00060 +14C00070130F6C14806CEB1F006C133E380780F83801FFE038007F801C2D7DAB23>53 +D<1230123C003FB512F8A215F05A15E039700001C000601480140348EB0700140E140CC7 +121C5C143014705C495AA2495AA249C7FCA25B130E131EA2133EA3133C137CA413FCA913 +781D2E7CAC23>55 D<EB3F80EBFFF03803E0783807C03E48487E48487E003E1480140700 +7E14C0127C00FC14E01403A315F0A5007C1307127EA2003E130F7E6C131F3807803B3803 +E0F33800FFC390383F03E013001407A215C0A2140F001E1480003F14005C143E143C003E +5B001C5B380E03E03807FF80D801FEC7FC1C2D7DAB23>57 D<EE01C0EE0780EE1E001678 +ED01E0ED0780031EC7FC1578EC01E0EC0780021EC8FC1478EB01E0EB0780011EC9FC1378 +EA01E0EA0780001ECAFC127812E01278121EEA0780EA01E0EA0078131EEB0780EB01E0EB +0078141EEC0780EC01E0EC0078151EED0780ED01E0ED0078161EEE0780EE01C02A297AA4 +37>60 D<12E01278121EEA0780EA01E0EA0078131EEB0780EB01E0EB0078141EEC0780EC +01E0EC0078151EED0780ED01E0ED0078161EEE0780EE01C0EE0780EE1E001678ED01E0ED +0780031EC7FC1578EC01E0EC0780021EC8FC1478EB01E0EB0780011EC9FC1378EA01E0EA +0780001ECAFC127812E02A297AA437>62 D<4A7E4A7EA34A7EA24A7EA3EC1BF81419A2EC +30FCA2EC70FEEC607EA24A7EA349486C7EA2010380EC000FA201066D7EA3496D7EA2011F +B57EA29038180001496D7EA349147EA201E0147F4980A20001ED1F801203000716C0D80F +F0EC3FE0D8FFFC0103B5FCA2302F7EAE35>65 D<B612FCEDFF803A03F8000FC00001EC03 +F06F7E6F7E82167E167FA6167E16FE5E4B5A4B5AED0FE0ED7F8090B6C7FC16E09039F800 +03F0ED01FC6F7E167F821780161F17C0A61780163F17005E16FEED03FC0003EC0FF0B712 +C04BC7FC2A2D7DAC32>I<DA1FF013C09138FFFE01903903F00F8390390F8001E3013FC7 +1277017C143F4848141F4848140F48481407A248481403121F491401123F90C8FC481500 +A300FE1600AB127F17C0A27E7F001F15016D1580120F6C6C1403EE07006C6C14066C6C14 +0ED8007C5C013F147890390F8001E0903903F00FC0902600FFFEC7FCEC1FF02A2F7CAD33 +>I<B712FCA23903F800030001EC007C82161E160EA21606A31607821530A293C7FCA315 +70A2EC01F090B5FCA2EBF801EC0070A21530A217C0A39238000180A4160317005EA25E5E +167F0003EC01FEB7FCA22A2D7DAC30>69 D<B712FCA23903F800030001EC007C163E161E +160EA21606A3160716031518A21600A31538157815F890B5FCA2EBF800157815381518A5 +92C7FCAB487EB512F8A2282D7EAC2E>I<DA1FF013C09138FFFE01903903F00F8390390F +8001E3013FC71277017C143F4848141F4848140F48481407A248481403121F491401123F +90C8FC481500A300FE1600A992381FFFFEA2007F9138001FE0EE0FC0A27E7F121F7F120F +6C7EA26C7E6C6C141FEA007C013F143FD90F8013F3903903F007C10100B51200DA1FF813 +002F2F7CAD37>I<B512F0A23803FC006C5AB3B3A3487EB512F0A2142D7EAC19>73 +D<90387FFFF0A201001300147EB3AD123812FEA314FE5C1278387001F86C485A381E07E0 +3807FF80D801FCC7FC1C2E7DAC24>I<D8FFF8923807FFC06D5D0003EFF00000015F01BE +151BA2019F1533A3D98F801463A2D987C014C3A2D983E0EB0183A3D981F0EB0303A2D980 +F81306A3027C130CA26E1318A36E1330A291380F8060A2913807C0C0A3913803E180A291 +3801F300A3EC00FEA2157C487ED80FF04B7EB5D93801B512C0A23A2D7DAC41>77 +D<D8FFF8903803FFFC7F00019138003FC06DEC0F006D1406EBBF80A2EB9FC0EB8FE01387 +80EB83F8138180EB80FE147E147FEC3F80EC1FC0140F15E0EC07F0140315F8EC01FC1400 +15FE157FED3F86151F16C6ED0FE6150716F6ED03FE1501A21500167E163EA2486C141ED8 +0FF0140EB5FC16062E2D7DAC35>I<EC3FF0903801FFFE903907E01F8090391F8007E090 +393E0001F001FCEB00FC4848147E4848804848EC1F8049140F000F16C04848EC07E0A248 +C8EA03F0A24816F8A2007E1501A200FE16FCAA007FED03F8A36C16F06D1407001F16E0A2 +6C6CEC0FC06D141F000716806C6CEC3F006C6C147E6C6C5C017E495A90391F8007E09039 +07E01F80902601FFFEC7FC9038003FF02E2F7CAD37>I<B612F815FF3A03F8001FC00001 +EC07E0ED01F016F8ED00FC16FE167E167FA6167E16FE16FCED01F816F0ED07E0ED1FC090 +B6120015F801F8C8FCB2487EB512F0A2282D7DAC30>I<90383F80303901FFF0703807C0 +7C390F000EF0001E13074813034813011400127000F01470A315307EA26C1400127E127F +EA3FE013FE381FFFE06C13FC6C13FF00011480D8003F13E013039038003FF0EC07F81401 +140015FC157C12C0153CA37EA215787E6C14706C14F06CEB01E039F78003C039E3F00F00 +38E07FFE38C00FF01E2F7CAD27>83 D<007FB712F8A29039000FC003007C150000701638 +A200601618A200E0161CA248160CA5C71500B3A94A7E011FB512E0A22E2D7EAC33>I<B5 +39F003FFFCA2D803FCC7EA3FC06C48EC0F001606B3AB160E0000150C7F161C017C141801 +7E14386D5C6D146090390F8001E0903907E00380902601F80FC7FC9038007FFCEC0FF02E +2E7DAC35>I<13FF000713C0380F01F0381C00F8003F137C80A2143F001E7FC7FCA4EB07 +FF137F3801FE1FEA07F0EA1FC0EA3F80EA7F00127E00FE14065AA3143F7E007E137F007F +EBEF8C391F83C7FC390FFF03F83901FC01E01F207D9E23>97 D<EA07C012FFA2120F1207 +AC14FE9038C7FF809038CF03E09038DC01F09038F8007C49137E49133E497F1680A2150F +16C0A9ED1F80A216005D6D133E6D5B01B05B9038BC01F090380E07E0390607FF80260001 +FCC7FC222F7EAD27>I<EB1FE0EB7FFC3801F01E3803E0073907C01F80EA0F80EA1F005A +003EEB0F00007E90C7FCA2127C12FCA9127EA215C07E6C130101801380380FC0033907E0 +07003801F03E38007FF8EB1FC01A207E9E1F>I<15F8141FA214011400ACEB0FE0EB7FF8 +3801F81E3803E0073807C003380F8001EA1F00481300123E127EA25AA9127C127EA2003E +13017EEB8003000F13073903E00EFC3A01F03CFFC038007FF090391FC0F800222F7EAD27 +>I<EB1F80EBFFF03803E0783807C03E380F801E381F001FEC0F80123E007E130715C012 +7C12FCA3B6FCA200FCC8FCA5127EA2003E14C0123F6C1301390F80038001C013003803E0 +0F3801F03C38007FF8EB1FC01A207E9E1F>I<EB03F0EB0FFCEB3E1EEB7C3F13F8EA01F0 +A23803E00C1400AAB512E0A23803E000B3A6487E387FFF80A2182F7FAE16>I<013F13F8 +9038FFC3FE3903E1FF1E3807807C000F140C391F003E00A2003E7FA76C133EA26C6C5A00 +071378380FE1F0380CFFC0D81C3FC7FC90C8FCA3121E121F380FFFF814FF6C14C04814F0 +391E0007F848130048147C12F848143CA46C147C007C14F86CEB01F06CEB03E03907E01F +803901FFFE0038003FF01F2D7E9D23>I<EA07C012FFA2120F1207AC14FE9038C3FF8090 +38C703E09038DE01F013F8496C7EA25BA25BB2486C487E3AFFFE1FFFC0A2222E7EAD27> +I<EA0780EA0FC0EA1FE0A4EA0FC0EA0780C7FCA8EA07C012FFA2120F1207B3A5EA0FE0EA +FFFCA20E2E7EAD14>I<EA07C012FFA2120F1207ADEC1FFEA2EC0FF0EC07C05D020EC7FC +5C5C5C5CEBC3C013C7EBCFE0EBDFF013F9EBF0F8497EEBC07E143E80816E7E14076E7E81 +6E7E486C487E3AFFFE07FF80A2212E7EAD25>107 D<EA07C012FFA2120F1207B3B3A3EA +0FE0EAFFFEA20F2E7EAD14>I<2607C07FEB07F03BFFC3FFC03FFC903AC783F0783F3C0F +CE01F8E01F803B07DC00F9C00F01F8D9FF8013C04990387F000749137EA249137CB2486C +01FEEB0FE03CFFFE0FFFE0FFFEA2371E7E9D3C>I<3807C0FE39FFC3FF809038C703E039 +0FDE01F0EA07F8496C7EA25BA25BB2486C487E3AFFFE1FFFC0A2221E7E9D27>I<EB1FE0 +EB7FF83801F03E3803C00F3907800780390F0003C04814E0003EEB01F0A248EB00F8A300 +FC14FCA9007C14F8A26CEB01F0A26CEB03E0A2390F8007C03907C00F803901F03E003800 +7FF8EB1FE01E207E9E23>I<3807C0FE39FFC7FF809038CF03E0390FDC01F03907F800FC +49137E49133E49133FED1F80A3ED0FC0A8151F1680A2ED3F00A26D137E6D137C5D9038FC +01F09038CE07E09038C7FF80D9C1FCC7FC01C0C8FCA9487EEAFFFEA2222B7E9D27>I<38 +0781F038FF87FCEB9E7EEA0F98EA07B813B0EBF03CEBE000A35BB1487EB5FCA2171E7E9D +1B>114 D<3801FE183807FFB8381E01F8EA3C00481378481338A21418A27E7EB41300EA +7FF06CB4FC6C13C06C13F0000113F838001FFC130138C0007E143EA26C131EA27EA26C13 +3CA26C137838FF01F038E3FFC000C0130017207E9E1C>I<1360A413E0A312011203A212 +07121FB512F0A23803E000AF1418A714383801F03014703800F860EB3FE0EB0F80152A7F +A81B>I<D807C013F800FF131FA2000F130100071300B21401A314033803E007EC0EFC3A +01F81CFFC038007FF890391FE0F800221F7E9D27>I<3AFFFC01FFC0A23A0FE0007E0000 +07147C15380003143015706C6C1360A26C6C5BA390387C0180A26D48C7FCA2EB3F07EB1F +06A2EB0F8CA214DCEB07D8A2EB03F0A36D5AA26D5A221E7F9C25>I<3BFFFC3FFE07FFA2 +3B0FE003F001F801C09038E000F00007010114E0812603E00314C0A2913807F8012701F0 +06781380A29039F80E7C030000D90C3C1300A290397C181E06A2151F6D486C5AA2168C90 +391F600798A216D890390FC003F0A36D486C5AA36DC75A301E7F9C33>I<3AFFFC07FF80 +A23A0FF003FC000003EB01F0000114C06D485A000091C7FCEB7C06EB3E0E6D5A14B8EB0F +B0EB07E013036D7E497E1307EB067C497EEB1C1F01387FEB700F496C7E6E7ED803C07F00 +076D7E391FE003FC3AFFF007FFC0A2221D7F9C25>I<3AFFFC01FFC0A23A0FE0007E0000 +07147C1538000314306D137000011460A26C6C5BA2EBFC01017C5BEB7E03013E90C7FCA2 +EB1F06A2148EEB0F8CA2EB07D8A2EB03F0A36D5AA26D5AA2495AA2130391C8FC1278EAFC +06A25B131CEA7838EA7070EA3FE0EA0F80222B7F9C25>I<B9FCA2D803F8C7EA1FC00001 +1680B3B3A3486CEC3FC0B5D8F00FB5FCA2302D7DAC37>207 D<B512F814FF390FC01F80 +0007EB07E0140315F0A4EC07E0EC0FC0EC3F809038FFFC00809038C00F80EC03E0EC01F0 +EC00F815FCA5EC01F8A2EC03F0000FEB0FE0B61280ECFE001E1D7E9C23>226 +D<90B612E0A290390E007E00157C13061304130CAA5BA35BA21370136013E0485A485A00 +0FC7127E007FB612E0A2007CC7120300781401007014000060156000E01570A2481530A5 +24287F9C27>228 D<EB1F80EBFFF03803E0783807C03E380F801E381F001FEC0F80123E +007E130715C0127C12FCA3B6FCA200FCC8FCA5127EA2003E14C0123F6C1301390F800380 +01C013003803E00F3801F03C38007FF8EB1FC01A207E9E1F>I<EB1FE0EB7FF83801F03E +3803C00F3907800780390F0003C04814E0003EEB01F0A248EB00F8A300FC14FCA9007C14 +F8A26CEB01F0A26CEB03E0A2390F8007C03907C00F803901F03E0038007FF8EB1FE01E20 +7E9E23>238 D<3807C0FE39FFC7FF809038CF03E0390FDC01F03907F800FC49137E4913 +3E49133FED1F80A3ED0FC0A8151F1680A2ED3F00A26D137E6D137C5D9038FC01F09038CE +07E09038C7FF80D9C1FCC7FC01C0C8FCA9487EEAFFFEA2222B7E9D27>240 +D E +%EndDVIPSBitmapFont +/Fc 197[23 58[{ TeXaae443f0Encoding ReEncodeFont }1 83.022 +/CMMI10 rf /Fd 145[42 3[23 106[{ TeXbbad153fEncoding ReEncodeFont }2 +83.022 /CMSY10 rf +%DVIPSBitmapFont: Fe lati1000 10 6 +/Fe 6 115 df<14F8EB07FE90381F871C90383E03FE137CEBF801120148486C5A485A12 +0FEBC001001F5CA2EA3F801403007F5C1300A21407485C5AA2140F5D48ECC1C0A2141F15 +831680143F1587007C017F1300ECFF076C485B9038038F8E391F0F079E3907FE03FC3901 +F000F0222677A42A>97 D<147F903803FFC090380FC1E090381F0070017E137849133839 +01F801F83803F003120713E0120FD81FC013F091C7FC485AA2127F90C8FCA35A5AA45AA3 +153015381578007C14F0007EEB01E0003EEB03C0EC0F806CEB3E00380F81F83803FFE0C6 +90C7FC1D2677A426>99 D<EC07C0EC3FF09138FC38E0903901F01FF0EB03E0903807C00F +EB0F80011F1307D93F0013E05B017E130F13FE4914C01201151F1203491480A2153F1207 +491400A25DA249137EA215FEA25D00031301140314076C6C485A0000131FEB787BEB3FF3 +90380FC3F0EB00031407A25DA2140F5D121C007E131F5D00FE49C7FC147E5C387801F838 +7C07E0381FFF80D803FEC8FC24367CA426>103 D<EB03F0EA01FFA3EA00075CA3130F5C +A3131F5CA3133F91C8FCA35B90387E07F0EC1FFCEC783E9038FFE01F02C01380EC800F14 +00485A16C05B49EB1F8012035BA2153F000715005BA25D000F147E5B15FE5D121FD98001 +131C15F8163C003F01031338010013F0A216704814E0007E15F016E0EDE1C000FE903801 +E38048903800FF000038143C263B7BB92A>I<D801E013FE3A07F803FF803A0E3C0F07C0 +3A1E3E3C03E0261C1F787F39383FF00114E0007813C000708114804A485AEAF07FEAE07E +A20000140701FE5C5BA2150F00015D5B151F5E12034990383F8380160316070007027F13 +0049137EA2160E000F147C49141E161C5E001FEC3C7849EB1FE00007C7EA0780292679A4 +2F>110 D<3903C003F0390FF01FFC391E783C0F381C7C703A3C3EE03F8038383FC0EB7F +800078150000701300151CD8F07E90C7FCEAE0FE5BA2120012015BA312035BA312075BA3 +120F5BA3121F5BA3123F90C9FC120E212679A423>114 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Ff labx1000 10 36 +/Ff 36 256 df<B61280A819087F9620>45 D<EE7F80ED7FFFA4150381AF903801FF8101 +0F13F1013F13FD9038FFC07F0003EB001FD807FC1307000F8048487F5B123FA2485AA312 +FFAA127FA27F123FA26C6C5B000F5C6C6C5B6C6C4913C02701FF80FD13FE39007FFFF901 +1F13E1010113012F3A7DB935>100 D<903803FF80011F13F0017F13FC3901FF83FE3A03 +FE007F804848133F484814C0001FEC1FE05B003FEC0FF0A2485A16F8150712FFA290B6FC +A301E0C8FCA4127FA36C7E1678121F6C6C14F86D14F000071403D801FFEB0FE06C9038C0 +7FC06DB51200010F13FC010113E025257DA42C>I<EC1FF0903801FFFC010713FF90391F +F87F8090383FE0FFD9FFC113C0A2481381A24813016E1380A2ED3E0092C7FCA8B6FCA400 +0390C8FCB3ABB512FEA4223A7DB91D>I<01FEEB7FC000FF903803FFF8020F13FE91381F +03FFDA3C011380000713780003497E6D4814C05CA25CA291C7FCB3A3B5D8FC3F13FFA430 +257DA435>110 D<01FFEC3FC0B5EB3FFFA4000714016C80B3A35DA25DA26C5C6E4813E0 +6CD9C03E13FF90387FFFFC011F13F00103138030257DA435>117 +D<EB3FFE0003B512E0000F14F8391FF00FFE003FEB03FF6D6C7F6E7FA26F7EA26C5A6C5A +EA0380C8FCA2EC3FFF010FB5FC137F3901FFF87F00071380380FFE00EA3FF85B485A12FF +5BA415FF6D5A127F263FF00713F83B1FFC1FBFFFC0390FFFFE1F0003EBF80F39003FE003 +2A257DA42E>224 D<163EED03FEEC01FF147F0107B5FC011F5C137F48B65A485D4815C0 +4802F8C7FC02C0C8FCD81FFCC9FC13F0485A5B5B90CAFC127EA2127C903801FFC0010F13 +F8D8787F13FF26F8FF807F3AFBFE003FE0B4486D7E496D7E496D7EA28249130382A31780 +A9007F1600A3003F5D6D1307001F5DA26C6C495A6C6C495A6C6C495A6C6C6CB45A6C6CB5 +C7FC011F13FC010113C0293A7DB930>I<B612FCEDFFC016F000039038001FF86F7E6F7E +A26F7EA44B5AA2ED1FFCED7FF091B512C093C7FC16E09138000FF86F7E6F7E6F7E178017 +C0A617805D17004B5AED1FFCB75A16E093C7FC2A257EA430>I<B712E0A30003EB003F15 +0F15071503150116F0A21500A51600B3B512FEA324257EA429>I<010FB712C0A3903B00 +7C003FF0001478AB1470A214F0A35C1301A25C1303A2495AA249C7FC5B133E5B5B485A00 +7FB812E0A301E0C8127F90C9120F007E1607007C1603A248EE01F0A3481600A5343280A4 +35>I<903803FF80011F13F0017F13FC3901FF83FE3A03FE007F804848133F484814C000 +1FEC1FE05B003FEC0FF0A2485A16F8150712FFA290B6FCA301E0C8FCA4127FA36C7E1678 +121F6C6C14F86D14F000071403D801FFEB0FE06C9038C07FC06DB51200010F13FC010113 +E025257DA42C>I<D83FFF013FB5EB3FFFA3D803FE010001C0EB1FF0000019C0017F4D5A +D91FC004FEC7FC6D6C4B5A6D6C4B5AD901FCED0FE06D6C4B5A023F4BC8FCDA1FC014FE6E +6CEBC1FC6F13C303FC13CF4A6CEBDFFE4AB7FC4A82DAFFEF01FD7F4901E301F17F4901C1 +01E07F0380EBC07F49496E7E49486F7E49486F7E49486F7E017F844A8149486F7F48496F +7F4849707E4890C76F7E4885B5D8E03FD9FF01B512C0A34A257EA44F>I<38701FFF007C +B512F0007F14FE9038E00FFFD98001138090C713C0127E007CEC7FE0A21278A2C8EAFFC0 +5C4A1300EC0FFE90383FFFF815C015F89038000FFE913803FF80020013C0A2ED7FE016F0 +A412F07E007815E015FF007C15C06C01031380261FC00F13006CB512FC000314F0C66C90 +C7FC24257EA42A>I<B5D8FC3FB5FCA3000390C713C0A25D5DA25D5D5D151E5D157C1578 +5D4A5AA24A5A4A5AA24A5A141E143E143C5C14F85C5C5CA25C91C7FCA2B5D8FC3F13FFA3 +30257EA435>I<90390F8001F090391FE007F8496C487E017F80ECF81FA4ECF00F013F5C +ECE0076D486C5A6DB55A010314C0010091C7FCEC1FF891C9FCA4B5D8FC3FB5FCA3000390 +C713C0A25D5DA25D5D5D151E5D157C15785D4A5AA24A5A4A5AA24A5A141E143E143C5C14 +F85C5C5CA25C91C7FCA2B5D8FC3F13FFA330397EB835>I<B500FCEBFFFCA3000390C7EA +7FC0170016FEED03F84B5A4B5AED3F804BC7FC15FCEC03F84A5A140F143F4A7E4A7E81EC +F7FF02C77F02837F14016E7F6F7E6F7E6F7E82150F6F7E6F13806F13C06F13E017F0B5D8 +FC0713FFA330257EA435>I<011FB71280A3903B00F8007FE0005CB3A3EA1E01123F387F +81E0EAFFC113C3A2EBC7C0138F6CB45A6CD9001FB512806C5AEA0FF831257FA435>I<B5 +6C91387FFF806E91B5FC5E00036DEDE000A2EE03BFEBDFF0EE073FEBCFF8160EEBC7FC16 +1CA2EBC3FE1638EBC1FF167001C0138016E0EC7FC0EDC1C0A2EC3FE1EDE380EC1FF3EDF7 +006EB4FC5D1407A25D14035D3807E001B5D9F00FB51280140015E039257DA440>I<B5D8 +FC3FB5FCA3000390C713C0AC91B6FCA391C7FCB0B5D8FC3F13FFA330257EA435>I<9038 +01FFC0010F13F8017F13FFD9FF807F3A03FE003FE048486D7E48486D7E48486D7EA2003F +81491303007F81A300FF1680A9007F1600A3003F5D6D1307001F5DA26C6C495A6C6C495A +6C6C495A6C6C6CB45A6C6CB5C7FC011F13FC010113C029257DA430>I<B9FCA3000390C7 +13C0B3ADB5D8FC3F13FFA330257EA435>I<9039FF01FF80B5000F13F0023F13FC9138FE +07FFDAF00113800007496C13C06C0180EB7FE091C713F0EE3FF8A2EE1FFCA3EE0FFEAA17 +FC161FA217F8163F17F06E137F6E14E06EEBFFC0DAF00313809139FC07FE0091383FFFF8 +020F13E0020390C7FC91C9FCACB512FCA42F357EA435>I<903801FFC0010F13FC017F13 +FFD9FF8013802603FE0013C048485AEA0FF8121F13F0123F6E13804848EB7F00151C92C7 +FC12FFA9127FA27F123FED01E06C7E15036C6CEB07C06C6C14806C6C131FC69038C07E00 +6DB45A010F13F00101138023257DA42A>I<007FB612FEA301811381D87E01EB807E007C +153E0078151EA200F8151FA200F0150FA500001500B348B61280A328257EA42D>I<B539 +F001FFF8A3000790C7EA3F806CED1F00161E6E133E6C153C6E137C6C15786E13F8017F5C +ECF001013F5C14F8011F495AA2ECFC07010F5CECFE0F010791C7FC6E5A6D131E15BE6D13 +BC15FC6D5BA36E5AA26E5AA26E5AA26E5AA292C8FCA25C141E003F133E387F803C38FFC0 +7C147814F8EBC1F0EBC3E06C485A387D1F80D83FFFC9FCEA1FFCEA07F02D357EA432>I< +ED01FEEC01FFA4EC000F1507AFDAFF87EB1FF0010F01E7EB7FFF013F90B712C09026FFE0 +7F9038E07FF00003D9801F9038801FFC48496C496C7E48486D486D7E4848701380498200 +3F19C04982007F19E0A34848EF7FF0A96C6CEFFFE0A3003F19C06D5E001F19806D5E6C6C +496C4913006C6C4C5A6C6D486D485AC6D9E07F9038E07FF0013FB812C0010F9026E7FE7F +90C7FC01000187EB1FF0DA000790C9FCAC4AB512F8A4444A7DB94B>I<B539F01FFFF0A3 +000790390003FE006C90388001F06C6D485A6C1407D97FE05B6D6C485A6E48C7FC90381F +FC3E010F5B903807FEFC6D6C5A5D6D5B6D5B6E7E6E7E814A7EA24A7E903801F3FFD903E3 +7FD907C17FEB0FC049486C7E4A6C7E013E80496D7E49130F00016E7ED807FC80B5013F13 +F8A32D257EA432>I<B5D8FC3FB5FCA3000390C713C0B3ADB91280A3C91201EE003F171F +170FA2EF07C0A31703A532327EA435>I<B5D8FC3FB5FCA3000390C713C0AD6C6D5A6C14 +0F90387FC07F90383FFFFE010F13F00101138090C8FCAC033F13FFA330257EA435>I<B5 +D8FC3FB5000FB512C0A3000390C7903AC0003FF000B3ADBC12E0A3CD127F1A0F1A071A03 +A2F201F0A31A00A54C327EA44F>249 D<007FB512F0A301811380EA7E01127C1278A212 +F8A212F0A5000091B5FC17F017FC9238801FFEEE07FF7013807013C0A27013E0A64C13C0 +A24C13804C1300EE1FFE017F90B55A17F094C7FC33257EA439>I<B500FC023FB5FCA300 +0390C913C0ACECFFFEEDFFE016F89138003FFCED0FFE6F7E6F7FA26F7FA64B5BA24B5B4B +5AED3FFCB7D8F83F13FF16E0EDFE0040257EA445>I<B512FCA3000390C9FCACECFFFEED +FFE016F89138003FFCED0FFE6F7E6F1380A26F13C0A64B1380A24B13004B5AED3FFCB75A +16E04BC7FC2A257EA430>I<B500FCECFFE0040713FC043FEBFF80000390C7397FC07FC0 +923A01FF001FF04B486D7E4B486D7E4B486D7EA2031F814C7F033F1680A3037F16C091B5 +FCA3EC007FA5033F1680A3031F1600705B030F5DA26F6C495A6F6C495A6F6C495A6F9038 +C07FE0B500FC013FB51280040F49C7FC040013E042257EA448>254 +D<49B612F8133F90B7FC00039039C007FE003807FE00120F5B121FA5120F6C7E6C7E6C13 +E06C6CB5FC131F13004913E715C74913875B491307EB1FFE14FC133FEB7FF8EBFFF04813 +E0A24813C0481380121FB500F1B512F8A32D257EA432>I E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fg latt1000 10 75 +/Fg 75 126 df<130EEB3F80497E3801FFF0487F000F13FE381FFBFFD87FF113C039FFC0 +7FE0EB803F38FE000F007CEB07C0007813031B0D77B42D>2 D<007FB512F0B612F8A36C +14F01D0579942C>21 D<121FEA3F80EA7FC0EAFFE0B0EA7FC0AEEA1F00C7FCA7121FEA3F +80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F000B3470B32C>33 D<003C131E007F137F481480 +A66C1400A6007E7FA6003E133EA3003C131E001C131C191977B32C>I<0107131C90380F +803EA8011F137EEC007CA4003FB612E0B712F8A43A003E00F800A2EB7E01017C5BA8EBFC +0301F85BA2B712F8A4003F15E03A01F007C000A30003130F01E05BA86C486CC7FC25337D +B22C>I<EB01C0497EA6EB0FFC90387FFF8048B512E00007804880391FFBEFFC393FC3E1 +FE903803E07F007E80127C00FC158012F8157FA300FCEC3F00A2007E91C7FC127FEA3FC3 +13FBEA1FFF6C13FC6C13FF000114C06C6C7F011F13F801037F14E7ECE1FEECE07F810018 +80007E1580150F12FFA312FE151F1600007E5C007F143ED83F8313FE9038C3E1FC391FFB +EFF86CB55A6C5C6C5CC691C7FCEB1FF8EB03E0A66D5A21417BB92C>I<D807801307D81F +E0EB0F80151F487E486C133F1600007C5CD8FCFC137EEAF87C15FE5D14015DA21403D8FC +FC5BEA7CF8007F13075D383FF00FD81FE05BA23807801FC75B143F92C7FCA25C147E14FE +5CA213015CA213035C13075CA2130F5C131FEC800FED3FC0013FEB7FE0140049EBFFF001 +7E13F9A2D9FE0113F801FC13F0A2120113F8120313F015F90007010013F05B000F14FF49 +EB7FE0A20007EC3FC06C48EB0F0025417DB92C>I<EA0F80EA1FE0EA3FF0127F13F8A213 +FCA2123F121F120FEA007CA313FC13F8A2120113F01203EA07E0A2EA0FC0EA3F80127FEA +FF005A12F812700E1D71B22C>39 D<143814FC13011303EB07F8EB0FF0EB1FC0EB3F80EB +7F0013FE485A485A5B12075B120F5B485AA2123F90C7FCA25A127EA312FE5AAC7E127EA3 +127F7EA27F121FA26C7E7F12077F12037F6C7E6C7E137FEB3F80EB1FC0EB0FF0EB07F8EB +03FC130113001438164272B92C>I<127012FC7E7E6C7E6C7EEA0FE06C7E6C7E6C7E6C7E +137F7F1480131F14C0130FEB07E0A214F01303A214F81301A314FC1300AC130114F8A313 +0314F0A2130714E0A2EB0FC0131F1480133F14005B13FE485A485A485A485AEA3FC0485A +48C7FC5A5A1270164279B92C>I<EB0380497EA60020140800F8143E00FE14FE00FF13C1 +EBC7C7EBE7CF003FB512F8000F14E0000314806C140038007FFCA248B5FC481480000F14 +E0003F14F839FFE7CFFEEBC7C7EB07C100FE13C000F8143E0020140800001400A66D5A1F +247AAA2C>I<147014F8AF003FB612E0B712F8A4C700F8C7FCB0147025267DAB2C>I<EA0F +80EA1FE0EA3FF0EA7FF8A213FCA3123F121F120F120013F8A21201EA03F01207EA1FE0EA +7FC0EAFF80130012FC12700E17718A2C>I<007FB512F0B612F8A36C14F01D0579942C>I< +121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F000B0B708A2C>I<1507ED0F80A2151F +16005D153E157E157CA215FC5D14015D14035D14075D140F5D141F92C7FC5C143EA2147E +147C14FC5C13015C13035C13075C130F5C131F91C8FC5B133EA2137E137C13FC5B12015B +12035B12075B120F5B121F90C9FCA25A123E127E127C12FC5AA2127021417BB92C>I<EB +03F8EB0FFE90383FFF80497F90B57E3901FE0FF03903F803F848486C7EEBE0004848137E +A248487FA248C7EA1F80A2003E140F007E15C0A3007C140700FC15E0AC6C140F007E15C0 +A46CEC1F80A36C6CEB3F00A26C6C137E6D13FE00075CEBF0016C6C485A3901FE0FF06CB5 +5A6D5B6D5BD90FFEC7FCEB03F823357CB32C>I<1307497EA2131FA2133F137F13FF5A12 +07127FB5FC13DF139FEA7C1F1200B3AE007FB512E0B612F0A36C14E01C3477B32C>I<EB +0FF890387FFF8048B512E00007804814FC391FF80FFE393FE001FF903880007F48C7EA3F +80007E141F00FE15C0150F6C15E01507A3127E123CC8FCA2150F16C0151F1680153F1600 +5D15FE4A5A14034A5A4A5A4A5A4A5AECFF804948C7FC495A495A495AEB3FE0EB7F8049C8 +FC485A4848EB03C04848EB07E0EA1FE0485A48B6FCB7FCA36C15C023347CB32C>I<EB0F +FC90387FFF8048B512E0000714F84880391FF807FEEBC0004848137F6D7F1680151FA26C +5A6CC7FCC8FC153F16005D15FE14014A5AEC1FF890381FFFF0495BA215F86D7F90380007 +FEEC00FF81ED3F80ED1FC0150FA216E01507A2123C127EB4FC150F16C0A248141F007FEC +3F806DEB7F006C6C5B391FF807FE6CB55A6C5C6C14E0C66C1380D90FFCC7FC23357CB32C +>I<EC07F04A7E141F143FA2147EA214FCEB01F8A2EB03F0EB07E0A2EB0FC0EB1F80A2EB +3F00137EA25B485AA2485A5B1207485AA2485A48C7FCA2127E5AB712FC16FEA36C15FCC8 +EAF800AA91387FFFF091B512F8A36E13F027347EB32C>I<000FB512FE4880A35D0180C8 +FCADEB83FE90389FFF8090B512E015F8819038FE03FE9038F000FF01C07F49EB3F8090C7 +121F6C15C0C8120FA2ED07E0A4123C127EB4FC150F16C0A248141F007EEC3F80007FEC7F +006C6C5B6D485A391FF80FFC6CB55A6C5C000114C06C6C90C7FCEB0FF823347CB22C>I< +121FEA3F80EA7FC0EAFFE0A5EA7FC0EA3F80EA1F00C7FCAE121FEA3F80EA7FC0EAFFE0A5 +EA7FC0EA3F80EA1F000B2470A32C>58 D<1502ED0F80151F157F15FF913803FE00EC0FFC +EC1FF0EC7FE0ECFF80D903FEC7FC495AEB1FF0495AEBFF80000390C8FCEA07FCEA1FF8EA +3FE0EAFF8090C9FCA27FEA3FE0EA1FF8EA07FC6CB4FCC67FEB3FE06D7EEB07FC6D7E9038 +00FF80EC7FE0EC1FF0EC0FFCEC03FE913800FF80157F151F150FED0200212A7BAD2C>60 +D<122012F87EB4FC7FEA3FE0EA1FF8EA07FC6CB4FCC67FEB3FE06D7EEB07FC6D7E903800 +FF80EC7FE0EC1FF0EC0FFCEC03FE913800FF80157FA215FF913803FE00EC0FFCEC1FF0EC +7FE0ECFF80D903FEC7FC495AEB1FF0495AEBFF80000390C8FCEA07FCEA1FF8EA3FE0EAFF +8090C9FC12FC5A1220212A7BAD2C>62 D<EB3FFE0003B512C0000F14F04814FC4880397F +E007FF90C7FC00FEEC3F806C141FA3153F007EEC7F00003C5CC7EA03FEEC0FFC4A5AEC3F +E04A5A4AC7FC495A495A5C13075C130F5CA76D5A90C9FCA8EB0380EB0FE0A2497EA36D5A +A2EB038021337BB22C>I<EC7F80903803FFE0010F7F013F7F497F9038FFC0FE3901FE00 +7FD803F87F4848EB1F809038E00FCF390FC03FFF48484813C091B5FCEA3F01393E03F87F +903907F03FE0007EEBE01F397C0FC00FEC8007A2EAFC1F00F8EB0003A900FCEB8007D87C +0F14C0A2ECC00F3A7E07E01F80003EEBF03F903903F87F00393F01FFFED81F805B6E5A6C +6C6C5A3907E00FC09039F00007C06C6CEB0FE0D801FE131F3900FFC0FF6DB512C06D1480 +010FEBFE00010313F89038007FC023337CB22C>I<14FE497EA4497FA214EFA2130781A2 +14C7A2010F7FA314C390381F83F0A590383F01F8A490387E00FCA549137E90B512FEA348 +80A29038F8003FA34848EB1F80A4000715C049130FD87FFEEBFFFC6D5AB514FE6C15FC49 +7E27347EB32C>I<007FB512E015F8B612FE6C8016C03903F0003FED0FE0ED07F01503A2 +ED01F8A6ED03F0A21507ED0FE0ED1FC0EDFF8090B612005D5D15FF16C09039F0001FE0ED +07F0ED03F81501ED00FCA216FE167EA616FE16FC1501ED03F8150FED3FF0007FB612E016 +C0B712806CECFE0015F027337FB22C>I<02FF13700107EBE0F84913F9013F13FD4913FF +EBFF813901FE007F4848131FD807F0130F1507485A491303485A150148C7FCA25A007EEC +00F01600A212FE5AAB7E127EA3007F15F06CEC01F8A26C7EA26C6C13036D14F06C6C1307 +16E0D803FC131F6C6CEB3FC03A00FF81FF806DB512006D5B010F5B6D13F0010013802535 +7DB32C>I<007FB5FCB612C015F0816C803907E003FEEC00FFED7F80153FED1FC0ED0FE0 +A2150716F0150316F81501A4ED00FCACED01F8A3150316F0A2150716E0150FED1FC0153F +ED7F80EDFF00EC03FE007FB55AB65A5D15C06C91C7FC26337EB22C>I<007FB612F0B712 +F8A37E3903F00001A7ED00F01600A4EC01E04A7EA490B5FCA5EBF003A46E5A91C8FCA516 +3C167EA8007FB612FEB7FCA36C15FC27337EB22C>I<007FB612F8B712FCA37ED803F0C7 +FCA716781600A515F04A7EA490B5FCA5EBF001A46E5A92C7FCAD387FFFE0B5FC805C7E26 +337EB22C>I<903901FC038090390FFF87C04913EF017F13FF90B6FC4813073803FC0149 +7E4848137F4848133F49131F121F5B003F140F90C7FCA2127EED078092C7FCA212FE5AA8 +913803FFF84A13FCA27E007E6D13F89138000FC0A36C141FA27F121F6D133F120F6D137F +6C7E6C6C13FF6D5A3801FF076C90B5FC6D13EF011F13CF6DEB0780D901FCC7FC26357DB3 +2C>I<387FFFE0B57EA36C5BD803F0C8FCB3AE16F0ED01F8A8007FB6FCB7FCA36C15F025 +337DB22C>76 D<D87FE0EB0FFC486CEB1FFEA26D133F007F15FC000F15E001BC137BA401 +9E13F3A3EB9F01A2018F13E3A21483A2018713C314C7A201831383A214EFA201811303A2 +14FFEB80FEA3147C14381400ACD87FF0EB1FFC486CEB3FFEA36C48EB1FFC27337EB22C> +I<007FB512C0B612F88115FF6C15802603F00013C0153FED0FE0ED07F0A2150316F81501 +A6150316F01507A2ED0FE0ED3FC015FF90B61280160015FC5D15C001F0C8FCB0387FFF80 +B57EA36C5B25337EB22C>80 D<387FFFFCB67E15E015F86C803907E007FE1401EC007F6F +7E151FA26F7EA64B5AA2153F4BC7FCEC01FE140790B55A5D15E081819038E007FCEC01FE +1400157F81A8160FEE1F80A5D87FFEEB1FBFB5ECFF00815E6C486D5AC8EA01F029347EB2 +2C>82 D<90381FF80790B5EA0F804814CF000714FF5A381FF01F383FC003497E48C7FC00 +7E147F00FE143F5A151FA46CEC0F00007E91C7FC127F7FEA3FE0EA1FFCEBFFC06C13FC00 +03EBFFC06C14F06C6C7F01077F9038007FFEEC07FF02001380153FED1FC0A2ED0FE0A200 +78140712FCA56CEC0FC0A26CEC1F806D133F01E0EB7F009038FE01FF90B55A5D00F914F0 +D8F83F13C0D8700790C7FC23357CB32C>I<007FB612FCB712FEA43AFC007E007EA70078 +153CC71400B3AF90383FFFFCA2497F6D5BA227337EB22C>I<D87FF0EB07FF486C491380 +A36C486D1300001FC8127CA46C6C5CA76C6C495AA4143E147FA33A03E0FF83E0A214F7A2 +01E113C3A3000101E35BA201F113C701F313E7A314C1A200005DA201F713F71480A301FF +13FF017F91C7FC4A7EA4013E133E29347FB22C>87 D<387FFFFCB512FEA314FC00FCC7FC +B3B3B3B512FC14FEA36C13FC17416FB92C>91 D<127012F8A27E127C127E123E123F7EA2 +7F120F7F12077F12037F12017F12007F137C137E133EA2133F7F80130F80130780130380 +130180130080147C147E143EA2143F8081140F81140781140381140181140081157CA215 +7E153E153F811680150FA2ED070021417BB92C>I<387FFFFCB512FEA37EC7127EB3B3B3 +387FFFFEB5FCA36C13FC17417DB92C>I<007FB6FCB71280A46C150021067B7D2C>95 +D<1338137CEA01FC1203EA07F813F0EA0FC0EA1F80A2EA3F00123E127E127CA212FC5AA3 +EAFFC013E013F013F8A2127FA2123F13F0EA1FE0EA07C00E1D72B82C>I<3801FFF00007 +13FE001F6D7E15E048809038C01FF81407EC01FC381F80000006C77EC8127EA3ECFFFE13 +1F90B5FC1203120F48EB807E383FF800EA7FC090C7FC12FE5AA47E007F14FEEB8003383F +E01F6CB612FC6C15FE6C14BF0001EBFE1F3A003FF007FC27247CA32C>I<EA7FF0487EA3 +127F1201AAEC1FE0ECFFF801FB13FE90B6FC16809138F07FC09138801FE091380007F049 +EB03F85BED01FC491300A216FE167EA816FE6D14FCA2ED01F86D13036DEB07F0150F9138 +801FE09138E07FC091B51280160001FB5B01F813F83900F03FC027337FB22C>I<903803 +FFE0011F13F8017F13FE48B5FC48804848C6FCEA0FF0485A49137E4848131890C9FC5A12 +7EA25AA8127EA2127F6C140F6DEB1F806C7E6D133F6C6CEB7F003907FE03FF6CB55A6C5C +6C6C5B011F13E0010390C7FC21247AA32C>I<EC0FFE4A7EA380EC003FAAEB07F8EB3FFE +90B512BF4814FF5A3807FC0F380FF00348487E497E48487F90C7FC007E80A212FE5AA87E +007E5CA2007F5C6C7E5C6C6C5A380FF0073807FC1F6CB612FC6CECBFFE6C143FEB3FFC90 +390FF01FFC27337DB22C>I<EB03FE90381FFFC0017F13F048B57E48803907FE03FE390F +F800FFD81FE0EB3F805B4848EB1FC090C7120F5A007E15E015075AB7FCA416C000FCC9FC +7E127EA2127F6CEC03C06DEB07E06C7ED80FF0130F6C6CEB3FC001FF13FF000190B51280 +6C1500013F13FC010F13F00101138023247CA32C>I<EC0FF8EC3FFE91B5FC4914805B90 +3807FC7F14F090390FE03F0014C092C7FCA6007FB512FEB7FCA36C5C26000FC0C7FCB3A8 +003FB512F04880A36C5C21337DB22C>I<ED03F8903907F80FFC90391FFE3FFE017FB6FC +48B7FC48ECFE7F9038FC0FF82607F003133E3A0FE001FC1CD9C0001300001F8049137EA6 +6D13FE000F5CEBE0016C6C485A3903FC0FF048B5FC5D481480D99FFEC7FCEB87F80180C8 +FCA37F6C7E90B512F06C14FE48ECFF804815E04815F03A3FC0001FF848C7EA03FC007E14 +00007C157C00FC157E48153EA46C157E007E15FCD87F801303D83FE0EB0FF8D81FFCEB7F +F06CB612E0000315806C1500D8003F13F8010713C028387EA42C>I<EA7FF0487EA3127F +1201AAEC1FE0EC7FFC9038F9FFFE01FB7F90B6FC9138F03F80ECC01F02807FEC000F5B5B +A25BB3267FFFE0B5FCB500F11480A36C01E0140029337FB22C>I<1307EB1FC0A2497EA3 +6D5AA20107C7FC90C8FCA7387FFFC080B5FC7EA2EA0007B3A8007FB512FCB612FEA36C14 +FC1F3479B32C>I<140EEC3F80A2EC7FC0A3EC3F80A2EC0E0091C7FCA748B512804814C0 +A37EC7120FB3B3A2141F003C1480007E133FB414005CEB01FEEBFFFC6C5B5C001F5B0007 +90C7FC1A467CB32C>I<EA7FE0487EA3127F1201AA91381FFFF04A13F8A36E13F0913800 +FE004A5A4A5A4A5A4A5A4A5A4A5A4AC7FC14FEEBF1FC13F3EBF7FE90B5FCA2EC9F80EC0F +C001FE7FEBFC07496C7E496C7E811400157E811680151F3A7FFFC0FFFCB500E113FEA36C +01C013FC27337EB22C>I<387FFFE0B57EA37EEA0003B3B3A5007FB61280B712C0A36C15 +8022337BB22C>I<3A7F83F007E09039CFFC1FF83AFFDFFE3FFCD87FFF13FF91B57E3A07 +FE1FFC3E01FCEBF83F496C487E01F013E001E013C0A301C01380B33B7FFC3FF87FF0027F +13FFD8FFFE6D13F8D87FFC4913F0023F137F2D2481A32C>I<397FF01FE039FFF87FFC90 +38F9FFFE01FB7F6CB6FC00019038F03F80ECC01F02807FEC000F5B5BA25BB3267FFFE0B5 +FCB500F11480A36C01E0140029247FA32C>I<EB07FCEB1FFF017F13C048B512F0488039 +07FC07FC390FF001FE48486C7E0180133F003F158090C7121F007EEC0FC0A348EC07E0A7 +6C140F007E15C0A2007F141F6C15806D133F6C6CEB7F006D5B6C6C485A3907FC07FC6CB5 +5A6C5C6C6C13C0011F90C7FCEB07FC23247CA32C>I<397FF01FE039FFF8FFF801FB13FE +90B6FC6C158000019038F07FC09138801FE091380007F049EB03F85BED01FC491300A216 +FE167EA816FE6D14FCA2ED01F86D13036DEB07F0150F9138801FE09138E07FC091B51280 +160001FB5B01F813F8EC3FC091C8FCAD387FFFE0B57EA36C5B27367FA32C>I<903903FC +078090391FFF0FC0017F13CF48B512EF4814FF3807FE07380FF00148487E49137F484813 +3F90C7FC48141F127E150F5AA87E007E141FA26C143F7F6C6C137F6D13FF380FF0033807 +FC0F6CB6FC6C14EF6C6C138F6D130FEB07F890C7FCAD0203B5FC4A1480A36E140029367D +A32C>I<D87FFEEB3FC0B53801FFF0020713F8021F13FC6C5B39003F7FE1ECFF019138FC +00F84A13704A13005CA25C5CA391C8FCAF007FB512E0B67EA36C5C26247EA32C>I<9038 +7FF8700003B512F8120F5A5A387FC00F387E00034813015AA36CEB00F0007F140013F038 +3FFFC06C13FE6CEBFF80000314E0C66C13F8010113FCEB0007EC00FE0078147F00FC143F +151F7EA26C143F6D133E6D13FE9038F007FC90B5FC15F815E000F8148039701FFC002024 +7AA32C>I<131E133FA9007FB6FCB71280A36C1500D8003FC8FCB1ED03C0ED07E0A5EC80 +0F011FEB1FC0ECE07F6DB51280160001035B6D13F89038003FE0232E7EAD2C>I<3A7FF0 +03FF80486C487FA3007F7F0001EB000FB3A3151FA2153F6D137F3900FE03FF90B7FC6D15 +807F6D13CF902603FE07130029247FA32C>I<3A7FFF01FFFCB514FE148314016C15FC3A +03E0000F80A26D131F00011500A26D5B0000143EA26D137E017C137CA2017E13FC013E5B +A2EB3F01011F5BA21483010F5BA214C701075BA214EF01035BA214FF6D90C7FCA26D5A14 +7C27247EA32C>I<D87FFFEB7FFF6EB5FCB515806C16004A7ED807C0EB01F0A66C6C495A +A3143E147FA2D801F0495AECFF87A214F7A201F113C700005D9038F9E3CFA201FB13EFA3 +D97BC190C7FC017F13FFA21480A2013F5B90381F007C29247FA32C>I<3A3FFF03FFF048 +018713F8A36C010313F03A00FC007E005D90387E01F8013F5BEB1F83EC87E090380FCFC0 +903807EF80EB03FF6D90C7FC5C6D5A147C14FE130180903803EF80903807CFC0EB0FC7EC +83E090381F01F0013F7FEB7E00017C137C49137E0001803A7FFF01FFFC1483B514FE6C15 +FC140127247EA32C>I<3A7FFF01FFFCB5008113FE148314816C010113FC3A03E0000F80 +6C7E151F6D140012005D6D133E137C017E137E013E137CA2013F13FC6D5BA2EB0F815DA2 +EB07C1ECC3E0A2EB03E3ECE7C0130114F75DEB00FFA292C7FC80A2143EA2147E147CA214 +FC5CA2EA0C01003F5BEA7F83EB87E0EA7E0F495A387FFF806C90C8FC6C5A6C5AEA07E027 +367EA32C>I<003FB612E04815F0A4007EC7EA1FE0ED3FC0ED7F80EDFF004A5A003C495A +C7485A4A5A4A5A4A5A4A5A4AC7FCEB01FC495AEB0FF0495A495A495A49C8FC4848EB01E0 +4848EB03F0485A485A485A485A485AB7FCA46C15E024247DA32C>I<15FF02071380141F +147F91B512004913C04AC7FCEB03F85CB31307EB1FE013FF007F5BB55A49C8FC6D7E6C7F +C67F131FEB07F01303B380EB01FEECFFC06D13FF6E1380141F14070200130021417BB92C +>I<127812FCB3B3B3A9127806416DB92C>I<EA7FC0EAFFF813FE6D7E6C7FC67F131FEB07 +F01303B380EB01FEECFFC06D13FF6E1380141F147F91B512004913C04AC7FCEB03F85CB3 +1307EB1FE013FF007F5BB55A49C8FC13F8EA7FC021417BB92C>I +E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fh labx1440 14.4 69 +/Fh 69 256 df<151E153E15FCEC01F8EC03F0EC07E0140FEC1FC0EC3F80EC7F005C5C49 +5A1303495AA2495A131F5C133F5C137F5C13FFA24890C7FCA25A5B1207A25B120FA3485A +A4123FA25BA2127FA65B12FFB3A3127F7FA6123FA27FA2121FA46C7EA312077FA212037F +7EA26C7FA2137F80133F80131F80130F6D7EA26D7E13016D7E8080EC3F80EC1FC0EC0FE0 +1407EC03F0EC01F8EC00FC153E151E1F7974D933>40 D<12F07E127E7E6C7E6C7E7F6C7E +6C7E6C7E7F1200137F806D7EA26D7E80130F80130780130380A26D7EA215807F15C0A214 +7F15E0A3EC3FF0A415F8A2141FA215FCA6140F15FEB3A315FC141FA615F8A2143FA215F0 +A4EC7FE0A315C014FFA215805B1500A2495AA25C13075C130F5C131F5C495AA2495A91C7 +FC13FE12015B485A485A485A5B485A48C8FC127E12F85A1F7979D933>I<EA07E0EA1FF0 +EA3FFC127F7FB5FCA31480A37EA27E7EEA07E7EA0007A3130F1400A35B131E133EA25BA2 +5BA2485A485A1207485A485A90C7FC121E120C1127768F25>44 D<913803FF80023F13F8 +49B6FC010715C04901017F903A3FFC007FF8D97FF0EB1FFC49486D7E48496D7E4A7F4817 +804890C76C13C0A248486E13E0A2001F17F0A3003F17F8A249157FA2007F17FCA600FF17 +FEB3A5007F17FCA6003F17F86D15FFA3001F17F0A3000F17E06D5C6C17C0A26C6D491380 +6C17006E5B6C6D495A6D6C495AD93FFCEB7FF8903A0FFF01FFE06D90B55A010192C7FCD9 +003F13F802031380374F7BCD42>48 D<151E153E15FE1403140F147FEB07FF0003B5FCB6 +FCA3EBF87FEAFC00C7FCB3B3B3A6007FB712FCA52E4E76CD42>I<EC1FFE49B512F0010F +14FC013FECFF804915E02701FF803F7F2703FC000713FCD807F001017F48486D7FD81F80 +6E138048C87E7013C0D87FE016E001F8806D16F000FF817F7013F8A56C5AA26C5A6C5AEA +0380C914F05EA218E05E18C05E18804C13005F4C5A4C5A5F4B5B4B5B4B5B94C7FCED0FFC +4B5A4B5AED7FC04B5A4A90C8FCEC03FC4A5A4A4814F84A5A4A5A4AC8FC02FEEC01F0495A +495A495A5CD90F80140349C8FC013E1507017FB7FC90B812E05A5A5A5A5A5A5AB9FC18C0 +A4354E7ACD42>I<913807FFC0027F13FC0103B67E010F15E090261FF80313F890267FC0 +007F01FEC7EA3FFE48488148486E138013FE486C6C6D13C0804817E080A66C5B18C06C5B +6C90C75AD80038168090C8FC4C1300A24C5A5F4C5A4B5B4B13C0030F5BDB7FFEC7FC9138 +7FFFF816C016FCEEFF80DA000313E09238007FF8EE3FFE707E70138018C07013E018F070 +13F8A218FC82A218FEA3EA03C0EA0FF0EA3FFC487EA2B5FCA218FCA25E18F8A26C4816F0 +495C4916E0D83FE04A13C06C485CD80FF04A1380D807FE91387FFE003B03FFE003FFFC6C +90B65A6C6C15E0010F92C7FC010114FCD9001F1380374F7BCD42>I<17FC1601A2160316 +07160FA2161F163F167FA216FF5D5DA25D5D5D167F153E157E15FC15F8EC01F01403EC07 +E015C0EC0F80141FEC3F00143E5C14FC495A5C495A1307495A5C49C7FC5B137E137C5B12 +01485A5B485A120F485A90C8FC123E127E5ABA1280A5C901FCC7FCAF021FB71280A5394F +7CCE42>I<486C150601F0153E01FEEC01FED9FFF0133F91B65A5F5F5F5F5F94C7FC16FC +5E16E093C8FC15FC01F0138091CAFCAC913807FF80023F13F891B512FE01F36E7E9026FF +FC0113E09139E0007FF891C76C7E496E7E01F86E7E5B7013804916C0C9FC18E08218F0A4 +18F8A31203EA0FE0EA3FF8487EA212FF7FA218F0A25B5E6C4816E05B01C016C06CC85A18 +806C6C4A13007FD80FF04A5A6C6CECFFFCD803FE4913F02701FFE00F5B6C6CB612806D92 +C7FC010F14F8010114C09026003FFCC8FC354F7ACD42>I<ED07FE92B512C0020314F002 +1F14FC91397FFC01FE9139FFE0007F01030180EB3F804990C7121F4948EC7FC0494814FF +4948010313E0495A49485B5A485BA2485BA2486F13C091C7FC4803001300177E94C7FC5A +A25B127FA2ED3FF04AB5FC020714C000FF4914F091391F807FF891393E001FFE02786D7E +4A6D13807013C06D5A4A6D13E018F05C7013F8A291C813FCA44916FEA3127FA6123FA37F +6C17FCA36C17F85E7E6E15F06C17E06C6D5B6E15C06C4B13806D6C491300D93FFC495A6D +B4EBFFFC010790B512F06D5D01001580021F01FCC7FC020313C0374F7BCD42>I<121F7F +7FEBFF8091B8FCA45A18FE18FC18F818F0A218E018C018804817000180C8123E007EC912 +7E5F007C4B5A4C5A5F16074C5A484B5A4CC7FC167E167CC912FC4B5A4B5AA24B5A150F4B +5AA24B5AA24BC8FC5DA25C5D1403A214075D140FA3141FA2143FA34A5AA414FFA65BAB6D +5B6E5A6E5A6E5A385279D042>I<913803FFC0023F13FC49B67E010715E090260FFC0013 +F8D93FE0EB1FFCD97F80EB07FE49C76C7E496E1380484880000317C049157F120718E017 +3F120FA27FA27F7F6E147F02E015C08002FC14FF6C01FF15806F481300EDE0036C9138F8 +07FE6F485A6C9138FF1FF06CEDFFE017806D4AC7FC7F010F6E7E6D81010115F06D810103 +15FE010F81D93FF71580D97FC115C02701FF807F14E048EB001F48486D14F04848010314 +F848481300496E13FC003F151F491407007F6F13FE491400177F00FF163F49151F170F17 +07A21703A218FCA27F127F6DED07F8A26C6CED0FF07F6C6CED1FE06C6CED3FC06C6CEDFF +806C01C0010313006C01FCEB3FFE6C6CB612F8011F15E001071580010002FCC7FC020F13 +C0374F7BCD42>I<913807FF80027F13F849B512FE01076E7E90261FFE0113E0903A7FF8 +003FF049486D7E48496D7E48496D7E484980486F138091C7FC486F13C05A18E0485A18F0 +A27013F812FFA318FCA618FEA35E127FA4003F5DA26C7E5E7E6C6D5B161E6C7F6C6D5B6C +6C6C13F890393FFC03F06DB55A01074A13FC01001400EC1FF891C8FCA218F85EA301FC16 +F0487E2607FF8015E05E486D15C0A24C1380A24C13005F4A131F6C4B5A49C7485A494A5A +6C48495B6D01075B2701FF803F90C7FC6C90B512FC013F5C6D14C0010791C8FC9038007F +F0374F7BCD42>I<BB12FEA5D8000F01E0C700077FF0007F191F190785858586A2F23F80 +A21A1FA31A0FA4DD01F014C01A07A497C7FCA21703A31707170F171F17FF92B6FCA5EDE0 +00171F170F17071703A317011BF8A3F201F0A394C8FCA21A03A21BE0A21A07A31A0F1BC0 +1A1F1A3FA21A7F1AFF4F13801907191F197F060FB5FCBCFCA21B00A34D527CD156>69 +D<B8D88007B712FCA5D8000701F0C9003FEB8000B3AE92BAFCA503F0C9123FB3B1B8D880 +07B712FCA55E527CD167>72 D<B81280A5D8000701F0C7FCB3B3B3B2B81280A529527DD1 +30>I<B812E0A5D8000F01E0CAFCB3B3A91AF8A419011AF0A51903A31907A2190F1AE019 +1FA2193F197F19FF60180760187F0503B5FCBB12C0A545527CD14F>76 +D<EC3FFE0107B512E0011F14FC017F14FF2701FFC00F13C02703FE00037F486C01007F6E +6D7E486D80707EA2707EA3707F6C5B6C90C7FC6C5AC9FCA60307B5FC0203B6FC147F0103 +B7FC011FEBF00F017F1300EBFFFC000313F04813C0485B4890C7FC5A5B485AF081F012FF +5BA35EA26D5C127F6D5C003F03F713C36DD901E314E06CD9C00714FF00079026F01F8114 +C06C90B5C61480C602FC6D1300011F01F0EB3FFC01010180EB07F03C387CB642>97 +D<913803FFE0023F13FE91B67E010315E0010F9038003FF8D93FFCEB07FC4948497E4948 +131F4849497E485B485BA24890C7FC5A5B003F6F5A705A705A007F92C8FC5BA312FFAD12 +7F7FA3123F7F6CEE0F80A26C6D141F18006C6D5C6C6D143E6C6D147E6C6D5C6D6C495A6D +B4EB07F0010F9038C01FE06D90B5128001014AC7FCD9003F13F80203138031387CB63A> +99 D<ED1FF8913803FFFE020FEBFF80023F14C09139FFF83FE001039038E0FFF0491380 +49010113F85BEB3FFEA2EB7FFCA26F13F0495AEE7FE0EE1F8093C7FCAEB712C0A5C601F8 +C8FCB3B3A7B612FEA52D547CD328>102 D<133FEBFFC0487F487FA2487FA66C5BA26C5B +6C5B013FC7FC90C8FCAEEB1FF8B5FCA512017EB3B3A6B612F0A51C547CD324>105 +D<D93FF0D91FF84AB47EB591B56C010F13F8030302E0013F13FE030F6E90B6FCDB3F8090 +27F803F80F7F922A7E007FFC07E0077F000302F890283FFE0F80037FC6D9F1F0011F4948 +7EDAF3E0DAFF3E814B153CDAF7805D92C76C496D7F14FF4A5EA24A5EA34A5EB3ADB6D8F8 +0FB66CB612F8A565367BB56E>109 D<D93FF0EB1FFCB591B57E030314E0030F14F89239 +1FC07FFC92397E003FFE000302F86D7EC6EBF1F04B6D7FECF3C0ECF78092C76C7F14FF5C +A25CA45CB3ACB6D8F807B612C0A542367CB549>I<913801FFC0023F13FE91B67E010315 +E0010F018013F8903A3FFC001FFED97FF0EB07FF49486D7F48496D7F48496D7F91C8127F +4883488349153F001F83A2003F8349151FA2007F83A400FF1880AC007F1800A3003F5F6D +153FA2001F5FA26C6C4B5AA26C6D4A5A6C5F6C6D495B6C6D495B6D6C4990C7FCD93FFCEB +1FFE6DB46CB45A010790B512F0010115C0D9003F49C8FC020313E039387CB642>I<D93F +F8EB7FF0B50107B5FC031F14C0037F14F09126F9FF0013FCDAFFF8EB3FFF000302E0010F +7FC602806D7F92C76C7F4A824A804A6E7F85187F85A2183F85A4721380AD4E1300A44E5A +A26118FF616E5C616E4A5B6E4A5B6F495B03E04990C7FC6FEB7FFE913AF9FE01FFF802F8 +B65A033F14C0030749C8FC030013E093CAFCB1B612F8A5414D7DB549>I<903903FFC00E +011FEBFC1E90B6127E000315FE3907FE003FD80FF0130F4848130348481301491300127F +90C8127EA248153EA27FA27F01F091C7FC13FCEBFF806C13FEECFFF06C14FE6F7E6C15E0 +6C816C15FC6C81C681133F010F15801301D9000F14C0EC003F030713E0150100F880167F +6C153FA2161F7EA217C07E6D143F17807F6DEC7F0001F85C6DEB03FE9039FF801FFC486C +B512F0D8F81F14C0D8F00791C7FC39E0007FF02B387CB634>115 +D<BB12FCA5D8000F01C0C7000F7F1800193F190F1907190319011900A21A7FA286A386A4 +1B801A0FA497C7FCA684047FB512E092B712FE737E1AE01AF89326E0007F13FE03E0C700 +077F4B02011480726C13C07313E07313F07313F8851BFC851BFE85A37313FFA91BFE61A3 +4F13FCA24F13F8A24F13F04F13E04F13C04F13804EB51200060F5BBB12F8621A804FC7FC +19C050527BD15D>193 D<B912FEF0FFF019FE737E1AE0D8000F01C0C7001F7F06037F72 +7F726C7E867313807313C0A27313E0A37313F0A94F13E0A34F13C01B80614F1300624F5A +06035B4E13E0063F5B92B8C7FC19F8A2F1FF8003C0C7001F13E0060113F89538007FFE73 +7E070F13C01BE07313F0851BF87313FCA27313FEA31BFFA91BFEA2611BFCA2614F13F81B +F0614F13E0077F13C04EB51280060FEBFE00BB5A1AF01AC04FC7FC19C050527BD15D>I< +0038EC3FFF003C0107B512F8003F013FECFF806DB712E001E316F801F7D9C00713FED9FF +FCC77F02E0023F7F02806E13E091C87E01FC6F7F496F7F496F7F5B717F5BA249838490CA +FCA3123EA395B5FCCB5BA24D5BA24D5B614D5B4D5B4D5B4D48C7FCEFFFF8040713E0020F +B612804A02FCC8FC5FEFFF8091C7001F13F0040013FE94381FFF80050713E0717F717F71 +13FE727E841A807213C0A21AE0841AF0A312F8A57E007C19E0A2007E5F1AC06C5F1A806C +6C5E6D93B512006C6C4B5B6C6C4B5BD803FC4B5B6CB44B5B6C01E0027F13C06DB40103B5 +5A011F90B648C7FC010716F8010116C0D9003F4AC8FC0200148044547AD250>199 +D<B8D88007B712FCA5D8000701F0C9003FEB80006297B5FCA261A26161A261611ABFF13F +3FA2197E19FE19FCF001F8A2F003F0F007E0A2F00FC0A2F01F80F03F00A2187EA2604D5A +A24D5A1707604D5AA24D5A173F95C7FC177EA25F4C5AA24C5AA24C5A4C5AA24C5AA24CC8 +FC167EA25E15F15EEDF3F0A2EDF7E015FF5E5EA293C9FC5DA25DA25D5DB8D88007B712FC +A55E527CD167>I<B86C0103B612E0A5D8000701F0C9000FEB8000E001FCC7FC505AF20F +F0505A505A50C8FC1AFE4F5A4F5A4F5A4F5AF13FC04F5A4FC9FCF001FC4E5A4E5A4E5A4E +5AF07F804ECAFC4D5AEF03F84D5A4D5A4D5A4D7E4D7EEE01FF4C7F4C7F4C7F5E4C7F4C80 +EEFE7FDBF3FC809226F7F83F7F9226FFF01F7FEEC00F0480804C6C7F4B7F4B814B6D7F4B +6D808486727F8486727F727F8486727F8487737F737F8587737F8587737F737F8588747F +97B57EB86C90B712F8A55D527CD167>202 D<B600F04EB612F06F606F60A3D800076D4E +49C7FCA2DADFFFF01F7FA202CF6D173EA302C76D177CA202C36D17F8A202C16DEE01F0A2 +02C06DEE03E0A36F6CEE07C0A26F6CEE0F80A26F6CEE1F00A36F6D153EA26F6D5DA26F6D +5DA36F6D4A5AA26F6D4A5AA2706C4A5AA3706C4A5AA2706C4AC7FCA2706D133EA3706D5B +A2706D5BA2706D485AA2706D485AA3716C485AA2716C485AA2716C48C8FCA37113BEA271 +13FCA2715BA3715BA2715BA2D91FF06F5AB600FE050FB712F0A2725AA272C7FC74527CD1 +7D>204 D<B8D88007B712FCA5D8000701F0C9003FEB8000B3AE92BAFCA503F0C9123FB3 +B1B8D88007B712FCA55E527CD167>I<93381FFF800303B512FC033FECFFC092B712F002 +07D9F80113FE021F903A80001FFF804A48C700077FDAFFF8020113F049496E7F4901C0ED +3FFC49496F7E4990C96C7E4948707F013F854948707F4948707F48864A8248864A177F48 +864849717EA3481B804A83481BC0A44890CB6C13E0A5B51AF0AF6C1BE06E5FA46C1BC0A2 +6E5F6C1B80A36C6D4D1300A26C6D4D5AA26C626C6D4C5B6E5E6C626D6C4C5B6E5E6D6D4B +5B6D6D4B5B6D6D4B90C7FC6D6D4B5A01016D4A13F86D01FE02075B91263FFFC0013F13C0 +6ED9F801B55A020790B648C8FC020116F8DA003F15C003074AC9FCDB001F1380545479D2 +63>I<BE12FCA5D8000701F0C9003FEB8000B3B3B3B2B8D88007B712FCA55E527CD167>I< +B912FCF0FFE019FE737E1AE0D8000F01E0C7003F7F060313FC06007F737E7313807313C0 +7313E0851BF0A21BF885A21BFCA91BF8A3611BF0A21BE04F13C0614F13804F13004F5A06 +0713F8063F5B92B812C097C7FC19F8198003E0CBFCB3AEB712FEA54E527CD15A>I<9326 +03FFF01407047F01FF140F0307B600E0131F033F03F8133F92B700FE137F02039126C003 +FF13FF020F01F8C7EA3FC1023F01C0EC0FE391B5C80003B5FC4901FC814949814901E082 +011F498249498292CA7E4948834948835A4A83485B4885A24849187FA2485B1B3FA2485B +1B1FA25AA21B0091CDFCA2B5FCAE7EA280A36C1A1FA36C7FA21B3F6C7F1B3E6C7F1B7E6C +6D187C6C1AFC6E18F86C19016D6CEF03F06D7E6FEE07E06D6DEE0FC001076DEE1F806D01 +F8EE3F006D6D16FE6D01FF4B5A023F01C0EC07F8020F01FCEC3FF00203903AFFC001FFC0 +020091B6C7FC033F15FC030715F0DB007F1480040301F0C8FC505479D25F>I<003FBB12 +FEA59126C0007FEB000101FCC7ED001FD87FF0F007FF49844984498490C883A2007E86A3 +007C86A500FC1B80481A0FA6C994C7FCB3B3AD49B912C0A551527BD15C>I<B700F8033F +B512F0A5D8001F01F0CA383FF0006DF10FC06F606D6D171F7F6F95C7FC6D616D6D173E70 +167E806E6D167C7016FC6E607015016E7F6E607015036E6D5E6E1707826E606F6D140F71 +5D6F161F6F7F7192C8FC6F5E71143E6F6D147E8171147C6F6D14FC6F5EF08001827001C0 +5BF0E003705D70EBF00718F8705DF0FC0F7001FE5B70141F18FF70029FC9FC7113BF19FE +83836183715BA283DA03805DDA0FF07FDA3FF86D5B4A7E6F6E5A02FF153F6F5D72CAFC60 +187EA24B5C4D5A6E48495A4B130FDA3FE0495A4BEBFFC091261FF80790CBFC6EB55A0203 +5C6E14F06E6C1380DB0FFCCCFC5C537DD163>I<92B812FCA592C701FCCAFCA74BB612FE +92B812FC020FEFFFC0027F18F849B500E0D9FC1F13FE010FD9FC000200EBFFC04901E004 +1F7F017F0180040713F84948C703017F4849717F4849727E484972138048497213C0A248 +497213E0A248497213F0A2481CF8A291C882A2B51BFCAB6C1CF8A26E60A26C1CF0A26C6D +4E13E0A26C6D4E13C0A26C6D4E13806C6D4E13006C6D4E5A6C6D4D5B6D6C6C04075B011F +01E0041F13E06D01FC93B55A0101D9FFE0021F49C7FC6D6C90B812F8020F18C0020005FC +C8FC03014BC9FC92C701FCCAFCAA92B812FCA55E5279D16D>I<EC3FFE0107B512E0011F +14FC017F14FF2701FFC00F13C02703FE00037F486C01007F6E6D7E486D80707EA2707EA3 +707F6C5B6C90C7FC6C5AC9FCA60307B5FC0203B6FC147F0103B7FC011FEBF00F017F1300 +EBFFFC000313F04813C0485B4890C7FC5A5B485AF081F012FF5BA35EA26D5C127F6D5C00 +3F03F713C36DD901E314E06CD9C00714FF00079026F01F8114C06C90B5C61480C602FC6D +1300011F01F0EB3FFC01010180EB07F03C387CB642>224 D<18FC170F17FF163F030FB5 +FC4AB6FC021F5D91B7FC01035E130F495E49168090B8C7FC17F04803E0C8FC4802C0C9FC +4801F8CAFC14E048138049CBFC5B485A5B5B123F5B5BA23A7F0001FFC0023F13FE91B67E +D87E0315E0010F018013F8903A3FFC001FFE267C7FF0EB07FF49486D7F00FD496D7FB548 +6D7F91C8127F848449153F84A28449151FA284A41980AC007F1800A3003F5F6D153FA200 +1F5FA26C6C4B5AA26C6D4A5A6C5F6C6D495B6C6D495B6D6C4990C7FCD93FFCEB1FFE6DB4 +6CB45A010790B512F0010115C0D9003F49C8FC020313E039547CD242>I<B712FEEEFFF0 +17FC17FFC69026F8001F7F040713E004017FA2707FA2717EA64D5AA24C5B4C5B4C5B041F +90C7FC91B612FC17F05F17FC9139F80007FF040113C07013F0717E717E84171F84A21980 +A61900A25F604D5A17FF04035B040F5BB912C095C7FC17FC17C039357CB442>I<B9FCA4 +C69038F8001F160382707EA283A2EF1F80A4170FA694C7FCB3AAB612FEA431357CB439> +I<91B912F8A4DA00FCC7EBF8005DAE5DA21401A55D1403A35D1407A34A5AA24AC8FCA25C +143E5CA25C1301495A495A495AEB3F8049C9FC003FBA12FCA491CAFC01F8171FD87FE0EF +07FE49170349170190CCFC1A7E127EA2007C193EA400FC193F48191FA5484880B449>I< +913807FF80027F13F849B512FE01076E7E011F010313E0903A3FFC007FF0D97FF06D7E49 +486D7E4849130F48496D7E48824890C77E1880485A82003F17C0A3485A18E082A212FFA2 +90B8FCA401FCCAFCA6127FA37F123FA2EF03E06C7E17076C17C06C6D140F18806C6D141F +6C6DEC3F006C6D147ED97FFC495AD91FFFEB07F86D9038E03FF0010390B512C001005D02 +3F01FCC7FC020113E033387CB63C>I<001FB50103B600E090387FFFFCA426007FFCD900 +0301E0C7001F90C7FCD90FF8F10FF8D903FCF11FE06D6C4F5A6D6C4F5ADA7FC04D48C8FC +DA1FE0EF03FC6E6C4D5ADA07FCEF1FF0DA01FEEF3FC06E6C4D5ADB7F804CC9FCDB1FE0ED +03FCDB0FF04B5ADB07F84B5ADB03FEED3FE004FF157F4B01834A7E4B01E301E37F4B01F3 +01E77F4B01FB01EF7F94B7FC4B834B486C023F7F4A496C496C7F4AD9F80FD9F80F7F4C6C +497E4A6E01E0804A01E06F7F4A01C06F7F4A01806F7F0400167F4A854A48717F4949717F +4949717F4949717FA24949717F4949717F4949717F4990C7717EA24948737F00036D4F13 +E0B6D8E003B6D8E003B61280A469357EB46E>I<0070EBFFFED87C0FEBFFF0D87E3F14FE +007FB77EDA801F13E09026F800037F4901007F01C06E7E5B707E90C8FC007E6F7EA3127C +A2C9FC4C5AA24C5A5F4B485A4B13C0030F5B49B500FCC7FC4914F0A216FE90C7381FFFC0 +03037F030013F8707E707E707EA2701380A218C0A412F8A36C1780007C5D007E17005E6C +4B5A6C6C4A5A01E001035BD80FFE011F5B0003B712C0C693C7FC013F14F8010391C8FC32 +387DB63A>I<B6D8F807B612C0A4C601F8C70007EBC000A25F5FA25F5FA294B5FCEE01F7 +A2EE03E7EE07C7A2EE0F87EE1F07163F163E167C16FC16F8ED01F0150316E0ED07C0150F +1680ED1F005D153E5D5DA2ECF9F0ECFBE0A2ECFFC05DA292C7FC5CA25C5CA2B6D8F807B6 +12C0A442357DB449>I<023E141FDAFF80EB7FC0496D497E496D487FA2496D487FA54B7E +6D5E4B7E6D496D5AA26D90B65A023F92C8FC6E5C020714F8020114E09126001FFEC9FC92 +CBFCA4B6D8F807B612C0A4C601F8C70007EBC000A25F5FA25F5FA294B5FCEE01F7A2EE03 +E7EE07C7A2EE0F87EE1F07163F163E167C16FC16F8ED01F0150316E0ED07C0150F1680ED +1F005D153E5D5DA2ECF9F0ECFBE0A2ECFFC05DA292C7FC5CA25C5CA2B6D8F807B612C0A4 +424E7DCD49>I<B600F8011FB5FCA4C601F8C7000713C07148C7FCEF07F84D5A4D5AEF7F +C04DC8FC4C5AEE07FCEE0FF04C5AEE7FC04CC9FC4B5A4B5AED0FF8151F4B7EEDFFFE02F9 +7F02FB8091B6FC8303CF7F03877FDAFE037F4A7E02F8806F7F707E707F8284707F707F70 +7F707FA2707F717E717F717FA2717F4D13F8B600F890B612E0A443357DB449>I<0103B9 +12E0A490280003F00003EBE0005DB3A914075DA4EA0F80EA1FC0383FE00FEA7FF0D8FFF8 +5BA2141FA292C7FC5CEBF07E387FE0FED9FFFC0103B612E06C5B6C5B6C5B0003018090CA +FCD80030CCFC43377EB449>I<B500FC93387FFFFE6E93B5FC8060C6F1FE0081F003DF01 +FB7FF0079F01F97FF00F1F01F87FA2181E6E7E183C6E7E18786E7E18F0A26E7EEF01E06E +1380EF03C06E13C0EF07806E13E0EF0F00A26E13F0171EED7FF85FED3FFC5FED1FFEA25F +ED0FFF5F815F815FA28194C7FCD807FF7FB500F849011FB512FE167E167C163C4F357CB4 +58>I<B6D8F807B612C0A4C601F8C70007EBC000B291B8FCA402F8C71207B3A5B6D8F807 +B612C0A442357DB449>I<913801FFC0023F13FE91B67E010315E0010F018013F8903A3F +FC001FFED97FF0EB07FF49486D7F48496D7F48496D7F91C8127F4883488349153F001F83 +A2003F8349151FA2007F83A400FF1880AC007F1800A3003F5F6D153FA2001F5FA26C6C4B +5AA26C6D4A5A6C5F6C6D495B6C6D495B6D6C4990C7FCD93FFCEB1FFE6DB46CB45A010790 +B512F0010115C0D9003F49C8FC020313E039387CB642>I<BB12C0A4C601F8C70007EBC0 +00B3B3A9B6D8F807B612C0A442357DB449>I<D93FF8EB7FF0B50107B5FC031F14C0037F +14F09126F9FF0013FCDAFFF8EB3FFF000302E0010F7FC602806D7F92C76C7F4A824A804A +6E7F85187F85A2183F85A4721380AD4E1300A44E5AA26118FF616E5C616E4A5B6E4A5B6F +495B03E04990C7FC6FEB7FFE913AF9FE01FFF802F8B65A033F14C0030749C8FC030013E0 +93CAFCB1B612F8A5414D7DB549>I<913803FFE0023F13FE91B67E010315E0010F903800 +3FF8D93FFCEB07FC4948497E4948131F4849497E485B485BA24890C7FC5A5B003F6F5A70 +5A705A007F92C8FC5BA312FFAD127F7FA3123F7F6CEE0F80A26C6D141F18006C6D5C6C6D +143E6C6D147E6C6D5C6D6C495A6DB4EB07F0010F9038C01FE06D90B5128001014AC7FCD9 +003F13F80203138031387CB63A>I<007FB812FCA4D9F807EBC03F01C015070180150301 +001501007E1600A2007C177C00FC177EA348173EA7C71600B3AA017FB612FCA437357DB4 +3E>I<B600E090381FFFFCA4000101F8C700011380943800FE006C177C6E15FC017F5E6E +1401013F5E8017036D6D5C17076D5E6F130F6D5E6F131F6D93C7FC815F6D6D133E177E6D +157C6F13FC027F5C811601DA3FFF5B16036E5C16876E5C16CF6E5C16EF16FF6E91C8FCA2 +6E5BA26E5BA26F5AA36F5AA26F5AA26F5AA35E151F93C9FC5D153E157ED81FC0137C487E +486C13FC486C5B14015D4A5A14074A5A6C48485A4948CAFC495A383F81FC6CB45A6C5B00 +0313C0C648CBFC3E4D7DB445>I<EF3FF893B5FCA516031600B3A4912603FF80EC0FFE02 +3F01F091387FFFE091B500FC01F9B512F801036E01FB14FE010FD9C03F903AFFE01FFF80 +013FD9000FDA800713E0D97FFC6DDA00017F49486D496D7F48496D496E7E48496D496E7E +4849727E481C804A84481CC091C882481CE0A248487313F0A448487313F8AD6C6C4F13F0 +A46C6C4F13E0A26C1CC06E606C1C806E606C1C006C6D496D4A5A6C6D4E5A6C6D496D4A5A +6D6C496D495B6DB449DA80075B010FD9C07FDAF01F13800103D9FFFE01FBB548C7FC0100 +02F801F814F8023F496E13E002010180DA0FFCC8FC91C891CAFCB193B612F8A55D6A7CD2 +66>I<B6D8F001B512FCA4C649C7381FFE00017FED0FF06D6C5D6D6D495A606D6D49C7FC +6D6D137E6D6D13FE6D6D485A4C5A6D01FC5B6E6C485A6E6C485A161F6EEBBF806E01FFC8 +FC6E5B5E6E5B806E7F6F7EA26F7E834B7F92B5FC83DA01FB7FDA03F17FDA07F07F4A5A4A +486C7E4B6C7E4A486C7F147E02FE6D7F49486D7F49486D7F4A8149487F49486D7F011F6F +7E013F6F7E48B47EB500FE0107B6FCA440357EB445>I<B6D8F807B612C0A4C601F8C700 +07EBC000B3B3A9BB12E0A4CB12071800F13FF0191F190F19071903A31901A41AF81900A5 +45487DB449>I<B6D8F807B612C0A4C601F8C70007EBC000B1137F80013F153F6E91B5FC +6D6C130F010790B512F7010115876D6CEBFC07020713C091C8FCB30407B612C0A442357D +B449>I<B6D8F81FB60003B612E0A4C601F8C7001F90C70003EBE000B3B3A9BF12E0A463 +357CB46C>I<B6D8F81FB60003B612E0A4C601F8C7001F90C70003EBE000B3B3A9BF12F0 +A4CF1203F4007FF51FF81D0F1D071D031D01A31D00A41EFC1E7CA566487CB46C>I<B600 +F8037FB512FCA4C601F8CA387FFC00B291B512F8EEFFF017FE717E9126F8001F13E00407 +7F04017F707F717EA2717EA2711380A74D1300A24D5AA24D5A4C5B04075B041F5BB9D8C0 +7FB512FC180017F8178056357CB45F>251 D<B612F8A4C601F8CAFCB291B512F8EEFFF0 +17FE717E9126F8001F13E004077F04017F707F717EA2717EA2711380A74D1300A24D5AA2 +4D5A4C5B04075B041F5BB95A95C7FC17F8178039357CB442>I<4AB712FE147F0103B8FC +130F013F903AC0003FFE004948C7FCEBFFF8485B5A5C5AA67E807E807EEB7FFE90381FFF +C0010790B6FC1301EB001F1401EEFC3F4A13F85C4A13F016E04A13C05C4A1380160091B5 +FC495B495B5D5B495B495BA2495B495B90B5C7FC5A1207B6D8F83FB512FEA43F357EB445 +>255 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fi larm1000 10 86 +/Fi 86 256 df<486C1360000314E039070001C0000EEB038048EB070000181306003813 +0E0030130C0070131C00601318A200E01338481330A400CEEB338039FF803FE001C013F0 +A3007F131FA2393F800FE0390E0003801C1981B91C>16 D<001C1307007FEB1FC039FF80 +3FE0A201C013F0A3007F131F001CEB073000001300A400011470491360A2000314E090C7 +12C048130100061480000E130348EB070048130E485B006013181C1980B91C>I<B81280 +A2290280962A>21 D<146014E0EB01C0EB0380EB0700130E131E5B5BA25B485AA2485AA2 +12075B120F90C7FCA25A121EA2123EA35AA65AB2127CA67EA3121EA2121F7EA27F12077F +1203A26C7EA26C7E1378A27F7F130E7FEB0380EB01C0EB00E01460135278BD20>40 +D<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C133E131EA2131F7F +A21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E133C137C1378A2 +5BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>I<121C127FEAFF80A213C0 +A3127F121C1200A412011380A2120313005A1206120E5A5A5A12600A19798817>44 +D<B512FCA516057F941C>I<121C127FEAFF80A5EA7F00121C0909798817>I<1506A2150E +150CA2151C151815381530A215701560A215E015C0A214011580A2140315005C1406A214 +0E140CA2141C1418A214381430A21470146014E05CA213015CA2130391C7FCA25B1306A2 +130E130C131C1318A213381330A213701360A213E05BA212015B120390C8FCA25A1206A2 +120E120CA2121C1218A21238123012701260A212E05AA21F537BBD2A>I<EB01C0130313 +07131F13FFB5FCA2131F1200B3B3A7497E007FB512F0A31C3779B62A>49 +D<EB0FF0EB7FFE48B57E3903E03FE0390F000FF0001E6D7E001C6D7E486D7E5A6E7E1260 +12FE6CEC7F807FA56CC7FC121CC8FCEDFF00A25D14015D14035D4A5A4A5A5D4A5A4AC7FC +147E5C495A14E0495A495A49C8FC011EEB01805B5B49130348481400485A485A90C75A48 +B6FC5A5A485CB6FCA321377CB62A>I<EB07F8EB3FFF90B512C03901F80FF03903C007F8 +48486C7E390E0001FEEA0F80391FE000FF7FA56C5A6C5AC7485AA25D14035D4A5A5DEC0F +80027FC7FCEB1FFCECFF809038000FE06E7EEC01FC816E7EED7F80A216C0A2153F16E0A2 +121EEA7F80A2487EA316C0157F491480007EC7FC0070ECFF006C495A121E390F8003F839 +07F00FF00001B512C06C6C90C7FCEB0FF823397DB62A>I<1538A2157815F8A214011403 +1407A2140F141F141B14331473146314C313011483EB030313071306130C131C13181330 +1370136013C01201EA038013005A120E120C5A123812305A12E0B712F8A3C73803F800AA +4A7E0103B512F8A325387EB72A>I<0006140CD80780133C9038F003F890B5FC5D5D1580 +92C7FC14FC38067FE090C9FCAAEB07F8EB1FFE9038780F809038E007E03907C003F0496C +7E130000066D7E81C8FC8181A21680A4121C127F5A7FA390C713005D12FC00605C12704A +5A6C5C6C1303001E495A6C6C485A3907E03F800001B5C7FC38007FFCEB1FE021397CB62A +>I<EC3FC0903801FFF0010713FC90380FE03E90383F800790387E001F49EB3F80484813 +7F485A12075B000FEC3F0049131E001F91C7FC5B123FA3127F90C9FCEB01FC903807FF80 +39FF1E07E090383801F0496C7E01607F01E0137E497F16805BED1FC0A390C713E0A57EA4 +7F123F16C0A2001FEC3F807F000F15006D5B000714FE6C6C5B6C6C485A3900FE07F09038 +7FFFC0011F90C7FCEB03FC23397DB62A>I<EB03F8EB1FFF017F13C03901FC07E048486C +7E3907E001F8000F6D7E4848137E5B003F80A248C71380A25AED1FC0A516E0A56C143FA3 +6C7E157F121F6C6C13FF6C6C13DF000313013901F0039F3900FC0F1FD93FFC13C0EB07F0 +90C7FCA2153F1680A216005D120F486C137E486C5BA24A5A4A5A49485A381F000F001CEB +1F80260F807FC7FC3807FFFE000113F838003FC023397DB62A>57 +D<121C127FEAFF80A5EA7F00121CC7FCB2121C127FEAFF80A5EA7F00121C092479A317> +I<B712C016F816FE000190398001FF806C90C7EA3FE0EE0FF0EE03F8707E707E177FA2EF +3F8018C0171F18E0170F18F0A3EF07F8A418FCAC18F8A4EF0FF0A218E0A2171F18C0EF3F +80A2EF7F0017FE4C5A4C5AEE0FF0EE3FE0486DEBFF80B8C7FC16F816C036397DB83F>68 +D<B812FEA3000190388000076C90C8FC173F838383A383A31880170116C0A394C7FCA315 +01A21503150F91B5FCA3EC000F15031501A21500A21860A318E093C712C0A41701A3EF03 +80A21707A2170F173F177F486D903807FF00B9FCA333397EB838>I<DBFF8013C0020FEB +F001023F13FC9139FF803F03903A03FC000787D90FF0EB03CF4948EB00EF4948147F4948 +143F49C8121F485A4848150F48481507A248481503A2485A1701123F5B007F1600A44848 +1600AB93B6FCA26C7E9338007FE0EF3FC0A2123F7F121FA26C7EA26C7EA26C7E6C7E6C6C +157F6D7E6D6C14FF6D6C14EFD90FF8EB03C7D903FEEB0783903A00FFC03F0191393FFFFC +00020F01F0130002001380383D7CBA41>71 D<B648B512FEA30001902680000313006C90 +C76C5AB3A491B6FCA391C71201B3A6486D497EB648B512FEA337397DB83E>I<B612E0A3 +000101C0C8FC6C90C9FCB3AD1718A517381730A31770A317F0A216011603160FEE1FE048 +6D13FFB8FCA32D397DB834>76 D<B5933807FFF86E5DA20001F0FC002600DFC0ED1BF8A2 +D9CFE01533A3D9C7F01563A3D9C3F815C3A2D9C1FCEC0183A3D9C0FEEC0303A2027F1406 +A36E6C130CA36E6C1318A26E6C1330A36E6C1360A26E6C13C0A3913901FC0180A3913900 +FE0300A2ED7F06A3ED3F8CA2ED1FD8A3ED0FF0A3486C6D5A487ED80FFC6D48497EB500C0 +0203B512F8A2ED018045397DB84C>I<B5913807FFFE8080C69238007FE06EEC1F80D9DF +F0EC0F001706EBCFF8EBC7FCA2EBC3FEEBC1FFA201C07F6E7EA26E7E6E7E81140F6E7E81 +14036E7E168080ED7FC016E0153FED1FF0ED0FF8A2ED07FCED03FEA2ED01FF6F1386A2EE +7FC6EE3FE6A2EE1FF6EE0FFEA216071603A216011600A2177E486C153E487ED80FFC151E +B500C0140EA2170637397DB83E>I<B6903807FFFEA3000101809038007FE06C90C8EA1F +80EF0F001706B3B2170E6D150C80171C133F17186D6C14385F6D6C14F06D6C5C6D6C495A +6D6CEB07806D6C49C7FC91387F807E91381FFFF8020713E09138007F80373B7DB83E>85 +D<007FB590383FFFFCA3C601F801071380D97FE0D903FCC7FC013FEC01F06D6C5C5F6D6C +5C6D6C13034CC8FC6D6C1306160E6D6C5B6DEB8018163891387FC0306E6C5A16E06E6C5A +91380FF18015FB6EB4C9FC5D14036E7EA26E7F6F7EA24B7E15DF9138019FF09138038FF8 +150F91380607FC91380E03FE140C4A6C7EEC38000230804A6D7E14E04A6D7E49486D7E13 +0391C76C7E01066E7E130E010C6E7E011C1401013C8101FE822607FF80010713E0B500E0 +013FEBFF80A339397EB83E>88 D<EB1FE0EBFFFC3803E03F3907000F80390F8007E0486C +6C7E13E06E7EA26E7E6C5A6C5AC8FCA4147FEB07FFEB3FE0EBFE00EA03F8EA0FF0EA1FC0 +123F485A90C7FC160C12FEA31401A26C13036CEB077C903980063E18383FC01E3A0FE078 +1FF03A03FFF00FE03A007F8007C026277DA52A>97 D<EB03FC90381FFF8090387E03E039 +01F80070484813F83907E001FC380FC003A2EA1F80123F90380001F848EB00F01500A212 +7E12FEAA127E127FA26C14067F001F140E6D130C000F141C6C6C13386C6C13706C6C13E0 +39007C07C090381FFF00EB07F81F277DA525>99 D<ED0FC0EC03FFA3EC003F150FB0EB03 +F8EB1FFF90387E078F9038F801EF3903F0007F4848133F4848131FA24848130F123F90C7 +FC5AA2127E12FEAA127E127FA27EA26C6C131FA26C6C133F6C6C137F6C6CEBEFF03A01F8 +01CFFF39007C078F90381FFE0FD907F813C0283B7DB92E>I<EB07F8EB1FFF90387C0FC0 +3901F803E03903F001F0D807E013F8380FC0004848137CA248C7127E153E5A153F127E12 +FEA3B7FCA248C8FCA5127EA2127FA26C14037F001F14076C6C13060007140E6D131CD801 +F013386C6C137090387E03E090381FFF80903803FC0020277EA525>I<147E903803FF80 +90380FC1E0EB1F8790383F0FF0137EA213FCA23901F803C091C7FCADB512FCA3D801F8C7 +FCB3AB487E387FFFF8A31C3B7FBA19>I<ED03F090390FF00FF890393FFC3C3C9039F81F +707C3901F00FE03903E007C03A07C003E010000FECF000A248486C7EA86C6C485AA20007 +5C6C6C485A6D485A6D48C7FC38073FFC38060FF0000EC9FCA4120FA213C06CB512C015F8 +6C14FE6CECFF804815C03A0F80007FE048C7EA0FF0003E140348140116F8481400A56C14 +01007C15F06CEC03E0003F1407D80F80EB0F80D807E0EB3F003901FC01FC39007FFFF001 +0790C7FC26387EA52A>I<EA0380EA0FE0487EA56C5AEA0380C8FCAAEA03F012FFA31207 +1203B3AA487EB512C0A312387EB717>105 D<EA03F012FFA3120F1203B3B3AD487EB512 +C0A3123A7EB917>108 D<2703F00FF0EB1FE000FFD93FFCEB7FF8913AF03F01E07E903B +F1C01F83803F3D0FF3800FC7001F802603F70013CE01FE14DC49D907F8EB0FC0A2495CA3 +495CB3A3486C496CEB1FE0B500C1B50083B5FCA340257EA445>I<EB03FE90380FFF8090 +383E03E09038F800F84848137C48487F48487F4848EB0F80001F15C090C712074815E0A2 +007EEC03F0A400FE15F8A9007E15F0A2007F14076C15E0A26C6CEB0FC0000F15806D131F +6C6CEB3F006C6C137EC66C13F890387E03F090381FFFC0D903FEC7FC25277EA52A>111 +D<3903F01FE000FFEB7FF89038F1E07E9039F3801F803A0FF7000FC0D803FEEB07E049EB +03F04914F849130116FC150016FEA3167FAA16FEA3ED01FCA26DEB03F816F06D13076DEB +0FE001F614C09039F7803F009038F1E07E9038F0FFF8EC1FC091C8FCAB487EB512C0A328 +357EA42E>I<D903F813C090381FFE0190387E07819038FC01C33903F000E30007147748 +48133749133F001F141F485A150F48C7FCA312FEAA127FA37E6D131F121F6D133F120F6C +6C137F6C6C13EF3901F801CF39007E078F90381FFE0FEB07F890C7FCABED1FE00203B5FC +A328357DA42C>I<3807E01F00FFEB7FC09038E1E3E09038E387F0380FE707EA03E613EE +9038EC03E09038FC0080491300A45BB3A2487EB512F0A31C257EA421>I<EBFF03000313 +E7380F80FF381E003F487F487F00707F12F0A2807EA27EB490C7FCEA7FE013FF6C13E06C +13F86C7F00037FC67F01071380EB007F141F00C0EB0FC01407A26C1303A37E15806C1307 +7EEC0F00B4131E38F3C07C38E1FFF038C03F801A277DA521>I<1318A51338A31378A313 +F8120112031207001FB5FCB6FCA2D801F8C7FCB215C0A93800FC011580EB7C03017E1300 +6D5AEB0FFEEB01F81A347FB220>I<D803F0EB07E000FFEB01FFA3000FEB001F00031407 +B3A4150FA3151F12016D133F0000EC77F86D9038E7FF8090383F03C790381FFF87903A03 +FC07E00029267EA42E>I<B538807FFFA33A03FE003FF00001EC1F80000092C7FC017E13 +1C6D13186D6C5AECC070010F5B6D6C5AECF180EB03FB6DB4C8FC6D5AA2147F804A7E8114 +CF903801C7E090380383F090380703F8EB0601496C7E011C137E49137F01787F496D7E48 +6C80000FEC3FF0D8FFFE90B51280A329247FA32C>120 D<B538803FFEA33A0FF8000FF0 +6C48EB07C00003EC03806C7E16007F00001406A2017E5BA2137F6D5BA26D6C5AA2ECC070 +010F1360A26D6C5AA214F101035BA2D901FBC7FCA214FF6D5AA2147CA31438A21430A214 +701460A25CA2EA7C0100FE5B130391C8FC1306EAFC0EEA701C6C5AEA1FF0EA0FC027357E +A32C>I<B712E016FC16FF0001903980007FC06C90C7EA1FE0707E707E707EA2707EA283 +A75F16035F4C5A4C5A4C5A4C5AEEFF8091B500FCC7FCA291C7EA7F80EE1FE0EE07F0707E +707E83707EA21880177F18C0A7188017FFA24C13005F16034C5AEE1FF8486DEB7FF0B812 +C094C7FC16F832397DB83B>194 D<0103B812F8A3903C0003C0000FFC006E486D5AAD92 +C7FC5CA81406A55CA45CA35CA35CA25CA2495A130391C8FC1306130E5B5B137801F84B7E +003FB912FCA301E0C9120790CBFC007C183E0078181EA20070180EA200601806A400E018 +07481803A4404980B841>196 D<B812FEA3000190388000076C90C8FC173F838383A383 +A31880170116C0A394C7FCA31501A21503150F91B5FCA3EC000F15031501A21500A21860 +A318E093C712C0A41701A3EF0380A21707A2170F173F177F486D903807FF00B9FCA33339 +7EB838>I<0060EBFFC0D8700F13F8D8783F13FE3A7C7F00FF80D87FF0EB3FC001C06D7E +496D7E90C76C7E007E81007C6E7E12781501007081A41260A3C85B15035E15075E4B5A4B +5AED3F8003FEC7FC903807FFF85B90380001FF9138003FC0ED0FF06F7E6F7E6F7E6F7E17 +80EE7FC0A2EE3FE0A212C0A57E0060ED7FC0A2007016806C15FF4B13006C5D6C4A5A6C6C +EB0FF8D803E0495AD801FEEBFFC0D8007FB5C7FC011F13FC010113C02B3D7CBA33>199 +D<B649B5FCA3000101809038007FF06C90C8EA3F80053EC7FC173C17385F5F4C5A4C5A4C +C8FC160E5E5E5E5E4B5AED0780030EC9FC5D153E157E15FF5C4A7F4A6C7E140E4A6C7E4A +6C7E14704A6C7E4A6C7E14804A6C7E6F7EA26F7F707EA2707E707EA2707EA2707E707EA2 +707E707F8484486D497FB6011FEBFF80A339397DB841>202 D<B6013FB512C0A3000101 +809039007FE0006C90C86C5AB3A491B7FCA391C8123FB3A6486D4A7EB6013FB512C0A33A +397DB841>205 D<EC03FF021F13E09138FE01FC903901F8007ED907E0EB1F8049486D7E +D93F80EB07F049C76C7E01FE6E7E48486E7E49157E0003167F4848ED3F80A24848ED1FC0 +A2001F17E049150F003F17F0A3007F17F8491507A300FF17FCAC007F17F86D150FA3003F +17F0A26C6CED1FE0A36C6CED3FC0000717806D157F000317006C6C15FEA26C6C4A5A017F +4A5A6D6C495A6D6C495AD907E0EB1F80D903F8017FC7FC903900FE01FC91381FFFE00203 +90C8FC363D7BBA41>I<BA12C0A300010180C7387FE0006C90C86C5AB3B3AD486D4A7EB6 +013FB512C0A33A397DB841>I<913A01FF800180020FEBE003027F13F8903A01FF807E07 +903A03FC000F0FD90FF0EB039F4948EB01DFD93F80EB00FF49C8127F01FE153F12014848 +151F4848150FA248481507A2485A1703123F5B007F1601A35B00FF93C7FCAD127F6DED01 +80A3123F7F001F160318006C7E5F6C7E17066C6C150E6C6C5D00001618017F15386D6C5C +D91FE05C6D6CEB03C0D903FCEB0F80902701FF803FC7FC9039007FFFFC020F13F0020113 +80313D7BBA3C>209 D<49B612E0A3D9000101E0C8FC9138007F80A491381FFFFE0103B6 +12F0903A1FFC7F8FFED97FC0903880FF802601FF00EC3FE0D803FCED0FF048486F7E4848 +6F7E48486F7EA248486F7EA2007F188049167FA200FF18C0A9007F1880A26D16FF003F18 +00A26C6C4B5AA26C6C4B5A6C6C4B5A6C6C4B5A6CB4ED3FE026007FC0ECFF80D91FFCD98F +FEC7FC0103B612F0D9001F49C8FC9138007F80A6913801FFE049B612E0A33A397BB845> +212 D<EB1FE0EBFFFC3803E03F3907000F80390F8007E0486C6C7E13E06E7EA26E7E6C5A +6C5AC8FCA4147FEB07FFEB3FE0EBFE00EA03F8EA0FF0EA1FC0123F485A90C7FC160C12FE +A31401A26C13036CEB077C903980063E18383FC01E3A0FE0781FF03A03FFF00FE03A007F +8007C026277DA52A>224 D<16C01507153FEC07FF027F13800103B51200010F13FC013F +13F0D9FFFEC7FC4813C0D803FCC8FCEA07F0EA0FC05B48C9FC121E5AA212381278387003 +FE90380FFF8090383E03E03960F800F8D861F0137CD8E3E07FD8E7C07FD8EF80EB0F8000 +DF15C090C71207B415E0A248EC03F0A416F8A9007E15F0A2007F14076C15E0A26C6CEB0F +C0000F15806D131F6C6CEB3F006C6C137EC66C13F890387E03F090381FFFC0D903FEC7FC +253B7EB92A>I<B67E15F03907F801FC3903F0007E81ED1F8016C0A5ED3F80160015FEEC +03F890B512C0A29038F000F8153E81ED0FC016E0150716F0A516E0150F16C0151FED7F80 +486CEBFE00B65A15E024247EA32A>I<B612FEA23807F8006C48131E150EA215061507A2 +1503A51500B3EA07FCB512F0A220247EA325>I<013FB612E0A2903A01E003FC006D486C +5AAC14801301A5EB0300A31306A35B131C13185B13F0485A00074A7E007FB712F0A290C8 +1207007C15010070ED0070A20060163000E01638A3481618A52D3180A32E>I<EB07F8EB +1FFF90387C0FC03901F803E03903F001F0D807E013F8380FC0004848137CA248C7127E15 +3E5A153F127E12FEA3B7FCA248C8FCA5127EA2127FA26C14037F001F14076C6C13060007 +140E6D131CD801F013386C6C137090387E03E090381FFF80903803FC0020277EA525>I< +D83FFF90B538C03FFFA2D807FE903A07F8001FF8D801FC6D48EB0FE0D8007C1780011E04 +1EC7FC6D5ED907805DD901C015E0D900E04A5A02704A5A023C020FC8FC020E141C020F14 +3CDA1F83137E91393FE3F1FFEDF3F3913A7F3BF73F80913AFE1FFE1FC049486C486C7EED +03F0D903F86E7ED907F06E7ED90FE06E7EA2D91FC06E7ED93F80157FD97F006F7E017E16 +1F01FE834848707E000384000784000F4A6C80B590B539C03FFFC0A242247FA345>I<38 +C07FF000E3B5FC39FF803FC039FC000FE048EB03F04814F848130115FC5AA2C7FCA215F8 +EC03F0EC07E0EC0FC0EC3F00EB7FF8809038003F80EC0FE0EC03F0EC01F815FC140015FE +A312C0A315FC6C1301006014F80070EB03F0003CEB0FE0000FEB3FC00003B51200C613F0 +1F277EA525>I<B500C1B51280A23B07F8000FF0006C486D5AA4150F151F153F157715E7 +15C71401EC0387EC0707140E140C14181438147014E0EBF1C0148013F3EBF70013FE5B5B +5BA4486C497EB500C1B51280A229247EA32E>I<011E133C017F137F6E5A01FF80A46D48 +6CC7FC013E133E90381FFFFC010713F00100138091C9FCA4B500C1B51280A23B07F8000F +F0006C486D5AA4150F151F153F157715E715C71401EC0387EC0707140E140C1418143814 +7014E0EBF1C0148013F3EBF70013FE5B5B5BA4486C497EB500C1B51280A229347EB32E> +I<B538C03FFFA23A07F8001FF86C48EB0FE01680031EC7FC5D5D15E04A5A4A5A020FC8FC +141C143C147EEBF1FF13F39038F73F809038FE1FC0496C7E13F06E7E6E7E6E7EA26E7E15 +7F6F7E151F826F7E8282486C80B539C03FFFC0A22A247EA32E>I<90B712C0A2903A03C0 +07F8006D486C5AAF13031400A65B13061238127C12FE130E130C131CD8F818497ED87038 +90B512C0EA3FF0D81FC090C8FC2A257FA32E>I<D8FFF0EC0FFF6D5C000716E0000316C0 +017C1437A26D1467A36D14C7A290390F800187A3903907C00307A2903803E006A3903801 +F00CA2903800F818A3EC7C30A2EC3E60A3EC1FC0A23907800F80EA0FC0D81FE0EC0FE027 +FFFC0701B5FCA230247DA337>I<B500C1B51280A23B07F8000FF0006C486D5AAC90B6FC +A29038F00007B0486C497EB500C1B51280A229247EA32E>I<EB03FE90380FFF8090383E +03E09038F800F84848137C48487F48487F4848EB0F80001F15C090C712074815E0A2007E +EC03F0A400FE15F8A9007E15F0A2007F14076C15E0A26C6CEB0FC0000F15806D131F6C6C +EB3F006C6C137EC66C13F890387E03F090381FFFC0D903FEC7FC25277EA52A>I<B81280 +A23B07F8000FF0006C486D5AB3AC486C497EB500C1B51280A229247EA32E>I<3903F01F +E000FFEB7FF89038F1E07E9039F3801F803A0FF7000FC0D803FEEB07E049EB03F04914F8 +49130116FC150016FEA3167FAA16FEA3ED01FCA26DEB03F816F06D13076DEB0FE001F614 +C09039F7803F009038F1E07E9038F0FFF8EC1FC091C8FCAB487EB512C0A328357EA42E> +I<EB03FC90381FFF8090387E03E03901F80070484813F83907E001FC380FC003A2EA1F80 +123F90380001F848EB00F01500A2127E12FEAA127E127FA26C14067F001F140E6D130C00 +0F141C6C6C13386C6C13706C6C13E039007C07C090381FFF00EB07F81F277DA525>I<00 +7FB612E0A2397E03FC07397801F8010070140000601560A200E01570A200C01530A50000 +1500B3EB07FE0003B512FCA224247EA329>I<B538803FFEA23A0FF8000FF86C48EB07E0 +0003EC03C016806C7E16007F00001406A2017E5BA2137F6D5BA26D6C5AA2ECC070010F13 +60A26D6C5AA214F101035BA2D901FBC7FCA214FF6D5AA2147CA31438A21430A214701460 +A25CA2EA7C0100FE5B130391C8FC1306EAFC0EEA701C6C5AEA1FF0EA0FC027357EA32C> +I<153FEC0FFFA31400153FB0D903F8EB07F0D90FFEEB1FFC903B7F07BF783F80903BFC01 +FFE00FC048486C496C7ED807F090397F8003F848486F7E496DC7FC001F834848167FA248 +C7ED3F80A300FEEF1FC0AA007FEF3F80A36C6CEE7F00A26C6C16FE000F5F6D90387F8001 +6C6C496C485AD801F8ED07E06C6C486D485A903B7F07BF783F8090280FFE3F1FFCC7FCD9 +03F8EB07F090C790C9FCAB4B7E91380FFFFCA33A4A7DB941>I<B538807FFFA200079038 +003FF06C48EB1FC06C4891C7FC6C6C131E017E131C6D13186D6C5AECC070010F5B6D6C5A +ECF180EB03FB6DB4C8FC6D5AA2147F804A7E8114CF903801C7E090380383F090380703F8 +EB0601496C7E011C137E49137F01787F496D7E000181000381D81FF8EB3FF8D8FFFE90B5 +1280A229247FA32C>I<B500C1B51280A23B07F8000FF0006C486D5AB3AC486C497EB812 +C0A2C9121F16071601A2160017E0A31760A52B317EA32E>I<B500C1B51280A23B07F800 +0FF0006C486D5AAC6C7E0000141F017E13FF90383FFFE70107130790C7FCAD4B7E4AB512 +80A229247EA32E>I<B500C3B5380FFFFCA23D07F8001FE0007F806C486D48EB3F00B3AC +486C496CEB7F80BA12FCA23E247EA343>I<B500C3B5380FFFFCA23D07F8001FE0007F80 +6C486D48EB3F00B3AC486C496CEB7F80BA12FEA2CCFC193E190EA219061907A31903A540 +317EA343>I<007FB5FCA2387E03FC387801F812701260A212E0A212C0A5120091B512E0 +16FC9138F800FFEE3F80EE1FC0EE0FE0EE07F0A2EE03F8A5EE07F0A2EE0FE0EE1FC0EE3F +80496CEBFF00017FB512FC16E02D247EA333>I<B500C00107B5FCA2D807F8C8EA3FC06C +48151F1880AB90B512C015F89038F001FEEC007FED3F80ED1FC0ED0FE0A2ED07F0A5ED0F +E0A2ED1FC0ED3F80DB7F0013C02707F801FE133FB6D8F807B5FC15C038247EA33C>I<B5 +12C0A2D807F8C8FC6C5AAC90B512C015F89038F001FEEC007FED3F80ED1FC0ED0FE0A2ED +07F0A5ED0FE0A2ED1FC0ED3F80ED7F003907F801FEB612F815C024247EA32A>I<EB3F80 +38C1FFF038E7C0FC38FE003F48EB1F8048EB0FC048EB07E05AEC03F04814F8C7120115FC +A3140015FEEA03FE380FFF8014FFEA003FEB0FFCEB03C090C7FCA315FC1401A200C014F8 +14036C14F000601307007014E06CEB0FC06CEB1F806CEB3F003807C07C3801FFF038003F +C01F277EA525>I<EE1FE0EEFFFCB539C003F03F923907C00F803C07F8000F0003C06C48 +011E6D7E033E804B6D7E03FC804B147C0201157EA24A4880A302071680A290B5FCA2EBF0 +07A602031600A26F5C0201157EA26E6C5C037C5C037E1301033E5C6F495A486C903907C0 +0F80B527C003F03FC7FC923800FFFCC9EA1FE039277EA53E>I<49B61280131F903A7F00 +0FF00001FC6D5A485A485A1207A512037F1201EA00FEEB3F80010FB5FC1300ECFE0714FC +EB01F8EB03F0130714E0EB0FC0EB1F80133FEB7F00137E13FE485A485A1207001F4A7EB5 +48B51280A229247FA32D>I E +%EndDVIPSBitmapFont +end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 600dpi +TeXDict begin +%%PaperSize: A4 + end +%%EndSetup +%%Page: 1 1 +TeXDict begin 1 0 bop 1234 -45 a Fi +(\321\357\360\340\342\356\367\355\340\377)26 b(\352)n(\340\360\362)n +(\340)h(\357\356)g(GNU)i(Emacs)1583 55 y(\(\344\353\377)g +(\342\345\360\361\350\350)e(21\))-128 330 y Fh(1)132 +b(\307\340\357\363)l(\361\352)45 b(Emacs)-128 511 y Fi(\304\353\377)28 +b(\347\340\357\363)n(\361\352)n(\340)e(GNU)i(Emacs)f(21,)g +(\357\360\356\361\362\356)g(\355\340\341\345\360\350\362\345)h +(\350\354\377)g(\357\360\356\343\360\340\354\354\373:)f +Fg(emacs)-128 611 y Fi(\316)h(\362\356\354,)g(\352)n(\340\352)f +(\356\362\352\360\373\342\340\362\374)g(\364\340\351\353\373,)g +(\367\350\362)n(\340\351\362\345)h(\344\340\353\345\345)f(\342)g +(\360\340\347\344\345\353\345)g(\324\340\351\353\373.)-128 +886 y Fh(2)132 b(\302\373\365)l(\356)l(\344)45 b(\350\347)f(Emacs)-78 +1065 y Fi(\317\360\350\356\361\362)n(\340\355\356\342\350\362\374)26 +b(\360\340\341\356\362\363)h(Emacs)g(\(\350\353\350)h +(\361\342\345\360\355\363\362\374)f(\342)g(\350\352)n(\356\355\352\363) +h(\357\360\350)g(\360\340\341\356\362\345)e(\342)h(X\))255 +b Fg(C-z)-78 1165 y Fi(\302\373\351\362\350)28 b(\350\347)g(Emacs)2307 +b Fg(C-x)42 b(C-c)-128 1410 y Fh(3)132 b(\324\340\351\353\373)-78 +1570 y Ff(\356\362\352\360\373\362\374)28 b Fi(\364\340\351\353)f(\342) +g(\341\363\364\345\360\345)f(Emacs)1717 b Fg(C-x)42 b(C-f)-78 +1670 y Ff(\361\356)m(\365\360\340\355\350\362\374)29 +b Fi(\364\340\351\353)e(\356\341\360\340\362\355\356)g(\355\340)g +(\344\350\361\352)1627 b Fg(C-x)42 b(C-s)-78 1770 y Fi(\361\356)n +(\365\360\340\355\350\362\374)27 b Ff(\342\361\345)g +Fi(\364\340\351\353\373)2104 b Fg(C-x)42 b(s)-78 1869 +y Ff(\342\361\362)m(\340\342\350\362\374)29 b Fi(\361\356)n +(\344\345\360)n(\346\350\354\356\345)d(\344\360\363\343\356\343\356)h +(\364\340\351\353\340)f(\342)h(\362\345\352\363\371\350\351)h +(\341\363\364\345\360)809 b Fg(C-x)42 b(i)-78 1969 y +Fi(\356\362\352\360\373\362\374)28 b(\355\363\346\355\373\351)g +(\342\340\354)f(\364\340\351\353)g(\342\354\345\361\362\356)g +(\362\345\352\363\371\345\343\356)1226 b Fg(C-x)42 b(C-v)-78 +2068 y Fi(\361\356)n(\365\360\340\355\350\362\374)27 +b(\341\363\364\345\360)f(\342)h(\363\352)n +(\340\347\340\355\355\356\354)g(\364\340\351\353\345)1534 +b Fg(C-x)42 b(C-w)-78 2168 y Fi +(\302\352\353\376\367\350\362\374/\342\373\352\353\376\367\350\362\374) +28 b(\361\356\361\362\356)n(\377\355\350\345)f +(\341\363\364\345\360\340)f(\020\362\356\353\374\352)n(\356)g +(\344\353\377)i(\367\362\345\355\350\377\021)581 b Fg(C-x)42 +b(C-q)-128 2413 y Fh(4)132 b(\317\356\353\363\367\345\355\350\345)43 +b(\357\356\354\356\371\350)-128 2595 y Fi +(\321\357\360\340\342\356\367\355\340\377)19 b +(\361\350\361\362\345\354\340)i(\344\356\361\362)n +(\340\362\356\367\355\356)e(\357\360\356\361\362)n(\340.)h +(H\340\346\354\350\362\345)i Fg(C-h)d Fi(\(\350\353\350)i +Fg(F1)p Fi(\))f(\350)h(\361\353\345\344\363\351\362\345)g +(\350\355\361\362\360\363\352\366\350\377\354.)g(\305\361\353\350)h +(\342\373)d(\342)i(\357\345\360\342\373\351)-128 2695 +y(\360\340\347)28 b(\360\340\341\356\362)n(\340\345\362\345)e(\361)h +(Emacs,)h(\355\340\341\345\360\350\362\345)f Fg(C-u)43 +b(C-h)f(t)h(Russian)e(RET)26 b Fi(\344\353\377)i +(\342\373\347\356\342\340)d Ff(\363\367\345\341\355\350\352)m(\340)p +Fi(.)-78 2789 y(\307\340\352\360\373\362\374)i(\356\352\355\356)g +(\361\357\360\340\342\352\350)2072 b Fg(C-x)42 b(1)-78 +2889 y Fi(\317\360\356\352\360\363\362\350\362\374)28 +b(\356\352\355\356)f(\361\357\360\340\342\352\350)1940 +b Fg(C-M-v)-78 2988 y Fi(aprop)r(os:)26 b(\357\356\352)n +(\340\347\340\362\374)g(\352)n(\356\354\340\355\344\373,)h +(\361\356\356\362\342\345\362\361\362\342\363\376\371\350\345)g +(\361\362\360\356\352)n(\345)921 b Fg(C-h)42 b(a)-78 +3088 y Fi(\357\356\352)n(\340\347\340\362\374)26 b(\350\354\377)i +(\364\363\355\352\366\350\350,)g(\352)n(\356\362\356\360\340\377)f +(\347\340\357\363)n(\361\352)n(\340\345\362\361)n(\377)e +(\352\353\340\342\350\370\345\351)835 b Fg(C-h)42 b(c)-78 +3187 y Fi(\356\357\350\361\340\362\374)27 b +(\364\363\355\352\366\350\376)2257 b Fg(C-h)42 b(f)-78 +3287 y Fi(\357\356\353\363\367\350\362\374)28 b +(\350\355\364\356\360\354\340\366\350\376)f(\356)g +(\360\345\346\350\354\345)1672 b Fg(C-h)42 b(m)-128 3533 +y Fh(5)132 b(\310\361\357\360\340\342\353\345\355\350\345)43 +b(\356\370\350\341\356\352)-78 3717 y Ff +(\357\360\345\360\342\340\362\374)28 b Fi +(\367\340\361\362\350\367\355\356)f +(\355\340\341\360\340\355\355\363\376)g(\350\353\350)h +(\350\361\357\356\353\355\377\345\354\363\376)g(\352)n +(\356\354\340\355\344\363)682 b Fg(C-g)-78 3816 y Ff +(\342\356\361\361\362)m(\340\355\356\342\350\362\374)29 +b Fi(\364\340\351\353,)e(\357\356\362\345\360)n(\377\355\355\373\351)g +(\357\360\350)h(\352\360\340\365)n(\345)f(\361\350\361\362\345\354\373) +895 b Fg(M-x)2857 3916 y(recover-file)-78 4016 y Ff +(\356\362\354\345\355\350\362\374)27 b Fi(\355\345\346)n +(\345\353\340\362\345\353\374\355\373\345)g +(\350\347\354\345\355\345\355\350\377)1502 b Fg(C-x)42 +b(u)h Fi(\350\353\350)h Fg(C-_)-78 4115 y Fi(\342\356\361\361\362)n +(\340\355\356\342\350\362\374)26 b(\341\363\364\345\360)g(\342)h +(\357\345\360\342\356\355\340)n(\367\340\353\374\355\356\345)e +(\361\356\361\362\356)n(\377\355\350\345)1086 b Fg(M-x)2857 +4215 y(revert-buffer)-78 4315 y Fi +(\357\345\360\345\360\350\361\356\342\340\362\374)27 +b(\347\340\357\356\353\355\345\355\355\373\351)g(\354\363)n +(\361\356\360\356\354)f(\375\352\360\340\355)1321 b Fg(C-l)-128 +4560 y Fh(6)132 b(H\340\360\340\371\350\342\340\345\354\373\351)41 +b(\357\356\350\361\352)-78 4743 y Fi(\357\356\350\361\352)28 +b(\342\357\345\360\345\344)2436 b Fg(C-s)-78 4843 y Fi +(\357\356\350\361\352)28 b(\355\340\347\340\344)2477 +b Fg(C-r)-78 4943 y Fi(\357\356\350\361\352)28 b(\357\356)f +(\360\345\343\363)-5 b(\353\377\360\355\356\354\363)28 +b(\342\373\360\340\346)n(\345\355\350\376)1616 b Fg(C-M-s)-78 +5042 y Fi(\357\356\350\361\352)28 b(\357\356)f(\360\345\343\363)-5 +b(\353\377\360\355\356\354\363)28 b(\342\373\360\340\346)n +(\345\355\350\376)f(\355\340\347\340\344)1376 b Fg(C-M-r)-78 +5142 y Fi(\342\373\341\360\340\362\374)26 b +(\357\360\345\344\373\344\363\371\363\376)i(\361\362\360\356\352\363)g +(\357\356\350\361\352)n(\340)1527 b Fg(M-p)-78 5241 y +Fi(\342\373\341\360\340\362\374)26 b +(\361\353\345\344\363\376\371\363\376)i(\361\362\360\356\352\363)g +(\357\356\350\361\352)n(\340)1580 b Fg(M-n)-78 5341 y +Fi(\357\360\345\352\360\340\362\350\362\374)28 b +(\355\340\360\340\371\350\342\340\345\354\373\351)f +(\357\356\350\361\352)1659 b Fg(RET)-78 5441 y Fi +(\356\362\354\345\355\350\362\374)28 b(\375\364\364\345\352\362)g +(\342\342\356)n(\344\340)d(\357\356\361\353\345\344\355\345\343\356)i +(\361\350\354\342\356\353\340)1248 b Fg(DEL)-78 5540 +y Fi(\357\360\345\360\342\340\362\374)27 b +(\362\345\352\363\371\350\351)h(\357\356\350\361\352)1994 +b Fg(C-g)-128 5636 y Fi(\304\353\377)26 b(\357\356\342\362\356\360\340) +f(\357\356\350\361\352)n(\340)f(\342)i(\353\376\341\356\354)f +(\355\340\357\360\340\342\353\345\355\350\350)h +(\350\361\357\356\353\374\347\363\351\362\345)f +(\352\353\340\342\350\370\350)g Fg(C-s)g Fi(\350\353\350)h +Fg(C-r)p Fi(.)f(\305\361\353\350)h(Emacs)g(\342\361\345)f(\345\371\345) +h(\357\360\356\350\347-)-128 5736 y(\342\356)n(\344\350\362)i +(\357\356\350\361\352,)f Fg(C-g)f Fi(\356\362\354\345\355\350\362)j +(\362\356\353\374\352)n(\356)e(\355\345\361)n +(\344\345\353\340\355\355\363\376)g(\367\340\361\362\374.)1860 +6192 y(1)p eop end +%%Page: 2 2 +TeXDict begin 2 1 bop -128 -45 a Fh(7)132 b +(\317\345\360\345\354\345\371\345\355\350\345)-78 139 +y Ff(\345\344\350\355\350\366\373)32 b +(\357\345\360\345\354\345\371\345\355\350\377)1944 b +(\355\340\347\340\344)450 b(\342\357\345\360\345\344)-78 +239 y Fi(\361\350\354\342\356\353)2667 b Fg(C-b)558 b(C-f)-78 +338 y Fi(\361\353\356\342\356)2726 b Fg(M-b)558 b(M-f)-78 +438 y Fi(\361\362\360\356\352)n(\340)2683 b Fg(C-p)558 +b(C-n)-78 537 y Fi(\355\340)n(\367\340\353\356)26 b(\(\350\353\350)j +(\352)n(\356\355\345\366\))e(\361\362\360\356\352\350)1916 +b Fg(C-a)558 b(C-e)-78 637 y Fi(\357\360\345\344\353\356)n(\346)n +(\345\355\350\345)2441 b Fg(M-a)558 b(M-e)-78 737 y Fi +(\340\341\347\340\366)2726 b Fg(M-{)558 b(M-})-78 836 +y Fi(\361\362\360\340\355\350\366\340)2589 b Fg(C-x)42 +b([)472 b(C-x)42 b(])-78 936 y Fi(\342\373\360\340\346)n +(\345\355\350\345)27 b(\(sexp\))2261 b Fg(C-M-b)470 b(C-M-f)-78 +1036 y Fi(\364\363\355\352\366\350\377)2597 b Fg(C-M-a)470 +b(C-M-e)-78 1135 y Fi(\357\345\360\345\365)n(\356)n(\344)27 +b(\342)g(\355\340)n(\367\340\353\356)f(\(\350\353\350)i(\352)n +(\356\355\345\366\))g(\341\363\364\345\360\340)1508 b +Fg(M-<)558 b(M->)-78 1243 y Fi(\357\360\356\352\360\363\362\352)n(\340) +27 b(\375\352\360\340\355\340)g(\342\355\350\347)2054 +b Fg(C-v)-78 1343 y Fi(\357\360\356\352\360\363\362\352)n(\340)27 +b(\375\352\360\340\355\340)g(\342\342\345\360)n(\365)2016 +b Fg(M-v)-78 1442 y Fi(\357\360\356\352\360\363\362\352)n(\340)27 +b(\342\353\345\342\356)2302 b Fg(C-x)42 b(<)-78 1542 +y Fi(\357\360\356\352\360\363\362\352)n(\340)27 b +(\342\357\360\340\342\356)2251 b Fg(C-x)42 b(>)-78 1642 +y Fi(\357\360\356\352\360\363\362\352)n(\340)27 b +(\362\345\352\363\371\345\351)h(\361\362\360\356\352\350)g(\342)f +(\366\345\355\362\360)i(\375\352\360\340\355\340)1306 +b Fg(C-u)42 b(C-l)-128 1887 y Fh(8)132 b(\323\355\350\367\362\356)l +(\346)l(\345\355\350\345)44 b(\350)g(\363)-7 b +(\344\340\353\345\355\350\345)-78 2070 y Ff(\363\355\350\367\362\356)m +(\346)m(\340\345\354\373\351)33 b(\356\341\372\345\352\362)1956 +b(\355\340\347\340\344)450 b(\342\357\345\360\345\344)-78 +2170 y Fi(\361\350\354\342\356\353)27 b(\(\363)-5 b +(\344\340\353\345\355\350\345,)28 b(\340)f(\355\345)h +(\363\355\350\367\362\356)n(\346)n(\345\355\350\345\))1510 +b Fg(DEL)558 b(C-d)-78 2270 y Fi(\361\353\356\342\356)2726 +b Fg(M-DEL)470 b(M-d)-78 2369 y Fi(\361\362\360\356\352)n(\340)27 +b(\(\344\356)h(\352)n(\356\355\366\340)e(\361\362\360\356\352\350\)) +1972 b Fg(M-0)42 b(C-k)384 b(C-k)-78 2469 y Fi +(\357\360\345\344\353\356)n(\346)n(\345\355\350\345)2441 +b Fg(C-x)42 b(DEL)384 b(M-k)-78 2569 y Fi(\342\373\360\340\346)n +(\345\355\350\345)2512 b Fg(M\025)42 b(C-M-k)340 b(C-M-k)-78 +2676 y Fi(\363\355\350\367\362\356)n(\346\350\362\374)28 +b Ff(\356\341\353\340\361\362\374)2116 b Fg(C-w)-78 2776 +y Fi(\361\352)n(\356\357\350\360\356\342\340\362\374)26 +b(\356\341\353\340\361\362\374)g(\342)h(\361\357\350\361\356\352)h +(\363\355\350\367\362\356)n(\346)n(\345\355\350\351)1265 +b Fg(M-w)-78 2876 y Fi(\363\355\350\367\362\356)n(\346\350\362\374)28 +b(\344\356)f(\361\353\345\344\363\376\371\345\343\356)g(\342\365)n +(\356)n(\346\344\345\355\350\377)f(\361\350\354\342\356\353\340)h +Fe(char)916 b Fg(M-z)42 b Fe(char)-78 2975 y Fi(\342\361\362)n +(\340\342\350\362\374)27 b(\357\356\361\353\345\344\355\350\351)g +(\363\355\350\367\362\356)n(\346)n(\345\355\355\373\351)h +(\356\341\372\345\352\362)1306 b Fg(C-y)-78 3075 y Fi +(\347\340\354\345\355\350\362\374)24 b(\362\356\353\374\352)n(\356)e +(\367\362\356)i(\342\356\361\361\362)n +(\340\355\356\342\353\345\355\355\373\351)d(\362\345\352)n(\361\362)k +(\357\360\345\344\370\345\361\362\342\363\376\371\350\354)f +(\363\355\350\367\362\356)n(\346)n(\345\355-)-78 3175 +y(\355\373\354)k(\362\345\352)n(\361\362\356\354)2857 +3075 y(M-y)-128 3420 y Fh(9)132 b(\317\356\354\345\362\352)l(\340)-78 +3580 y Fi(\363)n(\361\362)n(\340\355\356\342\350\362\374)26 +b(\357\356\354\345\362\352\350)2177 b Fg(C-@)42 b Fi(or)g +Fg(C-SPC)-78 3680 y Fi(\356\341\354\345\355\377\362\374)27 +b(\354\345\361\362)n(\340\354\350)h(\352\363\360\361\356\360)f(\350)h +(\357\356\354\345\362\352\363)1546 b Fg(C-x)42 b(C-x)-78 +3779 y Fi(\357\356\354\345\362\350\362\374)28 b Fe(ar)l(g)36 +b Ff(\361\353\356\342)2219 b Fg(M-@)-78 3879 y Fi +(\357\356\354\345\362\350\362\374)28 b Ff +(\357\340\360\340\343\360\340\364)2144 b Fg(M-h)-78 3979 +y Fi(\357\356\354\345\362\350\362\374)28 b Ff +(\361\362\360\340\355\350\366\363)2162 b Fg(C-x)42 b(C-p)-78 +4078 y Fi(\357\356\354\345\362\350\362\374)28 b Ff +(\342\373\360\340\346)m(\345\355\350\345)2071 b Fg(C-M-@)-78 +4178 y Fi(\357\356\354\345\362\350\362\374)28 b Ff +(\364\363\355\352\366\350\376)2148 b Fg(C-M-h)-78 4277 +y Fi(\357\356\354\345\362\350\362\374)28 b(\342\345\361\374)f +Ff(\341\363\364\345\360)2102 b Fg(C-x)42 b(h)-128 4523 +y Fh(10)131 b(\307\340\354\345\355\340)44 b(\361)g +(\347\340\357\360\356\361\356\354)-78 4706 y Fi +(\350\355\362\345\360\340\352\362\350\342\355\340\377)28 +b(\347\340\354\345\355\340)f(\362\345\352)n(\361\362\356\342\356\351)g +(\361\362\360\356\352\350)1398 b Fg(M-\045)-78 4806 y +Fi(\361)28 b(\350\361\357\356\353\374\347\356\342\340\355\350\345\354)e +(\360\345\343\363)-5 b(\353\377\360\355\373\365)27 b +(\342\373\360\340\346)n(\345\355\350\351)1333 b Fg(M-x)42 +b(query-replace-r)o(ege)o(xp)-128 4901 y Fi(\302)28 b +(\360\345\346\350\354\345)g +(\350\355\362\345\360\340\352\362\350\342\355\356\351)g +(\347\340\354\345\355\373)f +(\357\356\353\374\347\356\342\340\362\345\353\376)f +(\344\356\361\362\363\357\355\373)i +(\361\353\345\344\363\376\371\350\345)g(\356\362\342\345\362\373:)-78 +4995 y Ff(\347\340\354\345\355\350\362\374)g Fi +(\344\340\355\355\356\345)f +(\361\356\356\362\342\345\362\361\362\342\350\345,)g +(\357\345\360\345\351\362\350)h(\352)g +(\361\353\345\344\363\376\371\345\354\363)815 b Fg(SPC)-78 +5095 y Fi(\347\340\354\345\355\350\362\374)28 b(\375\362\356)f +(\361\356\356\362\342\345\362\361\362\342\350\345,)g(\355\345)h +(\357\345\360\345\354\345\371\340\362\374\361)n(\377)1238 +b Fg(,)-78 5194 y Ff(\357\360\356\357\363)m(\361\362\350\362\374)29 +b Fi(\361\356\356\362\342\345\362\361\362\342\350\345)e(\341\345\347)g +(\347\340\354\345\355\373)1487 b Fg(DEL)-78 5294 y Fi +(\347\340\354\345\355\350\362\374)28 b(\342\361\345)f(\356\361\362)n +(\340\342\370\350\345\361)n(\377)e +(\361\356\356\362\342\345\362\361\362\342\350\377)1468 +b Fg(!)-78 5393 y Ff(\342\345\360\355\363\362\374\361)m(\377)29 +b Fi(\352)f(\357\360\345\344\373\344\363\371\345\354\363)f +(\361\356\356\362\342\345\362\361\362\342\350\376)1337 +b Fg(\002)-78 5493 y Ff(\342\373\351\362\350)28 b Fi(\350\347)g +(\360\345\346\350\354\340)f(\347\340\354\345\355\340)g(\361)h +(\347\340\357\360\356\361\356\354)1508 b Fg(RET)-78 5593 +y Fi(\342\356\351\362\350)38 b(\342)g(\360\345\346\350\354)h +(\360\345\352\363\360\361\350\342\355\356\343\356)d +(\360\345\344\340\352\362\350\360\356\342\340\355\350\377)i +(\(\344\353\377)g(\342\373\365)n(\356)n(\344\340)e +(\350\361\357\356\353\374\347\363)n(\345\362\361)n(\377)-78 +5692 y Fg(C-M-c)p Fi(\))2857 5593 y Fg(C-r)1860 6192 +y Fi(2)p eop end +%%Page: 3 3 +TeXDict begin 3 2 bop -128 -45 a Fh(11)131 b(\314\355\356)l(\346)l +(\345\361\362\342\356)44 b(\356\352)l(\356\355)-128 137 +y Fi(\312\356\354\340\355\344\373,)27 b +(\357\360\350\342\345\344\345\355\355\373\345)h(\342\356)e +(\342\362\356\360\356\354)h(\361\362\356\353\341\366\345,)h +(\357\360\350\354\345\355\377\376\362\361)n(\377)g(\352)g +(\344\360\363\343\356\354\363)f +(\(\355\345\340\352\362\350\342\355\356\354\363\))h(\356\352\355\363)-7 +b(.)-78 236 y(\363)i(\344\340\353\350\362\374)28 b(\342\361\345)f +(\356\361\362)n(\340\353\374\355\373\345)f(\356\352\355\340)1869 +b Fg(C-x)42 b(1)-78 344 y Fi(\360\340\347\341\350\362\374)27 +b(\356\352\355\356)g(\357\356)g(\343\356\360\350\347\356\355\362)n +(\340\353\350)1825 b Fg(C-x)42 b(2)472 b(C-x)42 b(5)h(2)-78 +444 y Fi(\363)-5 b(\344\340\353\350\362\374)28 b +(\344\340\355\355\356\345)f(\356\352\355\356)2143 b Fg(C-x)42 +b(0)472 b(C-x)42 b(5)h(0)-78 543 y Fi(\360\340\347\341\350\362\374)27 +b(\356\352\355\356)g(\357\356)g(\342\345\360\362\350\352)n +(\340\353\350)1904 b Fg(C-x)42 b(3)-78 643 y Fi +(\342\373\357\356\353\355\350\362\374)27 b +(\357\360\356\352\360\363\362\352\363)h(\342)f +(\344\360\363\343\356\354)h(\356\352\355\345)1530 b Fg(C-M-v)-78 +751 y Fi(\357\345\360\345\354\345\361\362\350\362\374)29 +b(\352\363\360\361\356\360)e(\342)g(\344\360\363\343\356\345)g +(\356\352\355\356)1629 b Fg(C-x)42 b(o)472 b(C-x)42 b(5)h(o)-78 +850 y Fi(\342\373\341\360\340\362\374)26 b(\341\363\364\345\360)h(\342) +g(\344\360\363\343\356\354)h(\356\352\355\345)1795 b +Fg(C-x)42 b(4)h(b)385 b(C-x)42 b(5)h(b)-78 950 y Fi(\357\356\352)n +(\340\347\340\362\374)26 b(\341\363\364\345\360)h(\342)g +(\344\360\363\343\356\354)g(\356\352\355\345)1775 b Fg(C-x)42 +b(4)h(C-o)297 b(C-x)42 b(5)h(C-o)-78 1050 y Fi +(\347\340\343\360\363\347\350\362\374)27 b(\364\340\351\353)g(\342)g +(\344\360\363\343\356\345)g(\356\352\355\356)1786 b Fg(C-x)42 +b(4)h(f)385 b(C-x)42 b(5)h(f)-78 1149 y Fi +(\356\362\352\360\373\362\374)28 b(\364\340\351\353)f(\342)g +(\360\345\346\350\354\345)h(\367\362\345\355\350\377)h(\342)e +(\344\360\363\343\356\354)g(\356\352\355\345)1149 b Fg(C-x)42 +b(4)h(r)385 b(C-x)42 b(5)h(r)-78 1249 y Fi(\347\340\357\363)n +(\361\362\350\362\374)27 b(Dired)h(\342)f(\344\360\363\343\356\354)h +(\356\352\355\345)1766 b Fg(C-x)42 b(4)h(d)385 b(C-x)42 +b(5)h(d)-78 1349 y Fi(\355\340\351\362\350)28 b(\362)n(\340\343)g(\342) +f(\344\360\363\343\356\354)g(\356\352\355\345)2003 b +Fg(C-x)42 b(4)h(.)385 b(C-x)42 b(5)h(.)-78 1457 y Fi +(\363\342\345\353\350\367\350\362\374)28 b(\342\373\361\356\362\363)e +(\356\352\355\340)2049 b Fg(C-x)42 b(\002)-78 1556 y +Fi(\361\363\347\350\362\374)28 b(\362\345\352\363\371\345\345)f +(\356\352\355\356)2148 b Fg(C-x)42 b({)-78 1656 y Fi +(\360\340\361\370\350\360\350\362\374)28 b +(\362\345\352\363\371\345\345)f(\356\352\355\356)1982 +b Fg(C-x)42 b(})-128 1901 y Fh(12)131 b +(\324\356\360\354\340\362\350\360\356\342\340\355\350\345)-78 +2085 y Fi(\361)n(\344\345\353\340\362\374)27 b +(\356\362\361\362\363\357)h(\344\353\377)g +(\362\345\352\363\371\345\351)g Ff(\361\362\360\356\352\350)g +Fi(\(\342)f(\347\340\342\350\361\350\354\356\361\362\350)g(\356\362)h +(\360\345\346\350\354\340\))470 b Fg(TAB)-78 2184 y Fi(\361)n +(\344\345\353\340\362\374)27 b(\356\362\361\362\363\357)h(\344\353\377) +g Ff(\356\341\353\340\361\362\350)g Fi(\(\342)g +(\347\340\342\350\361\350\354\356\361\362\350)f(\356\362)g +(\360\345\346\350\354\340\))775 b Fg(C-M-)p Fd(n)-78 +2284 y Fi(\361)n(\344\345\353\340\362\374)27 b +(\356\362\361\362\363\357)h(\344\353\377)g Ff(\342\373\360\340\346)m +(\345\355\350\377)h Fi(\(\342)e +(\347\340\342\350\361\350\354\356\361\362\350)g(\356\362)h +(\360\345\346\350\354\340\))617 b Fg(C-M-q)-78 2383 y +Fi(\361)n(\344\345\353\340\362\374)27 b(\356\362\361\362\363\357)h +(\352)g(\347\340\344\340\355\355\356\351)e Fe(ar)l(g)36 +b Fi(\352)n(\356\353\356\355\352)n(\345)1445 b Fg(C-x)42 +b(TAB)-78 2483 y Fi(\342\361\362)n(\340\342\350\362\374)27 +b(\355\356\342\363\376)f(\361\362\360\356\352\363)i +(\357\356\361\353\345)f(\352\363\360\361\356\360\340)1493 +b Fg(C-o)-78 2583 y Fi(\361)n(\344\342\350\355\363\362\374)27 +b(\356\361\362)n(\340\362\356\352)g(\361\362\360\356\352\350)h +(\342\345\360\362\350\352)n(\340\353\374\355\356)e(\342\355\350\347) +1293 b Fg(C-M-o)-78 2682 y Fi(\363)-5 b(\344\340\353\350\362\374)28 +b(\357\363)n(\361\362\373\345)f(\361\362\360\356\352\350)h +(\342\356\352\360\363\343)f(\352\363\360\361\356\360\340)1442 +b Fg(C-x)42 b(C-o)-78 2782 y Fi +(\356\341\372\345\344\350\355\350\362\374)27 b +(\361\362\360\356\352\363)h(\361)f +(\357\360\345\344\373\344\363\371\345\351)h(\(\361\356)f +(\361\353\345\344\363\376\371\350\354\350)h(arg\))817 +b Fg(M-\002)-78 2882 y Fi(\363)-5 b(\344\340\353\350\362\374)28 +b(\357\363)n(\361\362\356\345)f +(\357\360\356\361\362\360\340\355\361\362\342\356)g +(\342\356\352\360\363\343)g(\352\363\360\361\356\360\340)1211 +b Fg(M-)p Fd(n)-78 2981 y Fi(\357\356\354\345\361\362\350\362\374)28 +b(\362\356\353\374\352)n(\356)f(\356)n(\344\350\355)g +(\357\360\356\341\345\353)g(\342)g(\357\356\347\350\366\350\350)h +(\352\363\360\361\356\360\340)1036 b Fg(M-SPC)-78 3081 +y Fi(\347\340\357\356\353\355\350\362\374)27 b +(\362\345\352\363\371\350\351)h(\357\340\360\340\343\360\340\364)1799 +b Fg(M-q)-78 3180 y Fi(\363)n(\361\362)n(\340\355\356\342\350\362\374) +26 b(\361\362\356\353\341\345\366)h +(\347\340\357\356\353\355\345\355\350\377)1739 b Fg(C-x)42 +b(f)-78 3280 y Fi(\363)n(\361\362)n(\340\355\356\342\350\362\374)26 +b(\357\360\345\364\350\352)n(\361)h +(\347\340\357\356\353\355\345\355\350\377)g(\352)n +(\340\346\344\356\351)g(\361\362\360\356\352\350)1108 +b Fg(C-x)42 b(.)-78 3380 y Fi(\363)n(\361\362)n +(\340\355\356\342\350\362\374)26 b(\355\340)n(\367\345\360\362)n +(\340\355\350\345)2065 b Fg(M-g)-128 3625 y Fh(13)131 +b(\310\347\354\345\355\345\355\350\345)44 b +(\360\345\343\350\361\362\360\340)-78 3808 y Fi(\361)n +(\344\345\353\340\362\374)27 b(\341\363\352\342\373)g +(\361\353\356\342\340)f(\347\340\343)n(\353\340\342\355\373\354\350) +1672 b Fg(M-u)-78 3908 y Fi(\361)n(\344\345\353\340\362\374)27 +b(\341\363\352\342\373)g(\361\353\356\342\340)f +(\361\362\360\356\367\355\373\354\350)1704 b Fg(M-l)-78 +4008 y Fi(\361)n(\344\345\353\340\362\374)27 b +(\357\345\360\342\363\376)g(\341\363\352\342\363)g +(\361\353\356\342\340)f(\347\340\343)n(\353\340\342\355\356\351)1457 +b Fg(M-c)-78 4107 y Fi(\361)n(\344\345\353\340\362\374)27 +b(\341\363\352\342\373)g(\356\341\353\340\361\362\350)f(\347\340\343)n +(\353\340\342\355\373\354\350)1585 b Fg(C-x)42 b(C-u)-78 +4207 y Fi(\361)n(\344\345\353\340\362\374)27 b(\341\363\352\342\373)g +(\356\341\353\340\361\362\350)f(\361\362\360\356\367\355\373\354\350) +1617 b Fg(C-x)42 b(C-l)-128 4453 y Fh(14)131 b +(\314\350\355\350\341\363\364\345\360)-128 4635 y Fi +(\321\353\345\344\363\376\371\350\345)28 b +(\352\353\340\342\350\370\350)f(\(\352\353\376\367\350\))i +(\356\357\360\345\344\345\353\345\355\373)e(\342)h +(\354\350\355\350\341\363\364\345\360\345.)-78 4734 y +(\344\356\357\356\353\355\350\362\374)f(\355\340\361\352)n +(\356\353\374\352)n(\356)f(\342\356\347\354\356)n(\346\355\356)1727 +b Fg(TAB)-78 4833 y Fi(\344\356\357\356\353\355\350\362\374)27 +b(\344\356)h(\356)n(\344\355\356\343\356)e(\361\353\356\342\340)1907 +b Fg(SPC)-78 4933 y Fi(\344\356\357\356\353\355\350\362\374)27 +b(\350)h(\342\373\357\356\353\355\350\362\374)2026 b +Fg(RET)-78 5033 y Fi(\357\356\352)n(\340\347\340\362\374)26 +b(\342\356\347\354\356)n(\346\355\373\345)g +(\344\356\357\356\353\355\345\355\350\377)1677 b Fg(?)-78 +5132 y Fi(\342\373\341\360\340\362\374)26 b +(\357\360\345\344\373\344\363\371\350\351)i(\342\342\356)n(\344)e(\342) +h(\354\350\355\350\341\363\364\345\360)1390 b Fg(M-p)-78 +5232 y Fi(\342\373\341\360\340\362\374)26 b +(\361\353\345\344\363\376\371\350\351)i(\342\342\356)n(\344)e(\342)h +(\354\350\355\350\341\363\364\345\360)1443 b Fg(M-n)-78 +5332 y Fi(\357\356\350\361\352)28 b(\342)f +(\350\361\362\356\360\350\350)h(\357\356)f(\360\345\343\363)-5 +b(\353\377\360\355\356\354\363)28 b(\342\373\360\340\346)n +(\345\355\350\376)f(\342)g(\356\341\360\340\362\355\356\354)g +(\355\340\357\360\342\353\345\355\350\350)293 b Fg(M-r)-78 +5431 y Fi(\357\356\350\361\352)28 b(\342)f +(\350\361\362\356\360\350\350)h(\357\356)f(\360\345\343\363)-5 +b(\353\377\360\355\356\354\363)28 b(\342\373\360\340\346)n +(\345\355\350\376)f(\342)g(\357\360)n(\377\354\356\354)h +(\355\340\357\360\342\353\345\355\350\350)361 b Fg(M-s)-78 +5531 y Fi(\357\360\345\360\342\340\362\374)27 b(\352)n +(\356\354\340\355\344\363)2247 b Fg(C-g)-128 5627 y Fi +(\315\340\341\345\360\350\362\345)31 b Fg(C-x)42 b(ESC)g(ESC)30 +b Fi(\344\353\377)i +(\360\345\344\340\352\362\350\360\356\342\340\355\350\377)e(\350)h +(\357\356\342\362\356\360\345\355\350\377)g +(\357\356\361\353\345\344\355\345\351)g(\352)n +(\356\354\340\355\344\373)f(\355\340\341\360\340\355\355\356\351)g +(\342)h(\354\350\355\350\341\363\364\345\360\345.)-128 +5726 y(\315\340\341\345\360\350\362\345)c Fg(F10)p Fi(,)g +(\367\362\356\341\373)g(\360\340\341\356\362)n(\340\362\374)f(\361)h +(\357\363\355\352\362)n(\340\354\350)h(\354\345\355\376)h(\357\360\350) +f(\357\356\354\356\371\350)f(\352)n(\356\354\340\355\344)g +(\354\350\355\350\341\363\364\345\360\340.)1860 6192 +y(3)p eop end +%%Page: 4 4 +TeXDict begin 4 3 bop -128 -45 a Fh(15)131 b(\301\363\364\345\360\340) +-78 139 y Fi(\342\373\341\360\340\362\374)26 b +(\344\360\363\343\356\351)i(\341\363\364\345\360)2071 +b Fg(C-x)42 b(b)-78 239 y Fi(\342\373\344\340\362\374)27 +b(\361\357\350\361\356\352)g(\342\361\345\365)g +(\341\363\364\345\360\356\342)1849 b Fg(C-x)42 b(C-b)-78 +338 y Fi(\363\355\350\367\362\356)n(\346\350\362\374)28 +b(\341\363\364\345\360)2212 b Fg(C-x)42 b(k)-128 584 +y Fh(16)131 b(\316\341\354\345\355)43 b(\354\345\361\362)l +(\340\354\350)-78 745 y Fi(\356\341\354\345\355\377\362\374)27 +b(\354\345\361\362)n(\340\354\350)h Ff(\361\350\354\342\356\353\373) +1842 b Fg(C-t)-78 844 y Fi(\356\341\354\345\355\377\362\374)27 +b(\354\345\361\362)n(\340\354\350)h Ff(\361\353\356\342\340)1982 +b Fg(M-t)-78 944 y Fi(\356\341\354\345\355\377\362\374)27 +b(\354\345\361\362)n(\340\354\350)h Ff(\361\362\360\356\352\350)1925 +b Fg(C-x)42 b(C-t)-78 1044 y Fi(\356\341\354\345\355\377\362\374)27 +b(\354\345\361\362)n(\340\354\350)h Ff(\342\373\360\340\346)m +(\345\355\350\377)1727 b Fg(C-M-t)-128 1289 y Fh(17)131 +b(\317\360\356\342\345\360\352)l(\340)44 b +(\343\360\340\354\354\340\362\350\352\350)-78 1472 y +Fi(\357\360\356\342\345\360\350\362\374)27 b +(\362\345\352\363\371\345\345)h(\361\353\356\342\356)1974 +b Fg(M-$)-78 1572 y Fi(\357\360\356\342\345\360\350\362\374)27 +b(\342\361\345)g(\361\353\356\342\340)f(\342)i +(\356\341\353\340\361\362\350)1776 b Fg(M-x)42 b(ispell-region)-78 +1672 y Fi(\342\373\357\356\353\355\350\362\374)27 b +(\357\360\356\342\345\360\352\363)g(\342\361\345\343\356)f +(\341\363\364\345\360\340)1624 b Fg(M-x)42 b(ispell-buffer)-128 +1917 y Fh(18)131 b(\322)-11 b(\345\343\350)-78 2077 y +Fi(\355\340\351\362\350)28 b +(\356\357\360\345\344\345\353\345\355\350\345)g(\362\345\343)n(\340) +2037 b Fg(M-.)-78 2177 y Fi(\355\340\351\362\350)28 b +(\361\353\345\344\363\376\371\345\345)g(\342\365)n(\356)n +(\346\344\345\355\350\345)e(\362\345\343)n(\340)1659 +b Fg(C-u)42 b(M-.)-78 2276 y Fi(\363\352)n(\340\347\340\362\374)26 +b(\355\356\342\373\351)h(\364\340\351\353)g(\361)h(\362\345\343)n +(\340\354\350)1807 b Fg(M-x)42 b(visit-tags-tabl)o(e)-78 +2376 y Fi(\357\356\350\361\352)28 b(\357\356)f +(\370\340\341\353\356\355\363)f(\357\356)h(\342\361\345\351)g(\362)n +(\340\341\353\350\366\345)g(\362\345\343\356\342)1392 +b Fg(M-x)42 b(tags-search)-78 2476 y Fi +(\342\373\357\356\353\355\350\362\374)27 b(query-replace)f +(\355\340\344)h(\342\361\345\354\350)g(\364\340\351\353\340\354\350) +1237 b Fg(M-x)42 b(tags-query-repl)o(ace)-78 2575 y Fi(\357\360\356)n +(\344\356\353\346\350\362\374)27 b(\357\356\350\361\352)h(\350\353\350) +g(\357\356\350\361\352-\347\340\354\345\355\363)e(\362\345\343)n(\340) +1346 b Fg(M-,)-128 2820 y Fh(19)131 b +(\312\356\354\340\355\344\355\373\345)43 b +(\357\360\356\366\345\361\361\356\360\373)-78 3004 y +Fi(\302\373\357\356\353\355\350\362\374)28 b(\352)n +(\356\354\340\355\344\363)e(\352)n +(\356\354\340\355\344\355\356\343\356)g +(\357\360\356\366\345\361\361\356\360\340)1245 b Fg(M-!)-78 +3104 y Fi(\342\373\357\356\353\355\350\362\374)27 b(\352)n +(\356\354\340\355\344\363)g(\352)n +(\356\354\340\355\344\355\356\343\356)f +(\357\360\356\366\345\361\361\356\360\340)g(\355\340\344)i +(\356\341\353\340\361\362\374\376)720 b Fg(M-|)-78 3203 +y Fi(\357\360\356\357\363)n(\361\362\350\362\374)28 b(\361\356)n +(\344\345\360)n(\346\350\354\356\345)e(\356\341\353\340\361\362\350)h +(\367\345\360\345\347)h(\352)n(\356\354\340\355\344\363)f(\352)n +(\356\354\340\355\344\355\356\343\356)f +(\357\360\356\366\345\361\361\356\360\340)210 b Fg(C-u)42 +b(M-|)-78 3303 y Fi(\347\340\357\363)n(\361\362\350\362\374)27 +b(\352)n(\356\354\340\355\344\355\373\351)h +(\357\360\356\366\345\361\361\356\360)e(\342)i(\356\352\355\345)f +Fg(*shell*)1098 b(M-x)42 b(shell)-128 3549 y Fh(20)131 +b(\317\360)l(\377\354\356\363\343\356\353\374\355\373\345)44 +b(\356\341\353\340\361\362\350)-78 3733 y Fi(\361\352)n +(\356\357\350\360\356\342\340\362\374)26 b(\357\360)n +(\377\354\356\363\343\356\353\374\355\363\376)g +(\356\341\353\340\361\362\374)g(\342)i(\360\345\343\350\361\362\360) +1140 b Fg(C-x)42 b(r)h(r)-78 3832 y Fi(\363)-5 b +(\344\340\353\350\362\374)28 b(\357\360)n +(\377\354\356\363\343\356\353\374\355\363\376)e +(\356\341\353\340\361\362\374)1692 b Fg(C-x)42 b(r)h(k)-78 +3932 y Fi(\342\361\362)n(\340\342\350\362\374)27 b +(\357\356\361\353\345\344\355\363\376)g(\363\355\350\367\362\356)n +(\346)n(\345\355\355\363\376)h(\357\360)n +(\377\354\356\363\343\356\353\374\355\363\376)e +(\356\341\353\340\361\362\374)638 b Fg(C-x)42 b(r)h(y)-78 +4031 y Fi(\356\362\352\360\373\362\374)28 b(\357\360)n +(\377\354\356\363\343\356\353\374\355\363\376)e +(\356\341\353\340\361\362\374,)h(\361)n(\344\342\350\343)n(\340\377)f +(\362\345\352)n(\361\362)i(\342\357\360\340\342\356)821 +b Fg(C-x)42 b(r)h(o)-78 4131 y Fi(\356\367\350\361\362\350\362\374)28 +b(\357\360)n(\377\354\356\363\343\356\353\374\355\363\376)f +(\356\341\353\340\361\362\374)1652 b Fg(C-x)42 b(r)h(c)-78 +4231 y Fi(\357\360\345\344\342\340\360\350\362\374)27 +b(\352)n(\340\346\344\363\376)h(\361\362\360\356\352\363)f +(\361\362\360\356\352)n(\356\351)g(\362\345\352)n(\361\362)n(\340)1291 +b Fg(C-x)42 b(r)h(t)-128 4476 y Fh(21)131 b +(\321\356\352\360\340\371\345\355\350\377)-78 4659 y +Fi(\344\356\341\340\342\350\362\374)26 b(\343)n +(\353\356\341\340\353\374\355\356\345)f +(\361\356\352\360\340\371\345\355\350\345)1675 b Fg(C-x)42 +b(a)h(g)-78 4759 y Fi(\344\356\341\340\342\350\362\374)26 +b(\353\356\352)n(\340\353\374\355\356\345)g(\344\353\377)i +(\360\345\346\350\354\340)f(\361\356\352\360\340\371\345\355\350\345) +1220 b Fg(C-x)42 b(a)h(l)-78 4859 y Fi +(\344\356\341\340\342\350\362\374)26 b(\343)n +(\353\356\341\340\353\374\355\356\345)f(\347\355\340)n +(\367\345\355\350\345)i(\344\353\377)h(\344\340\355\355\356\343\356)e +(\361\356\352\360\340\371\345\355\350\377)813 b Fg(C-x)42 +b(a)h(i)g(g)-78 4958 y Fi(\344\356\341\340\342\350\362\374)26 +b(\361\357\345\366\350\364\350\367\345\361\352)n(\356\345)h +(\344\353\377)h(\360\345\346\350\354\340)f(\347\355\340)n +(\367\345\355\350\345)g(\344\340\355\355\356\343\356)g +(\361\356\352\360\340\371\345\355\350\377)342 b Fg(C-x)42 +b(a)h(i)g(l)-78 5058 y Fi(\377\342\355\356)27 b(\342\361\362)n +(\340\342\350\362\374)f(\347\355\340)n(\367\345\355\350\345)h +(\344\353\377)h(\361\356\352\360\340\371\345\355\350\377)1395 +b Fg(C-x)42 b(a)h(e)-78 5158 y Fi +(\344\350\355\340\354\350\367\345\361\352\350)28 b +(\344\356\357\356\353\355\350\362\374)g +(\357\360\345\344\373\344\363\371\345\345)f(\361\353\356\342\356)1287 +b Fg(M-/)1860 6192 y Fi(4)p eop end +%%Page: 5 5 +TeXDict begin 5 4 bop -128 -45 a Fh(22)131 b(\320)l(\345\343\363)-7 +b(\353\377\360\355\373\345)44 b(\342\373\360\340\346)l +(\345\355\350\377)-78 139 y Fi(\353\376\341\356\351)27 +b(\356)n(\344\350\355\356\367\355\373\351)g(\361\350\354\342\356\353)g +(\(\347\340)h(\350\361\352\353\376\367\345\355\350\345\354)g +(\361\350\354\342\356\353\340)f(\355\356\342\356\351)f +(\361\362\360\356\352\350\))388 b Fg(.)43 b Fi(\(dot\))-78 +239 y(\355\356\353\374)27 b(\350\353\350)h(\341\356\353\345\345)f +(\357\356\342\362\356\360\345\355\350\351)1901 b Fg(*)-78 +338 y Fi(\356)n(\344\355\356)27 b(\350\353\350)h(\341\356\353\345\345)e +(\357\356\342\362\356\360\345\355\350\351)1904 b Fg(+)-78 +438 y Fi(\355\356\353\374)27 b(\350\353\350)h(\356)n(\344\355\356)f +(\357\356\342\362\356\360\345\355\350\345)1940 b Fg(?)-78 +537 y Fi(\375\352\360\340\355\350\360\356\342\340\362\374)26 +b(\361\357\345\366\350\340\353\374\355\373\351)h +(\361\350\354\342\356\353)h Fe(c)1536 b Fd(n)p Fe(c)-78 +637 y Fi(\342\373\341\356\360)26 b(\354\345\346\344\363)i(\340\353\374) +n(\362\345\360\355\340\362\350\342\340\354\350)f +(\(\020\350\353\350\021\))1501 b Fd(nj)-78 737 y Fi +(\343\360\363\357\357\350\360\356\342\352)n(\340)2454 +b Fd(n)p Fg(\()42 b Fc(:)14 b(:)g(:)44 b Fd(n)p Fg(\))-78 +836 y Fi(\362\345\352)n(\361\362)29 b(\342)e Fe(n)6 b +Fi(-\351)27 b(\343\360\363\357\357\345)2227 b Fd(n)p +Fe(n)-78 936 y Fi(\343\360\340\355\350\366\340)27 b +(\361\353\356\342\340)2394 b Fd(n)p Fg(b)-78 1036 y Fi(\355\345)28 +b(\343\360\340\355\350\366\340)f(\361\353\356\342\340)2283 +b Fd(n)p Fg(B)-78 1144 y Ff(\356\341\372\345\352\362)2640 +b(\355\340)m(\367\340\353\356)79 b(\361\356\356\362-)2857 +1243 y(\342\345\362\361\362\342\350\377)3547 1144 y(\352)m +(\356\355\345\366)127 b(\361\356\356\362-)3547 1243 y +(\342\345\362\361\362\342\350\377)-78 1343 y Fi(\361\362\360\356\352)n +(\340)2683 b Fg(\002)645 b($)-78 1442 y Fi(\361\353\356\342\356)2726 +b Fd(n)p Fg(<)604 b Fd(n)p Fg(>)-78 1542 y Fi(\341\363\364\345\360)2701 +b Fd(n)p Fg(`)604 b Fd(n)p Fg(')-78 1650 y Ff(\352\353\340\361\361)33 +b(\361\350\354\342\356\353\356\342)2262 b +(\361\356\356\362\342\345\362-)2857 1750 y(\361\362\342\363)m(\345\362) +32 b(\350\354)3547 1650 y(\361\356\356\362\342\345\362-)3547 +1750 y(\361\362\342\363)m(\345\362)131 b(\344\360\363-)3547 +1849 y(\343\350\354)-78 1949 y Fi(\377\342\355\373\351)28 +b(\355\340\341\356\360)2450 b Fg([)43 b Fc(:)14 b(:)g(:)43 +b Fg(])419 b([\002)p Fc(:)14 b(:)g(:)41 b Fg(])-78 2048 +y Fi(\361\350\354\342\356\353-\341\363\352\342\340)2423 +b Fd(n)p Fg(w)604 b Fd(n)p Fg(W)-78 2148 y Fi(\361\350\354\342\356\353) +27 b(\361)h(\361\350\355\362)n(\340\352)n(\361\350\361\356\354)f +Fe(c)2039 b Fd(n)p Fg(s)p Fe(c)566 b Fd(n)p Fg(S)p Fe(c)-128 +2394 y Fh(23)131 b(\314\345\346\344\363\355\340\360\356)l +(\344\355\373\345)43 b(\355\340\341\356\360\373)g +(\361\350\354\342\356\353\356\342)-78 2578 y Fi +(\342\373\341\360\340\362\374)26 b(\377\347\373\352)2406 +b Fg(M-x)42 b(set-language-en)o(vir)o(on)o(me)o(nt)-78 +2677 y Fi(\357\356\352)n(\340\347\340\362\374)26 b(\342\361\345)h +(\342\356\347\354\356)n(\346\355\373\345)f(\354\345\362\356)n(\344\373) +i(\342\342\356)n(\344\340)1457 b Fg(M-x)42 b(list-input-meth)o(ods)-78 +2777 y Fi(\360\340\347\360\345\370\350\362\374)27 b(\350\353\350)h +(\347\340\357\360\345\362\350\362\374)g(\354\345\362\356)n(\344)g +(\342\342\356)n(\344\340)1473 b Fg(C-)p Fd(n)-78 2877 +y Fi(\363)n(\361\362)n(\340\355\356\342\350\362\374)26 +b(\361\350\361\362\345\354\363)i(\352)n(\356)n +(\344\350\360\356\342\340\355\350\377)e(\344\353\377)i +(\361\353\345\344\363\376\371\345\351)f(\352)n +(\356\354\340\355\344\373)705 b Fg(C-x)42 b(RET)g(c)-78 +2976 y Fi(\357\356\352)n(\340\347\340\362\374)26 b +(\361\357\350\361\356\352)i(\342\361\345\365)e +(\361\350\361\362\345\354)j(\352)n(\356)n +(\344\350\360\356\342\340\355\350\377)1338 b Fg(M-x)42 +b(list-coding-sys)o(tem)o(s)-78 3076 y Fi(\342\373\341\360\340\362\374) +26 b(\357\360\345\344\357\356\367\362\350\362\345\353\374\355\363\376)j +(\361\350\361\362\345\354\363)f(\352)n(\356)n +(\344\350\360\356\342\340\355\350\377)1041 b Fg(M-x)42 +b(prefer-coding-s)o(yst)o(em)-128 3329 y Fh(24)131 b +(\310\355\364\356\360\354\340\366\350\377)44 b +(\(\361\350\361\362\345\354\340)g(Info\))-78 3519 y Fi +(\347\340\357\363)n(\361\362\350\362\374)27 b +(\361\350\361\362\345\354\363)i(\344\356\361\362\363\357\340)e(\352)g +(\344\356\352\363\354\345\355\362)n(\340\366\350\350)1275 +b Fg(C-h)42 b(i)-78 3619 y Fi(\355\340\351\362\350)28 +b(\363\352)n(\340\347\340\355\355\363\376)f +(\364\363\355\352\366\350\376)g(\350\353\350)h +(\357\345\360\345\354\345\355\355\363\376)h(\342)e +(\344\356\352\363\354\345\355\362)n(\340\366\350\350)615 +b Fg(C-h)42 b(C-i)-128 3719 y Fi +(\317\345\360\345\354\345\371\345\355\350\345)28 b +(\342\355\363\362\360\350)f(\363\347\353\340)g(\(\355\356)n +(\344\340\354\350\):)-78 3818 y(\357\360\356\352\360\363\362\352)n +(\340)g(\342\357\345\360\345\344)2257 b Fg(SPC)-78 3917 +y Fi(\357\360\356\352\360\363\362\352)n(\340)27 b(\355\340\347\340\344) +2298 b Fg(DEL)-78 4017 y Fi(\357\345\360\345\351\362\350)29 +b(\352)e(\355\340)n(\367\340\353\363)g(\363\347\353\340)2074 +b Fg(.)43 b Fi(\(dot\))-128 4112 y +(\317\345\360\345\354\345\371\345\355\350\345)28 b +(\354\345\346\344\363)g(\363\347\353\340\354\350:)-78 +4206 y Ff(\361\353\345\344\363\376\371\350\351)f Fi(\363\347\345\353) +2245 b Fg(n)-78 4306 y Ff(\357\360\345\344\373\344\363\371\350\351)27 +b Fi(\363\347\345\353)2184 b Fg(p)-78 4405 y Fi +(\357\345\360\345\351\362\350)29 b(\352)e Ff(\342\345\360)m +(\365\355\345\354\363)h Fi(\363\347\353\363)1932 b Fg(u)-78 +4505 y Fi(\342\373\341\360\340\362\374)26 b(\354\345\355\376)j +(\357\356)e(\350\354\345\355\350)2020 b Fg(m)-78 4605 +y Fi(\342\373\341\360\340\362\374)26 b Fe(n)6 b Fi(-\351)28 +b(\357\363\355\352\362)g(\354\345\355\376)h(\357\356)e +(\355\356\354\345\360\363)g(\(1\0259\))1357 b Fe(n)-78 +4704 y Fi(\357\345\360\345\351\362\350)29 b(\357\356)e +(\361\361\373\353\352)n(\345)g(\(\342\356\347\342\360\340\362)g(\361)g +(\357\356\354\356\371\374\376)g Fg(l)p Fi(\))1330 b Fg(f)-78 +4804 y Fi(\342\356\347\342\360\340\362\350\362\361)n(\377)27 +b(\352)g(\357\356\361\353\345\344\355\345\354\363)h +(\357\360\356\361\354\356\362\360\345\355\355\356\354\363)f +(\363\347\353\363)1089 b Fg(l)-78 4904 y Fi +(\342\356\347\342\360\340\362\350\362\361)n(\377)27 b(\352)g +(\363\347\353\363-\352)n(\340\362)n(\340\353\356\343\363)1841 +b Fg(d)-78 5003 y Fi(\357\345\360\345\351\362\350)29 +b(\352)e(\363\347\353\363)-7 b(,)28 b +(\347\340\344\340\355\355\356\354\363)e(\350\354\345\355\345\354)1617 +b Fg(g)-128 5098 y Fi(\304\360\363\343\350\345)27 b(\352)n +(\356\354\340\355\344\373:)-78 5192 y(\347\340\357\363)n +(\361\362\350\362\374)g Ff(\363\367\345\341\355\350\352)h +Fi(\357\356)f(\361\350\361\362\345\354\345)i +(\344\356\352\363\354\345\355\362)n(\340\366\350\350)1183 +b Fg(h)-78 5292 y Ff(\357\360\345\352\360\340\362\350\362\374)32 +b(\360\340\341\356\362\363)d Fi(\361)e +(\344\356\352\363\354\345\355\362)n(\340\366\350\345\351)1455 +b Fg(q)-78 5392 y Fi(\357\356\350\361\352)28 b(\342)f +(\363\347\353\340\365)g(\361)g(\357\356\354\356\371\374\376)g +(\360\345\343\363)-5 b(\353\377\360\355\373\365)28 b +(\342\373\360\340\346)n(\345\355\350\351)1028 b Fg(M-s)1860 +6192 y Fi(5)p eop end +%%Page: 6 6 +TeXDict begin 6 5 bop -128 -45 a Fh(25)131 b(\320)l +(\345\343\350\361\362\360\373)-78 139 y Fi(\361\356)n +(\365\360\340\355\350\362\374)27 b(\356\341\353\340\361\362\374)f(\342) +h(\360\345\343\350\361\362\360\345)1810 b Fg(C-x)42 b(r)h(s)-78 +239 y Fi(\342\361\362)n(\340\342\350\362\374)27 b(\361\356)n +(\344\345\360)n(\346\350\354\356\345)f +(\360\345\343\350\361\362\360\340)i(\342)f(\341\363\364\345\360)1435 +b Fg(C-x)42 b(r)h(i)-78 338 y Fi(\361\356)n +(\365\360\340\355\350\362\374)27 b(\357\356\353\356)n(\346)n +(\345\355\350\345)f(\352\363\360\361\356\360\340)h(\342)g +(\360\345\343\350\361\362\360\345)1365 b Fg(C-x)42 b(r)h(SPC)-78 +438 y Fi(\357\345\360\345\351\362\350)29 b(\352)e(\357\356\353\356)n +(\346)n(\345\355\350\376)g(\352\363\360\361\356\360\340,)g(\361\356)n +(\365\360\340\355\345\355\355\356\354\363)f(\342)h +(\360\345\343\350\361\362\360\345)775 b Fg(C-x)42 b(r)h(j)-128 +683 y Fh(26)131 b(\312\353\340\342\350\340\362\363\360\355\373\345)44 +b(\354\340\352\360\356\361\373)-78 867 y Ff(\355\340)m +(\367\340\362\374)29 b Fi(\356\357\360\345\344\345\353\345\355\350\345) +e(\352\353\340\342\350\340\362\363\360\355\356\343\356)f +(\354\340\352\360\356\361\340)1227 b Fg(C-x)42 b(\()-78 +966 y Ff(\347\340\352)m(\356\355\367\350\362\374)29 b +Fi(\356\357\360\345\344\345\353\345\355\350\345)e +(\352\353\340\342\350\340\362\363\360\355\356\343\356)f +(\354\340\352\360\356\361\340)1077 b Fg(C-x)42 b(\))-78 +1066 y Ff(\342\373\357\356\353\355\350\362\374)27 b Fi +(\357\356\361\353\345\344\355\350\351)h +(\356\357\360\345\344\345\353\345\355\355\373\351)g +(\354\340\352\360\356\361)1187 b Fg(C-x)42 b(e)-78 1165 +y Fi(\344\356\357\356\353\355\350\362\374)27 b +(\357\356\361\353\345\344\355\350\351)h +(\356\357\360\345\344\345\353\345\355\355\373\351)g +(\354\340\352\360\356\361)1260 b Fg(C-u)42 b(C-x)g(\()-78 +1265 y Fi(\347\340\344\340\362\374)27 b(\350\354\377)h(\344\353\377)g +(\357\356\361\353\345\344\355\345\343\356)f +(\356\357\360\345\344\345\353\345\355\355\356\343\356)f +(\354\340\352\360\356\361\340)990 b Fg(M-x)42 b(name-last-kbd-m)o(acr)o +(o)-78 1365 y Fi(\342\361\362)n(\340\342\350\362\374)27 +b(\342)g(\341\363\364\345\360)f +(\356\357\360\345\344\345\353\345\355\350\345)i +(\354\340\352\360\356\361\340)e(\355\340)i(\377\347\373\352)n(\345)f +(Lisp)898 b Fg(M-x)42 b(insert-kbd-macr)o(o)-128 1611 +y Fh(27)131 b(\312\356\354\340\355\344\373,)43 b +(\361\342\377\347\340\355\355\373\345)h(\361)h(Emacs)e(Lisp)-78 +1794 y Fi(\342\373\367\350\361\353\350\362\374)28 b Ff +(\342\373\360\340\346)m(\345\355\350\345)g Fi(\357\345\360\345\344)g +(\352\363\360\361\356\360\356\354)1389 b Fg(C-x)42 b(C-e)-78 +1894 y Fi(\342\373\367\350\361\353\350\362\374)28 b +(\362\345\352\363\371\363\376)g(\364\363\355\352\366\350\376)f +Ff(defun)1518 b Fg(C-M-x)-78 1994 y Fi +(\342\373\367\350\361\353\350\362\374)28 b Ff +(\356\341\353\340\361\362\374)g Fi(\352)n(\340\352)f +(\342\373\360\340\346)n(\345\355\350\345)1561 b Fg(M-x)42 +b(eval-region)-78 2093 y Fi(\361\367\350\362)n(\340\362\374)28 +b(\350)g(\342\373\367\350\361\353\350\362\374)f(\342\373\360\340\346)n +(\345\355\350\345)g(\350\347)g +(\354\350\355\350\341\363\364\345\360\340)1078 b Fg(M-:)-78 +2193 y Fi(\347\340\343\360\363\347\350\362\374)27 b(\350\347)h +(\361\362)n(\340\355\344\340\360\362\355\356\343\356)e +(\361\350\361\362\345\354\355\356\343\356)i(\352)n(\340\362)n +(\340\353\356\343)n(\340)1113 b Fg(M-x)42 b(load-library)-128 +2438 y Fh(28)131 b(\317\360\356\361\362)l(\340\377)45 +b(\355\340\361\362\360\356\351\352)l(\340)-78 2619 y +Fi(\355\340\361\362\360\356\350\362\374)28 b +(\357\345\360\345\354\345\355\355\373\345)g(\350)f +(\356\364\356\360\354\353\345\355\350\345)g(\(faces\))1249 +b Fg(M-x)42 b(customize)-128 2720 y Fi(\321\356\347\344\340\362\374)27 +b(\343)n(\353\356\341\340\353\374\355\356\345)e(\355\340\347\355\340)n +(\367\345\355\350\345)i(\352\353\376\367\345\351)h(\355\340)f(Emacs)h +(Lisp)f(\(\357\360\350\354\345\360\):)-128 2902 y Fg(\(global-set-key) +38 b("\\C-cg")i('goto-line\))-128 3002 y(\(global-set-key)e("\\M-#")j +('query-replace-)o(re)o(gex)o(p\))-128 3276 y Fh(29)131 +b(\315\340\357\350\361\340\355\350\345)44 b(\352)l +(\356\354\340\355\344)-128 3458 y Fg(\(defun)d(<command-name>)d +(\(<args>\))-40 3558 y("<documentation)o(>")f(\(interactive)h +("<template>"\))-40 3658 y(<body>\))-128 3840 y Fi +(\317\360\350\354\345\360:)-128 4023 y Fg(\(defun)j(this-line-to-top-)o +(of)o(-wi)o(nd)o(ow)c(\(line\))-40 4122 y("Reposition)i(line)i(point)h +(is)h(on)f(to)h(top)f(of)h(window.)-128 4222 y(With)f(ARG,)g(put)h +(point)e(on)i(line)f(ARG.")-40 4322 y(\(interactive)c("P"\))-40 +4421 y(\(recenter)h(\(if)k(\(null)e(line\))570 4521 y(0)483 +4621 y(\(prefix-numeric)o(-v)o(al)o(ue)c(line\)\)\)\))-128 +4803 y Fi(\321\357\345\366\350\364\350\352)n(\340\366\350\377)30 +b Fg(interactive)25 b Fi(\361\356\356\341\371\340\345\362)j(\356)h +(\362\356\354,)h(\367\362\356)g(\340\360\343\363\354\345\355\362)g +(\355\340\344\356)e(\361\367\350\362\373\342\340\362\374)i +(\350\355\362\345\360\340\352\362\350\342\355\356.)g(\304\353\377)f +(\344\356\357\356\353\355\350-)-128 4903 y +(\362\345\353\374\355\356\351)f +(\350\355\364\356\360\354\340\366\350\350)f +(\355\340\341\345\360\350\362\345)g Fg(C-h)43 b(f)g(interactive)p +Fi(.)1110 5391 y Fb(Cop)n(yrigh)n(t)1461 5389 y(c)1441 +5391 y Fa(\015)23 b Fb(1997)i(F)-6 b(ree)25 b(Soft)n(w)n(are)g(F)-6 +b(oundation,)25 b(Inc.)1214 5470 y(v2.2)f(for)g(GNU)g(Emacs)e(v)n +(ersion)j(21,)f(June)g(1997)1453 5549 y(designed)g(b)n(y)g(Stephen)i +(Gildea)1239 5628 y(\317\345\360\345\342\356)n(\344)f(Alex)e(Ott)h +(<ottalex)h(at)g(naro)r(d.ru>)-128 5707 y(P)n(ermission)31 +b(is)h(gran)n(ted)i(to)f(mak)n(e)e(and)i(distribute)g(copies)g(of)e +(this)h(card)i(pro)n(vided)f(the)g(cop)n(yrigh)n(t)h(notice)f(and)g +(this)f(p)r(ermission)f(notice)i(are)-128 5786 y(preserv)n(ed)27 +b(on)c(all)g(copies.)-128 5864 y(F)-6 b(or)33 b(copies)f(of)g(the)h +(GNU)e(Emacs)g(man)n(ual,)g(write)h(to)h(the)f(F)-6 b(ree)34 +b(Soft)n(w)n(are)f(F)-6 b(oundation,)33 b(Inc.,)f(59)g(T)-6 +b(emple)31 b(Place,)h(Suite)g(330,)g(Boston,)h(MA)-128 +5943 y(02111-1307)26 b(USA)1860 6192 y Fi(6)p eop end +%%Trailer + +userdict /end-hook known{end-hook}if +%%EOF diff --git a/etc/ru-refcard.tex b/etc/ru-refcard.tex new file mode 100644 index 00000000000..608eff79967 --- /dev/null +++ b/etc/ru-refcard.tex @@ -0,0 +1,516 @@ +\documentclass[10pt]{article} +\usepackage{multicol,tabularx} +\usepackage[a4paper,hmargin={2cm,2cm},vmargin={2cm,2cm},nohead,twoside]{geometry} +\usepackage[T2A]{fontenc} +\usepackage[koi8-r]{inputenc} +\usepackage[english,russian]{babel} +\usepackage{verbatim} +%\usepackage{enumerate,calc} +%\usepackage{indentfirst,amsmath,graphicx,citehack,floatflt} +% +%\usepackage{pscyr} +%\renewcommand{\rmdefault}{fha} + +\newlength{\ColWidth} +\setlength{\ColWidth}{120mm} +\newlength{\ColThreeWidth} +\setlength{\ColThreeWidth}{25mm} + +\newcommand{\versionnumber}[0]{2.2} +\newcommand{\nyear}[0]{1997} + +\newcommand\shortcopyrightnotice[0]{\vskip 1ex plus 2 fill + \centerline{\footnotesize \copyright\ \nyear\ Free Software Foundation, Inc. + Permissions on back. v\versionnumber}} + +\newcommand\copyrightnotice[0]{ +\vskip 1ex plus 2 fill\begingroup\footnotesize +\centerline{Copyright \copyright\ \nyear\ Free Software Foundation, Inc.} +\centerline{v\versionnumber{} for GNU Emacs version 21, June \nyear} +\centerline{designed by Stephen Gildea} +\centerline{ðÅÒÅ×ÏÄ Alex Ott <ottalex at narod.ru>} + +Permission is granted to make and distribute copies of +this card provided the copyright notice and this permission notice +are preserved on all copies. + +For copies of the GNU Emacs manual, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +\endgroup} + +\hyphenation{mini-buf-fer} + +\parindent 0pt +%\parskip 0.5ex plus .2ex minus .2ex + +\newcommand{\kbd}[1]{\texttt{#1}} + +\begin{document} + +%\begin{multicols}{3} + +\centerline{óÐÒÁ×ÏÞÎÁÑ ËÁÒÔÁ ÐÏ GNU Emacs} +\centerline{(ÄÌÑ ×ÅÒÓÉÉ 21)} + +\section{úÁÐÕÓË Emacs} + +äÌÑ ÚÁÐÕÓËÁ GNU Emacs 21, ÐÒÏÓÔÏ ÎÁÂÅÒÉÔÅ ÉÍÑ ÐÒÏÇÒÁÍÍÙ: \kbd{emacs} + +ï ÔÏÍ, ËÁË ÏÔËÒÙ×ÁÔØ ÆÁÊÌÙ, ÞÉÔÁÊÔÅ ÄÁÌÅÅ × ÒÁÚÄÅÌÅ æÁÊÌÙ. + +\section{÷ÙÈÏÄ ÉÚ Emacs} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +ðÒÉÏÓÔÁÎÏ×ÉÔØ ÒÁÂÏÔÕ Emacs (ÉÌÉ Ó×ÅÒÎÕÔØ × ÉËÏÎËÕ ÐÒÉ ÒÁÂÏÔÅ × X) & \kbd{C-z} \\ +÷ÙÊÔÉ ÉÚ Emacs & \kbd{C-x C-c} \\ +\end{tabular} + +\section{æÁÊÌÙ} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +{\bf ÏÔËÒÙÔØ} ÆÁÊÌ × ÂÕÆÅÒÅ Emacs & \kbd{C-x C-f} \\ +{\bf ÓÏÈÒÁÎÉÔØ} ÆÁÊÌ ÏÂÒÁÔÎÏ ÎÁ ÄÉÓË & \kbd{C-x C-s} \\ +ÓÏÈÒÁÎÉÔØ {\bf ×ÓÅ} ÆÁÊÌÙ & \kbd{C-x s} \\ +{\bf ×ÓÔÁ×ÉÔØ} ÓÏÄÅÒÖÉÍÏÅ ÄÒÕÇÏÇÏ ÆÁÊÌÁ × ÔÅËÕÝÉÊ ÂÕÆÅÒ & \kbd{C-x i} \\ +ÏÔËÒÙÔØ ÎÕÖÎÙÊ ×ÁÍ ÆÁÊÌ ×ÍÅÓÔÏ ÔÅËÕÝÅÇÏ & \kbd{C-x C-v} \\ +ÓÏÈÒÁÎÉÔØ ÂÕÆÅÒ × ÕËÁÚÁÎÎÏÍ ÆÁÊÌÅ & \kbd{C-x C-w} \\ +÷ËÌÀÞÉÔØ/×ÙËÌÀÞÉÔØ ÓÏÓÔÏÑÎÉÅ ÂÕÆÅÒÁ ``ÔÏÌØËÏ ÄÌÑ ÞÔÅÎÉÑ'' & \kbd{C-x C-q} \\ +\end{tabular} + +\section{ðÏÌÕÞÅÎÉÅ ÐÏÍÏÝÉ} + +óÐÒÁ×ÏÞÎÁÑ ÓÉÓÔÅÍÁ ÄÏÓÔÁÔÏÞÎÏ ÐÒÏÓÔÁ. HÁÖÍÉÔÅ \kbd{C-h} (ÉÌÉ \kbd{F1}) É +ÓÌÅÄÕÊÔÅ ÉÎÓÔÒÕËÃÉÑÍ. åÓÌÉ ×Ù × ÐÅÒ×ÙÊ ÒÁÚ ÒÁÂÏÔÁÅÔÅ Ó Emacs, ÎÁÂÅÒÉÔÅ +\kbd{C-u C-h t Russian RET} ÄÌÑ ×ÙÚÏ×Á {\bf ÕÞÅÂÎÉËÁ}. + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +úÁËÒÙÔØ ÏËÎÏ ÓÐÒÁ×ËÉ & \kbd{C-x 1} \\ +ðÒÏËÒÕÔÉÔØ ÏËÎÏ ÓÐÒÁ×ËÉ & \kbd{C-M-v} \\ + +apropos: ÐÏËÁÚÁÔØ ËÏÍÁÎÄÙ, ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÉÅ ÓÔÒÏËÅ & \kbd{C-h a} \\ +ÐÏËÁÚÁÔØ ÉÍÑ ÆÕÎËÃÉÉ, ËÏÔÏÒÁÑ ÚÁÐÕÓËÁÅÔÓÑ ËÌÁ×ÉÛÅÊ & \kbd{C-h c} \\ +ÏÐÉÓÁÔØ ÆÕÎËÃÉÀ & \kbd{C-h f} \\ +ÐÏÌÕÞÉÔØ ÉÎÆÏÒÍÁÃÉÀ Ï ÒÅÖÉÍÅ & \kbd{C-h m} \\ +\end{tabular} + +\section{éÓÐÒÁ×ÌÅÎÉÅ ÏÛÉÂÏË} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +{\bf ÐÒÅÒ×ÁÔØ} ÞÁÓÔÉÞÎÏ ÎÁÂÒÁÎÎÕÀ ÉÌÉ ÉÓÐÏÌÎÑÅÍÕÀ ËÏÍÁÎÄÕ & \kbd{C-g} \\ +{\bf ×ÏÓÓÔÁÎÏ×ÉÔØ} ÆÁÊÌ, ÐÏÔÅÒÑÎÎÙÊ ÐÒÉ ËÒÁÈÅ ÓÉÓÔÅÍÙ & \kbd{M-x recover-file} \\ +{\bf ÏÔÍÅÎÉÔØ} ÎÅÖÅÌÁÔÅÌØÎÙÅ ÉÚÍÅÎÅÎÉÑ & \kbd{C-x u {\rm ÉÌÉ} C-\_} \\ +×ÏÓÓÔÁÎÏ×ÉÔØ ÂÕÆÅÒ × ÐÅÒ×ÏÎÁÞÁÌØÎÏÅ ÓÏÓÔÏÑÎÉÅ & \kbd{M-x revert-buffer} \\ +ÐÅÒÅÒÉÓÏ×ÁÔØ ÚÁÐÏÌÎÅÎÎÙÊ ÍÕÓÏÒÏÍ ÜËÒÁÎ & \kbd{C-l} \\ +\end{tabular} + +\section{HÁÒÁÝÉ×ÁÅÍÙÊ ÐÏÉÓË} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +ÐÏÉÓË ×ÐÅÒÅÄ & \kbd{C-s} \\ +ÐÏÉÓË ÎÁÚÁÄ & \kbd{C-r} \\ +ÐÏÉÓË ÐÏ ÒÅÇÕÌÑÒÎÏÍÕ ×ÙÒÁÖÅÎÉÀ & \kbd{C-M-s} \\ +ÐÏÉÓË ÐÏ ÒÅÇÕÌÑÒÎÏÍÕ ×ÙÒÁÖÅÎÉÀ ÎÁÚÁÄ & \kbd{C-M-r} \\ + +×ÙÂÒÁÔØ ÐÒÅÄÙÄÕÝÕÀ ÓÔÒÏËÕ ÐÏÉÓËÁ & \kbd{M-p} \\ +×ÙÂÒÁÔØ ÓÌÅÄÕÀÝÕÀ ÓÔÒÏËÕ ÐÏÉÓËÁ & \kbd{M-n} \\ +ÐÒÅËÒÁÔÉÔØ ÎÁÒÁÝÉ×ÁÅÍÙÊ ÐÏÉÓË & \kbd{RET} \\ +ÏÔÍÅÎÉÔØ ÜÆÆÅËÔ ××ÏÄÁ ÐÏÓÌÅÄÎÅÇÏ ÓÉÍ×ÏÌÁ & \kbd{DEL} \\ +ÐÒÅÒ×ÁÔØ ÔÅËÕÝÉÊ ÐÏÉÓË & \kbd{C-g} \\ +\end{tabular} + +äÌÑ ÐÏ×ÔÏÒÁ ÐÏÉÓËÁ × ÌÀÂÏÍ ÎÁÐÒÁ×ÌÅÎÉÉ ÉÓÐÏÌØÚÕÊÔÅ ËÌÁ×ÉÛÉ \kbd{C-s} ÉÌÉ +\kbd{C-r}. åÓÌÉ Emacs ×ÓÅ ÅÝÅ ÐÒÏÉÚ×ÏÄÉÔ ÐÏÉÓË, \kbd{C-g} ÏÔÍÅÎÉÔ ÔÏÌØËÏ +ÎÅÓÄÅÌÁÎÎÕÀ ÞÁÓÔØ. + +\section{ðÅÒÅÍÅÝÅÎÉÅ} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +{\bf ÅÄÉÎÉÃÙ ÐÅÒÅÍÅÝÅÎÉÑ} & {\bf ÎÁÚÁÄ} & {\bf ×ÐÅÒÅÄ} \\ +ÓÉÍ×ÏÌ & \kbd{C-b} & \kbd{C-f} \\ +ÓÌÏ×Ï & \kbd{M-b} & \kbd{M-f} \\ +ÓÔÒÏËÁ & \kbd{C-p} & \kbd{C-n} \\ +ÎÁÞÁÌÏ (ÉÌÉ ËÏÎÅÃ) ÓÔÒÏËÉ & \kbd{C-a} & \kbd{C-e} \\ +ÐÒÅÄÌÏÖÅÎÉÅ & \kbd{M-a} & \kbd{M-e} \\ +ÁÂÚÁà & \kbd{M-\{} & \kbd{M-\}} \\ +ÓÔÒÁÎÉÃÁ & \kbd{C-x [} & \kbd{C-x ]} \\ +×ÙÒÁÖÅÎÉÅ (sexp) & \kbd{C-M-b} & \kbd{C-M-f} \\ +ÆÕÎËÃÉÑ & \kbd{C-M-a} & \kbd{C-M-e} \\ +ÐÅÒÅÈÏÄ × ÎÁÞÁÌÏ (ÉÌÉ ËÏÎÅÃ) ÂÕÆÅÒÁ & \kbd{M-<} & \kbd{M->} \\ + +\end{tabular} + +\begin{tabular}{p{\ColWidth}l} +ÐÒÏËÒÕÔËÁ ÜËÒÁÎÁ ×ÎÉÚ & \kbd{C-v} \\ +ÐÒÏËÒÕÔËÁ ÜËÒÁÎÁ ××ÅÒÈ & \kbd{M-v} \\ +ÐÒÏËÒÕÔËÁ ×ÌÅ×Ï & \kbd{C-x <} \\ +ÐÒÏËÒÕÔËÁ ×ÐÒÁ×Ï & \kbd{C-x >} \\ +ÐÒÏËÒÕÔËÁ ÔÅËÕÝÅÊ ÓÔÒÏËÉ × ÃÅÎÔÒ ÜËÒÁÎÁ & \kbd{C-u C-l} \\ +\end{tabular} + +\section{õÎÉÞÔÏÖÅÎÉÅ É ÕÄÁÌÅÎÉÅ} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +{\bf ÕÎÉÞÔÏÖÁÅÍÙÊ ÏÂßÅËÔ} & {\bf ÎÁÚÁÄ} & {\bf ×ÐÅÒÅÄ} \\ +ÓÉÍ×ÏÌ (ÕÄÁÌÅÎÉÅ, Á ÎÅ ÕÎÉÞÔÏÖÅÎÉÅ) & \kbd{DEL} & \kbd{C-d} \\ +ÓÌÏ×Ï & \kbd{M-DEL} & \kbd{M-d} \\ +ÓÔÒÏËÁ (ÄÏ ËÏÎÃÁ ÓÔÒÏËÉ) & \kbd{M-0 C-k} & \kbd{C-k} \\ +ÐÒÅÄÌÏÖÅÎÉÅ & \kbd{C-x DEL} & \kbd{M-k} \\ +×ÙÒÁÖÅÎÉÅ & \kbd{M-- C-M-k} & \kbd{C-M-k} \\ +\end{tabular} + + +\begin{tabular}{p{\ColWidth}l} +ÕÎÉÞÔÏÖÉÔØ {\bf ÏÂÌÁÓÔØ} & \kbd{C-w} \\ +ÓËÏÐÉÒÏ×ÁÔØ ÏÂÌÁÓÔØ × ÓÐÉÓÏË ÕÎÉÞÔÏÖÅÎÉÊ & \kbd{M-w} \\ +ÕÎÉÞÔÏÖÉÔØ ÄÏ ÓÌÅÄÕÀÝÅÇÏ ×ÈÏÖÄÅÎÉÑ ÓÉÍ×ÏÌÁ {\it char} & \kbd{M-z {\it char}} \\ + +×ÓÔÁ×ÉÔØ ÐÏÓÌÅÄÎÉÊ ÕÎÉÞÔÏÖÅÎÎÙÊ ÏÂßÅËÔ & \kbd{C-y} \\ +ÚÁÍÅÎÉÔØ ÔÏÌØËÏ ÞÔÏ ×ÏÓÓÔÁÎÏ×ÌÅÎÎÙÊ ÔÅËÓÔ ÐÒÅÄÛÅÓÔ×ÕÀÝÉÍ ÕÎÉÞÔÏÖÅÎÎÙÍ ÔÅËÓÔÏÍ & M-y \\ +\end{tabular} + +\section{ðÏÍÅÔËÁ} + +\begin{tabular}{p{\ColWidth}l} +ÕÓÔÁÎÏ×ÉÔØ ÐÏÍÅÔËÉ & \kbd{C-@ {\rm or} C-SPC} \\ +ÏÂÍÅÎÑÔØ ÍÅÓÔÁÍÉ ËÕÒÓÏÒ É ÐÏÍÅÔËÕ & \kbd{C-x C-x} \\ + +ÐÏÍÅÔÉÔØ {\it arg\/} {\bf ÓÌÏ×} & \kbd{M-@} \\ +ÐÏÍÅÔÉÔØ {\bf ÐÁÒÁÇÒÁÆ} & \kbd{M-h} \\ +ÐÏÍÅÔÉÔØ {\bf ÓÔÒÁÎÉÃÕ} & \kbd{C-x C-p} \\ +ÐÏÍÅÔÉÔØ {\bf ×ÙÒÁÖÅÎÉÅ} & \kbd{C-M-@} \\ +ÐÏÍÅÔÉÔØ {\bf ÆÕÎËÃÉÀ} & \kbd{C-M-h} \\ +ÐÏÍÅÔÉÔØ ×ÅÓØ {\bf ÂÕÆÅÒ} & \kbd{C-x h} \\ +\end{tabular} + +\section{úÁÍÅÎÁ Ó ÚÁÐÒÏÓÏÍ} + +\begin{tabular}{p{\ColWidth}l} +ÉÎÔÅÒÁËÔÉ×ÎÁÑ ÚÁÍÅÎÁ ÔÅËÓÔÏ×ÏÊ ÓÔÒÏËÉ & \kbd{M-\%} \\ +Ó ÉÓÐÏÌØÚÏ×ÁÎÉÅÍ ÒÅÇÕÌÑÒÎÙÈ ×ÙÒÁÖÅÎÉÊ & \kbd{M-x query-replace-regexp} \\ +\end{tabular} + +÷ ÒÅÖÉÍÅ ÉÎÔÅÒÁËÔÉ×ÎÏÊ ÚÁÍÅÎÙ ÐÏÌØÚÏ×ÁÔÅÌÀ ÄÏÓÔÕÐÎÙ ÓÌÅÄÕÀÝÉÅ ÏÔ×ÅÔÙ: + +\begin{tabular}{p{\ColWidth}l} +{\bf ÚÁÍÅÎÉÔØ} ÄÁÎÎÏÅ ÓÏÏÔ×ÅÔÓÔ×ÉÅ, ÐÅÒÅÊÔÉ Ë ÓÌÅÄÕÀÝÅÍÕ & \kbd{SPC} \\ +ÚÁÍÅÎÉÔØ ÜÔÏ ÓÏÏÔ×ÅÔÓÔ×ÉÅ, ÎÅ ÐÅÒÅÍÅÝÁÔØÓÑ & \kbd{,} \\ +{\bf ÐÒÏÐÕÓÔÉÔØ} ÓÏÏÔ×ÅÔÓÔ×ÉÅ ÂÅÚ ÚÁÍÅÎÙ & \kbd{DEL} \\ +ÚÁÍÅÎÉÔØ ×ÓÅ ÏÓÔÁ×ÛÉÅÓÑ ÓÏÏÔ×ÅÔÓÔ×ÉÑ & \kbd{!} \\ +{\bf ×ÅÒÎÕÔØÓÑ} Ë ÐÒÅÄÙÄÕÝÅÍÕ ÓÏÏÔ×ÅÔÓÔ×ÉÀ & \kbd{\^} \\ +{\bf ×ÙÊÔÉ} ÉÚ ÒÅÖÉÍÁ ÚÁÍÅÎÁ Ó ÚÁÐÒÏÓÏÍ & \kbd{RET} \\ +×ÏÊÔÉ × ÒÅÖÉÍ ÒÅËÕÒÓÉ×ÎÏÇÏ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ (ÄÌÑ ×ÙÈÏÄÁ ÉÓÐÏÌØÚÕÅÔÓÑ \kbd{C-M-c}) & \kbd{C-r} \\ +\end{tabular} + +\section{íÎÏÖÅÓÔ×Ï ÏËÏÎ} + +ëÏÍÁÎÄÙ, ÐÒÉ×ÅÄÅÎÎÙÅ ×Ï ×ÔÏÒÏÍ ÓÔÏÌÂÃÅ, ÐÒÉÍÅÎÑÀÔÓÑ Ë ÄÒÕÇÏÍÕ +(ÎÅÁËÔÉ×ÎÏÍÕ) ÏËÎÕ. + +\begin{tabular}{p{\ColWidth}l} +ÕÄÁÌÉÔØ ×ÓÅ ÏÓÔÁÌØÎÙÅ ÏËÎÁ & \kbd{C-x 1} \\ +\end{tabular} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +ÒÁÚÂÉÔØ ÏËÎÏ ÐÏ ÇÏÒÉÚÏÎÔÁÌÉ & \kbd{C-x 2\ \ \ \ } & \kbd{C-x 5 2} \\ +ÕÄÁÌÉÔØ ÄÁÎÎÏÅ ÏËÎÏ & \kbd{C-x 0\ \ \ \ } & \kbd{C-x 5 0} \\ + +ÒÁÚÂÉÔØ ÏËÎÏ ÐÏ ×ÅÒÔÉËÁÌÉ & \kbd{C-x 3} \\ + +×ÙÐÏÌÎÉÔØ ÐÒÏËÒÕÔËÕ × ÄÒÕÇÏÍ ÏËÎÅ & \kbd{C-M-v} \\ +\end{tabular} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +ÐÅÒÅÍÅÓÔÉÔØ ËÕÒÓÏÒ × ÄÒÕÇÏÅ ÏËÎÏ & \kbd{C-x o} & \kbd{C-x 5 o} \\ + +×ÙÂÒÁÔØ ÂÕÆÅÒ × ÄÒÕÇÏÍ ÏËÎÅ & \kbd{C-x 4 b} & \kbd{C-x 5 b} \\ +ÐÏËÁÚÁÔØ ÂÕÆÅÒ × ÄÒÕÇÏÍ ÏËÎÅ & \kbd{C-x 4 C-o} & \kbd{C-x 5 C-o} \\ +ÚÁÇÒÕÚÉÔØ ÆÁÊÌ × ÄÒÕÇÏÅ ÏËÎÏ & \kbd{C-x 4 f} & \kbd{C-x 5 f} \\ +ÏÔËÒÙÔØ ÆÁÊÌ × ÒÅÖÉÍÅ ÞÔÅÎÉÑ × ÄÒÕÇÏÍ ÏËÎÅ & \kbd{C-x 4 r} & \kbd{C-x 5 r} \\ +ÚÁÐÕÓÔÉÔØ Dired × ÄÒÕÇÏÍ ÏËÎÅ & \kbd{C-x 4 d} & \kbd{C-x 5 d} \\ +ÎÁÊÔÉ ÔÁÇ × ÄÒÕÇÏÍ ÏËÎÅ & \kbd{C-x 4 .} & \kbd{C-x 5 .} \\ + +\end{tabular} + +\begin{tabular}{p{\ColWidth}l} +Õ×ÅÌÉÞÉÔØ ×ÙÓÏÔÕ ÏËÎÁ & \kbd{C-x \^} \\ +ÓÕÚÉÔØ ÔÅËÕÝÅÅ ÏËÎÏ & \kbd{C-x \{} \\ +ÒÁÓÛÉÒÉÔØ ÔÅËÕÝÅÅ ÏËÎÏ & \kbd{C-x \}} \\ +\end{tabular} + +\section{æÏÒÍÁÔÉÒÏ×ÁÎÉÅ} + +\begin{tabular}{p{\ColWidth}l} +ÓÄÅÌÁÔØ ÏÔÓÔÕÐ ÄÌÑ ÔÅËÕÝÅÊ {\bf ÓÔÒÏËÉ} (× ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÒÅÖÉÍÁ) & \kbd{TAB} \\ +ÓÄÅÌÁÔØ ÏÔÓÔÕÐ ÄÌÑ {\bf ÏÂÌÁÓÔÉ} (× ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÒÅÖÉÍÁ) & \kbd{C-M-$\backslash$} \\ +ÓÄÅÌÁÔØ ÏÔÓÔÕÐ ÄÌÑ {\bf ×ÙÒÁÖÅÎÉÑ} (× ÚÁ×ÉÓÉÍÏÓÔÉ ÏÔ ÒÅÖÉÍÁ) & \kbd{C-M-q} \\ +ÓÄÅÌÁÔØ ÏÔÓÔÕÐ Ë ÚÁÄÁÎÎÏÊ {\it arg\/} ËÏÌÏÎËÅ & \kbd{C-x TAB} \\ + +×ÓÔÁ×ÉÔØ ÎÏ×ÕÀ ÓÔÒÏËÕ ÐÏÓÌÅ ËÕÒÓÏÒÁ & \kbd{C-o} \\ +ÓÄ×ÉÎÕÔØ ÏÓÔÁÔÏË ÓÔÒÏËÉ ×ÅÒÔÉËÁÌØÎÏ ×ÎÉÚ & \kbd{C-M-o} \\ +ÕÄÁÌÉÔØ ÐÕÓÔÙÅ ÓÔÒÏËÉ ×ÏËÒÕÇ ËÕÒÓÏÒÁ & \kbd{C-x C-o} \\ +ÏÂßÅÄÉÎÉÔØ ÓÔÒÏËÕ Ó ÐÒÅÄÙÄÕÝÅÊ (ÓÏ ÓÌÅÄÕÀÝÉÍÉ arg) & \kbd{M-\^} \\ +ÕÄÁÌÉÔØ ÐÕÓÔÏÅ ÐÒÏÓÔÒÁÎÓÔ×Ï ×ÏËÒÕÇ ËÕÒÓÏÒÁ & \kbd{M-$\backslash$} \\ +ÐÏÍÅÓÔÉÔØ ÔÏÌØËÏ ÏÄÉÎ ÐÒÏÂÅÌ × ÐÏÚÉÃÉÉ ËÕÒÓÏÒÁ & \kbd{M-SPC} \\ + +ÚÁÐÏÌÎÉÔØ ÔÅËÕÝÉÊ ÐÁÒÁÇÒÁÆ & \kbd{M-q} \\ +ÕÓÔÁÎÏ×ÉÔØ ÓÔÏÌÂÅà ÚÁÐÏÌÎÅÎÉÑ & \kbd{C-x f} \\ +ÕÓÔÁÎÏ×ÉÔØ ÐÒÅÆÉËÓ ÚÁÐÏÌÎÅÎÉÑ ËÁÖÄÏÊ ÓÔÒÏËÉ & \kbd{C-x .} \\ + +ÕÓÔÁÎÏ×ÉÔØ ÎÁÞÅÒÔÁÎÉÅ & \kbd{M-g} \\ +\end{tabular} + +\section{éÚÍÅÎÅÎÉÅ ÒÅÇÉÓÔÒÁ} + +\begin{tabular}{p{\ColWidth}l} +ÓÄÅÌÁÔØ ÂÕË×Ù ÓÌÏ×Á ÚÁÇÌÁ×ÎÙÍÉ & \kbd{M-u} \\ +ÓÄÅÌÁÔØ ÂÕË×Ù ÓÌÏ×Á ÓÔÒÏÞÎÙÍÉ & \kbd{M-l} \\ +ÓÄÅÌÁÔØ ÐÅÒ×ÕÀ ÂÕË×Õ ÓÌÏ×Á ÚÁÇÌÁ×ÎÏÊ & \kbd{M-c} \\ + +ÓÄÅÌÁÔØ ÂÕË×Ù ÏÂÌÁÓÔÉ ÚÁÇÌÁ×ÎÙÍÉ & \kbd{C-x C-u} \\ +ÓÄÅÌÁÔØ ÂÕË×Ù ÏÂÌÁÓÔÉ ÓÔÒÏÞÎÙÍÉ & \kbd{C-x C-l} \\ +\end{tabular} + +\section{íÉÎÉÂÕÆÅÒ} + +óÌÅÄÕÀÝÉÅ ËÌÁ×ÉÛÉ (ËÌÀÞÉ) ÏÐÒÅÄÅÌÅÎÙ × ÍÉÎÉÂÕÆÅÒÅ. + +\begin{tabular}{p{\ColWidth}l} +ÄÏÐÏÌÎÉÔØ ÎÁÓËÏÌØËÏ ×ÏÚÍÏÖÎÏ & \kbd{TAB} \\ +ÄÏÐÏÌÎÉÔØ ÄÏ ÏÄÎÏÇÏ ÓÌÏ×Á & \kbd{SPC} \\ +ÄÏÐÏÌÎÉÔØ É ×ÙÐÏÌÎÉÔØ & \kbd{RET} \\ +ÐÏËÁÚÁÔØ ×ÏÚÍÏÖÎÙÅ ÄÏÐÏÌÎÅÎÉÑ & \kbd{?} \\ +×ÙÂÒÁÔØ ÐÒÅÄÙÄÕÝÉÊ ××ÏÄ × ÍÉÎÉÂÕÆÅÒ & \kbd{M-p} \\ +×ÙÂÒÁÔØ ÓÌÅÄÕÀÝÉÊ ××ÏÄ × ÍÉÎÉÂÕÆÅÒ & \kbd{M-n} \\ +ÐÏÉÓË × ÉÓÔÏÒÉÉ ÐÏ ÒÅÇÕÌÑÒÎÏÍÕ ×ÙÒÁÖÅÎÉÀ × ÏÂÒÁÔÎÏÍ ÎÁÐÒ×ÌÅÎÉÉ & \kbd{M-r} \\ +ÐÏÉÓË × ÉÓÔÏÒÉÉ ÐÏ ÒÅÇÕÌÑÒÎÏÍÕ ×ÙÒÁÖÅÎÉÀ × ÐÒÑÍÏÍ ÎÁÐÒ×ÌÅÎÉÉ & \kbd{M-s} \\ +ÐÒÅÒ×ÁÔØ ËÏÍÁÎÄÕ & \kbd{C-g} \\ +\end{tabular} + +îÁÂÅÒÉÔÅ \kbd{C-x ESC ESC} ÄÌÑ ÒÅÄÁËÔÉÒÏ×ÁÎÉÑ É ÐÏ×ÔÏÒÅÎÉÑ ÐÏÓÌÅÄÎÅÊ +ËÏÍÁÎÄÙ ÎÁÂÒÁÎÎÏÊ × ÍÉÎÉÂÕÆÅÒÅ. îÁÂÅÒÉÔÅ \kbd{F10}, ÞÔÏÂÙ ÒÁÂÏÔÁÔØ Ó +ÐÕÎËÔÁÍÉ ÍÅÎÀ ÐÒÉ ÐÏÍÏÝÉ ËÏÍÁÎÄ ÍÉÎÉÂÕÆÅÒÁ. + +\section{âÕÆÅÒÁ} + +\begin{tabular}{p{\ColWidth}l} +×ÙÂÒÁÔØ ÄÒÕÇÏÊ ÂÕÆÅÒ & \kbd{C-x b} \\ +×ÙÄÁÔØ ÓÐÉÓÏË ×ÓÅÈ ÂÕÆÅÒÏ× & \kbd{C-x C-b} \\ +ÕÎÉÞÔÏÖÉÔØ ÂÕÆÅÒ & \kbd{C-x k} \\ +\end{tabular} + +\section{ïÂÍÅÎ ÍÅÓÔÁÍÉ} + +\begin{tabular}{p{\ColWidth}l} +ÏÂÍÅÎÑÔØ ÍÅÓÔÁÍÉ {\bf ÓÉÍ×ÏÌÙ} & \kbd{C-t} \\ +ÏÂÍÅÎÑÔØ ÍÅÓÔÁÍÉ {\bf ÓÌÏ×Á} & \kbd{M-t} \\ +ÏÂÍÅÎÑÔØ ÍÅÓÔÁÍÉ {\bf ÓÔÒÏËÉ} & \kbd{C-x C-t} \\ +ÏÂÍÅÎÑÔØ ÍÅÓÔÁÍÉ {\bf ×ÙÒÁÖÅÎÉÑ} & \kbd{C-M-t} \\ +\end{tabular} + +\section{ðÒÏ×ÅÒËÁ ÇÒÁÍÍÁÔÉËÉ} + +\begin{tabular}{p{\ColWidth}l} +ÐÒÏ×ÅÒÉÔØ ÔÅËÕÝÅÅ ÓÌÏ×Ï & \kbd{M-\$} \\ +ÐÒÏ×ÅÒÉÔØ ×ÓÅ ÓÌÏ×Á × ÏÂÌÁÓÔÉ & \kbd{M-x ispell-region} \\ +×ÙÐÏÌÎÉÔØ ÐÒÏ×ÅÒËÕ ×ÓÅÇÏ ÂÕÆÅÒÁ & \kbd{M-x ispell-buffer} \\ +\end{tabular} + +\section{ôÅÇÉ} + +\begin{tabular}{p{\ColWidth}l} +ÎÁÊÔÉ ÏÐÒÅÄÅÌÅÎÉÅ ÔÅÇÁ & \kbd{M-.} \\ +ÎÁÊÔÉ ÓÌÅÄÕÀÝÅÅ ×ÈÏÖÄÅÎÉÅ ÔÅÇÁ & \kbd{C-u M-.} \\ +ÕËÁÚÁÔØ ÎÏ×ÙÊ ÆÁÊÌ Ó ÔÅÇÁÍÉ & \kbd{M-x visit-tags-table} \\ + +ÐÏÉÓË ÐÏ ÛÁÂÌÏÎÕ ÐÏ ×ÓÅÊ ÔÁÂÌÉÃÅ ÔÅÇÏ× & \kbd{M-x tags-search} \\ +×ÙÐÏÌÎÉÔØ query-replace ÎÁÄ ×ÓÅÍÉ ÆÁÊÌÁÍÉ & \kbd{M-x tags-query-replace} \\ +ÐÒÏÄÏÌÖÉÔØ ÐÏÉÓË ÉÌÉ ÐÏÉÓË-ÚÁÍÅÎÕ ÔÅÇÁ & \kbd{M-,} \\ +\end{tabular} + +\section{ëÏÍÁÎÄÎÙÅ ÐÒÏÃÅÓÓÏÒÙ} + +\begin{tabular}{p{\ColWidth}l} +÷ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ ËÏÍÁÎÄÎÏÇÏ ÐÒÏÃÅÓÓÏÒÁ & \kbd{M-!} \\ +×ÙÐÏÌÎÉÔØ ËÏÍÁÎÄÕ ËÏÍÁÎÄÎÏÇÏ ÐÒÏÃÅÓÓÏÒÁ ÎÁÄ ÏÂÌÁÓÔØÀ & \kbd{M-|} \\ +ÐÒÏÐÕÓÔÉÔØ ÓÏÄÅÒÖÉÍÏÅ ÏÂÌÁÓÔÉ ÞÅÒÅÚ ËÏÍÁÎÄÕ ËÏÍÁÎÄÎÏÇÏ ÐÒÏÃÅÓÓÏÒÁ & \kbd{C-u M-|} \\ +ÚÁÐÕÓÔÉÔØ ËÏÍÁÎÄÎÙÊ ÐÒÏÃÅÓÓÏÒ × ÏËÎÅ \kbd{*shell*} & \kbd{M-x shell} \\ +\end{tabular} + +\section{ðÒÑÍÏÕÇÏÌØÎÙÅ ÏÂÌÁÓÔÉ} + +\begin{tabular}{p{\ColWidth}l} +ÓËÏÐÉÒÏ×ÁÔØ ÐÒÑÍÏÕÇÏÌØÎÕÀ ÏÂÌÁÓÔØ × ÒÅÇÉÓÔÒ & \kbd{C-x r r} \\ +ÕÄÁÌÉÔØ ÐÒÑÍÏÕÇÏÌØÎÕÀ ÏÂÌÁÓÔØ & \kbd{C-x r k} \\ +×ÓÔÁ×ÉÔØ ÐÏÓÌÅÄÎÕÀ ÕÎÉÞÔÏÖÅÎÎÕÀ ÐÒÑÍÏÕÇÏÌØÎÕÀ ÏÂÌÁÓÔØ & \kbd{C-x r y} \\ +ÏÔËÒÙÔØ ÐÒÑÍÏÕÇÏÌØÎÕÀ ÏÂÌÁÓÔØ, ÓÄ×ÉÇÁÑ ÔÅËÓÔ ×ÐÒÁ×Ï & \kbd{C-x r o} \\ +ÏÞÉÓÔÉÔØ ÐÒÑÍÏÕÇÏÌØÎÕÀ ÏÂÌÁÓÔØ & \kbd{C-x r c} \\ +ÐÒÅÄ×ÁÒÉÔØ ËÁÖÄÕÀ ÓÔÒÏËÕ ÓÔÒÏËÏÊ ÔÅËÓÔÁ & \kbd{C-x r t} \\ +\end{tabular} + +\section{óÏËÒÁÝÅÎÉÑ} + +\begin{tabular}{p{\ColWidth}l} +ÄÏÂÁ×ÉÔØ ÇÌÏÂÁÌØÎÏÅ ÓÏËÒÁÝÅÎÉÅ & \kbd{C-x a g} \\ +ÄÏÂÁ×ÉÔØ ÌÏËÁÌØÎÏÅ ÄÌÑ ÒÅÖÉÍÁ ÓÏËÒÁÝÅÎÉÅ & \kbd{C-x a l} \\ +ÄÏÂÁ×ÉÔØ ÇÌÏÂÁÌØÎÏÅ ÚÎÁÞÅÎÉÅ ÄÌÑ ÄÁÎÎÏÇÏ ÓÏËÒÁÝÅÎÉÑ & \kbd{C-x a i g} \\ +ÄÏÂÁ×ÉÔØ ÓÐÅÃÉÆÉÞÅÓËÏÅ ÄÌÑ ÒÅÖÉÍÁ ÚÎÁÞÅÎÉÅ ÄÁÎÎÏÇÏ ÓÏËÒÁÝÅÎÉÑ & \kbd{C-x a i l} \\ +Ñ×ÎÏ ×ÓÔÁ×ÉÔØ ÚÎÁÞÅÎÉÅ ÄÌÑ ÓÏËÒÁÝÅÎÉÑ & \kbd{C-x a e} \\ + +ÄÉÎÁÍÉÞÅÓËÉ ÄÏÐÏÌÎÉÔØ ÐÒÅÄÙÄÕÝÅÅ ÓÌÏ×Ï & \kbd{M-/} \\ +\end{tabular} + +\section{òÅÇÕÌÑÒÎÙÅ ×ÙÒÁÖÅÎÉÑ} + +\begin{tabular}{p{\ColWidth}l} +ÌÀÂÏÊ ÏÄÉÎÏÞÎÙÊ ÓÉÍ×ÏÌ (ÚÁ ÉÓËÌÀÞÅÎÉÅÍ ÓÉÍ×ÏÌÁ ÎÏ×ÏÊ ÓÔÒÏËÉ) & \kbd{. {\rm(dot)}} \\ +ÎÏÌØ ÉÌÉ ÂÏÌÅÅ ÐÏ×ÔÏÒÅÎÉÊ & \kbd{*} \\ +ÏÄÎÏ ÉÌÉ ÂÏÌÅÅ ÐÏ×ÔÏÒÅÎÉÊ & \kbd{+} \\ +ÎÏÌØ ÉÌÉ ÏÄÎÏ ÐÏ×ÔÏÒÅÎÉÅ & \kbd{?} \\ +ÜËÒÁÎÉÒÏ×ÁÔØ ÓÐÅÃÉÁÌØÎÙÊ ÓÉÍ×ÏÌ {\it c\/} & \kbd{$\backslash${\it c}} \\ +×ÙÂÏÒ ÍÅÖÄÕ ÁÌØÔÅÒÎÁÔÉ×ÁÍÉ (``ÉÌÉ'') & \kbd{$\backslash|$} \\ +ÇÒÕÐÐÉÒÏ×ËÁ & \kbd{$\backslash$( {\rm$\ldots$} $\backslash$)} \\ +ÔÅËÓÔ × {\it n\/}-Ê ÇÒÕÐÐÅ & \kbd{$\backslash${\it n}} \\ +ÇÒÁÎÉÃÁ ÓÌÏ×Á & \kbd{$\backslash$b} \\ +ÎÅ ÇÒÁÎÉÃÁ ÓÌÏ×Á & \kbd{$\backslash$B} \\ +\end{tabular} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +{\bf ÏÂßÅËÔ} & {\bf ÎÁÞÁÌÏ ÓÏÏÔ×ÅÔÓÔ×ÉÑ} & {\bf ËÏÎÅà ÓÏÏÔ×ÅÔÓÔ×ÉÑ} \\ +ÓÔÒÏËÁ & \kbd{\^} & \kbd{\$} \\ +ÓÌÏ×Ï & \kbd{$\backslash$<} & \kbd{$\backslash$>} \\ +ÂÕÆÅÒ & \kbd{$\backslash$`} & \kbd{$\backslash$'} \\ +\end{tabular} + +\begin{tabular}{p{\ColWidth}p{\ColThreeWidth}p{\ColThreeWidth}} +{\bf ËÌÁÓÓ ÓÉÍ×ÏÌÏ×} & {\bf ÓÏÏÔ×ÅÔ\-ÓÔ×ÕÅÔ ÉÍ} & {\bf ÓÏÏÔ×ÅÔ\-ÓÔ×ÕÅÔ ÄÒÕÇÉÍ} \\ +Ñ×ÎÙÊ ÎÁÂÏÒ & \kbd{[ {\rm$\ldots$} ]} & \kbd{[\^ {\rm$\ldots$} ]} \\ +ÓÉÍ×ÏÌ-ÂÕË×Á & \kbd{$\backslash$w} & \kbd{$\backslash$W} \\ +ÓÉÍ×ÏÌ Ó ÓÉÎÔÁËÓÉÓÏÍ {\it c} & \kbd{$\backslash$s{\it c}} & \kbd{$\backslash$S{\it c}} \\ +\end{tabular} + +\section{íÅÖÄÕÎÁÒÏÄÎÙÅ ÎÁÂÏÒÙ ÓÉÍ×ÏÌÏ×} + +\begin{tabular}{p{\ColWidth}l} +×ÙÂÒÁÔØ ÑÚÙË & \kbd{M-x set-language-environment} \\ +ÐÏËÁÚÁÔØ ×ÓÅ ×ÏÚÍÏÖÎÙÅ ÍÅÔÏÄÙ ××ÏÄÁ & \kbd{M-x list-input-methods} \\ +ÒÁÚÒÅÛÉÔØ ÉÌÉ ÚÁÐÒÅÔÉÔØ ÍÅÔÏÄ ××ÏÄÁ & \kbd{C-$\backslash$} \\ +ÕÓÔÁÎÏ×ÉÔØ ÓÉÓÔÅÍÕ ËÏÄÉÒÏ×ÁÎÉÑ ÄÌÑ ÓÌÅÄÕÀÝÅÊ ËÏÍÁÎÄÙ & \kbd{C-x RET c} \\ +ÐÏËÁÚÁÔØ ÓÐÉÓÏË ×ÓÅÈ ÓÉÓÔÅÍ ËÏÄÉÒÏ×ÁÎÉÑ & \kbd{M-x list-coding-systems} \\ +×ÙÂÒÁÔØ ÐÒÅÄÐÏÞÔÉÔÅÌØÎÕÀ ÓÉÓÔÅÍÕ ËÏÄÉÒÏ×ÁÎÉÑ & \kbd{M-x prefer-coding-system} \\ +\end{tabular} + +\section{éÎÆÏÒÍÁÃÉÑ (ÓÉÓÔÅÍÁ Info)} + +\begin{tabular}{p{\ColWidth}l} +ÚÁÐÕÓÔÉÔØ ÓÉÓÔÅÍÕ ÄÏÓÔÕÐÁ Ë ÄÏËÕÍÅÎÔÁÃÉÉ & \kbd{C-h i} \\ +ÎÁÊÔÉ ÕËÁÚÁÎÎÕÀ ÆÕÎËÃÉÀ ÉÌÉ ÐÅÒÅÍÅÎÎÕÀ × ÄÏËÕÍÅÎÔÁÃÉÉ & \kbd{C-h C-i} \\ +\end{tabular} + +ðÅÒÅÍÅÝÅÎÉÅ ×ÎÕÔÒÉ ÕÚÌÁ (ÎÏÄÁÍÉ): + +\begin{tabular}{p{\ColWidth}l} +ÐÒÏËÒÕÔËÁ ×ÐÅÒÅÄ & \kbd{SPC} \\ +ÐÒÏËÒÕÔËÁ ÎÁÚÁÄ & \kbd{DEL} \\ +ÐÅÒÅÊÔÉ Ë ÎÁÞÁÌÕ ÕÚÌÁ & \kbd{. {\rm (dot)}} \\ +\end{tabular} + +ðÅÒÅÍÅÝÅÎÉÅ ÍÅÖÄÕ ÕÚÌÁÍÉ: + +\begin{tabular}{p{\ColWidth}l} +{\bf ÓÌÅÄÕÀÝÉÊ} ÕÚÅÌ & \kbd{n} \\ +{\bf ÐÒÅÄÙÄÕÝÉÊ} ÕÚÅÌ & \kbd{p} \\ +ÐÅÒÅÊÔÉ Ë {\bf ×ÅÒÈÎÅÍÕ} ÕÚÌÕ & \kbd{u} \\ +×ÙÂÒÁÔØ ÍÅÎÀ ÐÏ ÉÍÅÎÉ & \kbd{m} \\ +×ÙÂÒÁÔØ {\it n\/}-Ê ÐÕÎËÔ ÍÅÎÀ ÐÏ ÎÏÍÅÒÕ (1--9) & \kbd{{\it n}} \\ +ÐÅÒÅÊÔÉ ÐÏ ÓÓÙÌËÅ (×ÏÚ×ÒÁÔ Ó ÐÏÍÏÝØÀ \kbd{l}) & \kbd{f} \\ +×ÏÚ×ÒÁÔÉÔÓÑ Ë ÐÏÓÌÅÄÎÅÍÕ ÐÒÏÓÍÏÔÒÅÎÎÏÍÕ ÕÚÌÕ & \kbd{l} \\ +×ÏÚ×ÒÁÔÉÔÓÑ Ë ÕÚÌÕ-ËÁÔÁÌÏÇÕ & \kbd{d} \\ +ÐÅÒÅÊÔÉ Ë ÕÚÌÕ, ÚÁÄÁÎÎÏÍÕ ÉÍÅÎÅÍ & \kbd{g} \\ +\end{tabular} + +äÒÕÇÉÅ ËÏÍÁÎÄÙ: + +\begin{tabular}{p{\ColWidth}l} +ÚÁÐÕÓÔÉÔØ {\bf ÕÞÅÂÎÉË} ÐÏ ÓÉÓÔÅÍÅ ÄÏËÕÍÅÎÔÁÃÉÉ & \kbd{h} \\ +{\bf ÐÒÅËÒÁÔÉÔØ ÒÁÂÏÔÕ} Ó ÄÏËÕÍÅÎÔÁÃÉÅÊ & \kbd{q} \\ +ÐÏÉÓË × ÕÚÌÁÈ Ó ÐÏÍÏÝØÀ ÒÅÇÕÌÑÒÎÙÈ ×ÙÒÁÖÅÎÉÊ & \kbd{M-s} \\ +\end{tabular} + +\section{òÅÇÉÓÔÒÙ} + +\begin{tabular}{p{\ColWidth}l} +ÓÏÈÒÁÎÉÔØ ÏÂÌÁÓÔØ × ÒÅÇÉÓÔÒÅ & \kbd{C-x r s} \\ +×ÓÔÁ×ÉÔØ ÓÏÄÅÒÖÉÍÏÅ ÒÅÇÉÓÔÒÁ × ÂÕÆÅÒ & \kbd{C-x r i} \\ + +ÓÏÈÒÁÎÉÔØ ÐÏÌÏÖÅÎÉÅ ËÕÒÓÏÒÁ × ÒÅÇÉÓÔÒÅ & \kbd{C-x r SPC} \\ +ÐÅÒÅÊÔÉ Ë ÐÏÌÏÖÅÎÉÀ ËÕÒÓÏÒÁ, ÓÏÈÒÁÎÅÎÎÏÍÕ × ÒÅÇÉÓÔÒÅ & \kbd{C-x r j} \\ +\end{tabular} + +\section{ëÌÁ×ÉÁÔÕÒÎÙÅ ÍÁËÒÏÓÙ} + +\begin{tabular}{p{\ColWidth}l} +{\bf ÎÁÞÁÔØ} ÏÐÒÅÄÅÌÅÎÉÅ ËÌÁ×ÉÁÔÕÒÎÏÇÏ ÍÁËÒÏÓÁ & \kbd{C-x (} \\ +{\bf ÚÁËÏÎÞÉÔØ} ÏÐÒÅÄÅÌÅÎÉÅ ËÌÁ×ÉÁÔÕÒÎÏÇÏ ÍÁËÒÏÓÁ & \kbd{C-x )} \\ +{\bf ×ÙÐÏÌÎÉÔØ} ÐÏÓÌÅÄÎÉÊ ÏÐÒÅÄÅÌÅÎÎÙÊ ÍÁËÒÏÓ & \kbd{C-x e} \\ +ÄÏÐÏÌÎÉÔØ ÐÏÓÌÅÄÎÉÊ ÏÐÒÅÄÅÌÅÎÎÙÊ ÍÁËÒÏÓ & \kbd{C-u C-x (} \\ +ÚÁÄÁÔØ ÉÍÑ ÄÌÑ ÐÏÓÌÅÄÎÅÇÏ ÏÐÒÅÄÅÌÅÎÎÏÇÏ ÍÁËÒÏÓÁ & \kbd{M-x name-last-kbd-macro} \\ +×ÓÔÁ×ÉÔØ × ÂÕÆÅÒ ÏÐÒÅÄÅÌÅÎÉÅ ÍÁËÒÏÓÁ ÎÁ ÑÚÙËÅ Lisp & \kbd{M-x insert-kbd-macro} \\ +\end{tabular} + +\section{ëÏÍÁÎÄÙ, Ó×ÑÚÁÎÎÙÅ Ó Emacs Lisp} + +\begin{tabular}{p{\ColWidth}l} +×ÙÞÉÓÌÉÔØ {\bf ×ÙÒÁÖÅÎÉÅ} ÐÅÒÅÄ ËÕÒÓÏÒÏÍ & \kbd{C-x C-e} \\ +×ÙÞÉÓÌÉÔØ ÔÅËÕÝÕÀ ÆÕÎËÃÉÀ {\bf defun} & \kbd{C-M-x} \\ +×ÙÞÉÓÌÉÔØ {\bf ÏÂÌÁÓÔØ} ËÁË ×ÙÒÁÖÅÎÉÅ & \kbd{M-x eval-region} \\ +ÓÞÉÔÁÔØ É ×ÙÞÉÓÌÉÔØ ×ÙÒÁÖÅÎÉÅ ÉÚ ÍÉÎÉÂÕÆÅÒÁ & \kbd{M-:} \\ +ÚÁÇÒÕÚÉÔØ ÉÚ ÓÔÁÎÄÁÒÔÎÏÇÏ ÓÉÓÔÅÍÎÏÇÏ ËÁÔÁÌÏÇÁ & \kbd{M-x load-library} \\ +\end{tabular} + +\section{ðÒÏÓÔÁÑ ÎÁÓÔÒÏÊËÁ} + +\begin{tabular}{p{\ColWidth}l} +ÎÁÓÔÒÏÉÔØ ÐÅÒÅÍÅÎÎÙÅ É ÏÆÏÒÍÌÅÎÉÅ (faces) & \kbd{M-x customize} \\ +\end{tabular} + +% The intended audience here is the person who wants to make simple +% customizations and knows Lisp syntax. + +óÏÚÄÁÔØ ÇÌÏÂÁÌØÎÏÅ ÎÁÚÎÁÞÅÎÉÅ ËÌÀÞÅÊ ÎÁ Emacs Lisp (ÐÒÉÍÅÒ): + +\begin{verbatim} +(global-set-key "\C-cg" 'goto-line) +(global-set-key "\M-#" 'query-replace-regexp) +\end{verbatim} + +\section{îÁÐÉÓÁÎÉÅ ËÏÍÁÎÄ} + +\begin{verbatim} +(defun <command-name> (<args>) + "<documentation>" (interactive "<template>") + <body>) +\end{verbatim} + +ðÒÉÍÅÒ: + +\begin{verbatim} +(defun this-line-to-top-of-window (line) + "Reposition line point is on to top of window. +With ARG, put point on line ARG." + (interactive "P") + (recenter (if (null line) + 0 + (prefix-numeric-value line)))) +\end{verbatim} + +óÐÅÃÉÆÉËÁÃÉÑ \kbd{interactive} ÓÏÏÂÝÁÅÔ Ï ÔÏÍ, ÞÔÏ ÁÒÇÕÍÅÎÔ ÎÁÄÏ ÓÞÉÔÙ×ÁÔØ +ÉÎÔÅÒÁËÔÉ×ÎÏ. äÌÑ ÄÏÐÏÌÎÉÔÅÌØÎÏÊ ÉÎÆÏÒÍÁÃÉÉ ÎÁÂÅÒÉÔÅ \kbd{C-h f interactive}. + +\copyrightnotice + +%\end{multicols} + +\end{document} + +% arch-tag: 868a12f6-4339-4a14-a56e-4a3937277a9e diff --git a/etc/tree-widget/default/close.png b/etc/tree-widget/default/close.png Binary files differnew file mode 100644 index 00000000000..0725def3dee --- /dev/null +++ b/etc/tree-widget/default/close.png diff --git a/etc/tree-widget/default/close.xpm b/etc/tree-widget/default/close.xpm new file mode 100644 index 00000000000..63a7930fe34 --- /dev/null +++ b/etc/tree-widget/default/close.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *close[] = { +/* width height num_colors chars_per_pixel */ +" 16 21 256 2", +/* colors */ +"`` c #840000", +"`. c #942929", +"`# c #9c3131", +"`a c #9c3939", +"`b c #a54242", +"`c c #a54a4a", +"`d c #ad4a4a", +"`e c #ad5252", +"`f c #ad5a5a", +"`g c None", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g```````g`g`g`g`g`g`g`g`g", +"`g`g`g`````.`````g`g`g`g`g`g`g`g", +"`g`g`````.`#`a`````g`g`g`g`g`g`g", +"`g`````.`#`a`a`b`````g`g`g`g`g`g", +"`````.`#`a`a`b`c`e`````g`g`g`g`g", +"```.`#`a`a`b`c`e`e`f```g`g`g`g`g", +"`````a`a`b`c`e`e`f`````g`g`g`g`g", +"`g`````b`c`e`e`f`````g`g`g`g`g`g", +"`g`g`````e`e`f`````g`g`g`g`g`g`g", +"`g`g`g`````f`````g`g`g`g`g`g`g`g", +"`g`g`g`g```````g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g" +}; diff --git a/etc/tree-widget/default/empty.png b/etc/tree-widget/default/empty.png Binary files differnew file mode 100644 index 00000000000..45f464836cc --- /dev/null +++ b/etc/tree-widget/default/empty.png diff --git a/etc/tree-widget/default/empty.xpm b/etc/tree-widget/default/empty.xpm new file mode 100644 index 00000000000..6bb0a285dd8 --- /dev/null +++ b/etc/tree-widget/default/empty.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *empty[] = { +/* width height num_colors chars_per_pixel */ +" 16 21 256 2", +/* colors */ +"`` c #848400", +"`. c #949429", +"`# c #9c9c31", +"`a c #9c9c39", +"`b c #a5a542", +"`c c #a5a54a", +"`d c #adad4a", +"`e c #adad52", +"`f c #adad5a", +"`g c None", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g```````g`g`g`g`g`g`g`g`g", +"`g`g`g`````.`````g`g`g`g`g`g`g`g", +"`g`g`````.`#`a`````g`g`g`g`g`g`g", +"`g`````.`#`a`a`b`````g`g`g`g`g`g", +"`````.`#`a`a`b`c`c`````g`g`g`g`g", +"```.`#`a`a`b`c`c`e`f```g`g`g`g`g", +"`````a`a`b`c`c`e`f`````g`g`g`g`g", +"`g`````b`c`c`e`f`````g`g`g`g`g`g", +"`g`g`````c`e`f`````g`g`g`g`g`g`g", +"`g`g`g`````f`````g`g`g`g`g`g`g`g", +"`g`g`g`g```````g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g`g" +}; diff --git a/etc/tree-widget/default/end-guide.png b/etc/tree-widget/default/end-guide.png Binary files differnew file mode 100644 index 00000000000..908048c4293 --- /dev/null +++ b/etc/tree-widget/default/end-guide.png diff --git a/etc/tree-widget/default/end-guide.xpm b/etc/tree-widget/default/end-guide.xpm new file mode 100644 index 00000000000..8e5d727b440 --- /dev/null +++ b/etc/tree-widget/default/end-guide.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *end-guide[] = { +/* width height num_colors chars_per_pixel */ +" 6 21 256 2", +/* colors */ +"`` c #000000", +"`. c #a5a5c6", +"`# c #ada5c6", +"`a c #cecee7", +"`b c #ceceff", +"`c c None", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #808000", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c", +"`c`c`c`c`c`c" +}; diff --git a/etc/tree-widget/default/guide.png b/etc/tree-widget/default/guide.png Binary files differnew file mode 100644 index 00000000000..c93b71ef073 --- /dev/null +++ b/etc/tree-widget/default/guide.png diff --git a/etc/tree-widget/default/guide.xpm b/etc/tree-widget/default/guide.xpm new file mode 100644 index 00000000000..56006ee48e0 --- /dev/null +++ b/etc/tree-widget/default/guide.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *guide[] = { +/* width height num_colors chars_per_pixel */ +" 6 21 256 2", +/* colors */ +"`` c #000000", +"`. c #a5a5c6", +"`# c #ada5c6", +"`a c #cecee7", +"`b c #ceceff", +"`c c None", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #808000", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#", +"`c`c`c`c`c`#" +}; diff --git a/etc/tree-widget/default/handle.png b/etc/tree-widget/default/handle.png Binary files differnew file mode 100644 index 00000000000..8411624adaa --- /dev/null +++ b/etc/tree-widget/default/handle.png diff --git a/etc/tree-widget/default/handle.xpm b/etc/tree-widget/default/handle.xpm new file mode 100644 index 00000000000..11f618b4b25 --- /dev/null +++ b/etc/tree-widget/default/handle.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *handle[] = { +/* width height num_colors chars_per_pixel */ +" 10 21 256 2", +/* colors */ +"`` c #000000", +"`. c #a5a5c6", +"`# c #ada5c6", +"`a c #cecee7", +"`b c #ceceff", +"`c c None", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #808000", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`#`#`#`#`#`#`#`#`#`#", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c" +}; diff --git a/etc/tree-widget/default/leaf.png b/etc/tree-widget/default/leaf.png Binary files differnew file mode 100644 index 00000000000..0408f38bd5e --- /dev/null +++ b/etc/tree-widget/default/leaf.png diff --git a/etc/tree-widget/default/leaf.xpm b/etc/tree-widget/default/leaf.xpm new file mode 100644 index 00000000000..8b5db38784a --- /dev/null +++ b/etc/tree-widget/default/leaf.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *leaf[] = { +/* width height num_colors chars_per_pixel */ +" 16 21 256 2", +/* colors */ +"`` c #424242", +"`. c #737373", +"`# c #7b7b7b", +"`a c #848484", +"`b c #8c8c8c", +"`c c #949494", +"`d c #9c9c9c", +"`e c #a5a5a5", +"`f c None", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f```````````f`f`f`f`f`f`f`f", +"`f`f```.`#`#`a`a```f`f`f`f`f`f`f", +"`f```.`#`#`a`a`b`b```f`f`f`f`f`f", +"```.`#`#`a`a`b`b`c`c```f`f`f`f`f", +"```#`#`a`a`b`b`c`c`d```f`f`f`f`f", +"```#`a`a`b`b`c`c`d`e```f`f`f`f`f", +"`f```a`b`b`c`c`d`e```f`f`f`f`f`f", +"`f`f```b`c`c`d`e```f`f`f`f`f`f`f", +"`f`f`f```````````f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f", +"`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f`f" +}; diff --git a/etc/tree-widget/default/no-guide.png b/etc/tree-widget/default/no-guide.png Binary files differnew file mode 100644 index 00000000000..dc4292ea98f --- /dev/null +++ b/etc/tree-widget/default/no-guide.png diff --git a/etc/tree-widget/default/no-guide.xpm b/etc/tree-widget/default/no-guide.xpm new file mode 100644 index 00000000000..82729cf59b0 --- /dev/null +++ b/etc/tree-widget/default/no-guide.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *no-guide[] = { +/* width height num_colors chars_per_pixel */ +" 6 21 256 2", +/* colors */ +"`` c #000000", +"`. c #84849c", +"`# c #8c8ca5", +"`a c #a5a5c6", +"`b c #ada5c6", +"`c c #b5b5ce", +"`d c #cecee7", +"`e c #ceceff", +"`f c #e7e7ff", +"`g c None", +"`h c #808000", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g", +"`g`g`g`g`g`g" +}; diff --git a/etc/tree-widget/default/no-handle.png b/etc/tree-widget/default/no-handle.png Binary files differnew file mode 100644 index 00000000000..00de3c09c26 --- /dev/null +++ b/etc/tree-widget/default/no-handle.png diff --git a/etc/tree-widget/default/no-handle.xpm b/etc/tree-widget/default/no-handle.xpm new file mode 100644 index 00000000000..7ce048c91ea --- /dev/null +++ b/etc/tree-widget/default/no-handle.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *no-handle[] = { +/* width height num_colors chars_per_pixel */ +" 10 21 256 2", +/* colors */ +"`` c #000000", +"`. c #84849c", +"`# c #8c8ca5", +"`a c #a5a5c6", +"`b c #ada5c6", +"`c c #b5b5ce", +"`d c #cecee7", +"`e c #ceceff", +"`f c #e7e7ff", +"`g c None", +"`h c #808000", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g", +"`g`g`g`g`g`g`g`g`g`g" +}; diff --git a/etc/tree-widget/default/open.png b/etc/tree-widget/default/open.png Binary files differnew file mode 100644 index 00000000000..d234ecadf39 --- /dev/null +++ b/etc/tree-widget/default/open.png diff --git a/etc/tree-widget/default/open.xpm b/etc/tree-widget/default/open.xpm new file mode 100644 index 00000000000..4c5c7b065b8 --- /dev/null +++ b/etc/tree-widget/default/open.xpm @@ -0,0 +1,284 @@ +/* XPM */ +static char *open[] = { +/* width height num_colors chars_per_pixel */ +" 16 21 256 2", +/* colors */ +"`` c #004200", +"`. c #296329", +"`# c #316331", +"`a c #316b31", +"`b c #396b39", +"`c c #427342", +"`d c #4a734a", +"`e c #4a7b4a", +"`f c #528452", +"`g c #5a845a", +"`h c #a5a5c6", +"`i c None", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i```````i`i`i`i`i`i`i`i`i", +"`i`i`i`````.`````i`i`i`i`i`i`i`i", +"`i`i`````.`#`b`````i`i`i`i`i`i`i", +"`i`````.`#`b`b`c`````i`i`i`i`i`i", +"`````.`#`b`b`c`d`e`````i`i`i`i`i", +"```.`#`b`b`c`d`e`f`g```i`i`i`i`i", +"`````b`b`c`d`e`f`g`````i`i`i`i`i", +"`i`````c`d`e`f`g`````i`i`i`i`i`i", +"`i`i`````e`f`g`````i`i`i`i`i`i`i", +"`i`i`i`````g`````i`i`i`i`i`i`i`i", +"`i`i`i`i```````i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`h`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`h`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`h`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`h`i`i`i`i`i`i`i`i`i`i", +"`i`i`i`i`i`h`i`i`i`i`i`i`i`i`i`i" +}; diff --git a/etc/tree-widget/folder/close.png b/etc/tree-widget/folder/close.png Binary files differnew file mode 100644 index 00000000000..f840ba89a4e --- /dev/null +++ b/etc/tree-widget/folder/close.png diff --git a/etc/tree-widget/folder/close.xpm b/etc/tree-widget/folder/close.xpm new file mode 100644 index 00000000000..1bd40ae6e94 --- /dev/null +++ b/etc/tree-widget/folder/close.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *close[] = { +/* width height num_colors chars_per_pixel */ +" 16 22 256 2", +/* colors */ +"`` c #848400", +"`. c #9c9c29", +"`# c #a5a531", +"`a c #adad39", +"`b c #adad42", +"`c c #b5b54a", +"`d c #b5b552", +"`e c #bdbd52", +"`f c #bdbd5a", +"`g c #c6c663", +"`h c #c6c66b", +"`i c #cece6b", +"`j c #cece73", +"`k c #dede8c", +"`l c #e7e794", +"`m c #e7e79c", +"`n c #efef9c", +"`o c None", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`````````o`o`o`o`o`o`o`o`o`o`o", +"```m`l`l`k```````````````o`o`o`o", +"```````````a`b`b`c`c`d`f```o`o`o", +"```.`#`#`a`b`b`c`c`d`f`f```o`o`o", +"```#`#`a`b`b`c`c`d`f`f`f```o`o`o", +"```#`a`b`b`c`c`d`f`f`f`g```o`o`o", +"```a`b`b`c`c`d`f`f`f`g`h```o`o`o", +"```b`b`c`c`d`f`f`f`g`h`h```o`o`o", +"```b`c`c`d`f`f`f`g`h`h`j```o`o`o", +"```````````````````````````o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o", +"`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o`o" +}; diff --git a/etc/tree-widget/folder/empty.png b/etc/tree-widget/folder/empty.png Binary files differnew file mode 100644 index 00000000000..712af9747c6 --- /dev/null +++ b/etc/tree-widget/folder/empty.png diff --git a/etc/tree-widget/folder/empty.xpm b/etc/tree-widget/folder/empty.xpm new file mode 100644 index 00000000000..df92fd22008 --- /dev/null +++ b/etc/tree-widget/folder/empty.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *empty[] = { +/* width height num_colors chars_per_pixel */ +" 16 22 256 2", +/* colors */ +"`` c #424242", +"`. c #6b6b6b", +"`# c #737373", +"`a c #7b7b7b", +"`b c #848484", +"`c c #8c8c8c", +"`d c #949494", +"`e c #9c9c9c", +"`f c #a5a5a5", +"`g c #adadad", +"`h c None", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`````````h`h`h`h`h`h`h`h`h`h`h", +"```f`f`f`e```````````h`h`h`h`h`h", +"```f`f`e`e`e`d`d`c`c```h`h`h`h`h", +"```f`e`````````````````````h`h`h", +"```e```.`.`.`#`#`#`a`a`b`b```h`h", +"```e```.`.`#`#`#`a`a`b`b```h`h`h", +"`````.`.`#`#`#`a`a`b`b`b```h`h`h", +"`````.`#`#`#`a`a`b`b`b```h`h`h`h", +"```.`#`#`#`a`a`b`b`b`c```h`h`h`h", +"```````````````````````h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h" +}; diff --git a/etc/tree-widget/folder/end-guide.png b/etc/tree-widget/folder/end-guide.png Binary files differnew file mode 100644 index 00000000000..994c8bbf10a --- /dev/null +++ b/etc/tree-widget/folder/end-guide.png diff --git a/etc/tree-widget/folder/end-guide.xpm b/etc/tree-widget/folder/end-guide.xpm new file mode 100644 index 00000000000..3cdb2332c55 --- /dev/null +++ b/etc/tree-widget/folder/end-guide.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *end-guide[] = { +/* width height num_colors chars_per_pixel */ +" 6 22 256 2", +/* colors */ +"`` c #ada5c6", +"`. c None", +"`# c #ffffff", +"`a c #ffffff", +"`b c #ffffff", +"`c c #ffffff", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`.", +"`.`.`.`.`.`." +}; diff --git a/etc/tree-widget/folder/guide.png b/etc/tree-widget/folder/guide.png Binary files differnew file mode 100644 index 00000000000..5a4d4f0b751 --- /dev/null +++ b/etc/tree-widget/folder/guide.png diff --git a/etc/tree-widget/folder/guide.xpm b/etc/tree-widget/folder/guide.xpm new file mode 100644 index 00000000000..5d23ef64eeb --- /dev/null +++ b/etc/tree-widget/folder/guide.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *guide[] = { +/* width height num_colors chars_per_pixel */ +" 6 22 256 2", +/* colors */ +"`` c #ada5c6", +"`. c None", +"`# c #ffffff", +"`a c #ffffff", +"`b c #ffffff", +"`c c #ffffff", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``", +"`.`.`.`.`.`.", +"`.`.`.`.`.``" +}; diff --git a/etc/tree-widget/folder/handle.png b/etc/tree-widget/folder/handle.png Binary files differnew file mode 100644 index 00000000000..87058b7cc4d --- /dev/null +++ b/etc/tree-widget/folder/handle.png diff --git a/etc/tree-widget/folder/handle.xpm b/etc/tree-widget/folder/handle.xpm new file mode 100644 index 00000000000..40d0ca417e9 --- /dev/null +++ b/etc/tree-widget/folder/handle.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *handle[] = { +/* width height num_colors chars_per_pixel */ +" 10 22 256 2", +/* colors */ +"`` c #000000", +"`. c #a5a5c6", +"`# c #ada5c6", +"`a c #cecee7", +"`b c #ceceff", +"`c c None", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #808000", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`#`c`#`c`#`c`#`c`#", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c" +}; diff --git a/etc/tree-widget/folder/leaf.png b/etc/tree-widget/folder/leaf.png Binary files differnew file mode 100644 index 00000000000..6abb6036f52 --- /dev/null +++ b/etc/tree-widget/folder/leaf.png diff --git a/etc/tree-widget/folder/leaf.xpm b/etc/tree-widget/folder/leaf.xpm new file mode 100644 index 00000000000..c353cb2cdf8 --- /dev/null +++ b/etc/tree-widget/folder/leaf.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *leaf[] = { +/* width height num_colors chars_per_pixel */ +" 16 22 256 2", +/* colors */ +"`` c #000000", +"`. c #424242", +"`# c #848484", +"`a c #949494", +"`b c #9c9c9c", +"`c c #a5a5a5", +"`d c #adadad", +"`e c #b5b5b5", +"`f c #bdbdbd", +"`g c #c6c6c6", +"`h c None", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`.`.`.`.`.`.`.`h`h`h`h`h`h`h`h`h", +"`.`a`a`b`b`c`.`.`h`h`h`h`h`h`h`h", +"`.`a`b`b`c`c`.`d`.`h`h`h`h`h`h`h", +"`.`b`b`c`c`c`.`.`.`.`h`h`h`h`h`h", +"`.`b`#`#`#`a`#`d`e`.`h`h`h`h`h`h", +"`.`c`c`c`d`d`d`e`e`.`h`h`h`h`h`h", +"`.`c`#`a`#`#`#`e`f`.`h`h`h`h`h`h", +"`.`c`d`d`d`e`e`f`f`.`h`h`h`h`h`h", +"`.`d`#`#`a`#`#`f`f`.`h`h`h`h`h`h", +"`.`d`d`e`e`f`f`f`f`.`h`h`h`h`h`h", +"`.`d`e`e`f`f`f`f`f`.`h`h`h`h`h`h", +"`.`.`.`.`.`.`.`.`.`.`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h", +"`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h`h" +}; diff --git a/etc/tree-widget/folder/no-guide.png b/etc/tree-widget/folder/no-guide.png Binary files differnew file mode 100644 index 00000000000..5705cc83cf4 --- /dev/null +++ b/etc/tree-widget/folder/no-guide.png diff --git a/etc/tree-widget/folder/no-guide.xpm b/etc/tree-widget/folder/no-guide.xpm new file mode 100644 index 00000000000..2d3e1e7c099 --- /dev/null +++ b/etc/tree-widget/folder/no-guide.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *no-guide[] = { +/* width height num_colors chars_per_pixel */ +" 6 22 256 2", +/* colors */ +"`` c None", +"`. c #ffffff", +"`# c #ffffff", +"`a c #ffffff", +"`b c #ffffff", +"`c c #ffffff", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````", +"````````````" +}; diff --git a/etc/tree-widget/folder/no-handle.png b/etc/tree-widget/folder/no-handle.png Binary files differnew file mode 100644 index 00000000000..c335dd938ac --- /dev/null +++ b/etc/tree-widget/folder/no-handle.png diff --git a/etc/tree-widget/folder/no-handle.xpm b/etc/tree-widget/folder/no-handle.xpm new file mode 100644 index 00000000000..fa3e4c5874b --- /dev/null +++ b/etc/tree-widget/folder/no-handle.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *no-handle[] = { +/* width height num_colors chars_per_pixel */ +" 10 22 256 2", +/* colors */ +"`` c #000000", +"`. c #a5a5c6", +"`# c #ada5c6", +"`a c #cecee7", +"`b c #ceceff", +"`c c None", +"`d c #ffffff", +"`e c #ffffff", +"`f c #ffffff", +"`g c #ffffff", +"`h c #ffffff", +"`i c #ffffff", +"`j c #ffffff", +"`k c #ffffff", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #808000", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c", +"`c`c`c`c`c`c`c`c`c`c" +}; diff --git a/etc/tree-widget/folder/open.png b/etc/tree-widget/folder/open.png Binary files differnew file mode 100644 index 00000000000..4237d3aa648 --- /dev/null +++ b/etc/tree-widget/folder/open.png diff --git a/etc/tree-widget/folder/open.xpm b/etc/tree-widget/folder/open.xpm new file mode 100644 index 00000000000..720f79fa94b --- /dev/null +++ b/etc/tree-widget/folder/open.xpm @@ -0,0 +1,285 @@ +/* XPM */ +static char *open[] = { +/* width height num_colors chars_per_pixel */ +" 16 22 256 2", +/* colors */ +"`` c #848400", +"`. c #a5a5c6", +"`# c #adad39", +"`a c #adad42", +"`b c #b5b54a", +"`c c #bdbd52", +"`d c #bdbd5a", +"`e c #c6c663", +"`f c #c6c66b", +"`g c #cece6b", +"`h c #cece73", +"`i c #cece7b", +"`j c #d6d67b", +"`k c None", +"`l c #ffffff", +"`m c #ffffff", +"`n c #ffffff", +"`o c #ffffff", +"`p c #ffffff", +"`q c #ffffff", +"`r c #ffffff", +"`s c #ffffff", +"`t c #ffffff", +"`u c #ffffff", +"`v c #ffffff", +"`w c #ffffff", +"`x c #ffffff", +"`y c #ffffff", +"`z c #ffffff", +"`A c #ffffff", +"`B c #ffffff", +"`C c #ffffff", +"`D c #ffffff", +"`E c #ffffff", +"`F c #ffffff", +"`G c #ffffff", +"`H c #ffffff", +"`I c #ffffff", +"`J c #ffffff", +"`K c #ffffff", +"`L c #ffffff", +"`M c #ffffff", +"`N c #ffffff", +"`O c #ffffff", +"`P c #ffffff", +"`Q c #ffffff", +"`R c #ffffff", +"`S c #ffffff", +"`T c #ffffff", +"`U c #ffffff", +"`V c #ffffff", +"`W c #ffffff", +"`X c #ffffff", +"`Y c #ffffff", +"`Z c #ffffff", +"`0 c #ffffff", +"`1 c #ffffff", +"`2 c #ffffff", +"`3 c #ffffff", +"`4 c #ffffff", +"`5 c #ffffff", +"`6 c #ffffff", +"`7 c #ffffff", +"`8 c #ffffff", +".` c #ffffff", +".. c #ffffff", +".# c #ffffff", +".a c #ffffff", +".b c #ffffff", +".c c #ffffff", +".d c #ffffff", +".e c #ffffff", +".f c #ffffff", +".g c #ffffff", +".h c #ffffff", +".i c #ffffff", +".j c #ffffff", +".k c #ffffff", +".l c #ffffff", +".m c #ffffff", +".n c #ffffff", +".o c #ffffff", +".p c #ffffff", +".q c #ffffff", +".r c #ffffff", +".s c #ffffff", +".t c #ffffff", +".u c #ffffff", +".v c #ffffff", +".w c #ffffff", +".x c #ffffff", +".y c #ffffff", +".z c #ffffff", +".A c #ffffff", +".B c #ffffff", +".C c #ffffff", +".D c #ffffff", +".E c #ffffff", +".F c #ffffff", +".G c #ffffff", +".H c #ffffff", +".I c #ffffff", +".J c #ffffff", +".K c #ffffff", +".L c #ffffff", +".M c #ffffff", +".N c #ffffff", +".O c #ffffff", +".P c #ffffff", +".Q c #ffffff", +".R c #ffffff", +".S c #ffffff", +".T c #ffffff", +".U c #ffffff", +".V c #ffffff", +".W c #ffffff", +".X c #ffffff", +".Y c #ffffff", +".Z c #ffffff", +".0 c #ffffff", +".1 c #ffffff", +".2 c #ffffff", +".3 c #ffffff", +".4 c #ffffff", +".5 c #ffffff", +".6 c #ffffff", +".7 c #ffffff", +".8 c #ffffff", +"#` c #ffffff", +"#. c #ffffff", +"## c #ffffff", +"#a c #ffffff", +"#b c #ffffff", +"#c c #ffffff", +"#d c #ffffff", +"#e c #ffffff", +"#f c #ffffff", +"#g c #ffffff", +"#h c #ffffff", +"#i c #ffffff", +"#j c #ffffff", +"#k c #ffffff", +"#l c #ffffff", +"#m c #ffffff", +"#n c #ffffff", +"#o c #ffffff", +"#p c #ffffff", +"#q c #ffffff", +"#r c #ffffff", +"#s c #ffffff", +"#t c #ffffff", +"#u c #ffffff", +"#v c #ffffff", +"#w c #ffffff", +"#x c #ffffff", +"#y c #ffffff", +"#z c #ffffff", +"#A c #ffffff", +"#B c #ffffff", +"#C c #ffffff", +"#D c #ffffff", +"#E c #ffffff", +"#F c #ffffff", +"#G c #ffffff", +"#H c #ffffff", +"#I c #ffffff", +"#J c #ffffff", +"#K c #ffffff", +"#L c #ffffff", +"#M c #ffffff", +"#N c #ffffff", +"#O c #ffffff", +"#P c #ffffff", +"#Q c #ffffff", +"#R c #ffffff", +"#S c #ffffff", +"#T c #ffffff", +"#U c #ffffff", +"#V c #ffffff", +"#W c #ffffff", +"#X c #ffffff", +"#Y c #ffffff", +"#Z c #ffffff", +"#0 c #ffffff", +"#1 c #ffffff", +"#2 c #ffffff", +"#3 c #ffffff", +"#4 c #ffffff", +"#5 c #ffffff", +"#6 c #ffffff", +"#7 c #ffffff", +"#8 c #ffffff", +"a` c #ffffff", +"a. c #ffffff", +"a# c #ffffff", +"aa c #ffffff", +"ab c #ffffff", +"ac c #ffffff", +"ad c #ffffff", +"ae c #ffffff", +"af c #ffffff", +"ag c #ffffff", +"ah c #ffffff", +"ai c #ffffff", +"aj c #ffffff", +"ak c #ffffff", +"al c #ffffff", +"am c #ffffff", +"an c #ffffff", +"ao c #ffffff", +"ap c #ffffff", +"aq c #ffffff", +"ar c #ffffff", +"as c #ffffff", +"at c #ffffff", +"au c #ffffff", +"av c #ffffff", +"aw c #ffffff", +"ax c #ffffff", +"ay c #ffffff", +"az c #ffffff", +"aA c #ffffff", +"aB c #ffffff", +"aC c #ffffff", +"aD c #ffffff", +"aE c #ffffff", +"aF c #ffffff", +"aG c #ffffff", +"aH c #ffffff", +"aI c #ffffff", +"aJ c #ffffff", +"aK c #ffffff", +"aL c #ffffff", +"aM c #ffffff", +"aN c #ffffff", +"aO c #ffffff", +"aP c #ffffff", +"aQ c #ffffff", +"aR c #ffffff", +"aS c #ffffff", +"aT c #ffffff", +"aU c #ffffff", +"aV c #ffffff", +"aW c #ffffff", +"aX c #ffffff", +"aY c #ffffff", +"aZ c #ffffff", +"a0 c #ffffff", +"a1 c #ffffff", +"a2 c #ffffff", +"a3 c #ffffff", +"a4 c #ffffff", +"a5 c #ffffff", +"a6 c #ffffff", +"a7 c #ffffff", +"a8 c #ffffff", +/* pixels */ +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`````````k`k`k`k`k`k`k`k`k`k`k", +"```j`i`i`h```````````k`k`k`k`k`k", +"```i`i`h`h`f`f`d`d`c```k`k`k`k`k", +"```i`h`````````````````````k`k`k", +"```h```#`a`a`b`b`c`d`d`e`e```k`k", +"```h```a`a`b`b`c`d`d`e`e```k`k`k", +"`````a`a`b`b`c`d`d`e`e`f```k`k`k", +"`````a`b`b`c`d`d`e`e`f```k`k`k`k", +"```a`b`b`c`d`d`e`e`f`g```k`k`k`k", +"```````````````````````k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`.`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`.`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k`k", +"`k`k`k`k`k`.`k`k`k`k`k`k`k`k`k`k" +}; diff --git a/leim/.arch-inventory b/leim/.arch-inventory new file mode 100644 index 00000000000..3e125ae6e9c --- /dev/null +++ b/leim/.arch-inventory @@ -0,0 +1,4 @@ +# Auto-generated files, which ignore. +precious ^(stamp-subdir|changed\..*|leim-list\.el)$ + +# arch-tag: a4cda8ae-2a52-4d85-bd29-14e25c7ed2a2 diff --git a/leim/.cvsignore b/leim/.cvsignore index aea98a23838..7c52fa3961a 100644 --- a/leim/.cvsignore +++ b/leim/.cvsignore @@ -1,2 +1,4 @@ -leim-list.el Makefile +changed.misc +changed.tit +leim-list.el diff --git a/leim/ChangeLog b/leim/ChangeLog index 5ef6b3d4467..33440199708 100644 --- a/leim/ChangeLog +++ b/leim/ChangeLog @@ -1,3 +1,68 @@ +2004-06-05 Kenichi Handa <handa@m17n.org> + + * Makefile.in (leim-list.el): Depend on leim-ext.el. Append the + contents of leim-ext.el to leim-list.el. + + * leim-ext.el: New file. + +2004-05-17 Werner Lemberg <wl@gnu.org> + + * quail/sisheng.el: New file. + +2004-05-17 Kenichi Handa <handa@m17n.org> + + * Makefile.in (OTHERS): Add ${srcdir}/quail/sisheng.elc. + +2004-05-11 Eli Zaretskii <eliz@gnu.org> + + * Makefile.in (leim-list.el): Move commands to convert TIT and + MISC dictionaries from here... + (changed.tit, changed.misc): ...to here. Remove the (now + unneeded) test of the contents of changed.* files. + +2004-05-10 Andreas Schwab <schwab@suse.de> + + * Makefile.in (all): Readd dependency on ${WORLD} so that lisp + files are compiled when bootstrapping. + +2004-05-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * quail/latin-ltx.el ("TeX"): Fix typo. + +2004-05-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * quail/latin-ltx.el: Use utf-8 coding. + ("TeX"): Add de and fr quotes. From Karl Eichwalder <ke@suse.de>. + +2004-05-04 Kenichi Handa <handa@m17n.org> + + * Makefile.in (TIT-SOURCES): Prepend ${srcdir} to each elemnt. + (MISC-SOURCES): Likewise. + +2004-05-01 Kenichi Handa <handa@m17n.org> + + * Makefile.in (OTHERS): Raname from MISC. + (MISC): Rename from MISC-DIC. + (WORLD): Adjute for the above changes. + (TIT-MISC, NON-TIT-MISC): New targets. + (all): Don't depend on ${WORLD}. + (.NOTPARALLEL, .NO_PARALLEL, ${TIT}, ${MSIC-IDC}): Remove these targets. + (TIT-SOURCES, MISC-SOURCES): New macros. + (changed.tit, changed.misc): New targets. + (leim-list.el): Depend on ${NON-TIT-MISC}, changed.tit, and + changed.misc. Generate quail files from TIT and MISC files if + necessary. + (clean mostlyclean): Delete ${TIT-MISC} instead of ${TIT} and + ${MISC-DIC}. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.nt: Remove. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + 2004-04-09 Andrew Innes <andrewi@gnu.org> * makefile.w32-in (distclean clean): Remove nmake specific @@ -5,17 +70,17 @@ 2004-02-28 Kenichi Handa <handa@m17n.org> - * Makefile.in (all): Depends on ${WORLD} instead of ${TIT} and + * Makefile.in (all): Depend on ${WORLD} instead of ${TIT} and ${MISC-DIC}. (clean, mostlyclean): Don't delete *.elc distributed with tarball. (maintainer-clean): Delete files that are not in CVS repository. - * makefile.nt (all): Depends on $(WORLD) instead of $(TIT) and + * makefile.nt (all): Depend on $(WORLD) instead of $(TIT) and $(MISC-DIC). (clean, mostlyclean): Don't delete *.elc distributed with tarball. (maintainer-clean): Delete files that are not in CVS repository. - * makefile.w32-in (all): Depends on $(WORLD) instead of $(TIT) and + * makefile.w32-in (all): Depend on $(WORLD) instead of $(TIT) and $(MISC-DIC). (clean, mostlyclean): Don't delete *.elc distributed with tarball. (maintainer-clean): Delete files that are not in CVS repository. @@ -31,7 +96,7 @@ 2004-01-22 Ognyan Kulev <ogi@fmi.uni-sofia.bg> (tiny change) * quail/cyrillic.el ("bulgarian-phonetic"): Docstring fixed. - Duplicated entry removed. + Duplicate entry removed. ("bulgarian-bds"): Docstring fixed. 2003-10-06 Dave Love <fx@gnu.org> @@ -52,7 +117,7 @@ 2003-07-21 KAWABATA, Taichi <kawabata@m17n.org> - * quail/indian.el (quail-indian-update-translation): Adjusted the + * quail/indian.el (quail-indian-update-translation): Adjust the behaviour according to the change of quail-translate-key. 2003-05-22 Kenichi Handa <handa@m17n.org> @@ -71,11 +136,11 @@ 2003-02-27 David Kastrup <dak@gnu.org> - * quail/greek.el (greek-babel): add koronis transliteration. + * quail/greek.el (greek-babel): Add koronis transliteration. 2003-02-23 David Kastrup <dak@gnu.org> - * quail/greek.el (greek-babel): fix <' accent. + * quail/greek.el (greek-babel): Fix <' accent. 2003-02-17 Dave Love <fx@gnu.org> @@ -83,18 +148,17 @@ 2003-02-14 Juanma Barranquero <lektu@terra.es> - * quail/uni-input.el (utf-8-ccl-encode): Fix use of character - constants. + * quail/uni-input.el (utf-8-ccl-encode): Fix use of character constants. 2003-02-11 KAWABATA, Taichi <kawabata@m17n.org> * quail/indian.el (punjabi-itrans, gujarati-itrans, oriya-itrans) - (bengali-itrans, assamese-itrans, telugu-itrans kannada-itrans) + (bengali-itrans, assamese-itrans, telugu-itrans, kannada-itrans) (malayalam-itrans, tamil-itrans): New ITRANS based input methods. (punjabi-inscript, gujarati-inscript, oriya-inscript) (bengali-inscript, assamese-inscript, telugu-inscript) - (kannada-inscript, malayalam-inscript, tamil-inscript): New - INSCRIPT based input methods. + (kannada-inscript, malayalam-inscript, tamil-inscript): + New INSCRIPT based input methods. 2003-02-07 Kenichi Handa <handa@m17n.org> @@ -104,8 +168,7 @@ 2003-02-05 David Kastrup <dak@gnu.org> - * quail/greek.el: fix iota accent typos in greek-babel - encoding. + * quail/greek.el: Fix iota accent typos in greek-babel encoding. 2003-01-05 Dave Love <fx@gnu.org> @@ -156,12 +219,12 @@ * quail/cyrillic.el: Doc fixes. ("cyrillic-beylorussian"): Commented-out. - ("cyrillic-translit-bulgarian"): Deleted. + ("cyrillic-translit-bulgarian"): Delete. ("cyrillic-ukrainian"): Fix `q', `Q', `W', `w' bindings. ("ukrainian-computer", "belarusian", "bulgarian-bds") ("russian-computer"): New. - ("bulgarian-phonetic"): Renamed from bulgarian-pho. Add ,A'(B, $,1uV(B, ,LN(B. - ("russian-typewriter"): Renamed from cyrillic-jcuken. + ("bulgarian-phonetic"): Rename from bulgarian-pho. Add ,A'(B, $,1uV(B, ,LN(B. + ("russian-typewriter"): Rename from cyrillic-jcuken. 2002-06-20 Dave Love <fx@gnu.org> @@ -195,7 +258,7 @@ 2002-04-06 Jaeyoun Chung <jay@kldp.org> - * quail/hanja3.el ("kf"): added a few composing rules + * quail/hanja3.el ("kf"): Add a few composing rules from "Taik-kyun Lim" <mongmong@milab.yonsei.ac.kr> * quail/hangul3.el: buggy alternative second character @@ -234,9 +297,8 @@ 2002-01-07 Jaeyoun Chung <jay@kldp.org> - * quail/hangul.el: removed key sequence mapping for O[rsfaqtTd]. - Not used for Korean Hangul Type 2. (request from emacs-kr mailing - list). + * quail/hangul.el: Remove key sequence mapping for O[rsfaqtTd]. + Not used for Korean Hangul Type 2 (request from emacs-kr mailing list). 2002-01-03 Eli Zaretskii <eliz@is.elta.co.il> @@ -244,8 +306,7 @@ 2002-01-01 Dave Love <fx@gnu.org> - * quail/indian.el (quail-define-indian-trans-package): Unquote - lambda. + * quail/indian.el (quail-define-indian-trans-package): Unquote lambda. (quail-define-inscript-package): Avoid mapcar*. 2001-12-20 Dave Love <fx@gnu.org> @@ -263,7 +324,7 @@ ("spanish-keyboard"): Fix language assignment. * quail/indian.el: Don't require cl. - (quail-indian-flatten-list): Renamed from flatten-list. + (quail-indian-flatten-list): Rename from flatten-list. * quail/cyrillic.el ("cyrillic-beylorussian") ("cyrillic-ukrainian", "cyrillic-translit-bulgarian") @@ -273,8 +334,7 @@ ("spanish-alt-postfix", "turkish-latin-3-alt-postfix") ("turkish-alt-postfix"): Fix language assignment. ("dutch"): Assign to Dutch. Use chars, not strings. - ("lithuanian-numeric", "lithuanian-keyboard", "latvian-keyboard"): - New. + ("lithuanian-numeric", "lithuanian-keyboard", "latvian-keyboard"): New. 2001-12-08 Pavel Jan,Am(Bk <Pavel@Janik.cz> @@ -282,7 +342,7 @@ 2001-12-03 Jaeyoun Chung <jay@kldp.org> - * quail/hangul3.el: Added a few convenient composing sequences for + * quail/hangul3.el: Add a few convenient composing sequences for Korean keyboard type 3 users. 2001-11-29 Dave Love <fx@gnu.org> @@ -293,7 +353,7 @@ 2001-11-28 Juanma Barranquero <lektu@terra.es> - * makefile.w32-in (INDIAN): Adjusted for the file name change; + * makefile.w32-in (INDIAN): Adjust for the file name change; quail/devanagari.elc -> quail/indian.elc. * makefile.nt (INDIAN): Likewise. @@ -442,7 +502,7 @@ 2001-05-17 Dave Love <fx@gnu.org> - * quail/latin-ltx.el ("TeX"): Renamed from "latin-latex2e". + * quail/latin-ltx.el ("TeX"): Rename from "latin-latex2e". Language family and indicator changed. Many new translations. 2001-05-17 Gerd Moellmann <gerd@gnu.org> @@ -1389,7 +1449,7 @@ ;; Local Variables: -;; coding: iso-2022-7bit-unix +;; coding: iso-2022-7bit ;; End: Copyright (C) 1997, 1998, 1999, 2001 Free Software Foundation, Inc. diff --git a/leim/Makefile.in b/leim/Makefile.in index 8ee38f3da4c..1c13ff0613b 100644 --- a/leim/Makefile.in +++ b/leim/Makefile.in @@ -1,9 +1,6 @@ # Makefile for leim subdirectory in GNU Emacs. -# Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. -# Licensed to the Free Software Foundation. -# Copyright (C) 2003 -# National Institute of Advanced Industrial Science and Technology (AIST) -# Registration Number H13PRO009 +# Copyright (C) 1997, 2004 Electrotechnical Laboratory, JAPAN. +# Licensed to the Free Software Foundation. # This file is part of GNU Emacs. @@ -45,7 +42,7 @@ BUILT-EMACS = ${dot}${dot}/src/emacs buildlisppath=${srcdir}/${dot}${dot}/lisp # How to run Emacs. -RUN-EMACS = EMACSLOADPATH=$(buildlisppath) LC_ALL=C \ +RUN-EMACS = EMACSLOADPATH=$(buildlisppath) \ ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte # Subdirectories to be made if ${srcdir} is different from the current @@ -120,13 +117,14 @@ GREEK=${srcdir}/quail/greek.elc RUSSIAN=${srcdir}/quail/cyrillic.elc ${srcdir}/quail/cyril-jis.elc -MISC= \ +OTHERS= \ ${srcdir}/quail/ethiopic.elc \ ${srcdir}/quail/ipa.elc \ ${srcdir}/quail/hebrew.elc \ - ${srcdir}/quail/georgian.elc + ${srcdir}/quail/georgian.elc \ + ${srcdir}/quail/sisheng.elc -MISC-DIC=\ +MISC= \ quail/tsang-b5.elc \ quail/quick-b5.elc \ quail/tsang-cns.elc \ @@ -140,17 +138,17 @@ CHINESE=${CHINESE-GB} ${CHINESE-BIG5} EASTASIA=${CHINESE} ${JAPANESE} ${KOREAN} ASIA=${EASTASIA} ${THAI} ${VIETNAMESE} ${LAO} ${INDIAN} ${TIBETAN} EUROPEAN=${LATIN} ${SLAVIC} ${GREEK} ${RUSSIAN} -WORLD=${ASIA} ${EUROPEAN} ${MISC} ${MISC-DIC} ${UNICODE} +WORLD=${ASIA} ${EUROPEAN} ${OTHERS} ${MISC} ${UNICODE} -TIT=${CHINESE-TIT} -NON-TIT=${CHINESE-NON-TIT} ${JAPANESE} ${KOREAN} ${EUROPEAN} ${MISC} +TIT-MISC=${CHINESE-TIT} ${MISC} +NON-TIT-MISC=${CHINESE-NON-TIT} ${JAPANESE} ${KOREAN} ${EUROPEAN} ${OTHERS} .SUFFIXES: .elc .el .el.elc: ${RUN-EMACS} -f batch-byte-compile $< -all: ${BUILT-EMACS} ${SUBDIRS} ${WORLD} leim-list.el +all: ${BUILT-EMACS} ${SUBDIRS} leim-list.el ${WORLD} # To ensure that we can run Emacs. This target is ignored (never # being hit) if a user changes default value of EMACS. @@ -161,38 +159,42 @@ ${SUBDIRS}: mkdir $@ touch stamp-subdir -# The rules which generate ${TIT} and ${MISC-DIC} files create them all -# in one go. So we need to prevent parallel execution for that target, -# otherwise Emacs complains about files being locked. .NOTPARALLEL is -# for GNU Make, .NO_PARALLEL is for other Make's. -.NOTPARALLEL: ${TIT} ${MISC-DIC} - -.NO_PARALLEL: ${TIT} ${MISC-DIC} - -# Rule to generate quail/*.el from CXTERM-DIC/*.tit. -# The "if [ -f $@ ]; then true; " part prevents parallel Make's -# which don't honor .NOTPARALLEL, such as SGI's Make, from running -# this rule many times, one each for every file it creates. -${TIT}: - if [ -d quail ]; then true; else make quail; fi - if [ -f $@ ]; then true; else \ - ${RUN-EMACS} -l ${buildlisppath}/international/titdic-cnv \ - --eval '(batch-titdic-convert t)' -dir quail ${srcdir}/CXTERM-DIC; fi - if [ -f $@ ]; then true; else \ - ${RUN-EMACS} -l ${buildlisppath}/international/quail \ - -f batch-byte-compile ${TIT:.elc=.el}; fi - -# Rule to generate quail/*.el from MISC-DIC/*. -${MISC-DIC}: - if [ -d quail ]; then true; else make quail; fi - if [ -f $@ ]; then true; else \ - ${RUN-EMACS} -l ${buildlisppath}/international/titdic-cnv \ - -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; fi - if [ -f $@ ]; then true; else \ - ${RUN-EMACS} -l ${buildlisppath}/international/quail \ - -f batch-byte-compile ${MISC-DIC:.elc=.el}; fi - -leim-list.el: ${SUBDIRS} ${WORLD} +TIT-SOURCES= \ + ${srcdir}/CXTERM-DIC/4Corner.tit \ + ${srcdir}/CXTERM-DIC/ARRAY30.tit \ + ${srcdir}/CXTERM-DIC/CCDOSPY.tit \ + ${srcdir}/CXTERM-DIC/ECDICT.tit \ + ${srcdir}/CXTERM-DIC/ETZY.tit \ + ${srcdir}/CXTERM-DIC/PY-b5.tit \ + ${srcdir}/CXTERM-DIC/Punct-b5.tit \ + ${srcdir}/CXTERM-DIC/Punct.tit \ + ${srcdir}/CXTERM-DIC/QJ-b5.tit \ + ${srcdir}/CXTERM-DIC/QJ.tit \ + ${srcdir}/CXTERM-DIC/SW.tit \ + ${srcdir}/CXTERM-DIC/TONEPY.tit \ + ${srcdir}/CXTERM-DIC/ZOZY.tit + +changed.tit: ${TIT-SOURCES} + ${RUN-EMACS} -l ${buildlisppath}/international/titdic-cnv \ + -f batch-titdic-convert -dir quail ${srcdir}/CXTERM-DIC; \ + echo "changed" > $@ + +MISC-SOURCES= \ + ${srcdir}/MISC-DIC/CTLau-b5.html \ + ${srcdir}/MISC-DIC/CTLau.html \ + ${srcdir}/MISC-DIC/cangjie-table.b5 \ + ${srcdir}/MISC-DIC/cangjie-table.cns \ + ${srcdir}/MISC-DIC/pinyin.map \ + ${srcdir}/MISC-DIC/ziranma.cin + +changed.misc: ${MISC-SOURCES} + ${RUN-EMACS} -l ${buildlisppath}/international/titdic-cnv \ + -f batch-miscdic-convert -dir quail ${srcdir}/MISC-DIC; \ + echo "changed" > $@ + +leim-list.el: ${SUBDIRS} ${NON-TIT-MISC} changed.tit changed.misc ${srcdir}/leim-ext.el + ${RUN-EMACS} -l ${buildlisppath}/international/quail \ + -f batch-byte-compile-if-not-done ${TIT-MISC:.elc=.el} if [ x`(cd ${srcdir} && /bin/pwd)` = x`(/bin/pwd)` ] ; then \ ${RUN-EMACS} -l ${buildlisppath}/international/quail \ --eval "(update-leim-list-file \".\")" ; \ @@ -200,6 +202,7 @@ leim-list.el: ${SUBDIRS} ${WORLD} ${RUN-EMACS} -l ${buildlisppath}/international/quail \ --eval "(update-leim-list-file \".\" \"${srcdir}\")" ; \ fi + sed -n '/^[^;]/ p' < ${srcdir}/leim-ext.el >> $@ install: all if [ x`(cd ${INSTALLDIR} && /bin/pwd)` != x`(/bin/pwd)` ] ; then \ @@ -226,8 +229,8 @@ install: all -chmod -R a+r ${INSTALLDIR} clean mostlyclean: - rm -f ${TIT} ${TIT:.elc=.el} ${MISC-DIC} ${MISC-DIC:.elc=.el} \ - leim-list.el + rm -f ${TIT-MISC} ${TIT-MISC:.elc=.el} \ + leim-list.el changed.tit changed.misc distclean: clean if test -f stamp-subdir; then rm -rf ${SUBDIRS} stamp-subdir; fi @@ -238,5 +241,3 @@ maintainer-clean: distclean extraclean: maintainer-clean -rm -f *~ \#* m/?*~ s/?*~ - -# arch-tag: f666a939-8145-4d64-a6a6-cc1f61bd32ca diff --git a/leim/leim-ext.el b/leim/leim-ext.el new file mode 100644 index 00000000000..64437cc0d19 --- /dev/null +++ b/leim/leim-ext.el @@ -0,0 +1,37 @@ +;; leim-ext.el -- extra leim configulation -*- coding:iso-2022-7bit; -*- + +;; Copyright (C) 2004 +;; Free Software Foundation, Inc. +;; Copyright (C) 2004 +;; National Institute of Advanced Industrial Science and Technology (AIST) +;; Registration Number H13PRO009 + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Makefile in this directory appends the contents of this file (only +;; such non-empty lines that don't begin with ';') to the generated +;; file leim-list.el. + +;;; Code: + +(eval-after-load "quail/PY-b5" + '(quail-defrule "ling2" ?$(0!r(B nil t)) + +;; arch-tag: 75cfdfc7-de85-44f9-b408-ff67d1ec664e diff --git a/leim/makefile.nt b/leim/makefile.nt deleted file mode 100644 index 41dc8e2030a..00000000000 --- a/leim/makefile.nt +++ /dev/null @@ -1,208 +0,0 @@ -# Makefile for leim subdirectory in GNU Emacs on the Microsoft W32 API. -# Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. -# Licensed to the Free Software Foundation. - -# This file is part of GNU Emacs. - -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# -# Sets up the system dependent macros. -# -!include ..\nt\makefile.def - -srcdir=. - -# Where to install LEIM files. -INSTALLDIR=$(INSTALL_DIR)\leim - -# On Xenix and the IBM RS6000, double-dot gets screwed up. -dot = . - -# Which Emacs to use to convert TIT files to Emacs Lisp files, -# byte-compile Emacs Lisp files, and generate the file leim-list.el. -BUILT_EMACS = $(dot)$(dot)\src\$(BLD)\emacs.exe - -buildlisppath=$(MAKEDIR:\=/)/$(dot)$(dot)/lisp - -# How to run Emacs. -RUN_EMACS = $(BUILT_EMACS) -batch --no-init-file --no-site-file --multibyte - -# Subdirectories to be made if $(srcdir) is different from the current -# directory. -SUBDIRS=quail - -# Files generated from TIT dictionaries for Chinese GB character set. -TIT_GB=\ - quail/CCDOSPY.elc \ - quail/Punct.elc \ - quail/QJ.elc \ - quail/SW.elc \ - quail/TONEPY.elc - -# Files generated from TIT dictionaries for Chinese BIG5 character set. -TIT_BIG5=\ - quail/4Corner.elc \ - quail/ARRAY30.elc \ - quail/ECDICT.elc \ - quail/ETZY.elc \ - quail/Punct-b5.elc \ - quail/PY-b5.elc \ - quail/QJ-b5.elc \ - quail/ZOZY.elc - -CHINESE_TIT=$(TIT_GB) $(TIT_BIG5) - -NON_TIT_GB=$(srcdir)/quail/py-punct.elc - -NON_TIT_BIG5=$(srcdir)/quail/quick-b5.elc - -CHINESE_NON_TIT=$(NON_TIT_GB) $(NON_TIT_BIG5) - -CHINESE_GB=$(TIT_GB) $(NON_TIT_GB) - -CHINESE_BIG5=$(TIT_BIG5) $(NON_TIT_BIG5) - -JAPANESE=$(srcdir)/quail/japanese.elc $(srcdir)/ja-dic/ja-dic.elc - -KOREAN= $(srcdir)/quail/hangul.elc \ - $(srcdir)/quail/hangul3.elc \ - $(srcdir)/quail/hanja.elc \ - $(srcdir)/quail/hanja3.elc \ - $(srcdir)/quail/hanja-jis.elc \ - $(srcdir)/quail/symbol-ksc.elc - -THAI=$(srcdir)/quail/thai.elc - -VIETNAMESE=$(srcdir)/quail/viqr.elc $(srcdir)/quail/vntelex.elc - -LAO=$(srcdir)/quail/lao.elc $(srcdir)/quail/lrt.elc - -INDIAN=$(srcdir)/quail/indian.elc - -TIBETAN=$(srcdir)/quail/tibetan.elc - -LATIN= $(srcdir)/quail/latin-pre.elc \ - $(srcdir)/quail/latin-post.elc \ - $(srcdir)/quail/latin-alt.elc \ - $(srcdir)/quail/latin-ltx.elc - -SLAVIC= \ - $(srcdir)/quail/czech.elc \ - $(srcdir)/quail/slovak.elc - -GREEK=$(srcdir)/quail/greek.elc - -RUSSIAN=$(srcdir)/quail/cyrillic.elc $(srcdir)/quail/cyril-jis.elc - -MISC= \ - $(srcdir)/quail/ethiopic.elc \ - $(srcdir)/quail/ipa.elc \ - $(srcdir)/quail/hebrew.elc - -MISC_DIC=\ - quail/tsang-b5.elc \ - quail/quick-b5.elc \ - quail/tsang-cns.elc \ - quail/quick-cns.elc \ - quail/PY.elc \ - quail/ZIRANMA.elc \ - quail/CTLau.elc \ - quail/CTLau-b5.elc - -CHINESE=$(CHINESE_GB) $(CHINESE_BIG5) -EASTASIA=$(CHINESE) $(JAPANESE) $(KOREAN) -ASIA=$(EASTASIA) $(THAI) $(VIETNAMESE) $(LAO) $(INDIAN) $(TIBETAN) -EUROPEAN=$(LATIN) $(SLAVIC) $(GREEK) $(RUSSIAN) -WORLD=$(ASIA) $(EUROPEAN) $(MISC) - -TIT=$(CHINESE_TIT) -NON_TIT=$(CHINESE_NON_TIT) $(JAPANESE) $(KOREAN) $(EUROPEAN) $(MISC) - -all: $(BUILT_EMACS) $(SUBDIRS) $(WORLD) leim-list.el - -# To ensure that we can run Emacs. This target is ignored (never -# being hit) if a user changes default value of EMACS. -$(dot)$(dot)/src/emacs: - cd ../src; $(MAKE) $(MFLAGS) emacs - -$(SUBDIRS): - mkdir $@ - echo stamp>stamp-subdir - -# The rules which generate $(TIT) and ${MISC_DIC) files create them all -# in one go. So we need to prevent parallel execution for that target, -# otherwise Emacs complains about files being locked. .NOTPARALLEL is -# for GNU Make, .NO_PARALLEL is for other Make's. -.NOTPARALLEL: $(TIT) $(MISC_DIC) - -.NO_PARALLEL: $(TIT) $(MISC_DIC) - -# Rule to generate quail/*.el from CXTERM-DIC/*.tit. -$(TIT): $(SUBDIRS) - set EMACSLOADPATH=$(buildlisppath) - $(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \ - --eval "(batch-titdic-convert t)" -dir quail $(srcdir)/CXTERM-DIC - $(RUN_EMACS) -l $(buildlisppath)/international/quail \ - -f batch-byte-compile $(TIT:.elc=.el) - -# Rule to generate quail/*.el from CXTERM-DIC/*.tit. -$(MISC_DIC): $(SUBDIRS) - set EMACSLOADPATH=$(buildlisppath) - $(RUN_EMACS) -l $(buildlisppath)/international/titdic-cnv \ - -f batch-miscdic-convert -dir quail $(srcdir)/MISC-DIC - $(RUN_EMACS) -l $(buildlisppath)/international/quail \ - -f batch-byte-compile $(MISC_DIC:.elc=.el) - -.SUFFIXES: .elc .el - -.el.elc: - set EMACSLOADPATH=$(buildlisppath) - $(RUN_EMACS) -f batch-byte-compile $< - -leim-list.el: $(SUBDIRS) $(WORLD) - set EMACSLOADPATH=$(buildlisppath) - $(RUN_EMACS) -l $(buildlisppath)/international/quail \ - --eval "(update-leim-list-file \".\")" - -install: all - - mkdir $(INSTALLDIR) - - $(DEL) same-dir.tst - - $(DEL) $(INSTALLDIR)\same-dir.tst - echo SameDirTest > $(INSTALLDIR)\same-dir.tst - if not exist same-dir.tst $(CP) leim-list.el $(INSTALLDIR) - if not exist same-dir.tst $(CP_DIR) quail $(INSTALLDIR)\quail - if not exist same-dir.tst $(CP_DIR) ja-dic $(INSTALLDIR)\ja-dic - - $(DEL) $(INSTALLDIR)\same-dir.tst - -TIT_EL=$(TIT:.elc=.el) -MISC_DIC_EL=$(MISC_DIC:.elc=.el) - -clean mostlyclean: - for %%f in ($(TIT:/=\)) do $(DEL) %%f - for %%f in ($(TIT_EL:/=\)) do $(DEL) %%f - for %%f in ($(MISC_DIC:/=\)) do $(DEL) %%f - for %%f in ($(MISC_DIC_EL:/=\)) do $(DEL) %%f - $(DEL) leim-list.el - -distclean: clean - if exist stamp-subdir $(DELTREE) $(SUBDIRS) - $(DEL) stamp-subdir - -maintainer-clean: distclean - for %%f in ($(WORLD:/=\)) do $(DEL) %%f - -# arch-tag: cded53b4-4803-496b-8c05-7daff80e5b3b diff --git a/leim/makefile.w32-in b/leim/makefile.w32-in index bb4461c810c..839d6129a31 100644 --- a/leim/makefile.w32-in +++ b/leim/makefile.w32-in @@ -1,5 +1,5 @@ -# Makefile for leim subdirectory in GNU Emacs on the Microsoft W32 API. -# Copyright (C) 1997 Electrotechnical Laboratory, JAPAN. +# -*- Makefile -*- for leim subdirectory in GNU Emacs on the Microsoft W32 API. +# Copyright (C) 1997, 2004 Electrotechnical Laboratory, JAPAN. # Licensed to the Free Software Foundation. # This file is part of GNU Emacs. @@ -203,5 +203,3 @@ distclean clean: maintainer-clean: distclean - $(FOREACH) $(WORLD) $(FORDO) $(DEL) $(FORVAR) $(ENDFOR) - -# arch-tag: 08250c45-fa9c-4f39-a175-a0c5c36dd67b diff --git a/leim/quail/.arch-inventory b/leim/quail/.arch-inventory new file mode 100644 index 00000000000..8e90362b19d --- /dev/null +++ b/leim/quail/.arch-inventory @@ -0,0 +1,4 @@ +# Auto-generated lisp files, which ignore. +precious ^([A-Z0-9].*|tsang-.*|quick-.*)\.el$ + +# arch-tag: 3d0d3e6b-f7c3-4dce-9135-a72ba7fe095d diff --git a/leim/quail/latin-ltx.el b/leim/quail/latin-ltx.el index 9eb7a0b7dcb..e670316b212 100644 --- a/leim/quail/latin-ltx.el +++ b/leim/quail/latin-ltx.el @@ -1,8 +1,8 @@ -;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: iso-2022-7bit;-*- +;;; latin-ltx.el --- Quail package for TeX-style input -*-coding: utf-8;-*- +;; Copyright (C) 2001, 2004 Free Software Foundation, Inc. ;; Copyright (C) 2001 Electrotechnical Laboratory, JAPAN. ;; Licensed to the Free Software Foundation. -;; Copyright (C) 2001 Free Software Foundation, Inc. ;; Author: TAKAHASHI Naoto <ntakahas@m17n.org> ;; Dave Love <fx@gnu.org> @@ -36,921 +36,930 @@ "LaTeX-like input method for many characters. These characters are from the charsets used by the `utf-8' coding system, including many technical ones. Examples: - \\'a -> ,Aa(B \\`{a} -> ,A`(B - \\pi -> $,1'@(B \\int -> $,1xK(B ^1 -> ,A9(B" + \\'a -> á \\`{a} -> à + \\pi -> Ï€ \\int -> ∫ ^1 -> ¹" nil t t nil nil nil nil nil nil nil t) (quail-define-rules - ("!`" ?,A!(B) - ("{\\pounds}" ?,A#(B) ("\\pounds" ?,A#(B) - ("{\\S}" ?,A'(B) ("\\S" ?,A'(B) - ("\\\"{}" ?,A((B) - ("{\\copyright}" ?,A)(B) ("\\copyright" ?,A)(B) - ("$^a$" ?,A*(B) - ("\\={}" ?,A/(B) - ("$\\pm$" ?,A1(B) ("\\pm" ?,A1(B) - ("$^2$" ?,A2(B) - ("$^3$" ?,A3(B) - ("\\'{}" ?,A4(B) - ("{\\P}" ?,A6(B) ("\\P" ?,A6(B) - ;; Fixme: Yudit has the equivalent of ("\\cdot" ?$,1z%(B), for U+22C5, DOT - ;; OPERATOR, whereas ,A7(B is MIDDLE DOT. JadeTeX translates both to + ("!`" ?¡) + ("{\\pounds}" ?£) ("\\pounds" ?£) + ("{\\S}" ?§) ("\\S" ?§) + ("\\\"{}" ?¨) + ("{\\copyright}" ?©) ("\\copyright" ?©) + ("$^a$" ?ª) + ("\\={}" ?¯) + ("$\\pm$" ?±) ("\\pm" ?±) + ("$^2$" ?²) + ("$^3$" ?³) + ("\\'{}" ?´) + ("{\\P}" ?¶) ("\\P" ?¶) + ;; Fixme: Yudit has the equivalent of ("\\cdot" ?â‹…), for U+22C5, DOT + ;; OPERATOR, whereas · is MIDDLE DOT. JadeTeX translates both to ;; \cdot. - ("$\\cdot$" ?,A7(B) ("\\cdot" ?,A7(B) - ("\\c{}" ?,A8(B) - ("$^1$" ?,A9(B) - ("$^o$" ?,A:(B) - ("?`" ?,A?(B) - - ("\\`{A}" ?,A@(B) ("\\`A" ?,A@(B) - ("\\'{A}" ?,AA(B) ("\\'A" ?,AA(B) - ("\\^{A}" ?,AB(B) ("\\^A" ?,AB(B) - ("\\~{A}" ?,AC(B) ("\\~A" ?,AC(B) - ("\\\"{A}" ?,AD(B) ("\\\"A" ?,AD(B) - ("\\\k{A}" ?$,1 $(B) - ("{\\AA}" ?,AE(B) ("\\AA" ?,AE(B) - ("{\\AE}" ?,AF(B) ("\\AE" ?,AF(B) - ("\\c{C}" ?,AG(B) ("\\cC" ?,AG(B) - ("\\`{E}" ?,AH(B) ("\\`E" ?,AH(B) - ("\\'{E}" ?,AI(B) ("\\'E" ?,AI(B) - ("\\^{E}" ?,AJ(B) ("\\^E" ?,AJ(B) - ("\\\"{E}" ?,AK(B) ("\\\"E" ?,AK(B) - ("\\\k{E}" ?$,1 8(B) - ("\\`{I}" ?,AL(B) ("\\`I" ?,AL(B) - ("\\'{I}" ?,AM(B) ("\\'I" ?,AM(B) - ("\\^{I}" ?,AN(B) ("\\^I" ?,AN(B) - ("\\\"{I}" ?,AO(B) ("\\\"I" ?,AO(B) - ("\\\k{I}" ?$,1 N(B) - - ("\\~{N}" ?,AQ(B) ("\\~N" ?,AQ(B) - ("\\`{O}" ?,AR(B) ("\\`O" ?,AR(B) - ("\\'{O}" ?,AS(B) ("\\'O" ?,AS(B) - ("\\^{O}" ?,AT(B) ("\\^O" ?,AT(B) - ("\\~{O}" ?,AU(B) ("\\~O" ?,AU(B) - ("\\\"{O}" ?,AV(B) ("\\\"O" ?,AV(B) - ("\\\k{O}" ?$,1"J(B) - ("$\\times$" ?,AW(B) ("\\times" ?,AW(B) - ("{\\O}" ?,AX(B) ("\\O" ?,AX(B) - ("\\`{U}" ?,AY(B) ("\\`U" ?,AY(B) - ("\\'{U}" ?,AZ(B) ("\\'U" ?,AZ(B) - ("\\^{U}" ?,A[(B) ("\\^U" ?,A[(B) - ("\\\"{U}" ?,A\(B) ("\\\"U" ?,A\(B) - ("\\\k{U}" ?$,1!2(B) - ("\\'{Y}" ?,A](B) ("\\'Y" ?,A](B) - ("{\\ss}" ?,A_(B) ("\\ss" ?,A_(B) - - ("\\`{a}" ?,A`(B) ("\\`a" ?,A`(B) - ("\\'{a}" ?,Aa(B) ("\\'a" ?,Aa(B) - ("\\^{a}" ?,Ab(B) ("\\^a" ?,Ab(B) - ("\\~{a}" ?,Ac(B) ("\\~a" ?,Ac(B) - ("\\\"{a}" ?,Ad(B) ("\\\"a" ?,Ad(B) - ("\\\k{a}" ?$,1 %(B) - ("{\\aa}" ?,Ae(B) ("\\aa" ?,Ae(B) - ("{\\ae}" ?,Af(B) ("\\ae" ?,Af(B) - ("\\c{c}" ?,Ag(B) ("\\cc" ?,Ag(B) - ("\\`{e}" ?,Ah(B) ("\\`e" ?,Ah(B) - ("\\'{e}" ?,Ai(B) ("\\'e" ?,Ai(B) - ("\\^{e}" ?,Aj(B) ("\\^e" ?,Aj(B) - ("\\\"{e}" ?,Ak(B) ("\\\"e" ?,Ak(B) - ("\\\k{e}" ?$,1 9(B) - ("\\`{\\i}" ?,Al(B) ("\\`i" ?,Al(B) - ("\\'{\\i}" ?,Am(B) ("\\'i" ?,Am(B) - ("\\^{\\i}" ?,An(B) ("\\^i" ?,An(B) - ("\\\"{\\i}" ?,Ao(B) ("\\\"i" ?,Ao(B) - ("\\\k{i}" ?$,1 O(B) - - ("\\~{n}" ?,Aq(B) ("\\~n" ?,Aq(B) - ("\\`{o}" ?,Ar(B) ("\\`o" ?,Ar(B) - ("\\'{o}" ?,As(B) ("\\'o" ?,As(B) - ("\\^{o}" ?,At(B) ("\\^o" ?,At(B) - ("\\~{o}" ?,Au(B) ("\\~o" ?,Au(B) - ("\\\"{o}" ?,Av(B) ("\\\"o" ?,Av(B) - ("\\\k{o}" ?$,1"K(B) - ("$\\div$" ?,Aw(B) ("\\div" ?,Aw(B) - ("{\\o}" ?,Ax(B) ("\\o" ?,Ax(B) - ("\\`{u}" ?,Ay(B) ("\\`u" ?,Ay(B) - ("\\'{u}" ?,Az(B) ("\\'u" ?,Az(B) - ("\\^{u}" ?,A{(B) ("\\^u" ?,A{(B) - ("\\\"{u}" ?,A|(B) ("\\\"u" ?,A|(B) - ("\\\k{u}" ?$,1!3(B) - ("\\'{y}" ?,A}(B) ("\\'y" ?,A}(B) - ("\\\"{y}" ?,A(B) ("\\\"y" ?,A(B) - - ("\\={A}" ?$,1 (B) ("\\=A" ?$,1 (B) - ("\\={a}" ?$,1 !(B) ("\\=a" ?$,1 !(B) - ("\\u{A}" ?$,1 "(B) ("\\uA" ?$,1 "(B) - ("\\u{a}" ?$,1 #(B) ("\\ua" ?$,1 #(B) - ("\\'{C}" ?$,1 &(B) ("\\'C" ?$,1 &(B) - ("\\'{c}" ?$,1 '(B) ("\\'c" ?$,1 '(B) - ("\\^{C}" ?$,1 ((B) ("\\^C" ?$,1 ((B) - ("\\^{c}" ?$,1 )(B) ("\\^c" ?$,1 )(B) - ("\\.{C}" ?$,1 *(B) ("\\.C" ?$,1 *(B) - ("\\.{c}" ?$,1 +(B) ("\\.c" ?$,1 +(B) - ("\\v{C}" ?$,1 ,(B) ("\\vC" ?$,1 ,(B) - ("\\v{c}" ?$,1 -(B) ("\\vc" ?$,1 -(B) - ("\\v{D}" ?$,1 .(B) ("\\vD" ?$,1 .(B) - ("\\v{d}" ?$,1 /(B) ("\\vd" ?$,1 /(B) - - ("\\={E}" ?$,1 2(B) ("\\=E" ?$,1 2(B) - ("\\={e}" ?$,1 3(B) ("\\=e" ?$,1 3(B) - ("\\u{E}" ?$,1 4(B) ("\\uE" ?$,1 4(B) - ("\\u{e}" ?$,1 5(B) ("\\ue" ?$,1 5(B) - ("\\.{E}" ?$,1 6(B) ("\\.E" ?$,1 6(B) - ("\\e{e}" ?$,1 7(B) ("\\ee" ?$,1 7(B) - ("\\v{E}" ?$,1 :(B) ("\\vE" ?$,1 :(B) - ("\\v{e}" ?$,1 ;(B) ("\\ve" ?$,1 ;(B) - ("\\^{G}" ?$,1 <(B) ("\\^G" ?$,1 <(B) - ("\\^{g}" ?$,1 =(B) ("\\^g" ?$,1 =(B) - ("\\u{G}" ?$,1 >(B) ("\\uG" ?$,1 >(B) - ("\\u{g}" ?$,1 ?(B) ("\\ug" ?$,1 ?(B) - - ("\\.{G}" ?$,1 @(B) ("\\.G" ?$,1 @(B) - ("\\.{g}" ?$,1 A(B) ("\\.g" ?$,1 A(B) - ("\\c{G}" ?$,1 B(B) ("\\cG" ?$,1 B(B) - ("\\c{g}" ?$,1 C(B) ("\\cg" ?$,1 C(B) - ("\\^{H}" ?$,1 D(B) ("\\^H" ?$,1 D(B) - ("\\^{h}" ?$,1 E(B) ("\\^h" ?$,1 E(B) - ("\\~{I}" ?$,1 H(B) ("\\~I" ?$,1 H(B) - ("\\~{\\i}" ?$,1 I(B) ("\\~i" ?$,1 I(B) - ("\\={I}" ?$,1 J(B) ("\\=I" ?$,1 J(B) - ("\\={\\i}" ?$,1 K(B) ("\\=i" ?$,1 K(B) - ("\\u{I}" ?$,1 L(B) ("\\uI" ?$,1 L(B) - ("\\u{\\i}" ?$,1 M(B) ("\\ui" ?$,1 M(B) - - ("\\.{I}" ?$,1 P(B) ("\\.I" ?$,1 P(B) - ("{\\i}" ?$,1 Q(B) ("\\i" ?$,1 Q(B) - ("\\^{J}" ?$,1 T(B) ("\\^J" ?$,1 T(B) - ("\\^{\\j}" ?$,1 U(B) ("\\^j" ?$,1 U(B) - ("\\c{K}" ?$,1 V(B) ("\\cK" ?$,1 V(B) - ("\\c{k}" ?$,1 W(B) ("\\ck" ?$,1 W(B) - ("\\'{L}" ?$,1 Y(B) ("\\'L" ?$,1 Y(B) - ("\\'{l}" ?$,1 Z(B) ("\\'l" ?$,1 Z(B) - ("\\c{L}" ?$,1 [(B) ("\\cL" ?$,1 [(B) - ("\\c{l}" ?$,1 \(B) ("\\cl" ?$,1 \(B) - - ("{\\L}" ?$,1 a(B) ("\\L" ?$,1 a(B) - ("{\\l}" ?$,1 b(B) ("\\l" ?$,1 b(B) - ("\\'{N}" ?$,1 c(B) ("\\'N" ?$,1 c(B) - ("\\'{n}" ?$,1 d(B) ("\\'n" ?$,1 d(B) - ("\\c{N}" ?$,1 e(B) ("\\cN" ?$,1 e(B) - ("\\c{n}" ?$,1 f(B) ("\\cn" ?$,1 f(B) - ("\\v{N}" ?$,1 g(B) ("\\vN" ?$,1 g(B) - ("\\v{n}" ?$,1 h(B) ("\\vn" ?$,1 h(B) - ("\\={O}" ?$,1 l(B) ("\\=O" ?$,1 l(B) - ("\\={o}" ?$,1 m(B) ("\\=o" ?$,1 m(B) - ("\\u{O}" ?$,1 n(B) ("\\uO" ?$,1 n(B) - ("\\u{o}" ?$,1 o(B) ("\\uo" ?$,1 o(B) - - ("\\H{O}" ?$,1 p(B) ("\\HO" ?$,1 p(B) - ("\\U{o}" ?$,1 q(B) ("\\Uo" ?$,1 q(B) - ("{\\OE}" ?$,1 r(B) ("\\OE" ?$,1 r(B) - ("{\\oe}" ?$,1 s(B) ("\\oe" ?$,1 s(B) - ("\\'{R}" ?$,1 t(B) ("\\'R" ?$,1 t(B) - ("\\'{r}" ?$,1 u(B) ("\\'r" ?$,1 u(B) - ("\\c{R}" ?$,1 v(B) ("\\cR" ?$,1 v(B) - ("\\c{r}" ?$,1 w(B) ("\\cr" ?$,1 w(B) - ("\\v{R}" ?$,1 x(B) ("\\vR" ?$,1 x(B) - ("\\v{r}" ?$,1 y(B) ("\\vr" ?$,1 y(B) - ("\\'{S}" ?$,1 z(B) ("\\'S" ?$,1 z(B) - ("\\'{s}" ?$,1 {(B) ("\\'s" ?$,1 {(B) - ("\\^{S}" ?$,1 |(B) ("\\^S" ?$,1 |(B) - ("\\^{s}" ?$,1 }(B) ("\\^s" ?$,1 }(B) - ("\\c{S}" ?$,1 ~(B) ("\\cS" ?$,1 ~(B) - ("\\c{s}" ?$,1 (B) ("\\cs" ?$,1 (B) - - ("\\v{S}" ?$,1! (B) ("\\vS" ?$,1! (B) - ("\\v{s}" ?$,1!!(B) ("\\vs" ?$,1!!(B) - ("\\c{T}" ?$,1!"(B) ("\\cT" ?$,1!"(B) - ("\\c{t}" ?$,1!#(B) ("\\ct" ?$,1!#(B) - ("\\v{T}" ?$,1!$(B) ("\\vT" ?$,1!$(B) - ("\\v{t}" ?$,1!%(B) ("\\vt" ?$,1!%(B) - ("\\~{U}" ?$,1!((B) ("\\~U" ?$,1!((B) - ("\\~{u}" ?$,1!)(B) ("\\~u" ?$,1!)(B) - ("\\={U}" ?$,1!*(B) ("\\=U" ?$,1!*(B) - ("\\={u}" ?$,1!+(B) ("\\=u" ?$,1!+(B) - ("\\u{U}" ?$,1!,(B) ("\\uU" ?$,1!,(B) - ("\\u{u}" ?$,1!-(B) ("\\uu" ?$,1!-(B) - - ("\\H{U}" ?$,1!0(B) ("\\HU" ?$,1!0(B) - ("\\H{u}" ?$,1!1(B) ("\\Hu" ?$,1!1(B) - ("\\^{W}" ?$,1!4(B) ("\\^W" ?$,1!4(B) - ("\\^{w}" ?$,1!5(B) ("\\^w" ?$,1!5(B) - ("\\^{Y}" ?$,1!6(B) ("\\^Y" ?$,1!6(B) - ("\\^{y}" ?$,1!7(B) ("\\^y" ?$,1!7(B) - ("\\\"{Y}" ?$,1!8(B) ("\\\"Y" ?$,1!8(B) - ("\\'{Z}" ?$,1!9(B) ("\\'Z" ?$,1!9(B) - ("\\'{z}" ?$,1!:(B) ("\\'z" ?$,1!:(B) - ("\\.{Z}" ?$,1!;(B) ("\\.Z" ?$,1!;(B) - ("\\.{z}" ?$,1!<(B) ("\\.z" ?$,1!<(B) - ("\\v{Z}" ?$,1!=(B) ("\\vZ" ?$,1!=(B) - ("\\v{z}" ?$,1!>(B) ("\\vz" ?$,1!>(B) - - ("\\v{A}" ?$,1"-(B) ("\\vA" ?$,1"-(B) - ("\\v{a}" ?$,1".(B) ("\\va" ?$,1".(B) - ("\\v{I}" ?$,1"/(B) ("\\vI" ?$,1"/(B) - ("\\v{\\i}" ?$,1"0(B) ("\\vi" ?$,1"0(B) - ("\\v{O}" ?$,1"1(B) ("\\vO" ?$,1"1(B) - ("\\v{o}" ?$,1"2(B) ("\\vo" ?$,1"2(B) - ("\\v{U}" ?$,1"3(B) ("\\vU" ?$,1"3(B) - ("\\v{u}" ?$,1"4(B) ("\\vu" ?$,1"4(B) - - ("\\={\\AE}" ?$,1"B(B) ("\\=\\AE" ?$,1"B(B) - ("\\={\\ae}" ?$,1"C(B) ("\\=\\ae" ?$,1"C(B) - ("\\v{G}" ?$,1"F(B) ("\\vG" ?$,1"F(B) - ("\\v{g}" ?$,1"G(B) ("\\vg" ?$,1"G(B) - ("\\v{K}" ?$,1"H(B) ("\\vK" ?$,1"H(B) + ("$\\cdot$" ?·) ("\\cdot" ?·) + ("\\c{}" ?¸) + ("$^1$" ?¹) + ("$^o$" ?º) + ("?`" ?¿) + + ("\\`{A}" ?À) ("\\`A" ?À) + ("\\'{A}" ?Ã) ("\\'A" ?Ã) + ("\\^{A}" ?Â) ("\\^A" ?Â) + ("\\~{A}" ?Ã) ("\\~A" ?Ã) + ("\\\"{A}" ?Ä) ("\\\"A" ?Ä) + ("\\\k{A}" ?Ä„) + ("{\\AA}" ?Ã…) ("\\AA" ?Ã…) + ("{\\AE}" ?Æ) ("\\AE" ?Æ) + ("\\c{C}" ?Ç) ("\\cC" ?Ç) + ("\\`{E}" ?È) ("\\`E" ?È) + ("\\'{E}" ?É) ("\\'E" ?É) + ("\\^{E}" ?Ê) ("\\^E" ?Ê) + ("\\\"{E}" ?Ë) ("\\\"E" ?Ë) + ("\\\k{E}" ?Ę) + ("\\`{I}" ?ÃŒ) ("\\`I" ?ÃŒ) + ("\\'{I}" ?Ã) ("\\'I" ?Ã) + ("\\^{I}" ?ÃŽ) ("\\^I" ?ÃŽ) + ("\\\"{I}" ?Ã) ("\\\"I" ?Ã) + ("\\\k{I}" ?Ä®) + + ("\\~{N}" ?Ñ) ("\\~N" ?Ñ) + ("\\`{O}" ?Ã’) ("\\`O" ?Ã’) + ("\\'{O}" ?Ó) ("\\'O" ?Ó) + ("\\^{O}" ?Ô) ("\\^O" ?Ô) + ("\\~{O}" ?Õ) ("\\~O" ?Õ) + ("\\\"{O}" ?Ö) ("\\\"O" ?Ö) + ("\\\k{O}" ?Ǫ) + ("$\\times$" ?×) ("\\times" ?×) + ("{\\O}" ?Ø) ("\\O" ?Ø) + ("\\`{U}" ?Ù) ("\\`U" ?Ù) + ("\\'{U}" ?Ú) ("\\'U" ?Ú) + ("\\^{U}" ?Û) ("\\^U" ?Û) + ("\\\"{U}" ?Ãœ) ("\\\"U" ?Ãœ) + ("\\\k{U}" ?Ų) + ("\\'{Y}" ?Ã) ("\\'Y" ?Ã) + ("{\\ss}" ?ß) ("\\ss" ?ß) + + ("\\`{a}" ?à ) ("\\`a" ?à ) + ("\\'{a}" ?á) ("\\'a" ?á) + ("\\^{a}" ?â) ("\\^a" ?â) + ("\\~{a}" ?ã) ("\\~a" ?ã) + ("\\\"{a}" ?ä) ("\\\"a" ?ä) + ("\\\k{a}" ?Ä…) + ("{\\aa}" ?Ã¥) ("\\aa" ?Ã¥) + ("{\\ae}" ?æ) ("\\ae" ?æ) + ("\\c{c}" ?ç) ("\\cc" ?ç) + ("\\`{e}" ?è) ("\\`e" ?è) + ("\\'{e}" ?é) ("\\'e" ?é) + ("\\^{e}" ?ê) ("\\^e" ?ê) + ("\\\"{e}" ?ë) ("\\\"e" ?ë) + ("\\\k{e}" ?Ä™) + ("\\`{\\i}" ?ì) ("\\`i" ?ì) + ("\\'{\\i}" ?Ã) ("\\'i" ?Ã) + ("\\^{\\i}" ?î) ("\\^i" ?î) + ("\\\"{\\i}" ?ï) ("\\\"i" ?ï) + ("\\\k{i}" ?į) + + ("\\~{n}" ?ñ) ("\\~n" ?ñ) + ("\\`{o}" ?ò) ("\\`o" ?ò) + ("\\'{o}" ?ó) ("\\'o" ?ó) + ("\\^{o}" ?ô) ("\\^o" ?ô) + ("\\~{o}" ?õ) ("\\~o" ?õ) + ("\\\"{o}" ?ö) ("\\\"o" ?ö) + ("\\\k{o}" ?Ç«) + ("$\\div$" ?÷) ("\\div" ?÷) + ("{\\o}" ?ø) ("\\o" ?ø) + ("\\`{u}" ?ù) ("\\`u" ?ù) + ("\\'{u}" ?ú) ("\\'u" ?ú) + ("\\^{u}" ?û) ("\\^u" ?û) + ("\\\"{u}" ?ü) ("\\\"u" ?ü) + ("\\\k{u}" ?ų) + ("\\'{y}" ?ý) ("\\'y" ?ý) + ("\\\"{y}" ?ÿ) ("\\\"y" ?ÿ) + + ("\\={A}" ?Ä€) ("\\=A" ?Ä€) + ("\\={a}" ?Ä) ("\\=a" ?Ä) + ("\\u{A}" ?Ä‚) ("\\uA" ?Ä‚) + ("\\u{a}" ?ă) ("\\ua" ?ă) + ("\\'{C}" ?Ć) ("\\'C" ?Ć) + ("\\'{c}" ?ć) ("\\'c" ?ć) + ("\\^{C}" ?Ĉ) ("\\^C" ?Ĉ) + ("\\^{c}" ?ĉ) ("\\^c" ?ĉ) + ("\\.{C}" ?ÄŠ) ("\\.C" ?ÄŠ) + ("\\.{c}" ?Ä‹) ("\\.c" ?Ä‹) + ("\\v{C}" ?ÄŒ) ("\\vC" ?ÄŒ) + ("\\v{c}" ?Ä) ("\\vc" ?Ä) + ("\\v{D}" ?ÄŽ) ("\\vD" ?ÄŽ) + ("\\v{d}" ?Ä) ("\\vd" ?Ä) + + ("\\={E}" ?Ä’) ("\\=E" ?Ä’) + ("\\={e}" ?Ä“) ("\\=e" ?Ä“) + ("\\u{E}" ?Ä”) ("\\uE" ?Ä”) + ("\\u{e}" ?Ä•) ("\\ue" ?Ä•) + ("\\.{E}" ?Ä–) ("\\.E" ?Ä–) + ("\\e{e}" ?Ä—) ("\\ee" ?Ä—) + ("\\v{E}" ?Äš) ("\\vE" ?Äš) + ("\\v{e}" ?Ä›) ("\\ve" ?Ä›) + ("\\^{G}" ?Äœ) ("\\^G" ?Äœ) + ("\\^{g}" ?Ä) ("\\^g" ?Ä) + ("\\u{G}" ?Äž) ("\\uG" ?Äž) + ("\\u{g}" ?ÄŸ) ("\\ug" ?ÄŸ) + + ("\\.{G}" ?Ä ) ("\\.G" ?Ä ) + ("\\.{g}" ?Ä¡) ("\\.g" ?Ä¡) + ("\\c{G}" ?Ä¢) ("\\cG" ?Ä¢) + ("\\c{g}" ?Ä£) ("\\cg" ?Ä£) + ("\\^{H}" ?Ĥ) ("\\^H" ?Ĥ) + ("\\^{h}" ?Ä¥) ("\\^h" ?Ä¥) + ("\\~{I}" ?Ĩ) ("\\~I" ?Ĩ) + ("\\~{\\i}" ?Ä©) ("\\~i" ?Ä©) + ("\\={I}" ?Ī) ("\\=I" ?Ī) + ("\\={\\i}" ?Ä«) ("\\=i" ?Ä«) + ("\\u{I}" ?Ĭ) ("\\uI" ?Ĭ) + ("\\u{\\i}" ?Ä) ("\\ui" ?Ä) + + ("\\.{I}" ?Ä°) ("\\.I" ?Ä°) + ("{\\i}" ?ı) ("\\i" ?ı) + ("\\^{J}" ?Ä´) ("\\^J" ?Ä´) + ("\\^{\\j}" ?ĵ) ("\\^j" ?ĵ) + ("\\c{K}" ?Ķ) ("\\cK" ?Ķ) + ("\\c{k}" ?Ä·) ("\\ck" ?Ä·) + ("\\'{L}" ?Ĺ) ("\\'L" ?Ĺ) + ("\\'{l}" ?ĺ) ("\\'l" ?ĺ) + ("\\c{L}" ?Ä») ("\\cL" ?Ä») + ("\\c{l}" ?ļ) ("\\cl" ?ļ) + + ("{\\L}" ?Å) ("\\L" ?Å) + ("{\\l}" ?Å‚) ("\\l" ?Å‚) + ("\\'{N}" ?Ń) ("\\'N" ?Ń) + ("\\'{n}" ?Å„) ("\\'n" ?Å„) + ("\\c{N}" ?Å…) ("\\cN" ?Å…) + ("\\c{n}" ?ņ) ("\\cn" ?ņ) + ("\\v{N}" ?Ň) ("\\vN" ?Ň) + ("\\v{n}" ?ň) ("\\vn" ?ň) + ("\\={O}" ?ÅŒ) ("\\=O" ?ÅŒ) + ("\\={o}" ?Å) ("\\=o" ?Å) + ("\\u{O}" ?ÅŽ) ("\\uO" ?ÅŽ) + ("\\u{o}" ?Å) ("\\uo" ?Å) + + ("\\H{O}" ?Å) ("\\HO" ?Å) + ("\\U{o}" ?Å‘) ("\\Uo" ?Å‘) + ("{\\OE}" ?Å’) ("\\OE" ?Å’) + ("{\\oe}" ?Å“) ("\\oe" ?Å“) + ("\\'{R}" ?Å”) ("\\'R" ?Å”) + ("\\'{r}" ?Å•) ("\\'r" ?Å•) + ("\\c{R}" ?Å–) ("\\cR" ?Å–) + ("\\c{r}" ?Å—) ("\\cr" ?Å—) + ("\\v{R}" ?Ř) ("\\vR" ?Ř) + ("\\v{r}" ?Å™) ("\\vr" ?Å™) + ("\\'{S}" ?Åš) ("\\'S" ?Åš) + ("\\'{s}" ?Å›) ("\\'s" ?Å›) + ("\\^{S}" ?Åœ) ("\\^S" ?Åœ) + ("\\^{s}" ?Å) ("\\^s" ?Å) + ("\\c{S}" ?Åž) ("\\cS" ?Åž) + ("\\c{s}" ?ÅŸ) ("\\cs" ?ÅŸ) + + ("\\v{S}" ?Å ) ("\\vS" ?Å ) + ("\\v{s}" ?Å¡) ("\\vs" ?Å¡) + ("\\c{T}" ?Å¢) ("\\cT" ?Å¢) + ("\\c{t}" ?Å£) ("\\ct" ?Å£) + ("\\v{T}" ?Ť) ("\\vT" ?Ť) + ("\\v{t}" ?Å¥) ("\\vt" ?Å¥) + ("\\~{U}" ?Ũ) ("\\~U" ?Ũ) + ("\\~{u}" ?Å©) ("\\~u" ?Å©) + ("\\={U}" ?Ū) ("\\=U" ?Ū) + ("\\={u}" ?Å«) ("\\=u" ?Å«) + ("\\u{U}" ?Ŭ) ("\\uU" ?Ŭ) + ("\\u{u}" ?Å) ("\\uu" ?Å) + + ("\\H{U}" ?Å°) ("\\HU" ?Å°) + ("\\H{u}" ?ű) ("\\Hu" ?ű) + ("\\^{W}" ?Å´) ("\\^W" ?Å´) + ("\\^{w}" ?ŵ) ("\\^w" ?ŵ) + ("\\^{Y}" ?Ŷ) ("\\^Y" ?Ŷ) + ("\\^{y}" ?Å·) ("\\^y" ?Å·) + ("\\\"{Y}" ?Ÿ) ("\\\"Y" ?Ÿ) + ("\\'{Z}" ?Ź) ("\\'Z" ?Ź) + ("\\'{z}" ?ź) ("\\'z" ?ź) + ("\\.{Z}" ?Å») ("\\.Z" ?Å») + ("\\.{z}" ?ż) ("\\.z" ?ż) + ("\\v{Z}" ?Ž) ("\\vZ" ?Ž) + ("\\v{z}" ?ž) ("\\vz" ?ž) + + ("\\v{A}" ?Ç) ("\\vA" ?Ç) + ("\\v{a}" ?ÇŽ) ("\\va" ?ÇŽ) + ("\\v{I}" ?Ç) ("\\vI" ?Ç) + ("\\v{\\i}" ?Ç) ("\\vi" ?Ç) + ("\\v{O}" ?Ç‘) ("\\vO" ?Ç‘) + ("\\v{o}" ?Ç’) ("\\vo" ?Ç’) + ("\\v{U}" ?Ç“) ("\\vU" ?Ç“) + ("\\v{u}" ?Ç”) ("\\vu" ?Ç”) + + ("\\={\\AE}" ?Ç¢) ("\\=\\AE" ?Ç¢) + ("\\={\\ae}" ?Ç£) ("\\=\\ae" ?Ç£) + ("\\v{G}" ?Ǧ) ("\\vG" ?Ǧ) + ("\\v{g}" ?ǧ) ("\\vg" ?ǧ) + ("\\v{K}" ?Ǩ) ("\\vK" ?Ǩ) ("\\v{k}" ?k) ("\\vk" ?k) - ("\\v{\\j}" ?$,1"P(B) ("\\vj" ?$,1"P(B) - ("\\'{G}" ?$,1"T(B) ("\\'G" ?$,1"T(B) - ("\\'{g}" ?$,1"U(B) ("\\'g" ?$,1"U(B) - ("\\`{N}" ?$,1"X(B) ("\\`N" ?$,1"X(B) - ("\\`{n}" ?$,1"Y(B) ("\\`n" ?$,1"Y(B) - ("\\'{\\AE}" ?$,1"\(B) ("\\'\\AE" ?$,1"\(B) - ("\\'{\\ae}" ?$,1"](B) ("\\'\\ae" ?$,1"](B) - ("\\'{\\O}" ?$,1"^(B) ("\\'\\O" ?$,1"^(B) - ("\\'{\\o}" ?$,1"_(B) ("\\'\\o" ?$,1"_(B) - - ("\\v{H}" ?$,1"~(B) ("\\vH" ?$,1"~(B) - ("\\v{h}" ?$,1"(B) ("\\vh" ?$,1"(B) - ("\\.{A}" ?$,1#&(B) ("\\.A" ?$,1#&(B) - ("\\.{a}" ?$,1#'(B) ("\\.a" ?$,1#'(B) - ("\\c{E}" ?$,1#((B) ("\\cE" ?$,1#((B) - ("\\c{e}" ?$,1#)(B) ("\\ce" ?$,1#)(B) - ("\\.{O}" ?$,1#.(B) ("\\.O" ?$,1#.(B) - ("\\.{o}" ?$,1#/(B) ("\\.o" ?$,1#/(B) - ("\\={Y}" ?$,1#2(B) ("\\=Y" ?$,1#2(B) - ("\\={y}" ?$,1#3(B) ("\\=y" ?$,1#3(B) - - ("\\v{}" ?$,1$g(B) - ("\\u{}" ?$,1$x(B) - ("\\.{}" ?$,1$y(B) - ("\\~{}" ?$,1$|(B) - ("\\H{}" ?$,1$}(B) - - ("\\'" ?$,1%A(B) - ("\\'K" ?$,1mp(B) - ("\\'M" ?$,1m~(B) - ("\\'P" ?$,1n4(B) - ("\\'W" ?$,1nb(B) - ("\\'k" ?$,1mq(B) - ("\\'m" ?$,1m(B) - ("\\'p" ?$,1n5(B) - ("\\'w" ?$,1nc(B) - ("\\," ?$,1rf(B) - ("\\." ?$,1%G(B) - ("\\.B" ?$,1mB(B) - ("\\.D" ?$,1mJ(B) - ("\\.F" ?$,1m^(B) - ("\\.H" ?$,1mb(B) - ("\\.M" ?$,1n (B) - ("\\.N" ?$,1n$(B) - ("\\.P" ?$,1n6(B) - ("\\.R" ?$,1n8(B) - ("\\.S" ?$,1n@(B) - ("\\.T" ?$,1nJ(B) - ("\\.W" ?$,1nf(B) - ("\\.X" ?$,1nj(B) - ("\\.Y" ?$,1nn(B) - ("\\.b" ?$,1mC(B) - ("\\.d" ?$,1mK(B) - ("\\.e" ?$,1 7(B) - ("\\.f" ?$,1m_(B) - ("\\.h" ?$,1mc(B) - ("\\.m" ?$,1n!(B) - ("\\.n" ?$,1n%(B) - ("\\.p" ?$,1n7(B) - ("\\.r" ?$,1n9(B) - ("\\.s" ?$,1nA(B) - ("\\.t" ?$,1nK(B) - ("\\.w" ?$,1ng(B) - ("\\.x" ?$,1nk(B) - ("\\.y" ?$,1no(B) - ("\\/" ?$,1rl(B) - ("\\:" ?$,1re(B) - ("\\;" ?$,1rd(B) - ("\\=" ?$,1%D(B) - ("\\=G" ?$,1m`(B) - ("\\=g" ?$,1ma(B) - - ("^(" ?$,1s}(B) - ("^)" ?$,1s~(B) - ("^+" ?$,1sz(B) - ("^-" ?$,1s{(B) - ("^0" ?$,1sp(B) - ("^1" ?,A9(B) - ("^2" ?,A2(B) - ("^3" ?,A3(B) - ("^4" ?$,1st(B) - ("^5" ?$,1su(B) - ("^6" ?$,1sv(B) - ("^7" ?$,1sw(B) - ("^8" ?$,1sx(B) - ("^9" ?$,1sy(B) - ("^=" ?$,1s|(B) - ("^\\gamma" ?$,1% (B) - ("^h" ?$,1$P(B) - ("^j" ?$,1$R(B) - ("^l" ?$,1%!(B) - ("^n" ?$,1s(B) - ("^o" ?,A:(B) - ("^r" ?$,1$S(B) - ("^s" ?$,1%"(B) - ("^w" ?$,1$W(B) - ("^x" ?$,1%#(B) - ("^y" ?$,1$X(B) - ("^{SM}" ?$,1u`(B) - ("^{TEL}" ?$,1ua(B) - ("^{TM}" ?$,1ub(B) - ("_(" ?$,1t-(B) - ("_)" ?$,1t.(B) - ("_+" ?$,1t*(B) - ("_-" ?$,1t+(B) - ("_0" ?$,1t (B) - ("_1" ?$,1t!(B) - ("_2" ?$,1t"(B) - ("_3" ?$,1t#(B) - ("_4" ?$,1t$(B) - ("_5" ?$,1t%(B) - ("_6" ?$,1t&(B) - ("_7" ?$,1t'(B) - ("_8" ?$,1t((B) - ("_9" ?$,1t)(B) - ("_=" ?$,1t,(B) - - ("\\~" ?$,1%C(B) - ("\\~E" ?$,1o<(B) - ("\\~V" ?$,1n\(B) - ("\\~Y" ?$,1ox(B) - ("\\~e" ?$,1o=(B) - ("\\~v" ?$,1n](B) - ("\\~y" ?$,1oy(B) - - ("\\\"" ?$,1%H(B) - ("\\\"H" ?$,1mf(B) - ("\\\"W" ?$,1nd(B) - ("\\\"X" ?$,1nl(B) - ("\\\"h" ?$,1mg(B) - ("\\\"t" ?$,1nw(B) - ("\\\"w" ?$,1ne(B) - ("\\\"x" ?$,1nm(B) - ("\\^" ?$,1%B(B) - ("\\^Z" ?$,1np(B) - ("\\^z" ?$,1nq(B) - ("\\`" ?$,1%@(B) - ("\\`W" ?$,1n`(B) - ("\\`Y" ?$,1or(B) - ("\\`w" ?$,1na(B) - ("\\`y" ?$,1os(B) - ("\\b" ?$,1%q(B) - ("\\c" ?$,1%g(B) - ("\\c{D}" ?$,1mP(B) - ("\\c{H}" ?$,1mh(B) - ("\\c{d}" ?$,1mQ(B) - ("\\c{h}" ?$,1mi(B) - ("\\d" ?$,1%c(B) - ("\\d{A}" ?$,1o (B) - ("\\d{B}" ?$,1mD(B) - ("\\d{D}" ?$,1mL(B) - ("\\d{E}" ?$,1o8(B) - ("\\d{H}" ?$,1md(B) - ("\\d{I}" ?$,1oJ(B) - ("\\d{K}" ?$,1mr(B) - ("\\d{L}" ?$,1mv(B) - ("\\d{M}" ?$,1n"(B) - ("\\d{N}" ?$,1n&(B) - ("\\d{O}" ?$,1oL(B) - ("\\d{R}" ?$,1n:(B) - ("\\d{S}" ?$,1nB(B) - ("\\d{T}" ?$,1nL(B) - ("\\d{U}" ?$,1od(B) - ("\\d{V}" ?$,1n^(B) - ("\\d{W}" ?$,1nh(B) - ("\\d{Y}" ?$,1ot(B) - ("\\d{Z}" ?$,1nr(B) - ("\\d{a}" ?$,1o!(B) - ("\\d{b}" ?$,1mE(B) - ("\\d{d}" ?$,1mM(B) - ("\\d{e}" ?$,1o9(B) - ("\\d{h}" ?$,1me(B) - ("\\d{i}" ?$,1oK(B) - ("\\d{k}" ?$,1ms(B) - ("\\d{l}" ?$,1mw(B) - ("\\d{m}" ?$,1n#(B) - ("\\d{n}" ?$,1n'(B) - ("\\d{o}" ?$,1oM(B) - ("\\d{r}" ?$,1n;(B) - ("\\d{s}" ?$,1nC(B) - ("\\d{t}" ?$,1nM(B) - ("\\d{u}" ?$,1oe(B) - ("\\d{v}" ?$,1n_(B) - ("\\d{w}" ?$,1ni(B) - ("\\d{y}" ?$,1ou(B) - ("\\d{z}" ?$,1ns(B) - ("\\rq" ?$,1ry(B) - ("\\u" ?$,1%F(B) - ("\\v" ?$,1%L(B) - ("\\v{L}" ?$,1 ](B) - ("\\v{i}" ?$,1"0(B) - ("\\v{j}" ?$,1"P(B) - ("\\v{l}" ?$,1 ^(B) - ("\\yen" ?,A%(B) - - ("\\Box" ?$,2!a(B) - ("\\Bumpeq" ?$,1xn(B) - ("\\Cap" ?$,1z2(B) - ("\\Cup" ?$,1z3(B) - ("\\Delta" ?$,1&t(B) - ("\\Diamond" ?$,2"'(B) - ("\\Downarrow" ?$,1wS(B) - ("\\Gamma" ?$,1&s(B) - ("\\H" ?$,1%K(B) - ("\\H{o}" ?$,1 q(B) - ("\\Im" ?$,1uQ(B) - ("\\Join" ?$,1z((B) - ("\\Lambda" ?$,1&{(B) - ("\\Leftarrow" ?$,1wP(B) - ("\\Leftrightarrow" ?$,1wT(B) - ("\\Ll" ?$,1z8(B) - ("\\Lleftarrow" ?$,1wZ(B) - ("\\Longleftarrow" ?$,1wP(B) - ("\\Longleftrightarrow" ?$,1wT(B) - ("\\Longrightarrow" ?$,1wR(B) - ("\\Lsh" ?$,1w0(B) - ("\\Omega" ?$,1')(B) - ("\\Phi" ?$,1'&(B) - ("\\Pi" ?$,1' (B) - ("\\Psi" ?$,1'((B) - ("\\Re" ?$,1u\(B) - ("\\Rightarrow" ?$,1wR(B) - ("\\Rrightarrow" ?$,1w[(B) - ("\\Rsh" ?$,1w1(B) - ("\\Sigma" ?$,1'#(B) - ("\\Subset" ?$,1z0(B) - ("\\Supset" ?$,1z1(B) - ("\\Theta" ?$,1&x(B) - ("\\Uparrow" ?$,1wQ(B) - ("\\Updownarrow" ?$,1wU(B) - ("\\Upsilon" ?$,1'%(B) - ("\\Vdash" ?$,1yi(B) - ("\\Vert" ?$,1rv(B) - ("\\Vvdash" ?$,1yj(B) - ("\\Xi" ?$,1&~(B) - ("\\aleph" ?$,1,p(B) - ("\\alpha" ?$,1'1(B) - ("\\amalg" ?$,1x0(B) - ("\\angle" ?$,1x@(B) - ("\\approx" ?$,1xh(B) - ("\\approxeq" ?$,1xj(B) - ("\\ast" ?$,1x7(B) - ("\\asymp" ?$,1xm(B) - ("\\backcong" ?$,1xl(B) - ("\\backepsilon" ?$,1x-(B) - ("\\backprime" ?$,1s5(B) - ("\\backsim" ?$,1x](B) - ("\\backsimeq" ?$,1z-(B) + ("\\v{\\j}" ?Ç°) ("\\vj" ?Ç°) + ("\\'{G}" ?Ç´) ("\\'G" ?Ç´) + ("\\'{g}" ?ǵ) ("\\'g" ?ǵ) + ("\\`{N}" ?Ǹ) ("\\`N" ?Ǹ) + ("\\`{n}" ?ǹ) ("\\`n" ?ǹ) + ("\\'{\\AE}" ?Ǽ) ("\\'\\AE" ?Ǽ) + ("\\'{\\ae}" ?ǽ) ("\\'\\ae" ?ǽ) + ("\\'{\\O}" ?Ǿ) ("\\'\\O" ?Ǿ) + ("\\'{\\o}" ?Ç¿) ("\\'\\o" ?Ç¿) + + ("\\v{H}" ?Èž) ("\\vH" ?Èž) + ("\\v{h}" ?ÈŸ) ("\\vh" ?ÈŸ) + ("\\.{A}" ?Ȧ) ("\\.A" ?Ȧ) + ("\\.{a}" ?ȧ) ("\\.a" ?ȧ) + ("\\c{E}" ?Ȩ) ("\\cE" ?Ȩ) + ("\\c{e}" ?È©) ("\\ce" ?È©) + ("\\.{O}" ?È®) ("\\.O" ?È®) + ("\\.{o}" ?ȯ) ("\\.o" ?ȯ) + ("\\={Y}" ?Ȳ) ("\\=Y" ?Ȳ) + ("\\={y}" ?ȳ) ("\\=y" ?ȳ) + + ("\\v{}" ?ˇ) + ("\\u{}" ?˘) + ("\\.{}" ?Ë™) + ("\\~{}" ?Ëœ) + ("\\H{}" ?Ë) + + ("\\'" ?Ì) + ("\\'K" ?Ḱ) + ("\\'M" ?Ḿ) + ("\\'P" ?á¹”) + ("\\'W" ?Ẃ) + ("\\'k" ?ḱ) + ("\\'m" ?ḿ) + ("\\'p" ?ṕ) + ("\\'w" ?ẃ) + ("\\," ? ) + ("\\." ?̇) + ("\\.B" ?Ḃ) + ("\\.D" ?Ḋ) + ("\\.F" ?Ḟ) + ("\\.H" ?Ḣ) + ("\\.M" ?á¹€) + ("\\.N" ?Ṅ) + ("\\.P" ?á¹–) + ("\\.R" ?Ṙ) + ("\\.S" ?á¹ ) + ("\\.T" ?Ṫ) + ("\\.W" ?Ẇ) + ("\\.X" ?Ẋ) + ("\\.Y" ?Ẏ) + ("\\.b" ?ḃ) + ("\\.d" ?ḋ) + ("\\.e" ?Ä—) + ("\\.f" ?ḟ) + ("\\.h" ?ḣ) + ("\\.m" ?á¹) + ("\\.n" ?á¹…) + ("\\.p" ?á¹—) + ("\\.r" ?á¹™) + ("\\.s" ?ṡ) + ("\\.t" ?ṫ) + ("\\.w" ?ẇ) + ("\\.x" ?ẋ) + ("\\.y" ?áº) + ("\\/" ?‌) + ("\\:" ? ) + ("\\;" ? ) + ("\\=" ?Ì„) + ("\\=G" ?Ḡ) + ("\\=g" ?ḡ) + + ("^(" ?â½) + ("^)" ?â¾) + ("^+" ?âº) + ("^-" ?â») + ("^0" ?â°) + ("^1" ?¹) + ("^2" ?²) + ("^3" ?³) + ("^4" ?â´) + ("^5" ?âµ) + ("^6" ?â¶) + ("^7" ?â·) + ("^8" ?â¸) + ("^9" ?â¹) + ("^=" ?â¼) + ("^\\gamma" ?Ë ) + ("^h" ?Ê°) + ("^j" ?ʲ) + ("^l" ?Ë¡) + ("^n" ?â¿) + ("^o" ?º) + ("^r" ?ʳ) + ("^s" ?Ë¢) + ("^w" ?Ê·) + ("^x" ?Ë£) + ("^y" ?ʸ) + ("^{SM}" ?â„ ) + ("^{TEL}" ?â„¡) + ("^{TM}" ?â„¢) + ("_(" ?â‚) + ("_)" ?â‚Ž) + ("_+" ?â‚Š) + ("_-" ?â‚‹) + ("_0" ?â‚€) + ("_1" ?â‚) + ("_2" ?â‚‚) + ("_3" ?₃) + ("_4" ?â‚„) + ("_5" ?â‚…) + ("_6" ?₆) + ("_7" ?₇) + ("_8" ?₈) + ("_9" ?₉) + ("_=" ?â‚Œ) + + ("\\~" ?̃) + ("\\~E" ?Ẽ) + ("\\~V" ?á¹¼) + ("\\~Y" ?Ỹ) + ("\\~e" ?ẽ) + ("\\~v" ?á¹½) + ("\\~y" ?ỹ) + + ("\\\"" ?̈) + ("\\\"H" ?Ḧ) + ("\\\"W" ?Ẅ) + ("\\\"X" ?Ẍ) + ("\\\"h" ?ḧ) + ("\\\"t" ?ẗ) + ("\\\"w" ?ẅ) + ("\\\"x" ?áº) + ("\\^" ?Ì‚) + ("\\^Z" ?áº) + ("\\^z" ?ẑ) + ("\\`" ?Ì€) + ("\\`W" ?Ẁ) + ("\\`Y" ?Ỳ) + ("\\`w" ?áº) + ("\\`y" ?ỳ) + ("\\b" ?̱) + ("\\c" ?̧) + ("\\c{D}" ?á¸) + ("\\c{H}" ?Ḩ) + ("\\c{d}" ?ḑ) + ("\\c{h}" ?ḩ) + ("\\d" ?Ì£) + ("\\d{A}" ?Ạ) + ("\\d{B}" ?Ḅ) + ("\\d{D}" ?Ḍ) + ("\\d{E}" ?Ẹ) + ("\\d{H}" ?Ḥ) + ("\\d{I}" ?Ị) + ("\\d{K}" ?Ḳ) + ("\\d{L}" ?Ḷ) + ("\\d{M}" ?Ṃ) + ("\\d{N}" ?Ṇ) + ("\\d{O}" ?Ọ) + ("\\d{R}" ?Ṛ) + ("\\d{S}" ?á¹¢) + ("\\d{T}" ?Ṭ) + ("\\d{U}" ?Ụ) + ("\\d{V}" ?á¹¾) + ("\\d{W}" ?Ẉ) + ("\\d{Y}" ?á»´) + ("\\d{Z}" ?Ẓ) + ("\\d{a}" ?ạ) + ("\\d{b}" ?ḅ) + ("\\d{d}" ?á¸) + ("\\d{e}" ?ẹ) + ("\\d{h}" ?ḥ) + ("\\d{i}" ?ị) + ("\\d{k}" ?ḳ) + ("\\d{l}" ?ḷ) + ("\\d{m}" ?ṃ) + ("\\d{n}" ?ṇ) + ("\\d{o}" ?á») + ("\\d{r}" ?á¹›) + ("\\d{s}" ?á¹£) + ("\\d{t}" ?á¹) + ("\\d{u}" ?ụ) + ("\\d{v}" ?ṿ) + ("\\d{w}" ?ẉ) + ("\\d{y}" ?ỵ) + ("\\d{z}" ?ẓ) + ("\\rq" ?’) + ("\\u" ?̆) + ("\\v" ?ÌŒ) + ("\\v{L}" ?Ľ) + ("\\v{i}" ?Ç) + ("\\v{j}" ?Ç°) + ("\\v{l}" ?ľ) + ("\\yen" ?Â¥) + + ("\\Box" ?â–¡) + ("\\Bumpeq" ?≎) + ("\\Cap" ?â‹’) + ("\\Cup" ?â‹“) + ("\\Delta" ?Δ) + ("\\Diamond" ?â—‡) + ("\\Downarrow" ?⇓) + ("\\Gamma" ?Γ) + ("\\H" ?Ì‹) + ("\\H{o}" ?Å‘) + ("\\Im" ?â„‘) + ("\\Join" ?⋈) + ("\\Lambda" ?Λ) + ("\\Leftarrow" ?â‡) + ("\\Leftrightarrow" ?⇔) + ("\\Ll" ?⋘) + ("\\Lleftarrow" ?⇚) + ("\\Longleftarrow" ?â‡) + ("\\Longleftrightarrow" ?⇔) + ("\\Longrightarrow" ?⇒) + ("\\Lsh" ?↰) + ("\\Omega" ?Ω) + ("\\Phi" ?Φ) + ("\\Pi" ?Î ) + ("\\Psi" ?Ψ) + ("\\Re" ?â„œ) + ("\\Rightarrow" ?⇒) + ("\\Rrightarrow" ?⇛) + ("\\Rsh" ?↱) + ("\\Sigma" ?Σ) + ("\\Subset" ?â‹) + ("\\Supset" ?â‹‘) + ("\\Theta" ?Θ) + ("\\Uparrow" ?⇑) + ("\\Updownarrow" ?⇕) + ("\\Upsilon" ?Î¥) + ("\\Vdash" ?⊩) + ("\\Vert" ?‖) + ("\\Vvdash" ?⊪) + ("\\Xi" ?Ξ) + ("\\aleph" ?×) + ("\\alpha" ?α) + ("\\amalg" ?âˆ) + ("\\angle" ?∠) + ("\\approx" ?≈) + ("\\approxeq" ?≊) + ("\\ast" ?∗) + ("\\asymp" ?â‰) + ("\\backcong" ?≌) + ("\\backepsilon" ?âˆ) + ("\\backprime" ?‵) + ("\\backsim" ?∽) + ("\\backsimeq" ?â‹) ("\\backslash" ?\\) - ("\\barwedge" ?$,1y|(B) - ("\\because" ?$,1xU(B) - ("\\beta" ?$,1'2(B) - ("\\beth" ?$,1,q(B) - ("\\between" ?$,1y,(B) - ("\\bigcap" ?$,1z"(B) - ("\\bigcirc" ?$,2"O(B) - ("\\bigcup" ?$,1z#(B) - ("\\bigstar" ?$,2"e(B) - ("\\bigtriangledown" ?$,2!}(B) - ("\\bigtriangleup" ?$,2!s(B) - ("\\bigvee" ?$,1z!(B) - ("\\bigwedge" ?$,1z (B) - ("\\blacklozenge" ?$,2%f(B) - ("\\blacksquare" ?$,2!j(B) - ("\\blacktriangle" ?$,2!t(B) - ("\\blacktriangledown" ?$,2!~(B) - ("\\blacktriangleleft" ?$,2""(B) - ("\\blacktriangleright" ?$,2!x(B) - ("\\bot" ?$,1ye(B) - ("\\bowtie" ?$,1z((B) - ("\\boxminus" ?$,1y_(B) - ("\\boxplus" ?$,1y^(B) - ("\\boxtimes" ?$,1y`(B) - ("\\bullet" ?$,1s"(B) - ("\\bumpeq" ?$,1xo(B) - ("\\cap" ?$,1xI(B) - ("\\cdots" ?$,1zO(B) - ("\\centerdot" ?,A7(B) - ("\\checkmark" ?$,2%S(B) - ("\\chi" ?$,1'G(B) - ("\\circ" ?$,2"+(B) - ("\\circeq" ?$,1xw(B) - ("\\circlearrowleft" ?$,1w:(B) - ("\\circlearrowright" ?$,1w;(B) - ("\\circledR" ?,A.(B) - ("\\circledS" ?$,1H(B) - ("\\circledast" ?$,1y[(B) - ("\\circledcirc" ?$,1yZ(B) - ("\\circleddash" ?$,1y](B) - ("\\clubsuit" ?$,2#c(B) + ("\\barwedge" ?⊼) + ("\\because" ?∵) + ("\\beta" ?β) + ("\\beth" ?ב) + ("\\between" ?≬) + ("\\bigcap" ?â‹‚) + ("\\bigcirc" ?â—¯) + ("\\bigcup" ?⋃) + ("\\bigstar" ?★) + ("\\bigtriangledown" ?â–½) + ("\\bigtriangleup" ?â–³) + ("\\bigvee" ?â‹) + ("\\bigwedge" ?â‹€) + ("\\blacklozenge" ?✦) + ("\\blacksquare" ?â–ª) + ("\\blacktriangle" ?â–´) + ("\\blacktriangledown" ?â–¾) + ("\\blacktriangleleft" ?â—‚) + ("\\blacktriangleright" ?â–¸) + ("\\bot" ?⊥) + ("\\bowtie" ?⋈) + ("\\boxminus" ?⊟) + ("\\boxplus" ?⊞) + ("\\boxtimes" ?⊠) + ("\\bullet" ?•) + ("\\bumpeq" ?â‰) + ("\\cap" ?∩) + ("\\cdots" ?⋯) + ("\\centerdot" ?·) + ("\\checkmark" ?✓) + ("\\chi" ?χ) + ("\\circ" ?â—‹) + ("\\circeq" ?≗) + ("\\circlearrowleft" ?↺) + ("\\circlearrowright" ?↻) + ("\\circledR" ?®) + ("\\circledS" ?Ⓢ) + ("\\circledast" ?⊛) + ("\\circledcirc" ?⊚) + ("\\circleddash" ?âŠ) + ("\\clubsuit" ?♣) ("\\colon" ?:) - ("\\coloneq" ?$,1xt(B) - ("\\complement" ?$,1x!(B) - ("\\cong" ?$,1xe(B) - ("\\coprod" ?$,1x0(B) - ("\\cup" ?$,1xJ(B) - ("\\curlyeqprec" ?$,1z>(B) - ("\\curlyeqsucc" ?$,1z?(B) - ("\\curlypreceq" ?$,1y<(B) - ("\\curlyvee" ?$,1z.(B) - ("\\curlywedge" ?$,1z/(B) - ("\\curvearrowleft" ?$,1w6(B) - ("\\curvearrowright" ?$,1w7(B) - - ("\\dag" ?$,1s (B) - ("\\dagger" ?$,1s (B) - ("\\daleth" ?$,1,s(B) - ("\\dashv" ?$,1yc(B) - ("\\ddag" ?$,1s!(B) - ("\\ddagger" ?$,1s!(B) - ("\\ddots" ?$,1zQ(B) - ("\\delta" ?$,1'4(B) - ("\\diamond" ?$,1z$(B) - ("\\diamondsuit" ?$,2#b(B) - ("\\digamma" ?$,1'\(B) - ("\\divideontimes" ?$,1z'(B) - ("\\doteq" ?$,1xp(B) - ("\\doteqdot" ?$,1xq(B) - ("\\dotplus" ?$,1x4(B) - ("\\dotsquare" ?$,1ya(B) - ("\\downarrow" ?$,1vs(B) - ("\\downdownarrows" ?$,1wJ(B) - ("\\downleftharpoon" ?$,1wC(B) - ("\\downrightharpoon" ?$,1wB(B) - ("\\ell" ?$,1uS(B) - ("\\emptyset" ?$,1x%(B) - ("\\epsilon" ?$,1'5(B) - ("\\eqcirc" ?$,1xv(B) - ("\\eqcolon" ?$,1xu(B) - ("\\eqslantgtr" ?$,1z=(B) - ("\\eqslantless" ?$,1z<(B) - ("\\equiv" ?$,1y!(B) - ("\\eta" ?$,1'7(B) - ("\\euro" ?$,1tL(B) - ("\\exists" ?$,1x#(B) - ("\\fallingdotseq" ?$,1xr(B) - ("\\flat" ?$,2#m(B) - ("\\forall" ?$,1x (B) - ("\\frac1" ?$,1v?(B) - ("\\frac12" ?,A=(B) - ("\\frac13" ?$,1v3(B) - ("\\frac14" ?,A<(B) - ("\\frac15" ?$,1v5(B) - ("\\frac16" ?$,1v9(B) - ("\\frac18" ?$,1v;(B) - ("\\frac23" ?$,1v4(B) - ("\\frac25" ?$,1v6(B) - ("\\frac34" ?,A>(B) - ("\\frac35" ?$,1v7(B) - ("\\frac38" ?$,1v<(B) - ("\\frac45" ?$,1v8(B) - ("\\frac56" ?$,1v:(B) - ("\\frac58" ?$,1v=(B) - ("\\frac78" ?$,1v>(B) - ("\\frown" ?$,1{"(B) - ("\\gamma" ?$,1'3(B) - ("\\ge" ?$,1y%(B) - ("\\geq" ?$,1y%(B) - ("\\geqq" ?$,1y'(B) - ("\\geqslant" ?$,1y%(B) - ("\\gets" ?$,1vp(B) - ("\\gg" ?$,1y+(B) - ("\\ggg" ?$,1z9(B) - ("\\gimel" ?$,1,r(B) - ("\\gnapprox" ?$,1zG(B) - ("\\gneq" ?$,1y)(B) - ("\\gneqq" ?$,1y)(B) - ("\\gnsim" ?$,1zG(B) - ("\\gtrapprox" ?$,1y3(B) - ("\\gtrdot" ?$,1z7(B) - ("\\gtreqless" ?$,1z;(B) - ("\\gtreqqless" ?$,1z;(B) - ("\\gtrless" ?$,1y7(B) - ("\\gtrsim" ?$,1y3(B) - ("\\gvertneqq" ?$,1y)(B) - ("\\hbar" ?$,1uO(B) - ("\\heartsuit" ?$,2#e(B) - ("\\hookleftarrow" ?$,1w)(B) - ("\\hookrightarrow" ?$,1w*(B) - ("\\iff" ?$,1wT(B) - ("\\imath" ?$,1 Q(B) - ("\\in" ?$,1x((B) - ("\\infty" ?$,1x>(B) - ("\\int" ?$,1xK(B) - ("\\intercal" ?$,1yz(B) - ("\\iota" ?$,1'9(B) - ("\\kappa" ?$,1':(B) - ("\\lambda" ?$,1';(B) - ("\\langle" ?$,1{)(B) + ("\\coloneq" ?≔) + ("\\complement" ?âˆ) + ("\\cong" ?≅) + ("\\coprod" ?âˆ) + ("\\cup" ?∪) + ("\\curlyeqprec" ?â‹ž) + ("\\curlyeqsucc" ?â‹Ÿ) + ("\\curlypreceq" ?≼) + ("\\curlyvee" ?â‹Ž) + ("\\curlywedge" ?â‹) + ("\\curvearrowleft" ?↶) + ("\\curvearrowright" ?↷) + + ("\\dag" ?†) + ("\\dagger" ?†) + ("\\daleth" ?ד) + ("\\dashv" ?⊣) + ("\\ddag" ?‡) + ("\\ddagger" ?‡) + ("\\ddots" ?⋱) + ("\\delta" ?δ) + ("\\diamond" ?â‹„) + ("\\diamondsuit" ?♢) + ("\\digamma" ?Ïœ) + ("\\divideontimes" ?⋇) + ("\\doteq" ?â‰) + ("\\doteqdot" ?≑) + ("\\dotplus" ?∔) + ("\\dotsquare" ?⊡) + ("\\downarrow" ?↓) + ("\\downdownarrows" ?⇊) + ("\\downleftharpoon" ?⇃) + ("\\downrightharpoon" ?⇂) + ("\\ell" ?â„“) + ("\\emptyset" ?∅) + ("\\epsilon" ?ε) + ("\\eqcirc" ?≖) + ("\\eqcolon" ?≕) + ("\\eqslantgtr" ?â‹) + ("\\eqslantless" ?â‹œ) + ("\\equiv" ?≡) + ("\\eta" ?η) + ("\\euro" ?€) + ("\\exists" ?∃) + ("\\fallingdotseq" ?≒) + ("\\flat" ?â™) + ("\\forall" ?∀) + ("\\frac1" ?â…Ÿ) + ("\\frac12" ?½) + ("\\frac13" ?â…“) + ("\\frac14" ?¼) + ("\\frac15" ?â…•) + ("\\frac16" ?â…™) + ("\\frac18" ?â…›) + ("\\frac23" ?â…”) + ("\\frac25" ?â…–) + ("\\frac34" ?¾) + ("\\frac35" ?â…—) + ("\\frac38" ?â…œ) + ("\\frac45" ?â…˜) + ("\\frac56" ?â…š) + ("\\frac58" ?â…) + ("\\frac78" ?â…ž) + ("\\frown" ?⌢) + ("\\gamma" ?γ) + ("\\ge" ?≥) + ("\\geq" ?≥) + ("\\geqq" ?≧) + ("\\geqslant" ?≥) + ("\\gets" ?â†) + ("\\gg" ?≫) + ("\\ggg" ?â‹™) + ("\\gimel" ?×’) + ("\\gnapprox" ?⋧) + ("\\gneq" ?≩) + ("\\gneqq" ?≩) + ("\\gnsim" ?⋧) + ("\\gtrapprox" ?≳) + ("\\gtrdot" ?â‹—) + ("\\gtreqless" ?â‹›) + ("\\gtreqqless" ?â‹›) + ("\\gtrless" ?≷) + ("\\gtrsim" ?≳) + ("\\gvertneqq" ?≩) + ("\\hbar" ?â„) + ("\\heartsuit" ?♥) + ("\\hookleftarrow" ?↩) + ("\\hookrightarrow" ?↪) + ("\\iff" ?⇔) + ("\\imath" ?ı) + ("\\in" ?∈) + ("\\infty" ?∞) + ("\\int" ?∫) + ("\\intercal" ?⊺) + ("\\iota" ?ι) + ("\\kappa" ?κ) + ("\\lambda" ?λ) + ("\\langle" ?〈) ("\\lbrace" ?{) ("\\lbrack" ?[) - ("\\lceil" ?$,1zh(B) - ("\\ldots" ?$,1s&(B) - ("\\le" ?$,1y$(B) - ("\\leadsto" ?$,1v}(B) - ("\\leftarrow" ?$,1vp(B) - ("\\leftarrowtail" ?$,1w"(B) - ("\\leftharpoondown" ?$,1w=(B) - ("\\leftharpoonup" ?$,1w<(B) - ("\\leftleftarrows" ?$,1wG(B) - ("\\leftparengtr" ?$,1{)(B) - ("\\leftrightarrow" ?$,1vt(B) - ("\\leftrightarrows" ?$,1wF(B) - ("\\leftrightharpoons" ?$,1wK(B) - ("\\leftrightsquigarrow" ?$,1w-(B) - ("\\leftthreetimes" ?$,1z+(B) - ("\\leq" ?$,1y$(B) - ("\\leqq" ?$,1y&(B) - ("\\leqslant" ?$,1y$(B) - ("\\lessapprox" ?$,1y2(B) - ("\\lessdot" ?$,1z6(B) - ("\\lesseqgtr" ?$,1z:(B) - ("\\lesseqqgtr" ?$,1z:(B) - ("\\lessgtr" ?$,1y6(B) - ("\\lesssim" ?$,1y2(B) - ("\\lfloor" ?$,1zj(B) - ("\\lhd" ?$,2"!(B) - ("\\rhd" ?$,2!w(B) - ("\\ll" ?$,1y*(B) - ("\\llcorner" ?$,1z~(B) - ("\\lnapprox" ?$,1zF(B) - ("\\lneq" ?$,1y((B) - ("\\lneqq" ?$,1y((B) - ("\\lnsim" ?$,1zF(B) - ("\\longleftarrow" ?$,1vp(B) - ("\\longleftrightarrow" ?$,1vt(B) - ("\\longmapsto" ?$,1w&(B) - ("\\longrightarrow" ?$,1vr(B) - ("\\looparrowleft" ?$,1w+(B) - ("\\looparrowright" ?$,1w,(B) - ("\\lozenge" ?$,2%g(B) - ("\\lq" ?$,1rx(B) - ("\\lrcorner" ?$,1z(B) - ("\\ltimes" ?$,1z)(B) - ("\\lvertneqq" ?$,1y((B) - ("\\maltese" ?$,2%`(B) - ("\\mapsto" ?$,1w&(B) - ("\\measuredangle" ?$,1xA(B) - ("\\mho" ?$,1ug(B) - ("\\mid" ?$,1xC(B) - ("\\models" ?$,1yg(B) - ("\\mp" ?$,1x3(B) - ("\\multimap" ?$,1yx(B) - ("\\nLeftarrow" ?$,1wM(B) - ("\\nLeftrightarrow" ?$,1wN(B) - ("\\nRightarrow" ?$,1wO(B) - ("\\nVDash" ?$,1yo(B) - ("\\nVdash" ?$,1yn(B) - ("\\nabla" ?$,1x'(B) - ("\\napprox" ?$,1xi(B) - ("\\natural" ?$,2#n(B) - ("\\ncong" ?$,1xg(B) - ("\\ne" ?$,1y (B) - ("\\nearrow" ?$,1vw(B) - ("\\neg" ?,A,(B) - ("\\neq" ?$,1y (B) - ("\\nequiv" ?$,1y"(B) - ("\\newline" ?$,1s((B) - ("\\nexists" ?$,1x$(B) - ("\\ngeq" ?$,1y1(B) - ("\\ngeqq" ?$,1y1(B) - ("\\ngeqslant" ?$,1y1(B) - ("\\ngtr" ?$,1y/(B) - ("\\ni" ?$,1x+(B) - ("\\nleftarrow" ?$,1vz(B) - ("\\nleftrightarrow" ?$,1w.(B) - ("\\nleq" ?$,1y0(B) - ("\\nleqq" ?$,1y0(B) - ("\\nleqslant" ?$,1y0(B) - ("\\nless" ?$,1y.(B) - ("\\nmid" ?$,1xD(B) - ("\\not" ?$,1%x(B) - ("\\notin" ?$,1x)(B) - ("\\nparallel" ?$,1xF(B) - ("\\nprec" ?$,1y@(B) - ("\\npreceq" ?$,1z@(B) - ("\\nrightarrow" ?$,1v{(B) - ("\\nshortmid" ?$,1xD(B) - ("\\nshortparallel" ?$,1xF(B) - ("\\nsim" ?$,1xa(B) - ("\\nsimeq" ?$,1xd(B) - ("\\nsubset" ?$,1yD(B) - ("\\nsubseteq" ?$,1yH(B) - ("\\nsubseteqq" ?$,1yH(B) - ("\\nsucc" ?$,1yA(B) - ("\\nsucceq" ?$,1zA(B) - ("\\nsupset" ?$,1yE(B) - ("\\nsupseteq" ?$,1yI(B) - ("\\nsupseteqq" ?$,1yI(B) - ("\\ntriangleleft" ?$,1zJ(B) - ("\\ntrianglelefteq" ?$,1zL(B) - ("\\ntriangleright" ?$,1zK(B) - ("\\ntrianglerighteq" ?$,1zM(B) - ("\\nu" ?$,1'=(B) - ("\\nvDash" ?$,1ym(B) - ("\\nvdash" ?$,1yl(B) - ("\\nwarrow" ?$,1vv(B) - ("\\odot" ?$,1yY(B) - ("\\oint" ?$,1xN(B) - ("\\omega" ?$,1'I(B) - ("\\ominus" ?$,1yV(B) - ("\\oplus" ?$,1yU(B) - ("\\oslash" ?$,1yX(B) - ("\\otimes" ?$,1yW(B) - ("\\par" ?$,1s)(B) - ("\\parallel" ?$,1xE(B) - ("\\partial" ?$,1x"(B) - ("\\perp" ?$,1ye(B) - ("\\phi" ?$,1'F(B) - ("\\pi" ?$,1'@(B) - ("\\pitchfork" ?$,1z4(B) - ("\\prec" ?$,1y:(B) - ("\\precapprox" ?$,1y>(B) - ("\\preceq" ?$,1y<(B) - ("\\precnapprox" ?$,1zH(B) - ("\\precnsim" ?$,1zH(B) - ("\\precsim" ?$,1y>(B) - ("\\prime" ?$,1s2(B) - ("\\prod" ?$,1x/(B) - ("\\propto" ?$,1x=(B) - ("\\psi" ?$,1'H(B) - ("\\quad" ?$,1ra(B) - ("\\rangle" ?$,1{*(B) + ("\\lceil" ?⌈) + ("\\ldots" ?…) + ("\\le" ?≤) + ("\\leadsto" ?â†) + ("\\leftarrow" ?â†) + ("\\leftarrowtail" ?↢) + ("\\leftharpoondown" ?↽) + ("\\leftharpoonup" ?↼) + ("\\leftleftarrows" ?⇇) + ("\\leftparengtr" ?〈) + ("\\leftrightarrow" ?↔) + ("\\leftrightarrows" ?⇆) + ("\\leftrightharpoons" ?⇋) + ("\\leftrightsquigarrow" ?â†) + ("\\leftthreetimes" ?â‹‹) + ("\\leq" ?≤) + ("\\leqq" ?≦) + ("\\leqslant" ?≤) + ("\\lessapprox" ?≲) + ("\\lessdot" ?â‹–) + ("\\lesseqgtr" ?â‹š) + ("\\lesseqqgtr" ?â‹š) + ("\\lessgtr" ?≶) + ("\\lesssim" ?≲) + ("\\lfloor" ?⌊) + ("\\lhd" ?â—) + ("\\rhd" ?â–·) + ("\\ll" ?≪) + ("\\llcorner" ?⌞) + ("\\lnapprox" ?⋦) + ("\\lneq" ?≨) + ("\\lneqq" ?≨) + ("\\lnsim" ?⋦) + ("\\longleftarrow" ?â†) + ("\\longleftrightarrow" ?↔) + ("\\longmapsto" ?↦) + ("\\longrightarrow" ?→) + ("\\looparrowleft" ?↫) + ("\\looparrowright" ?↬) + ("\\lozenge" ?✧) + ("\\lq" ?‘) + ("\\lrcorner" ?⌟) + ("\\ltimes" ?⋉) + ("\\lvertneqq" ?≨) + ("\\maltese" ?✠) + ("\\mapsto" ?↦) + ("\\measuredangle" ?∡) + ("\\mho" ?℧) + ("\\mid" ?∣) + ("\\models" ?⊧) + ("\\mp" ?∓) + ("\\multimap" ?⊸) + ("\\nLeftarrow" ?â‡) + ("\\nLeftrightarrow" ?⇎) + ("\\nRightarrow" ?â‡) + ("\\nVDash" ?⊯) + ("\\nVdash" ?⊮) + ("\\nabla" ?∇) + ("\\napprox" ?≉) + ("\\natural" ?â™®) + ("\\ncong" ?≇) + ("\\ne" ?≠) + ("\\nearrow" ?↗) + ("\\neg" ?¬) + ("\\neq" ?≠) + ("\\nequiv" ?≢) + ("\\newline" ?
) + ("\\nexists" ?∄) + ("\\ngeq" ?≱) + ("\\ngeqq" ?≱) + ("\\ngeqslant" ?≱) + ("\\ngtr" ?≯) + ("\\ni" ?∋) + ("\\nleftarrow" ?↚) + ("\\nleftrightarrow" ?↮) + ("\\nleq" ?≰) + ("\\nleqq" ?≰) + ("\\nleqslant" ?≰) + ("\\nless" ?≮) + ("\\nmid" ?∤) + ("\\not" ?̸) + ("\\notin" ?∉) + ("\\nparallel" ?∦) + ("\\nprec" ?⊀) + ("\\npreceq" ?â‹ ) + ("\\nrightarrow" ?↛) + ("\\nshortmid" ?∤) + ("\\nshortparallel" ?∦) + ("\\nsim" ?â‰) + ("\\nsimeq" ?≄) + ("\\nsubset" ?⊄) + ("\\nsubseteq" ?⊈) + ("\\nsubseteqq" ?⊈) + ("\\nsucc" ?âŠ) + ("\\nsucceq" ?â‹¡) + ("\\nsupset" ?⊅) + ("\\nsupseteq" ?⊉) + ("\\nsupseteqq" ?⊉) + ("\\ntriangleleft" ?⋪) + ("\\ntrianglelefteq" ?⋬) + ("\\ntriangleright" ?â‹«) + ("\\ntrianglerighteq" ?â‹) + ("\\nu" ?ν) + ("\\nvDash" ?âŠ) + ("\\nvdash" ?⊬) + ("\\nwarrow" ?↖) + ("\\odot" ?⊙) + ("\\oint" ?∮) + ("\\omega" ?ω) + ("\\ominus" ?⊖) + ("\\oplus" ?⊕) + ("\\oslash" ?⊘) + ("\\otimes" ?⊗) + ("\\par" ?
) + ("\\parallel" ?∥) + ("\\partial" ?∂) + ("\\perp" ?⊥) + ("\\phi" ?φ) + ("\\pi" ?Ï€) + ("\\pitchfork" ?â‹”) + ("\\prec" ?≺) + ("\\precapprox" ?≾) + ("\\preceq" ?≼) + ("\\precnapprox" ?⋨) + ("\\precnsim" ?⋨) + ("\\precsim" ?≾) + ("\\prime" ?′) + ("\\prod" ?âˆ) + ("\\propto" ?âˆ) + ("\\psi" ?ψ) + ("\\quad" ?â€) + ("\\rangle" ?〉) ("\\rbrace" ?}) ("\\rbrack" ?]) - ("\\rceil" ?$,1zi(B) - ("\\rfloor" ?$,1zk(B) - ("\\rightarrow" ?$,1vr(B) - ("\\rightarrowtail" ?$,1w#(B) - ("\\rightharpoondown" ?$,1wA(B) - ("\\rightharpoonup" ?$,1w@(B) - ("\\rightleftarrows" ?$,1wD(B) - ("\\rightleftharpoons" ?$,1wL(B) - ("\\rightparengtr" ?$,1{*(B) - ("\\rightrightarrows" ?$,1wI(B) - ("\\rightthreetimes" ?$,1z,(B) - ("\\risingdotseq" ?$,1xs(B) - ("\\rtimes" ?$,1z*(B) - ("\\sbs" ?$,3q((B) - ("\\searrow" ?$,1vx(B) - ("\\setminus" ?$,1x6(B) - ("\\sharp" ?$,2#o(B) - ("\\shortmid" ?$,1xC(B) - ("\\shortparallel" ?$,1xE(B) - ("\\sigma" ?$,1'C(B) - ("\\sim" ?$,1x\(B) - ("\\simeq" ?$,1xc(B) - ("\\smallamalg" ?$,1x0(B) - ("\\smallsetminus" ?$,1x6(B) - ("\\smallsmile" ?$,1{#(B) - ("\\smile" ?$,1{#(B) - ("\\spadesuit" ?$,2#`(B) - ("\\sphericalangle" ?$,1xB(B) - ("\\sqcap" ?$,1yS(B) - ("\\sqcup" ?$,1yT(B) - ("\\sqsubset" ?$,1yO(B) - ("\\sqsubseteq" ?$,1yQ(B) - ("\\sqsupset" ?$,1yP(B) - ("\\sqsupseteq" ?$,1yR(B) - ("\\square" ?$,2!a(B) - ("\\squigarrowright" ?$,1w](B) - ("\\star" ?$,1z&(B) - ("\\straightphi" ?$,1'F(B) - ("\\subset" ?$,1yB(B) - ("\\subseteq" ?$,1yF(B) - ("\\subseteqq" ?$,1yF(B) - ("\\subsetneq" ?$,1yJ(B) - ("\\subsetneqq" ?$,1yJ(B) - ("\\succ" ?$,1y;(B) - ("\\succapprox" ?$,1y?(B) - ("\\succcurlyeq" ?$,1y=(B) - ("\\succeq" ?$,1y=(B) - ("\\succnapprox" ?$,1zI(B) - ("\\succnsim" ?$,1zI(B) - ("\\succsim" ?$,1y?(B) - ("\\sum" ?$,1x1(B) - ("\\supset" ?$,1yC(B) - ("\\supseteq" ?$,1yG(B) - ("\\supseteqq" ?$,1yG(B) - ("\\supsetneq" ?$,1yK(B) - ("\\supsetneqq" ?$,1yK(B) - ("\\surd" ?$,1x:(B) - ("\\swarrow" ?$,1vy(B) - ("\\tau" ?$,1'D(B) - ("\\therefore" ?$,1xT(B) - ("\\theta" ?$,1'8(B) - ("\\thickapprox" ?$,1xh(B) - ("\\thicksim" ?$,1x\(B) - ("\\to" ?$,1vr(B) - ("\\top" ?$,1yd(B) - ("\\triangle" ?$,2!u(B) - ("\\triangledown" ?$,2!(B) - ("\\triangleleft" ?$,2"#(B) - ("\\trianglelefteq" ?$,1yt(B) - ("\\triangleq" ?$,1x|(B) - ("\\triangleright" ?$,2!y(B) - ("\\trianglerighteq" ?$,1yu(B) - ("\\twoheadleftarrow" ?$,1v~(B) - ("\\twoheadrightarrow" ?$,1w (B) - ("\\ulcorner" ?$,1z|(B) - ("\\uparrow" ?$,1vq(B) - ("\\updownarrow" ?$,1vu(B) - ("\\upleftharpoon" ?$,1w?(B) - ("\\uplus" ?$,1yN(B) - ("\\uprightharpoon" ?$,1w>(B) - ("\\upsilon" ?$,1'E(B) - ("\\upuparrows" ?$,1wH(B) - ("\\urcorner" ?$,1z}(B) - ("\\u{i}" ?$,1 M(B) - ("\\vDash" ?$,1yh(B) - ("\\varkappa" ?$,1'p(B) - ("\\varphi" ?$,1'U(B) - ("\\varpi" ?$,1'V(B) - ("\\varprime" ?$,1s2(B) - ("\\varpropto" ?$,1x=(B) - ("\\varrho" ?$,1'q(B) - ("\\varsigma" ?$,1'B(B) - ("\\vartheta" ?$,1'Q(B) - ("\\vartriangleleft" ?$,1yr(B) - ("\\vartriangleright" ?$,1ys(B) - ("\\vdash" ?$,1yb(B) - ("\\vdots" ?$,1zN(B) - ("\\vee" ?$,1xH(B) - ("\\veebar" ?$,1y{(B) + ("\\rceil" ?⌉) + ("\\rfloor" ?⌋) + ("\\rightarrow" ?→) + ("\\rightarrowtail" ?↣) + ("\\rightharpoondown" ?â‡) + ("\\rightharpoonup" ?⇀) + ("\\rightleftarrows" ?⇄) + ("\\rightleftharpoons" ?⇌) + ("\\rightparengtr" ?〉) + ("\\rightrightarrows" ?⇉) + ("\\rightthreetimes" ?â‹Œ) + ("\\risingdotseq" ?≓) + ("\\rtimes" ?â‹Š) + ("\\sbs" ?﹨) + ("\\searrow" ?↘) + ("\\setminus" ?∖) + ("\\sharp" ?♯) + ("\\shortmid" ?∣) + ("\\shortparallel" ?∥) + ("\\sigma" ?σ) + ("\\sim" ?∼) + ("\\simeq" ?≃) + ("\\smallamalg" ?âˆ) + ("\\smallsetminus" ?∖) + ("\\smallsmile" ?⌣) + ("\\smile" ?⌣) + ("\\spadesuit" ?â™ ) + ("\\sphericalangle" ?∢) + ("\\sqcap" ?⊓) + ("\\sqcup" ?⊔) + ("\\sqsubset" ?âŠ) + ("\\sqsubseteq" ?⊑) + ("\\sqsupset" ?âŠ) + ("\\sqsupseteq" ?⊒) + ("\\square" ?â–¡) + ("\\squigarrowright" ?â‡) + ("\\star" ?⋆) + ("\\straightphi" ?φ) + ("\\subset" ?⊂) + ("\\subseteq" ?⊆) + ("\\subseteqq" ?⊆) + ("\\subsetneq" ?⊊) + ("\\subsetneqq" ?⊊) + ("\\succ" ?≻) + ("\\succapprox" ?≿) + ("\\succcurlyeq" ?≽) + ("\\succeq" ?≽) + ("\\succnapprox" ?â‹©) + ("\\succnsim" ?â‹©) + ("\\succsim" ?≿) + ("\\sum" ?∑) + ("\\supset" ?⊃) + ("\\supseteq" ?⊇) + ("\\supseteqq" ?⊇) + ("\\supsetneq" ?⊋) + ("\\supsetneqq" ?⊋) + ("\\surd" ?√) + ("\\swarrow" ?↙) + ("\\tau" ?Ï„) + ("\\therefore" ?∴) + ("\\theta" ?θ) + ("\\thickapprox" ?≈) + ("\\thicksim" ?∼) + ("\\to" ?→) + ("\\top" ?⊤) + ("\\triangle" ?â–µ) + ("\\triangledown" ?â–¿) + ("\\triangleleft" ?â—ƒ) + ("\\trianglelefteq" ?⊴) + ("\\triangleq" ?≜) + ("\\triangleright" ?â–¹) + ("\\trianglerighteq" ?⊵) + ("\\twoheadleftarrow" ?↞) + ("\\twoheadrightarrow" ?↠) + ("\\ulcorner" ?⌜) + ("\\uparrow" ?↑) + ("\\updownarrow" ?↕) + ("\\upleftharpoon" ?↿) + ("\\uplus" ?⊎) + ("\\uprightharpoon" ?↾) + ("\\upsilon" ?Ï…) + ("\\upuparrows" ?⇈) + ("\\urcorner" ?âŒ) + ("\\u{i}" ?Ä) + ("\\vDash" ?⊨) + ("\\varkappa" ?Ï°) + ("\\varphi" ?Ï•) + ("\\varpi" ?Ï–) + ("\\varprime" ?′) + ("\\varpropto" ?âˆ) + ("\\varrho" ?ϱ) + ("\\varsigma" ?Ï‚) + ("\\vartheta" ?Ï‘) + ("\\vartriangleleft" ?⊲) + ("\\vartriangleright" ?⊳) + ("\\vdash" ?⊢) + ("\\vdots" ?â‹®) + ("\\vee" ?∨) + ("\\veebar" ?⊻) ("\\vert" ?|) - ("\\wedge" ?$,1xG(B) - ("\\wp" ?$,1uX(B) - ("\\wr" ?$,1x`(B) - ("\\xi" ?$,1'>(B) - ("\\zeta" ?$,1'6(B) - - ("\\Bbb{N}" ?$,1uU(B) ; AMS commands for blackboard bold - ("\\Bbb{P}" ?$,1uY(B) ; Also sometimes \mathbb. - ("\\Bbb{R}" ?$,1u](B) - ("\\Bbb{Z}" ?$,1ud(B) - ("--" ?$,1rs(B) - ("---" ?$,1rt(B) - ("~" ?,A (B) ; nbsp - ("\\mu" ?$,1'<(B) - ("\\rho" ?$,1'A(B) - ("\\mathscr{I}" ?$,1uP(B) ; moment of inertia - ("\\Smiley" ?$,2#:(B) - ("\\blacksmiley" ?$,2#;(B) - ("\\Frowny" ?$,2#9(B) - ("\\Letter" ?$,2%I(B) - ("\\permil" ?$,1s0(B) -;;; Probably not useful enough: -;;; ("\\Telefon" ?$,2"n(B) ; there are other possibilities -;;; ("\\Radioactivity" ?$,2#"(B) -;;; ("\Biohazard" ?$,2##(B) -;;; ("\\Male" ?$,2#B(B) -;;; ("\\Female" ?$,2#@(B) -;;; ("\\Lightning" ?$,2"g(B) -;;; ("\\Mercury" ?$,2#?(B) -;;; ("\\Earth" ?$,2#A(B) -;;; ("\\Jupiter" ?$,2#C(B) -;;; ("\\Saturn" ?$,2#D(B) -;;; ("\\Uranus" ?$,2#E(B) -;;; ("\\Neptune" ?$,2#F(B) -;;; ("\\Pluto" ?$,2#G(B) -;;; ("\\Sun" ?$,2"i(B) -;;; ("\\Writinghand" ?$,2%M(B) -;;; ("\\\\Yinyang" ?$,2#/(B) -;;; ("\\Heart" ?$,2#a(B) - ("\\registered" ?,A.(B) - ("\\currency" ?,A$(B) - ("\\dh" ?,Ap(B) - ("\\DH" ?,AP(B) - ("\\th" ?,A~(B) - ("\\TH" ?,A^(B) - ("\\micro" ?,A5(B) - ("\\lnot" ?,A,(B) - ("\\ordfeminine" ?,A*(B) - ("\\ordmasculine" ?,A:(B) - ("\\lambdabar" ?$,1![(B) - ("\\celsius" ?$,1uC(B) + ("\\wedge" ?∧) + ("\\wp" ?℘) + ("\\wr" ?≀) + ("\\xi" ?ξ) + ("\\zeta" ?ζ) + + ("\\Bbb{N}" ?â„•) ; AMS commands for blackboard bold + ("\\Bbb{P}" ?â„™) ; Also sometimes \mathbb. + ("\\Bbb{R}" ?â„) + ("\\Bbb{Z}" ?ℤ) + ("--" ?–) + ("---" ?—) + ("~" ? ) ; nbsp + ("\\mu" ?μ) + ("\\rho" ?Ï) + ("\\mathscr{I}" ?â„) ; moment of inertia + ("\\Smiley" ?☺) + ("\\blacksmiley" ?☻) + ("\\Frowny" ?☹) + ("\\Letter" ?✉) + ("\\permil" ?‰) +;;; Probably not useful enough: +;;; ("\\Telefon" ?☎) ; there are other possibilities +;;; ("\\Radioactivity" ?☢) +;;; ("\Biohazard" ?☣) +;;; ("\\Male" ?♂) +;;; ("\\Female" ?♀) +;;; ("\\Lightning" ?☇) +;;; ("\\Mercury" ?☿) +;;; ("\\Earth" ?â™) +;;; ("\\Jupiter" ?♃) +;;; ("\\Saturn" ?♄) +;;; ("\\Uranus" ?â™…) +;;; ("\\Neptune" ?♆) +;;; ("\\Pluto" ?♇) +;;; ("\\Sun" ?☉) +;;; ("\\Writinghand" ?âœ) +;;; ("\\\\Yinyang" ?☯) +;;; ("\\Heart" ?♡) + ("\\registered" ?®) + ("\\currency" ?¤) + ("\\dh" ?ð) + ("\\DH" ?Ã) + ("\\th" ?þ) + ("\\TH" ?Þ) + ("\\micro" ?µ) + ("\\lnot" ?¬) + ("\\ordfeminine" ?ª) + ("\\ordmasculine" ?º) + ("\\lambdabar" ?Æ›) + ("\\celsius" ?℃) ;; by analogy with lq, rq: - ("\\ldq" ?\$,1r|(B) - ("\\rdq" ?\$,1r}(B) - ("\\minus" ?$,1x2(B) - ("\\defs" ?$,1xy(B) ; per fuzz/zed -;; ("\\sqrt[3]" ?$,1x;(B) - ("\\llbracket" ?\$,2=Z(B) ; stmaryrd - ("\\rrbracket" ?\$,2=[(B) -;; ("\\lbag" ?\$,2=Z(B) ; fuzz -;; ("\\rbag" ?\$,2=[(B) - ("\\ldata" ?\$,2=J(B) ; fuzz/zed - ("\\rdata" ?\$,2=K(B) + ("\\ldq" ?\“) + ("\\rdq" ?\â€) + ("\\minus" ?−) + ("\\defs" ?≙) ; per fuzz/zed +;; ("\\sqrt[3]" ?∛) + ("\\llbracket" ?\〚) ; stmaryrd + ("\\rrbracket" ?\〛) +;; ("\\lbag" ?\〚) ; fuzz +;; ("\\rbag" ?\〛) + ("\\ldata" ?\《) ; fuzz/zed + ("\\rdata" ?\》) + ;; From Karl Eichwalder. + ("\\glq" ?‚) + ("\\grq" ?‘) + ("\\glqq" ?„) ("\\\"`" ?„) + ("\\grqq" ?“) ("\\\"'" ?“) + ("\\flq" ?‹) + ("\\frq" ?›) + ("\\flqq" ?\«) ("\\\"<" ?\«) + ("\\frqq" ?\») ("\\\">" ?\») ) -;;; arch-tag: 3daae613-2c53-446e-a0a1-ee2e1ebed15f +;; arch-tag: 3daae613-2c53-446e-a0a1-ee2e1ebed15f ;;; latin-ltx.el ends here diff --git a/leim/quail/sisheng.el b/leim/quail/sisheng.el new file mode 100644 index 00000000000..ea65646e078 --- /dev/null +++ b/leim/quail/sisheng.el @@ -0,0 +1,292 @@ +;;; sisheng.el --- sisheng input method for Chinese pinyin transliteration + +;; Copyright (C) 2004 Free Software Foundation, Inc. + +;; Author: Werner LEMBERG <wl@gnu.org> + +;; Keywords: multilingual, input method, Chinese, pinyin, sisheng + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + +;;; Commentary: + +;;; Code: + +(require 'quail) + +(defconst sisheng-regexp + "[ÄÄ“Ä«ÅÅ«Ç–]\\|üē") + +;; First element is the key, +;; second element is the vowel used for the input sequence, +;; last four elements are the resulting tones. +;; +(defconst sisheng-vowel-table + '(("Ä" "a" "Ä" "á" "ÇŽ" "à ") + ("Ä“" "e" "Ä“" "é" "Ä›" "è") + ("Ä«" "i" "Ä«" "Ã" "Ç" "ì") + ("Å" "o" "Å" "ó" "Ç’" "ò") + ("Å«" "u" "Å«" "ú" "Ç”" "ù") + ("Ç–" "v" "Ç–" "ǘ" "Çš" "Çœ") + ("üē" "ve" "üē" "üé" "üě" "üè"))) + + +;; All possible syllables in Mandarin Chinese, presented in the first +;; tone. Note that make-sisheng-rules always constructs rules for all +;; four tones even if some of those tones aren't used in Mandarin. +;; +(defconst sisheng-syllable-table + '("Ä" "Äi" "Än" "Äng" "Äo" + + "bÄ" "bÄi" "bÄn" "bÄng" "bÄo" + "bÄ“i" "bÄ“n" "bÄ“ng" + "bÄ«" "biÄn" "biÄo" "biÄ“" "bÄ«n" "bÄ«ng" + "bÅ" + "bÅ«" + + "cÄ" "cÄi" "cÄn" "cÄng" "cÄo" + "cÄ“" "cÄ“n" "cÄ“ng" + "cÄ«" + "cÅng" "cÅu" + "cÅ«" "cuÄn" "cuÄ«" "cÅ«n" "cuÅ" + + "chÄ" "chÄi" "chÄn" "chÄng" "chÄo" + "chÄ“" "chÄ“n" "chÄ“ng" + "chÄ«" + "chÅng" "chÅu" + "chÅ«" "chuÄ" "chuÄi" "chuÄn" "chuÄng" "chuÄ«" "chÅ«n" "chuÅ" + + "dÄ" "dÄi" "dÄn" "dÄng" "dÄo" + "dÄ“" "dÄ“i" "dÄ“n" "dÄ“ng" + "dÄ«" "diÄn" "diÄo" "diÄ“" "dÄ«ng" "diÅ«" + "dÅng" "dÅu" + "dÅ«" "duÄn" "duÄ«" "dÅ«n" "duÅ" + + "Ä“" "Ä“i" "Ä“n" "Ä“ng" "Ä“r" + + "fÄ" "fÄn" "fÄng" + "fÄ“i" "fÄ“n" "fÄ“ng" + "fiÄo" + "fÅ" "fÅu" + "fÅ«" + + "gÄ" "gÄi" "gÄn" "gÄng" "gÄo" + "gÄ“" "gÄ“i" "gÄ“n" "gÄ“ng" + "gÅng" "gÅu" + "gÅ«" "guÄ" "guÄi" "guÄn" "guÄng" "guÄ«" "gÅ«n" "guÅ" + + "hÄ" "hÄi" "hÄn" "hÄng" "hÄo" + "hÄ“" "hÄ“i" "hÄ“n" "hÄ“ng" + "hÅng" "hÅu" + "hÅ«" "huÄ" "huÄi" "huÄn" "huÄng" "huÄ«" "hÅ«n" "huÅ" + + "jÄ«" "jiÄ" "jiÄn" "jiÄng" "jiÄo" "jiÄ“" "jÄ«n" "jÄ«ng" "jiÅng" "jiÅ«" + "jÅ«" "juÄn" "juÄ“" "jÅ«n" + + "kÄ" "kÄi" "kÄn" "kÄng" "kÄo" + "kÄ“" "kÄ“i" "kÄ“n" "kÄ“ng" + "kÅng" "kÅu" + "kÅ«" "kuÄ" "kuÄi" "kuÄn" "kuÄng" "kuÄ«" "kÅ«n" "kuÅ" + + "lÄ" "lÄi" "lÄn" "lÄng" "lÄo" + "lÄ“" "lÄ“i" "lÄ“ng" + "lÄ«" "liÄ" "liÄn" "liÄng" "liÄo" "liÄ“" "lÄ«n" "lÄ«ng" "liÅ«" + "lÅng" "lÅu" + "lÅ«" "luÄn" "lÅ«n" "luÅ" + "lÇ–" "lüē" + + "mÄ" "mÄi" "mÄn" "mÄng" "mÄo" + "mÄ“" "mÄ“i" "mÄ“n" "mÄ“ng" + "mÄ«" "miÄn" "miÄo" "miÄ“" "mÄ«n" "mÄ«ng" "miÅ«" + "mÅ" "mÅu" + "mÅ«" + + "nÄ" "nÄi" "nÄn" "nÄng" "nÄo" + "nÄ“" "nÄ“i" "nÄ“n" "nÄ“ng" + "nÄ«" "niÄn" "niÄng" "niÄo" "niÄ“" "nÄ«n" "nÄ«ng" "niÅ«" + "nÅng" "nÅu" + "nÅ«" "nuÄn" "nuÅ" + "nÇ–" "nüē" + + "Å" "Åu" + + "pÄ" "pÄi" "pÄn" "pÄng" "pÄo" + "pÄ“i" "pÄ“n" "pÄ“ng" + "pÄ«" "piÄn" "piÄo" "piÄ“" "pÄ«n" "pÄ«ng" + "pÅ" "pÅu" + "pÅ«" + + "qÄ«" "qiÄ" "qiÄn" "qiÄng" "qiÄo" "qiÄ“" "qÄ«n" "qÄ«ng" "qiÅng" "qiÅ«" + "qÅ«" "quÄn" "quÄ“" "qÅ«n" + + "rÄn" "rÄng" "rÄo" + "rÄ“" "rÄ“n" "rÄ“ng" + "rÄ«" + "rÅng" "rÅu" + "rÅ«" "ruÄ" "ruÄn" "ruÄ«" "rÅ«n" "ruÅ" + + "sÄ" "sÄi" "sÄn" "sÄng" "sÄo" + "sÄ“" "sÄ“n" "sÄ“ng" + "sÄ«" + "sÅng" "sÅu" + "sÅ«" "suÄn" "suÄ«" "sÅ«n" "suÅ" + + "shÄ" "shÄi" "shÄn" "shÄng" "shÄo" + "shÄ“" "shÄ“i" "shÄ“n" "shÄ“ng" + "shÄ«" + "shÅu" + "shÅ«" "shuÄ" "shuÄi" "shuÄn" "shuÄng" "shuÄ«" "shÅ«n" "shuÅ" + + "tÄ" "tÄi" "tÄn" "tÄng" "tÄo" + "tÄ“" "tÄ“i" "tÄ“ng" + "tÄ«" "tiÄn" "tiÄo" "tiÄ“" "tÄ«ng" + "tÅng" "tÅu" + "tÅ«" "tuÄn" "tuÄ«" "tÅ«n" "tuÅ" + + "wÄ" "wÄi" "wÄn" "wÄng" + "wÄ“i" "wÄ“n" "wÄ“ng" + "wÅ" + "wÅ«" + + "xÄ«" "xiÄ" "xiÄn" "xiÄng" "xiÄo" "xiÄ“" "xÄ«n" "xÄ«ng" "xiÅng" "xiÅ«" + "xÅ«" "xuÄn" "xuÄ“" "xÅ«n" + + "yÄ" "yÄn" "yÄng" "yÄo" + "yÄ“" + "yÄ«" "yÄ«n" "yÄ«ng" + "yÅ" "yÅng" "yÅu" + "yÅ«" "yuÄn" "yuÄ“" "yÅ«n" + + "zÄ" "zÄi" "zÄn" "zÄng" "zÄo" + "zÄ“" "zÄ“i" "zÄ“n" "zÄ“ng" + "zÄ«" + "zÅng" "zÅu" + "zÅ«" "zuÄn" "zuÄ«" "zÅ«n" "zuÅ" + + "zhÄ" "zhÄi" "zhÄn" "zhÄng" "zhÄo" + "zhÄ“" "zhÄ“i" "zhÄ“n" "zhÄ“ng" + "zhÄ«" + "zhÅng" "zhÅu" + "zhÅ«" "zhuÄ" "zhuÄi" "zhuÄn" "zhuÄng" "zhuÄ«" "zhÅ«n" "zhuÅ")) + +;; This function converts e.g. +;; +;; "zhuÅ" +;; +;; into +;; +;; (("zhuo4" ["zhuò"]) +;; ("zhuo3" ["zhuÇ’"]) +;; ("zhuo2" ["zhuó"]) +;; ("zhuo1" ["zhuÅ"])) +;; +(defun quail-make-sisheng-rules (syllable) + (let ((case-fold-search t) + vowel-match + vowel-list + input-vowel + base-key + key + value + key-value-list + (i 1)) + (string-match sisheng-regexp syllable) + (setq vowel-match (downcase (match-string 0 syllable))) + (setq vowel-list + (cdr (assoc-string vowel-match sisheng-vowel-table))) + (setq input-vowel (car vowel-list)) + (setq base-key (replace-match input-vowel nil nil syllable)) + (while (<= i 4) + (setq key (concat base-key (number-to-string i))) + (setq value (vector (replace-match (nth i vowel-list) nil nil syllable))) + (push (list key value) key-value-list) + (setq i (1+ i))) + key-value-list)) + +;; Set up sisheng input method. +;; +(quail-define-package + "chinese-sisheng" ; name + "Chinese" ; language + "Çš" ; title + t ; guidance + "SìshÄ“ng input method for pÄ«nyÄ«n transliteration of Chinese. + +Examples: shuang1 -> shuÄng + Lv3 -> LÇš + AN4 -> ÀN + +Use the fifth (unstressed) tone for syllables containing `ü' +without a tone mark. + +Example: nve5 -> nüe +" ; docstring + nil ; translation-keys + t ; forget-last-selection + nil ; deterministic + nil ; kbd-translate + nil ; show-layout + nil ; create-decode-map + nil ; maximum-shortest + nil ; overlay-plist + nil ; update-translation-function + nil ; conversion-keys + t ; simple + ) + +;; Call quail-make-sisheng-rules for all syllables in sisheng-syllable-table. +;; +(let ((case-table-save (current-case-table)) + sisheng-list) + (set-case-table (standard-case-table)) + (dolist (syllable sisheng-syllable-table) + (setq sisheng-list + (append (quail-make-sisheng-rules syllable) + sisheng-list))) + + (dolist (syllable sisheng-syllable-table) + (setq sisheng-list + (append (quail-make-sisheng-rules (upcase-initials syllable)) + sisheng-list))) + + (dolist (syllable sisheng-syllable-table) + (setq sisheng-list + (append (quail-make-sisheng-rules (upcase syllable)) + sisheng-list))) + + (eval `(quail-define-rules + ,@sisheng-list + + ("lv5" ["lü"]) + ("lve5" ["lüe"]) + ("nv5" ["nü"]) + ("nve5" ["nüe"]) + + ("Lv5" ["Lü"]) + ("Lve5" ["Lüe"]) + ("Nv5" ["Nü"]) + ("Nve5" ["Nüe"]) + + ("LV5" ["LÃœ"]) + ("LVE5" ["LÃœE"]) + ("NV5" ["NÃœ"]) + ("NVE5" ["NÃœE"]))) + (set-case-table case-table-save)) + +;; Local Variables: +;; coding: utf-8 +;; End: + +;;; arch-tag: 1fa6ba5f-6747-44bc-bf12-30628ad3e8ad diff --git a/lib-src/.arch-inventory b/lib-src/.arch-inventory new file mode 100644 index 00000000000..0e0621a8dc3 --- /dev/null +++ b/lib-src/.arch-inventory @@ -0,0 +1,10 @@ +# Ignore binaries +backup ^(test-distrib|make-docfile|profile|digest-doc|movemail|cvtmail|fakemail|yow|emacsserver|hexl|update-game-score|etags|ctags|emacsclient|b2m|ebrowse)$ + +# Building actually makes a copy/link of the source file +precious ^(ctags\.c)$ + +# Windows generates this +backup ^(DOC)$ + +# arch-tag: da33b3d6-170d-4fe5-9eb8-ed2753bc9b4f diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 75b3be839e1..9f3fcc13371 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog @@ -1,3 +1,59 @@ +2004-06-01 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in (obj): Add image.c. + +2004-05-10 Thien-Thi Nguyen <ttn@gnu.org> + + * test-distrib.c (main): For failing cases, exit with + `EXIT_FAILURE'. + +2004-05-08 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (lisp1, lisp2): Split lisp to avoid long + command-lines. + +2004-05-08 Thien-Thi Nguyen <ttn@gnu.org> + + * cvtmail.c: Throughout, replace 0 destined for `exit' arg + with `EXIT_SUCCESS'. Likewise, replace 1 with `EXIT_FAILURE'. + (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value. + + * ebrowse.c, emacsclient.c, fakemail.c, hexl.c, + * make-docfile.c, movemail.c, profile.c, sorted-doc.c, + * test-distrib.c, update-game-score.c, yow.c: Likewise. + +2004-05-08 Thien-Thi Nguyen <ttn@gnu.org> + + * Makefile.in (emacsclient${EXEEXT}): Use makefile var `version'. + +2004-05-07 Thien-Thi Nguyen <ttn@gnu.org> + + * b2m.c (GOOD, BAD): Delete macros. Throughout, + replace w/ `EXIT_SUCCESS' and `EXIT_FAILURE', respectively. + (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value. + + * etags.c: Likewise. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.nt: Remove. + +2004-04-26 Eli Zaretskii <eliz@gnu.org> + + * make-docfile.c (IS_DIRECTORY_SEP): New macro. + (put_filename): Remove unused variable len. Use IS_DIRECTORY_SEP + instead of a literal '/'. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-04-17 Paul Eggert <eggert@gnu.org> + + * rcs2log (Help): Clarify wording of the usage message. + Problem reported by Alan Mackenzie in + <http://mail.gnu.org/archive/html/bug-gnu-emacs/2004-04/msg00188.html>. + 2004-04-07 Stefan Monnier <monnier@iro.umontreal.ca> * make-docfile.c (xmalloc): Fix return type. diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in index 7868364148a..1d8c5e6c9ba 100644 --- a/lib-src/Makefile.in +++ b/lib-src/Makefile.in @@ -1,5 +1,5 @@ # Makefile for lib-src subdirectory in GNU Emacs. -# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003 +# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004 # Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -447,7 +447,7 @@ yow${EXEEXT}: ${srcdir}/yow.c ../src/epaths.h emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS) $(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \ - -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \ + -DVERSION="\"${version}\"" \ $(LOADLIBES) -o emacsclient hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h @@ -478,6 +478,3 @@ xveterm${EXEEXT}: ${srcdir}/emacstool.c $(CC) -o xveterm -DXVIEW -DTTERM ${ALL_CFLAGS} ${srcdir}/emacstool.c \ -lxview -lolgx -lX -I$(OPENWINHOME)/include -L$(OPENWINHOME)/lib \ $(LOADLIBES) - -/* arch-tag: cc40144d-fbd2-436b-9a22-dcb5b5b6a2af - (do not change this comment) */ diff --git a/lib-src/b2m.c b/lib-src/b2m.c index 5a1f9e85473..5bebe560e2a 100644 --- a/lib-src/b2m.c +++ b/lib-src/b2m.c @@ -39,15 +39,6 @@ #undef FALSE #define FALSE 0 -/* Exit codes for success and failure. */ -#ifdef VMS -#define GOOD 1 -#define BAD 0 -#else -#define GOOD 0 -#define BAD 1 -#endif - #define streq(s,t) (strcmp (s, t) == 0) #define strneq(s,t,n) (strncmp (s, t, n) == 0) @@ -124,18 +115,18 @@ main (argc, argv) case 'V': printf ("%s (GNU Emacs %s)\n", "b2m", VERSION); puts ("b2m is in the public domain."); - exit (GOOD); + exit (EXIT_SUCCESS); case 'h': fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname); - exit (GOOD); + exit (EXIT_SUCCESS); } } if (optind != argc) { fprintf (stderr, "Usage: %s <babylmailbox >unixmailbox\n", progname); - exit (GOOD); + exit (EXIT_SUCCESS); } labels_saved = printing = header = FALSE; @@ -191,7 +182,7 @@ main (argc, argv) puts (data.buffer); } - return 0; + return EXIT_SUCCESS; } @@ -298,8 +289,10 @@ fatal (message) char *message; { fprintf (stderr, "%s: %s\n", progname, message); - exit (BAD); + exit (EXIT_FAILURE); } /* arch-tag: 5a3ad2af-a802-408f-83cc-e7cf5e98653e (do not change this comment) */ + +/* b2m.c ends here */ diff --git a/lib-src/cvtmail.c b/lib-src/cvtmail.c index 28a4ae4c703..8992b3f9e80 100644 --- a/lib-src/cvtmail.c +++ b/lib-src/cvtmail.c @@ -119,7 +119,7 @@ main (argc, argv) } fclose (mddf); fclose (mfilef); - return 0; + return EXIT_SUCCESS; } void @@ -148,7 +148,7 @@ fatal (s1, s2) char *s1, *s2; { error (s1, s2); - exit (1); + exit (EXIT_FAILURE); } void @@ -157,7 +157,7 @@ sysfail (s) { fprintf (stderr, "cvtmail: "); perror (s); - exit (1); + exit (EXIT_FAILURE); } char * @@ -183,3 +183,5 @@ xrealloc (ptr, size) /* arch-tag: b93c25a9-9012-44f1-b78b-9cc7aed44a7a (do not change this comment) */ + +/* cvtmail.c ends here */ diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c index eeeb0eb3efd..4ad45d195f6 100644 --- a/lib-src/ebrowse.c +++ b/lib-src/ebrowse.c @@ -564,7 +564,7 @@ xmalloc (nbytes) if (p == NULL) { yyerror ("out of memory", NULL); - exit (1); + exit (EXIT_FAILURE); } return p; } @@ -581,7 +581,7 @@ xrealloc (p, sz) if (p == NULL) { yyerror ("out of memory", NULL); - exit (1); + exit (EXIT_FAILURE); } return p; } @@ -3671,7 +3671,7 @@ usage (error) int error; { puts (USAGE); - exit (error ? 1 : 0); + exit (error ? EXIT_FAILURE : EXIT_SUCCESS); } @@ -3688,7 +3688,7 @@ version () printf ("ebrowse %s\n", VERSION); puts ("Copyright (C) 1992-1999, 2000, 2001 Free Software Foundation, Inc."); puts ("This program is distributed under the same terms as Emacs."); - exit (0); + exit (EXIT_SUCCESS); } @@ -3925,7 +3925,7 @@ main (argc, argv) if (yyout == NULL) { yyerror ("cannot open output file `%s'", out_filename); - exit (1); + exit (EXIT_FAILURE); } } @@ -3970,11 +3970,10 @@ main (argc, argv) if (yyout != stdout) fclose (yyout); - return 0; + return EXIT_SUCCESS; } - -/* ebrowse.c ends here. */ - /* arch-tag: fc03b4bc-91a9-4c3d-b3b9-12a77fa86dd8 (do not change this comment) */ + +/* ebrowse.c ends here */ diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index c8b2596198f..0698691bf13 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -44,9 +44,6 @@ Boston, MA 02111-1307, USA. */ char *getenv (), *getwd (); char *getcwd (); -/* This is defined with -D from the compilation command, - which extracts it from ../lisp/version.el. */ - #ifndef VERSION #define VERSION "unspecified" #endif @@ -131,7 +128,7 @@ decode_options (argc, argv) case 'V': printf ("emacsclient %s\n", VERSION); - exit (0); + exit (EXIT_SUCCESS); break; case 'H': @@ -140,7 +137,7 @@ decode_options (argc, argv) default: fprintf (stderr, "Try `%s --help' for more information\n", progname); - exit (1); + exit (EXIT_FAILURE); break; } } @@ -166,7 +163,7 @@ The following OPTIONS are accepted:\n\ Editor to fallback to if the server is not running\n\ \n\ Report bugs to bug-gnu-emacs@gnu.org.\n", progname); - exit (0); + exit (EXIT_SUCCESS); } /* In NAME, insert a & before each &, each space, each newline, and @@ -221,7 +218,7 @@ xmalloc (size) if (result == NULL) { perror ("malloc"); - exit (1); + exit (EXIT_FAILURE); } return result; } @@ -243,7 +240,7 @@ fail (argc, argv) } else { - exit (1); + exit (EXIT_FAILURE); } } @@ -314,7 +311,7 @@ main (argc, argv) { fprintf (stderr, "%s: file name or argument required\n", progname); fprintf (stderr, "Try `%s --help' for more information\n", progname); - exit (1); + exit (EXIT_FAILURE); } /* @@ -356,7 +353,7 @@ main (argc, argv) { fprintf (stderr, "%s: socket-name %s too long", argv[0], socket_name); - exit (1); + exit (EXIT_FAILURE); } /* See if the socket exists, and if it's owned by us. */ @@ -391,7 +388,7 @@ main (argc, argv) { fprintf (stderr, "%s: socket-name %s too long", argv[0], socket_name); - exit (1); + exit (EXIT_FAILURE); } sock_status = socket_status (server.sun_path); @@ -522,13 +519,13 @@ To start the server in Emacs, type \"M-x server-start\".\n", } fprintf (out, " "); } - + fprintf (out, "\n"); fflush (out); /* Maybe wait for an answer. */ if (nowait) - return 0; + return EXIT_SUCCESS; if (!eval) { @@ -550,7 +547,7 @@ To start the server in Emacs, type \"M-x server-start\".\n", printf ("\n"); fflush (stdout); - return 0; + return EXIT_SUCCESS; } #endif /* HAVE_SOCKETS */ @@ -572,3 +569,5 @@ strerror (errnum) /* arch-tag: f39bb9c4-73eb-477e-896d-50832e2ca9a7 (do not change this comment) */ + +/* emacsclient.c ends here */ diff --git a/lib-src/etags.c b/lib-src/etags.c index e9fab1be3ee..829fc97fbfd 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -177,15 +177,6 @@ If you want regular expression support, you should delete this notice and # define CTAGS FALSE #endif -/* Exit codes for success and failure. */ -#ifdef VMS -# define GOOD 1 -# define BAD 0 -#else -# define GOOD 0 -# define BAD 1 -#endif - #define streq(s,t) (assert((s)!=NULL || (t)!=NULL), !strcmp (s, t)) #define strcaseeq(s,t) (assert((s)!=NULL && (t)!=NULL), !etags_strcasecmp (s, t)) #define strneq(s,t,n) (assert((s)!=NULL || (t)!=NULL), !strncmp (s, t, n)) @@ -830,7 +821,7 @@ print_version () puts ("Copyright (C) 2002 Free Software Foundation, Inc. and Ken Arnold"); puts ("This program is distributed under the same terms as Emacs"); - exit (GOOD); + exit (EXIT_SUCCESS); } static void @@ -849,7 +840,7 @@ print_help (argbuffer) } if (help_for_lang) - exit (GOOD); + exit (EXIT_SUCCESS); printf ("Usage: %s [options] [[regex-option ...] file-name] ...\n\ \n\ @@ -990,7 +981,7 @@ Relative ones are stored relative to the output file's directory.\n"); puts (""); puts ("Report bugs to bug-gnu-emacs@gnu.org"); - exit (GOOD); + exit (EXIT_SUCCESS); } @@ -1413,7 +1404,7 @@ main (argc, argv) if (fclose (tagf) == EOF) pfatal (tagfile); - exit (GOOD); + exit (EXIT_SUCCESS); } if (update) @@ -1432,7 +1423,7 @@ main (argc, argv) sprintf (cmd, "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS", tagfile, argbuffer[i].what, tagfile); - if (system (cmd) != GOOD) + if (system (cmd) != EXIT_SUCCESS) fatal ("failed to execute shell command", (char *)NULL); } append_to_tagfile = TRUE; @@ -1453,7 +1444,7 @@ main (argc, argv) sprintf (cmd, "sort -o %.*s %.*s", BUFSIZ, tagfile, BUFSIZ, tagfile); exit (system (cmd)); } - return GOOD; + return EXIT_SUCCESS; } @@ -6470,7 +6461,7 @@ fatal (s1, s2) char *s1, *s2; { error (s1, s2); - exit (BAD); + exit (EXIT_FAILURE); } static void @@ -6478,7 +6469,7 @@ pfatal (s1) char *s1; { perror (s1); - exit (BAD); + exit (EXIT_FAILURE); } static void @@ -6492,7 +6483,7 @@ fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", fprintf (stderr, "\tTry `%s %s' for a complete list of options.\n", progname, "-h"); #endif - exit (BAD); + exit (EXIT_FAILURE); } /* Print error message. `s1' is printf control string, `s2' is arg for it. */ @@ -6788,3 +6779,5 @@ xrealloc (ptr, size) /* arch-tag: 8a9b748d-390c-4922-99db-2eeefa921051 (do not change this comment) */ + +/* etags.c ends here */ diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c index 944a728a28c..cee7eaa130e 100644 --- a/lib-src/fakemail.c +++ b/lib-src/fakemail.c @@ -169,7 +169,7 @@ fatal (s1, s2) char *s1, *s2; { error (s1, s2); - exit (1); + exit (EXIT_FAILURE); } /* Like malloc but get fatal error if memory is exhausted. */ @@ -410,7 +410,7 @@ close_the_streams () no_problems = (no_problems && ((*rem->action) (rem->handle) == 0)); the_streams = ((stream_list) NULL); - return (no_problems ? 0 : 1); + return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE); } void @@ -667,7 +667,7 @@ read_header () if (next_line == ((line_list *) NULL)) { /* Not a valid header */ - exit (1); + exit (EXIT_FAILURE); } *next_line = new_list (); (*next_line)->string = alloc_string (length); @@ -753,3 +753,5 @@ main (argc, argv) /* arch-tag: acb0afa6-315a-4c5b-b9e3-def5725c8783 (do not change this comment) */ + +/* fakemail.c ends here */ diff --git a/lib-src/hexl.c b/lib-src/hexl.c index 0cfb88445b3..5ca7c2a5b8a 100644 --- a/lib-src/hexl.c +++ b/lib-src/hexl.c @@ -270,15 +270,17 @@ main (argc, argv) fclose (fp); } while (*argv != NULL); - return 0; + return EXIT_SUCCESS; } void usage () { fprintf (stderr, "usage: %s [-de] [-iso]\n", progname); - exit (1); + exit (EXIT_FAILURE); } /* arch-tag: 20e04fb7-926e-4e48-be86-64fe869ecdaa (do not change this comment) */ + +/* hexl.c ends here */ diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index ba73f5800a7..802b4e09e67 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -60,6 +60,10 @@ Boston, MA 02111-1307, USA. */ #define READ_BINARY "r" #endif /* not DOS_NT */ +#ifndef IS_DIRECTORY_SEP +#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/') +#endif + int scan_file (); int scan_lisp_file (); int scan_c_file (); @@ -100,7 +104,7 @@ fatal (s1, s2) char *s1, *s2; { error (s1, s2); - exit (1); + exit (EXIT_FAILURE); } /* Like malloc but get fatal error if memory is exhausted. */ @@ -183,11 +187,13 @@ void put_filename (filename) char *filename; { - char *tmp = filename; - int len; - - while ((tmp = index (filename, '/'))) - filename = tmp + 1; + char *tmp; + + for (tmp = filename; *tmp; tmp++) + { + if (IS_DIRECTORY_SEP(*tmp)) + filename = tmp + 1; + } putc (037, outfile); putc ('S', outfile); @@ -1204,3 +1210,5 @@ scan_lisp_file (filename, mode) /* arch-tag: f7203aaf-991a-4238-acb5-601db56f2894 (do not change this comment) */ + +/* make-docfile.c ends here */ diff --git a/lib-src/makefile.nt b/lib-src/makefile.nt deleted file mode 100644 index 29282eea45d..00000000000 --- a/lib-src/makefile.nt +++ /dev/null @@ -1,417 +0,0 @@ -# Makefile for GNU Emacs lib-src directory. -# Geoff Voelker (voelker@cs.washington.edu) -# Copyright (C) 1994 Free Software Foundation, Inc. -# -# This file is part of GNU Emacs. -# -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -# -# Sets up the system dependent macros. -# -!include ..\nt\makefile.def - -LOCAL_FLAGS = -DWINDOWSNT -DDOS_NT -DSTDC_HEADERS=1 -DNO_LDAV=1 \ - -DNO_ARCHIVES=1 -DHAVE_CONFIG_H=1 -I..\nt\inc -I..\src - -LINK_FLAGS = $(ARCH_LDFLAGS) -debug:PARTIAL -machine:$(ARCH) -subsystem:console -entry:mainCRTStartup setargv.obj - -ALL = $(BLD)\make-docfile.exe \ - $(BLD)\hexl.exe \ - $(BLD)\ctags.exe \ - $(BLD)\etags.exe \ - $(BLD)\ebrowse.exe \ - $(BLD)\movemail.exe - - -# don't know what (if) to do with these yet... -# -# $(BLD)\sorted-doc.exe \ -# $(BLD)\env.exe \ -# $(BLD)\server.exe \ -# $(BLD)\emacstool.exe \ -# $(BLD)\leditcfns.exe \ -# $(BLD)\emacsclient.exe \ -# $(BLD)\cvtmail.exe \ -# $(BLD)\digest-doc.exe \ -# $(BLD)\test-distrib.exe \ - - -LIBS = $(BASE_LIBS) - -$(BLD)\make-docfile.exe: $(BLD)\make-docfile.obj $(BLD)\ntlib.obj - $(LINK) -out:$@ $(LINK_FLAGS) $(BLD)\make-docfile.obj $(BLD)\ntlib.obj $(LIBS) -$(BLD)\hexl.exe: $(BLD)\hexl.obj -$(BLD)\fakemail.exe: $(BLD)\fakemail.obj $(BLD)\ntlib.obj - $(LINK) -out:$@ $(LINK_FLAGS) -debug:full $(BLD)\fakemail.obj $(BLD)\ntlib.obj $(LIBS) - -make-docfile: $(BLD) $(BLD)\make-docfile.exe -etags: $(BLD) $(BLD)\etags.exe -ebrowse: $(BLD) $(BLD)\ebrowse.exe -hexl: $(BLD) $(BLD)\hexl.exe -movemail: $(BLD) $(BLD)\movemail.exe -fakemail: $(BLD) $(BLD)\fakemail.exe - -GETOPTOBJS = $(BLD)\getopt.obj $(BLD)\getopt1.obj -GETOPTDEPS = $(GETOPTOBJS) getopt.h -MOVEMAILOBJS = $(BLD)\movemail.obj \ - $(BLD)\pop.obj \ - $(BLD)\ntlib.obj \ - $(GETOPTOBJS) - -$(BLD)\movemail.exe: $(MOVEMAILOBJS) getopt.h -# put wsock32.lib before $(LIBS) to ensure we don't link to ws2_32.lib - $(LINK) -out:$@ $(LINK_FLAGS) -debug:FULL $(MOVEMAILOBJS) wsock32.lib $(LIBS) - -ETAGSOBJ = $(BLD)\etags.obj \ - $(BLD)\getopt.obj \ - $(BLD)\getopt1.obj \ - $(BLD)\ntlib.obj \ - $(BLD)\regex.obj - - -$(BLD)\etags.exe: $(ETAGSOBJ) - $(LINK) -out:$@ $(LINK_FLAGS) $(ETAGSOBJ) $(LIBS) - - -$(BLD)\regex.obj: ../src/regex.c ../src/regex.h ../src/config.h - $(CC) $(CFLAGS) -DCONFIG_BROKETS -DINHIBIT_STRING_HEADER \ - ../src/regex.c -Fo$@ - -ETAGS_CFLAGS = -DETAGS_REGEXPS -DHAVE_GETCWD -$(BLD)\etags.obj: etags.c - $(CC) $(CFLAGS) $(ETAGS_CFLAGS) -Fo$@ etags.c - -CTAGSOBJ = $(BLD)\ctags.obj \ - $(BLD)\getopt.obj \ - $(BLD)\getopt1.obj \ - $(BLD)\ntlib.obj \ - $(BLD)\regex.obj - -$(BLD)\ctags.exe: ctags.c $(CTAGSOBJ) - $(LINK) -out:$@ $(LINK_FLAGS) $(CTAGSOBJ) $(LIBS) - -ctags.c: etags.c - - $(DEL) ctags.c - copy etags.c ctags.c - -CTAGS_CFLAGS = -DCTAGS $(ETAGS_CFLAGS) -$(BLD)\ctags.obj: ctags.c - $(CC) $(CFLAGS) $(CTAGS_CFLAGS) -Fo$@ ctags.c - -EBROWSE_OBJ = $(BLD)\ebrowse.obj \ - $(BLD)\getopt.obj \ - $(BLD)\getopt1.obj \ - $(BLD)\ntlib.obj - -$(BLD)\ebrowse.exe: $(EBROWSE_OBJ) - $(LINK) -out:$@ $(LINK_FLAGS) $(EBROWSE_OBJ) $(LIBS) - -$(BLD)\ebrowse.obj: ebrowse.c ..\src\config.h - $(CC) $(CFLAGS) -DVERSION=\"$(VERSION)\" -Fo$@ ebrowse.c -# -# don't know what to do with these yet... -# -# $(BLD)\sorted-doc.exe: $(BLD)\sorted-doc.obj -# $(BLD)\yow.exe: $(BLD)\yow.obj -# $(BLD)\emacstool.exe: $(BLD)\emacstool.obj -# $(BLD)\leditcfns.exe: $(BLD)\leditcfns.obj -# $(BLD)\server.exe: $(BLD)\server.obj -# $(BLD)\cvtmail.exe: $(BLD)\cvtmail.obj -# $(BLD)\digest-doc.exe: $(BLD)\digest-doc.obj -# $(BLD)\emacsclient.exe: $(BLD)\emacsclient.obj -# $(BLD)\test-distrib.exe: $(BLD)\test-distrib.obj - -# -# From ..\src\makefile.nt. -# -obj = abbrev.c alloc.c alloca.c buffer.c bytecode.c callint.c callproc.c casefiddle.c cm.c cmds.c charset.c coding.c category.c ccl.c data.c dired.c dispnew.c doc.c doprnt.c editfns.c emacs.c eval.c fileio.c filelock.c filemode.c fns.c fontset.c indent.c insdel.c keyboard.c keymap.c lastfile.c lread.c macros.c marker.c minibuf.c xfaces.c print.c process.c regex.c scroll.c search.c syntax.c sysdep.c term.c termcap.c tparam.c undo.c unexw32.c window.c xdisp.c casetab.c floatfns.c frame.c gmalloc.c intervals.c ralloc.c textprop.c vm-limit.c region-cache.c strftime.c w32.c w32console.c w32faces.c w32fns.c w32heap.c w32inevt.c w32proc.c w32reg.c w32menu.c w32select.c w32term.c w32xfns.c - -# -# These are the lisp files that are loaded up in loadup.el -# -lispsource = ../lisp/ - -FACE_SUPPORT = $(lispsource)facemenu.elc -MOUSE_SUPPORT = $(lispsource)select.elc $(lispsource)scroll-bar.elc $(lispsource)mouse.elc -FLOAT_SUPPORT = $(lispsource)float-sup.elc -WINNT_SUPPORT = $(lispsource)ls-lisp.elc $(lispsource)w32-fns.elc $(lispsource)dos-w32.elc - -lisp= \ - $(lispsource)abbrev.elc \ - $(lispsource)buff-menu.elc \ - $(lispsource)byte-run.elc \ - $(lispsource)cus-start.el \ - $(lispsource)custom.elc \ - $(lispsource)disp-table.elc \ - $(lispsource)faces.elc \ - $(lispsource)files.elc \ - $(lispsource)textmodes/fill.elc \ - $(lispsource)format.elc \ - $(FACE_SUPPORT) \ - $(MOUSE_SUPPORT) \ - $(FLOAT_SUPPORT) \ - $(lispsource)frame.elc\ - $(X_WINDOWS_SUPPORT) \ - $(lispsource)help.elc \ - $(lispsource)indent.elc \ - $(lispsource)isearch.elc \ - $(lispsource)emacs-lisp/lisp-mode.elc \ - $(lispsource)emacs-lisp/lisp.elc \ - $(lispsource)loadup.el \ - $(lispsource)loaddefs.el \ - $(lispsource)bindings.el \ - $(lispsource)map-ynp.elc \ - $(lispsource)menu-bar.elc \ - $(lispsource)international/mule.elc \ - $(lispsource)international/mule-conf.el \ - $(lispsource)international/mule-cmds.elc \ - $(lispsource)international/characters.elc \ - $(lispsource)international/ccl.elc \ - $(lispsource)international/codepage.elc \ - $(lispsource)international/utf-8.elc \ - $(lispsource)case-table.elc \ - $(lispsource)language/chinese.elc \ - $(lispsource)language/cyrillic.elc \ - $(lispsource)language/devanagari.elc \ - $(lispsource)language/english.elc \ - $(lispsource)language/ethiopic.elc \ - $(lispsource)language/european.elc \ - $(lispsource)language/czech.elc \ - $(lispsource)language/slovak.elc \ - $(lispsource)language/romanian.elc \ - $(lispsource)language/greek.elc \ - $(lispsource)language/hebrew.elc \ - $(lispsource)language/indian.elc \ - $(lispsource)language/japanese.elc \ - $(lispsource)language/korean.elc \ - $(lispsource)language/lao.elc \ - $(lispsource)language/thai.elc \ - $(lispsource)language/tibetan.elc \ - $(lispsource)language/vietnamese.elc \ - $(lispsource)language/misc-lang.elc \ - $(lispsource)textmodes/page.elc \ - $(lispsource)textmodes/paragraphs.elc \ - $(lispsource)paths.el \ - $(lispsource)register.elc \ - $(lispsource)replace.elc \ - $(lispsource)simple.elc \ - $(lispsource)startup.elc \ - $(lispsource)subr.elc \ - $(lispsource)term/tty-colors.elc \ - $(lispsource)textmodes/text-mode.elc \ - $(lispsource)vc-hooks.elc \ - $(lispsource)ediff-hook.elc \ - $(VMS_SUPPORT) \ - $(MSDOS_SUPPORT) \ - $(WINNT_SUPPORT) \ - $(lispsource)widget.elc \ - $(lispsource)window.elc \ - $(lispsource)version.el - - -DOC = DOC -$(DOC): $(BLD)\make-docfile.exe - - $(DEL) $(DOC) - $(BLD)\make-docfile -d ..\src $(obj) > $(DOC) - $(BLD)\make-docfile -d ..\src $(lisp) >> $(DOC) - $(CP) $(DOC) ..\etc\DOC-X - - mkdir ..\src\$(OBJDIR) - - mkdir ..\src\$(OBJDIR)\etc - $(CP) $(DOC) ..\src\$(OBJDIR)\etc\DOC-X - -{$(BLD)}.obj{$(BLD)}.exe: - $(LINK) -out:$@ $(LINK_FLAGS) $*.obj $(LIBS) - -# -# Build the executables -# -all: $(BLD) $(ALL) $(DOC) - -# -# Assuming INSTALL_DIR is defined, build and install emacs in it. -# -INSTALL_FILES = $(ALL) -install: $(INSTALL_FILES) - - mkdir $(INSTALL_DIR)\bin - $(CP) $(BLD)\etags.exe $(INSTALL_DIR)\bin - $(CP) $(BLD)\ctags.exe $(INSTALL_DIR)\bin - $(CP) $(BLD)\hexl.exe $(INSTALL_DIR)\bin - $(CP) $(BLD)\movemail.exe $(INSTALL_DIR)\bin - - mkdir $(INSTALL_DIR)\etc - $(CP) $(DOC) $(INSTALL_DIR)\etc - -# Don't install fakemail by default, as it sends mail into a -# blackhole if /bin/mail is not installed. -# $(CP) $(BLD)\fakemail.exe $(INSTALL_DIR)\bin - -# -# Maintenance -# -clean:; - $(DEL) *~ *.pdb DOC* - - $(DEL) *.orig *.rej *.crlf ctags.c - - $(DEL_TREE) deleted - - $(DEL_TREE) obj - - $(DEL_TREE) obj-spd - -# -# Headers we would preprocess if we could. -# -..\src\config.h: ..\nt\$(CONFIG_H) - $(CP) $** $@ -..\src\paths.h: ..\nt\paths.h - $(CP) $** $@ - -### DEPENDENCIES ### - -EMACS_ROOT = .. -SRC = . - -$(BLD)\b2m.obj : \ - $(SRC)\b2m.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h - -$(BLD)\ctags.obj : \ - $(SRC)\ctags.c \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h \ - $(SRC)\ntlib.h \ - $(SRC)\getopt.h - -$(BLD)\cvtmail.obj : \ - $(SRC)\cvtmail.c - -$(BLD)\digest-doc.obj : \ - $(SRC)\digest-doc.c - -$(BLD)\emacsclient.obj : \ - $(SRC)\emacsclient.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h - -$(BLD)\emacstool.obj : \ - $(SRC)\emacstool.c \ - $(EMACS_ROOT)\nt\inc\sys\file.h - -$(BLD)\etags.obj : \ - $(SRC)\etags.c \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h \ - $(SRC)\ntlib.h \ - $(SRC)\getopt.h - -$(BLD)\fakemail.obj : \ - $(SRC)\fakemail.c \ - $(SRC)\ntlib.h \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h \ - $(EMACS_ROOT)\nt\inc\pwd.h - -$(BLD)\getdate.obj : \ - $(SRC)\getdate.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(MSTOOLS_SYS)\types.h - -$(BLD)\getopt.obj : \ - $(SRC)\getopt.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\ntlib.h \ - $(SRC)\getopt.h - -$(BLD)\getopt1.obj : \ - $(SRC)\getopt1.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\getopt.h - -$(BLD)\hexl.obj : \ - $(SRC)\hexl.c - -$(BLD)\leditcfns.obj : \ - $(SRC)\leditcfns.c - -$(BLD)\make-docfile.obj : \ - $(SRC)\make-docfile.c \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\make-path.obj : \ - $(SRC)\make-path.c - -$(BLD)\movemail.obj : \ - $(SRC)\movemail.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(EMACS_ROOT)\lib-src\..\src\syswait.h \ - $(EMACS_ROOT)\nt\inc\pwd.h \ - $(SRC)\ntlib.h - $(CC) $(CFLAGS) -DUSG -Fo$@ movemail.c - -$(BLD)\ntlib.obj : \ - $(SRC)\ntlib.c \ - $(SRC)\ntlib.h \ - $(EMACS_ROOT)\nt\inc\pwd.h - -$(BLD)\pop.obj : \ - $(SRC)\pop.c \ - $(SRC)\pop.h \ - $(SRC)\ntlib.h - -$(BLD)\profile.obj : \ - $(SRC)\profile.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h \ - $(EMACS_ROOT)\lib-src\..\src\systime.h - -$(BLD)\qsort.obj : \ - $(SRC)\qsort.c - -$(BLD)\sorted-doc.obj : \ - $(SRC)\sorted-doc.c - -$(BLD)\tcp.obj : \ - $(SRC)\tcp.c - -$(BLD)\test-distrib.obj : \ - $(SRC)\test-distrib.c - -$(BLD)\timer.obj : \ - $(SRC)\timer.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\lib-src\..\src\config.h - -$(BLD)\yow.obj : \ - $(SRC)\yow.c \ - $(EMACS_ROOT)\lib-src\..\src\paths.h - -# arch-tag: 59e1b54b-4cc2-4086-bb0b-ecfad4b683e9 diff --git a/lib-src/makefile.w32-in b/lib-src/makefile.w32-in index 20cf4727362..663d08e6f13 100644 --- a/lib-src/makefile.w32-in +++ b/lib-src/makefile.w32-in @@ -1,5 +1,5 @@ -# Makefile for GNU Emacs on the Microsoft W32 API. -# Copyright (c) 2000-2001 Free Software Foundation, Inc. +# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# Copyright (c) 2000-2001, 2004 Free Software Foundation, Inc. # # This file is part of GNU Emacs. # @@ -126,7 +126,7 @@ $(BLD)/ctags.$(O): ctags.c # # From ..\src\makefile.nt. # -obj = abbrev.c alloc.c alloca.c buffer.c bytecode.c callint.c callproc.c casefiddle.c casetab.c category.c ccl.c charset.c cm.c cmds.c coding.c data.c dired.c dispnew.c doc.c doprnt.c editfns.c emacs.c eval.c fileio.c filelock.c filemode.c floatfns.c fns.c fontset.c frame.c fringe.c gmalloc.c indent.c insdel.c intervals.c keyboard.c keymap.c lastfile.c lread.c macros.c marker.c minibuf.c print.c process.c ralloc.c regex.c region-cache.c scroll.c search.c sound.c strftime.c syntax.c sysdep.c term.c termcap.c textprop.c tparam.c undo.c unexw32.c vm-limit.c w32.c w32console.c w32fns.c w32heap.c w32inevt.c w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c window.c xdisp.c xfaces.c xfaces.c +obj = abbrev.c alloc.c alloca.c buffer.c bytecode.c callint.c callproc.c casefiddle.c casetab.c category.c ccl.c charset.c cm.c cmds.c coding.c data.c dired.c dispnew.c doc.c doprnt.c editfns.c emacs.c eval.c fileio.c filelock.c filemode.c floatfns.c fns.c fontset.c frame.c fringe.c gmalloc.c image.c indent.c insdel.c intervals.c keyboard.c keymap.c lastfile.c lread.c macros.c marker.c minibuf.c print.c process.c ralloc.c regex.c region-cache.c scroll.c search.c sound.c strftime.c syntax.c sysdep.c term.c termcap.c textprop.c tparam.c undo.c unexw32.c vm-limit.c w32.c w32console.c w32fns.c w32heap.c w32inevt.c w32menu.c w32proc.c w32reg.c w32select.c w32term.c w32xfns.c window.c xdisp.c xfaces.c xfaces.c # # These are the lisp files that are loaded up in loadup.el # @@ -139,7 +139,7 @@ WINNT_SUPPORT = $(lispsource)ls-lisp.elc $(lispsource)disp-table.elc $(lispsourc MSDOS_SUPPORT = $(lispsource)dos-fns.elc $(lispsource)dos-vars.elc $(lispsource)international/ccl.elc $(lispsource)international/codepage.elc VMS_SUPPORT = $(lispsource)vmsproc.elc $(lispsource)vms-patch.elc -lisp= \ +lisp1= \ $(lispsource)abbrev.elc \ $(lispsource)buff-menu.elc \ $(lispsource)button.elc \ @@ -178,7 +178,9 @@ lisp= \ $(lispsource)international/latin-5.el \ $(lispsource)international/latin-8.el \ $(lispsource)international/latin-9.el \ - $(lispsource)case-table.elc \ + $(lispsource)case-table.elc + +lisp2 = \ $(lispsource)language/chinese.elc \ $(lispsource)language/cyrillic.elc \ $(lispsource)language/indian.elc \ @@ -228,7 +230,8 @@ DOC = DOC $(DOC): make-docfile - $(DEL) $(DOC) "$(THISDIR)/$(BLD)/make-docfile" -o $(DOC) -d ../src $(obj) - "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp) + "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp1) + "$(THISDIR)/$(BLD)/make-docfile" -a $(DOC) -d ../src $(lisp2) $(CP) $(DOC) ../etc/DOC-X - mkdir "../src/$(OBJDIR)" - mkdir "../src/$(OBJDIR)/etc" @@ -422,5 +425,3 @@ $(BLD)/timer.$(O) : \ $(BLD)/yow.$(O) : \ $(SRC)/yow.c \ $(EMACS_ROOT)/lib-src/../src/paths.h - -# arch-tag: c051bc02-a6de-474b-889a-27f7b2fbbcea diff --git a/lib-src/movemail.c b/lib-src/movemail.c index 2d0cd9043fd..a634e2966d7 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c @@ -216,7 +216,7 @@ main (argc, argv) preserve_mail++; break; default: - exit(1); + exit (EXIT_FAILURE); } } @@ -234,7 +234,7 @@ main (argc, argv) #else fprintf (stderr, "Usage: movemail [-p] inbox destfile%s\n", ""); #endif - exit (1); + exit (EXIT_FAILURE); } inname = argv[optind]; @@ -536,12 +536,12 @@ main (argc, argv) if (spool_name) mailunlock (); #endif - exit (0); + exit (EXIT_SUCCESS); } wait (&status); if (!WIFEXITED (status)) - exit (1); + exit (EXIT_FAILURE); else if (WRETCODE (status) != 0) exit (WRETCODE (status)); @@ -554,7 +554,7 @@ main (argc, argv) #endif /* ! DISABLE_DIRECT_ACCESS */ - return 0; + return EXIT_SUCCESS; } #ifdef MAIL_USE_MAILLOCK @@ -607,7 +607,7 @@ fatal (s1, s2) if (delete_lockname) unlink (delete_lockname); error (s1, s2, 0); - exit (1); + exit (EXIT_FAILURE); } /* Print error message. `s1' is printf control string, `s2' and `s3' @@ -709,6 +709,8 @@ char Errmsg[200]; /* POP errors, at least, can exceed * If the mailbox is in the form "po:username:hostname", then it is * modified by this function -- the second colon is replaced by a * null. + * + * Return a value suitable for passing to `exit'. */ int @@ -736,19 +738,19 @@ popmail (mailbox, outfile, preserve, password, reverse_order) if (! server) { error ("Error connecting to POP server: %s", pop_error, 0); - return (1); + return EXIT_FAILURE; } if (pop_stat (server, &nmsgs, &nbytes)) { error ("Error getting message count from POP server: %s", pop_error, 0); - return (1); + return EXIT_FAILURE; } if (!nmsgs) { pop_close (server); - return (0); + return EXIT_SUCCESS; } mbfi = open (outfile, O_WRONLY | O_CREAT | O_EXCL, 0666); @@ -756,7 +758,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order) { pop_close (server); error ("Error in open: %s, %s", strerror (errno), outfile); - return (1); + return EXIT_FAILURE; } fchown (mbfi, getuid (), -1); @@ -766,7 +768,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order) error ("Error in fdopen: %s", strerror (errno), 0); close (mbfi); unlink (outfile); - return (1); + return EXIT_FAILURE; } if (reverse_order) @@ -789,7 +791,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order) { error (Errmsg, 0, 0); close (mbfi); - return (1); + return EXIT_FAILURE; } mbx_delimit_end (mbf); fflush (mbf); @@ -798,7 +800,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order) error ("Error in fflush: %s", strerror (errno), 0); pop_close (server); close (mbfi); - return (1); + return EXIT_FAILURE; } } @@ -812,14 +814,14 @@ popmail (mailbox, outfile, preserve, password, reverse_order) if (fsync (mbfi) < 0) { error ("Error in fsync: %s", strerror (errno), 0); - return (1); + return EXIT_FAILURE; } #endif if (close (mbfi) == -1) { error ("Error in close: %s", strerror (errno), 0); - return (1); + return EXIT_FAILURE; } if (! preserve) @@ -829,17 +831,17 @@ popmail (mailbox, outfile, preserve, password, reverse_order) { error ("Error from POP server: %s", pop_error, 0); pop_close (server); - return (1); + return EXIT_FAILURE; } } if (pop_quit (server)) { error ("Error from POP server: %s", pop_error, 0); - return (1); + return EXIT_FAILURE; } - return (0); + return EXIT_SUCCESS; } int @@ -957,3 +959,5 @@ strerror (errnum) /* arch-tag: 1c323112-41fe-4fe5-8de9-494de631f73f (do not change this comment) */ + +/* movemail.c ends here */ diff --git a/lib-src/profile.c b/lib-src/profile.c index ec77936f74d..8d924532b87 100644 --- a/lib-src/profile.c +++ b/lib-src/profile.c @@ -55,7 +55,7 @@ char * get_time () { if (watch_not_started) - exit (1); /* call reset_watch first ! */ + exit (EXIT_FAILURE); /* call reset_watch first ! */ EMACS_GET_TIME (TV2); EMACS_SUB_TIME (TV2, TV2, TV1); sprintf (time_string, "%lu.%06lu", (unsigned long)EMACS_SECS (TV2), (unsigned long)EMACS_USECS (TV2)); @@ -94,14 +94,16 @@ main () puts (get_time ()); break; case 'q': - exit (0); + exit (EXIT_SUCCESS); } /* Anything remaining on the line is ignored. */ while (c != '\n' && c != EOF) c = getchar (); } - exit (1); + exit (EXIT_FAILURE); } /* arch-tag: 8db68f7e-2322-4944-a315-dba349bdbf39 (do not change this comment) */ + +/* profile.c ends here */ diff --git a/lib-src/rcs2log b/lib-src/rcs2log index b7466b6c134..42c92ff6187 100755 --- a/lib-src/rcs2log +++ b/lib-src/rcs2log @@ -2,34 +2,57 @@ # RCS to ChangeLog generator -# Generate a change log prefix from RCS files (perhaps in the CVS repository) -# and the ChangeLog (if any). -# Output the new prefix to standard output. -# You can edit this prefix by hand, and then prepend it to ChangeLog. +Help=' +Generate ChangeLog entries from RCS files (perhaps in a CVS repository) +and the ChangeLog file (if any). An RCS file typically has a name +ending in ",v", and represents the entire history of a file that is +under revision control. The ChangeLog file logs entries for changes, +in reverse chronological order. -# Ignore log entries that start with `#'. -# Clump together log entries that start with `{topic} ', -# where `topic' contains neither white space nor `}'. +Generate entries for changes entered into RCS (or CVS) more recently +than the newest existing entry in the ChangeLog file. You can then +edit these entries by hand, and prepend them to the ChangeLog file. + +Output the resulting ChangeLog entries to standard output. +Each entry looks something like this: + +2004-04-17 Paul Eggert <eggert@gnu.org> + + * rcs2log (Help): Clarify wording of the usage message. + Problem reported by Alan Mackenzie in + <http://mail.gnu.org/archive/html/bug-gnu-emacs/2004-04/msg00188.html>. + +ChangeLog entries contain the current date, full name, email address +including hostname, the name of the affected file, and commentary. +RCS and CVS logs lack full names and email addresses, so they are +inferred from login names using a heuristic that can be overridden +via the -u option. + +Ignore log entries that start with "#". +Clump together log entries that start with "{topic} ", +where "topic" contains neither white space nor "}". + +If no FILE is specified, use all files under the working directory +that are maintained under version control. -Help='The default FILEs are the files registered under the working directory. Options: - -c CHANGELOG Output a change log prefix to CHANGELOG (default ChangeLog). + -c FILE Output ChangeLog entries for FILE (default ChangeLog). -h HOSTNAME Use HOSTNAME in change log entries (default current host). -i INDENT Indent change log lines by INDENT spaces (default 8). -l LENGTH Try to limit log lines to LENGTH characters (default 79). - -L FILE Use rlog-format FILE for source of logs. + -L FILE Use FILE (same format as "rlog") for source of logs. -R If no FILEs are given and RCS is used, recurse through working directory. - -r OPTION Pass OPTION to subsidiary log command. + -r OPTION Pass OPTION to subsidiary command (either "rlog" or "cvs -q log"). -t TABWIDTH Tab stops are every TABWIDTH characters (default 8). - -u "LOGIN<tab>FULLNAME<tab>MAILADDR" Assume LOGIN has FULLNAME and MAILADDR. + -u "LOGIN<tab>FULLNAME<tab>EMAILADDR" LOGIN has FULLNAME and EMAILADDR. -v Append RCS revision to file names in log lines. --help Output help. --version Output version number. Report bugs to <bug-gnu-emacs@gnu.org>.' -Id='$Id: rcs2log,v 1.52 2003/12/27 08:18:08 uid65632 Exp $' +Id='$Id$' # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003, # 2004 Free Software Foundation, Inc. diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c index 05a3e69cc92..3af3276e811 100644 --- a/lib-src/sorted-doc.c +++ b/lib-src/sorted-doc.c @@ -75,7 +75,7 @@ fatal (s1, s2) char *s1, *s2; { error (s1, s2); - exit (1); + exit (EXIT_FAILURE); } /* Like malloc but get fatal error if memory is exhausted. */ @@ -279,8 +279,10 @@ main () printf ("@bye\n"); } - return 0; + return EXIT_SUCCESS; } /* arch-tag: ce28f204-1e70-4b34-8210-3d54a5662071 (do not change this comment) */ + +/* sorted-doc.c ends here */ diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c index f7b3a8b8004..0333bd7d710 100644 --- a/lib-src/test-distrib.c +++ b/lib-src/test-distrib.c @@ -80,13 +80,13 @@ main (argc, argv) if (argc != 2) { fprintf (stderr, "Usage: %s testfile\n", argv[0]); - exit (2); + exit (EXIT_FAILURE); } fd = open (argv[1], O_RDONLY); if (fd < 0) { perror (argv[1]); - exit (2); + exit (EXIT_FAILURE); } if (cool_read (fd, buf, sizeof string1) != sizeof string1 || strcmp (buf, string1) || @@ -97,14 +97,13 @@ main (argc, argv) Most likely this means that many nonprinting characters\n\ have been corrupted in the files of Emacs, and it will not work.\n", argv[1]); - exit (2); + exit (EXIT_FAILURE); } close (fd); -#ifdef VMS - exit (1); /* On VMS, success is 1. */ -#endif - return (0); + return EXIT_SUCCESS; } /* arch-tag: 3a89005d-df98-4c32-aa9f-33570e16a26a (do not change this comment) */ + +/* test-distrib.c ends here */ diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index 74fa2b06920..8f7c90cad55 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -111,7 +111,7 @@ lose (msg) const char *msg; { fprintf (stderr, "%s\n", msg); - exit (1); + exit (EXIT_FAILURE); } void lose_syserr P_ ((const char *msg)) NO_RETURN; @@ -138,7 +138,7 @@ lose_syserr (msg) const char *msg; { fprintf (stderr, "%s: %s\n", msg, strerror (errno)); - exit (1); + exit (EXIT_FAILURE); } char * @@ -199,7 +199,7 @@ main (argc, argv) switch (c) { case 'h': - usage (0); + usage (EXIT_SUCCESS); break; case 'd': user_prefix = optarg; @@ -213,11 +213,11 @@ main (argc, argv) max = MAX_SCORES; break; default: - usage (1); + usage (EXIT_FAILURE); } if (optind+3 != argc) - usage (1); + usage (EXIT_FAILURE); running_suid = (getuid () != geteuid ()); @@ -266,7 +266,7 @@ main (argc, argv) lose_syserr ("Failed to write scores file"); } unlock_file (scorefile, lockstate); - exit (0); + exit (EXIT_SUCCESS); } int @@ -531,3 +531,5 @@ unlock_file (filename, state) /* arch-tag: 2bf5c52e-4beb-463a-954e-c58b9c64736b (do not change this comment) */ + +/* update-game-score.c ends here */ diff --git a/lib-src/yow.c b/lib-src/yow.c index 10f0fad1ce7..9d58ce5aecb 100644 --- a/lib-src/yow.c +++ b/lib-src/yow.c @@ -73,7 +73,7 @@ main (argc, argv) if ((fp = fopen(file, "r")) == NULL) { fprintf(stderr, "yow: "); perror(file); - exit(1); + exit(EXIT_FAILURE); } /* initialize random seed */ @@ -82,7 +82,7 @@ main (argc, argv) setup_yow(fp); yow(fp); fclose(fp); - return 0; + return EXIT_SUCCESS; } static long len = -1; @@ -113,7 +113,7 @@ setup_yow(fp) if (fseek(fp, 0L, 2) == -1) { perror("yow"); - exit(1); + exit(EXIT_FAILURE); } len = ftell(fp) - header_len; } @@ -132,7 +132,7 @@ yow (fp) offset = rand() % len + header_len; if (fseek(fp, offset, 0) == -1) { perror("yow"); - exit(1); + exit(EXIT_FAILURE); } /* Read until SEP, read next line, print it. @@ -180,3 +180,5 @@ yow (fp) /* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e (do not change this comment) */ + +/* yow.c ends here */ diff --git a/lisp/.arch-inventory b/lisp/.arch-inventory new file mode 100644 index 00000000000..9bd88350a95 --- /dev/null +++ b/lisp/.arch-inventory @@ -0,0 +1,7 @@ +# Auto-generated lisp files, which ignore +precious ^(loaddefs|finder-inf|cus-load)\.el$ + +# Something generated during a windows build?!? +precious ^(Makefile\.unix)$ + +# arch-tag: fc62dc9f-3a91-455b-b8e7-d49df66beee0 diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8571f7edd19..70f7255782a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,2714 @@ +2004-06-20 Richard M. Stallman <rms@gnu.org> + + * mouse.el (mouse-set-region-1): Set transient-mark-mode to `only'. + + * isearch.el (isearch-repeat): Avoid testing old match data. + (isearch-message): Display trailing space in special font + when search is failing. + (isearch-search-fun-function): Doc fix. + + * autorevert.el (global-auto-revert-non-file-buffers): Doc fix. + +2004-06-19 Luc Teirlinck <teirllm@auburn.edu> + + * frame.el (show-trailing-whitespace): Doc fix. + + * cus-edit.el (custom-variable-documentation): New function. + (custom-variable): Use it. + +2004-06-19 Nick Roberts <nickrob@gnu.org> + + * man.el (Man-getpage-in-background): Revert previous change but + make cygwin a special case. + +2004-06-18 Luc Teirlinck <teirllm@auburn.edu> + + * autorevert.el (global-auto-revert-non-file-buffers): Update + docstring. + +2004-06-19 Daniel Pfeiffer <occitan@esperanto.org> + + * progmodes/compile.el (compilation-error-properties): Store one + more than end-col, if present, so that transient-mark-mode will + highlight last char too. + * progmodes/grep.el (grep-regexp-alist): Match columns and column + ranges, if present. + +2004-06-18 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in: Double percent signs in for loops. + +2004-06-17 David Kastrup <dak@gnu.org> + + * replace.el (query-replace-read-args): Only warn about use of \n + and \t when we are doing a regexp replacement and the actual + escaped character is n or t. + (query-replace-regexp): Add \, and \# interpretation to + interactive call and document it. + (query-replace-regexp-eval, replace-match-string-symbols): add \# + as shortkey for replace-count. + (replace-quote): New function for doubling backslashes. + +2004-06-17 Juanma Barranquero <lektu@terra.es> + + * files.el (parse-colon-path, cd): Mention in docstring that the + path separator is colon in GNU-like systems. + + * newcomment.el (comment-region-internal): Fix docstring. + + * emacs-lisp/ewoc.el (ewoc-create, ewoc-map, ewoc-locate) + (ewoc-invalidate, ewoc-collect): Doc fixes. + (ewoc--create-node, ewoc--delete-node-internal): + Fix typos in docstring. + +2004-06-15 Luc Teirlinck <teirllm@auburn.edu> + + * files.el (buffer-stale-function): Add hyperlink to emacs-xtra + manual to docstring. + +2004-06-15 Vinicius Jose Latorre <viniciusjl@ig.com.br> + + * ps-print.el (ps-time-stamp-iso8601): Comment doc string of defalias. + +2004-06-15 Luc Teirlinck <teirllm@auburn.edu> + + * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir): + Add hyperlink to emacs-xtra manual to docstring. + + * autorevert.el (global-auto-revert-non-file-buffers): Add + hyperlink to emacs-xtra manual to docstring, as well as an + info-link. + +2004-06-14 Juanma Barranquero <lektu@terra.es> + + * image.el (image-library-alist): New variable to map image types + to external libraries. Initialized to nil, unless system-specific + configs change it. + (image-type-available-p): Determine whether an image type is + available by calling `init-image-library'. + + * term/w32-win.el (image-library-alist): Initialize to a known set + of probable library names. + +2004-06-14 Kenichi Handa <handa@m17n.org> + + * international/code-pages.el (windows-1256, cp1125): Fix tables + for several characters. + + * international/utf-8.el (ccl-encode-mule-utf-8): Fix previous + change. + +2004-06-13 Richard M. Stallman <rms@gnu.org> + + * textmodes/paragraphs.el (sentence-end): Add 0x5397d as close brace. + + * emulation/pc-select.el: Doc fixes: say "PC Selection mode", + not "`pc-selection-mode'". + + * emacs-lisp/bytecomp.el: Put `...' around symbols in warning messages. + + * simple.el (previous-matching-history-element): Specify a default. + + * hexl.el (hexl-mode): Catch errors in hexl-goto-address. + + * cus-face.el (custom-declare-face): Simplify code. + + * abbrev.el (abbrev-mode, edit-abbrevs-map): Doc fixes. + +2004-06-13 Luc Teirlinck <teirllm@auburn.edu> + + * files.el (before-save-hook): Add `time-stamp' to the options. + + * time-stamp.el (time-stamp): Recommend adding it to + `before-save-hook', rather than `write-file-functions'. + Make a similar change in `Commentary' section. + +2004-06-13 Kai Grossjohann <kai.grossjohann@gmx.net> + + * diff-mode.el (diff-current-defun): If at start of hunk, use + position of first change. + +2004-06-13 Lars Hansen <larsh@math.ku.dk> + + * dired-x.el (dired-mark-omitted): Bind to "*O". + +2004-06-12 Karl Fogel <kfogel@red-bean.com> + + * bookmark.el (bookmark-bmenu-relocate): New function, as + suggested by David J. Biesack <David.Biesack@sas.com>. + (bookmark-bmenu-mode-map): Bind `bookmark-bmenu-relocate' to "R". + (bookmark-bmenu-mode): Describe binding in doc string. + (bookmark-set-filename): Save the bookmark list if it's time. + +2004-06-13 Kenichi Handa <handa@m17n.org> + + * international/utf-8.el (ccl-decode-mule-utf-8): Fix previous + change. + (ccl-untranslated-to-ucs): Fix typo. + +2004-06-12 Karl Chen <quarl@hkn.eecs.berkeley.edu> (tiny change) + + * progmodes/python.el (python-open-block-statement-p): Fix + indentation after a block opening that contains a comment. + +2004-06-12 J,Ai(Br,At(Bme Marant <jerome@marant.org> (tiny change) + + * bindings.el (completion-ignored-extensions): Add file extensions + of Python byte-compiled files. + +2004-06-12 Juri Linkov <juri@jurta.org> + + * info.el (Info-goto-node): Add autoload. + (Info-toc): Add substring-no-properties on Info file name. + (Info-mode, info, Info-toc, Info-mode-menu): Doc fix. + (Info-mode-map): Bind L to Info-history, T to Info-toc. + +2004-06-12 Kenichi Handa <handa@m17n.org> + + * international/mule-cmds.el (set-language-environment): Load + subst tables if necessary. + + * international/mule.el (decode-char): Load subst tables if + necessary. + (encode-char): Likewise. + + * international/utf-16.el (utf-16-decode-ucs): Handle a surrogate + pair correctly. Call ccl-mule-utf-untrans for untranslable chars. + (utf-16le-decode-loop): Set r5 to -1 before loop. + (utf-16be-decode-loop): Likewise. + (ccl-decode-mule-utf-16le): Add EOF processing block. + (ccl-decode-mule-utf-16be): Likewise. + (ccl-decode-mule-utf-16le-with-signature): Likewise. + (ccl-decode-mule-utf-16be-with-signature): Likewise. + (ccl-decode-mule-utf-16): Likewise. Set r5 to -1 initially. + (ccl-mule-utf-16-encode-untrans): New CCL. + (utf-16-decode-to-ucs): Handle pre-read character. + (utf-16le-encode-loop): Handle surrogate pair. + (utf-16be-encode-loop): Likewise. + (ccl-encode-mule-utf-16le-with-signature): Adjusted for the change + of utf-16le-encode-loop. + (ccl-encode-mule-utf-16be-with-signature): Adjusted for the change + of utf-16be-encode-loop. + (mule-utf-16-post-read-conversion): Call + utf-8-post-read-conversion at first. + (mule-utf-16[{le|be}], mule-utf-16{le|be}-with-signature): Include + CJK charsets in safe-charsets if utf-translate-cjk-mode is on. + Add post-read-conversion and pre-write-conversion. + + * international/utf-8.el (utf-translate-cjk-charsets): New + variable. + (utf-translate-cjk-unicode-range): New variable. + (utf-translate-cjk-load-tables): New function. + (utf-lookup-subst-table-for-decode): New function. + (utf-lookup-subst-table-for-encode): New function. + (utf-translate-cjk-mode): Init-value changed to t. Don't load + tables here. Update safe-charsets of utf-* coding systems. + (ccl-mule-utf-untrans): New CCL. + (ccl-decode-mule-utf-8): Call ccl-mule-utf-untrans. Use `repeat' + at end of each branch. + (ccl-mule-utf-8-encode-untrans): New CCL. + (ccl-encode-mule-utf-8): Call ccl-mule-utf-8-encode-untrans. + (ccl-untranslated-to-ucs): Handle 2-byte encoding. Set r1 to the + length of encoding. Don't return r0. + (utf-8-compose): New arg hash-table. Handle 2-byte encoding. + (utf-8-post-read-conversion): Narrow to region properly. If + utf-translate-cjk-mode is on, load tables if necessary. Call + utf-8-compose with hash-table arg if necessary. Call + XXX-compose-region instead of XXX-post-read-convesion. + (utf-8-pre-write-conversion): New function. + (mule-utf-8): Include CJK charsets in safe-charsets if + utf-translate-cjk-mode is on. Add pre-write-conversion. + + * international/characters.el: Temporarily set + utf-translate-cjk-mode to nil. + + * language/devan-util.el (devanagari-compose-region): Add + autoload cookie. + + * international/ccl.el (ccl-dump-call): Fix printing the + subroutine name. + +2004-06-11 Luc Teirlinck <teirllm@auburn.edu> + + * dired.el (dired-revert): If buffer is marked unmodified before + reverting, keep it marked unmodified. + Adapt to new conventions for commenting out code. + (dired-make-relative): Adapt to new conventions for commenting out + code. + +2004-06-10 Miles Bader <miles@gnu.ai.mit.edu> + + * eshell/esh-module.el (eshell-load-defgroups): Bind + `vc-handled-backends' to nil when opening files. + +2004-06-11 Juanma Barranquero <lektu@terra.es> + + * files.el (parse-colon-path, cd): Doc fixes (refer to + `path-separator', not colon). + +2004-06-10 Juanma Barranquero <lektu@terra.es> + + * newcomment.el (comment-search-forward) + (comment-search-backward): Fix typos in docstring. + (comment-region): Doc fix. + +2004-06-10 Luc Teirlinck <teirllm@auburn.edu> + + * dired.el (dired-insert-old-subdirs): Adapt to fact that the R + switch is no longer stored in `dired-switches-alist'. + + * dired-aux.el (dired-insert-subdir): Do not store R switch in + `dired-switches-alist'. + +2004-06-10 Kim F. Storm <storm@cua.dk> + + * pcvs.el (cvs-mode-diff-yesterday): New command. + + * pcvs-defs.el (cvs-mode-diff-map): Bind y to cvs-mode-diff-yesterday. + +2004-06-10 Juri Linkov <juri@jurta.org> + + * emacs-lisp/edebug.el (edebug-eval-defun): + * emacs-lisp/lisp-mode.el (eval-defun-1): Add `defface'. + Fix docstring. + + * simple.el (eval-expression-print-format): Don't print additional + information on the first call to `eval-print-last-sexp'. + (next-error-find-buffer): Fix punctuation. + (killing) <defgroup>: Fix punctuation. + (yank-excluded-properties): Change group from editing to killing. + + * replace.el (perform-replace): Use `limit' to terminate the + while-loop explicitly. + +2004-06-09 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * toolbar/tool-bar.el (tool-bar-add-item, tool-bar-local-item): + Use lc-*.xpm as prefix instead of *-locol.xpm. + + * toolbar/lc-copy.xpm, toolbar/lc-cut.xpm + * toolbar/lc-help.xpm, toolbar/lc-home.xpm + * toolbar/lc-index.xpm, toolbar/lc-jump_to.xpm + * toolbar/lc-left_arrow.xpm, toolbar/lc-new.xpm + * toolbar/lc-open.xpm, toolbar/lc-paste.xpm + * toolbar/lc-preferences.xpm, toolbar/lc-print.xpm + * toolbar/lc-right_arrow.xpm, toolbar/lc-save.xpm + * toolbar/lc-saveas.xpm, toolbar/lc-search.xpm + * toolbar/lc-spell.xpm, toolbar/lc-undo.xpm + * toolbar/lc-up_arrow.xpm: + Renamed from *-locol.xpm. + +2004-06-09 Rajesh Vaidheeswarran <rv@gnu.org> + + * ffap.el (ffap-string-at-point-mode-alist): Fix the url mode to + include forms like &<str>; as valid url patterns. + +2004-06-08 Luc Teirlinck <teirllm@auburn.edu> + + * dired.el (dired-diff, dired-backup-diff) + (dired-clean-directory, dired-do-chmod, dired-do-chgrp) + (dired-do-chown, dired-do-touch, dired-do-print) + (dired-do-shell-command, dired-do-kill-lines, dired-do-compress) + (dired-do-byte-compile, dired-do-load, dired-do-redisplay) + (dired-create-directory, dired-do-copy, dired-do-symlink) + (dired-do-hardlink, dired-do-rename, dired-do-rename-regexp) + (dired-do-copy-regexp, dired-do-hardlink-regexp) + (dired-do-symlink-regexp, dired-upcase, dired-downcase) + (dired-maybe-insert-subdir, dired-next-subdir) + (dired-prev-subdir, dired-goto-subdir, dired-mark-subdir-files) + (dired-kill-subdir, dired-tree-up, dired-tree-down) + (dired-hide-subdir, dired-hide-all, dired-show-file-type) + (dired-run-shell-command, dired-query): Remove redundant, + or incorrect, autoloads. + + * dired-aux.el (dired-kill-tree): Do not kill DIRNAME, even if it + does not end in a slash. Add optional argument KILL-ROOT. Update + docstring. + (dired-do-touch, dired-clean-directory, dired-run-shell-command) + (dired-query): Add autoloads. + +2004-06-08 Daniel Pfeiffer <occitan@esperanto.org> + + * progmodes/compile.el (compilation-set-window-height): Rearrange + the save-* functions because a buffer can have several current + point in different windows. + (compilation-error-regexp-alist-alist): Recognize {standard input} + GNU messages (for gcc --pipe) and more kinds of Oracle messages. + +2004-06-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * toolbar/copy-locol.xpm, toolbar/cut-locol.xpm + * toolbar/help-locol.xpm, toolbar/home-locol.xpm + * toolbar/index-locol.xpm, toolbar/jump_to-locol.xpm + * toolbar/left_arrow-locol.xpm, toolbar/new-locol.xpm + * toolbar/open-locol.xpm, toolbar/paste-locol.xpm + * toolbar/preferences-locol.xpm, toolbar/print-locol.xpm + * toolbar/right_arrow-locol.xpm, toolbar/save-locol.xpm + * toolbar/saveas-locol.xpm, toolbar/search-locol.xpm + * toolbar/spell-locol.xpm, toolbar/undo-locol.xpm + * toolbar/up_arrow-locol.xpm: + New versions of icons that uses fewer colors. + + * toolbar/tool-bar.el (tool-bar-local-item) + (tool-bar-local-item-from-menu): Try to use icons with fewer colors + if display-color-cells is 256 or less. + +2004-06-08 Kim F. Storm <storm@cua.dk> + + * wid-edit.el (widget-specify-button): Use hand pointer rather + than mouse-face as visible mouse-over effect. + +2004-06-07 Karl Fogel <kfogel@red-bean.com> + + * saveplace.el (save-place-alist-to-file): Bind `print-length' + and `print-level' to nil when writing out `save-place-alist'. + Thanks to Kai Grossjohann <kai@emptydomain.de> for enlightenment. + +2004-06-07 Juanma Barranquero <lektu@terra.es> + + * completion.el (completion-kill-region): Doc fix. + + * format.el (format-insert-annotations) + (format-annotate-location): Doc fixes. + (format-subtract-regions): Make arguments match their use in + docstring. + + * simple.el (kill-region): Doc fix. + + * subr.el (insert-buffer-substring-no-properties) + (insert-buffer-substring-as-yank): Doc fixes. + +2004-06-07 Luc Teirlinck <teirllm@auburn.edu> + + * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir): + Update docstring. + (dired-reset-subdir-switches): New function. + + * dired.el (dired-undo): Call `dired-build-subdir-alist'. + Limit scope of `buffer-read-only' binding. + +2004-06-06 Emilio C. Lopes <eclig@gmx.net> + + * eshell/esh-cmd.el (eshell/which): Respect commands quoted with + eshell-explicit-command-char. + +2004-06-06 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-argument-name): Inherit from italic face only + if the frame supports it. + +2004-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * toolbar/alias.pbm, toolbar/close.pbm, toolbar/copy.pbm + * toolbar/cut.pbm, toolbar/help.pbm, toolbar/home.pbm + * toolbar/index.pbm, toolbar/jump_to.pbm, toolbar/left_arrow.pbm + * toolbar/new.pbm, toolbar/open.pbm, toolbar/paste.pbm + * toolbar/preferences.pbm, toolbar/print.pbm, toolbar/right_arrow.pbm + * toolbar/save.pbm, toolbar/saveas.pbm, toolbar/search.pbm + * toolbar/spell.pbm, toolbar/undo.pbm, toolbar/up_arrow.pbm: + New conversions from xpm files. + + * toolbar/README: New file. + +2004-06-06 Richard M. Stallman <rms@gnu.org> + + * isearch.el (isearch-mode-map): Undo previous change. + +2004-06-05 Juri Linkov <juri@jurta.org> + + * bindings.el (debug-ignored-errors): Add regexps for history + related messages. Remove $ from "No further undo information". + Move Ediff's messages to ediff.el. + + * ediff.el: Move Ediff's debug-ignored-errors from bindings.el. + + * cus-edit.el (custom-display): Add `min-colors'. + + * custom.el (defface): Add `supports' to docstring. + + * help-fns.el (help-argument-name): Add :group 'help. + +2004-06-05 Luc Teirlinck <teirllm@auburn.edu> + + * find-dired.el (find-ls-subdir-switches): New user option. + (find-dired): No longer call `abbreviate-file-name' on DIR. + Set `dired-subdir-switches' buffer-locally. + + * locate.el: Merge the two `Commentary' sections. + (locate-ls-subdir-switches): New user option. + (locate): Update for other changes. + (locate-mode-map): Restore Dired binding for mouse-2. + Bind `locate-mouse-view-file' to M-mouse-2. + Bind `l' to `locate-do-redisplay'. + (locate-main-listing-line-p, locate-do-redisplay): New functions. + (locate-mouse-view-file, locate-tags, locate-find-directory): + Print message if used outside main listing. + (locate-mode): Update docstring. Make `*Locate*' buffer read-only. + Various changes to support inserted subdirectories. + (locate-insert-header): Change header of *Locate* buffer. + + * dired-aux.el (dired-do-redisplay, dired-maybe-insert-subdir): + Change interactive default switches. + (dired-rename-subdir-2): Update `dired-switches-alist'. + (dired-insert-subdir, dired-kill-subdir): + Handle `dired-switches-alist'. Do not mark buffer modified. + (dired-insert-subdir-validate): Handle `dired-subdir-switches'. + (dired-insert-subdir-doinsert): Omit messages. + Handle `dired-subdir-switches'. + (dired-hide-subdir, dired-hide-all): Do not mark buffer modified. + + * dired.el (dired-subdir-switches, dired-switches-alist): + New vars. + (dired-insert-old-subdirs): Do not repeatedly delete and reinsert + subdirs if -R switch is used for a subdir. + (dired-mode): Set `dired-switches-alist'. + (dired-build-subdir-alist): Only print number of directories in + echo area when invoked interactively. + +2004-06-05 Lars Hansen <larsh@math.ku.dk> + + * dired-x.el (dired-omit-mode): Rename from + dired-omit-files-p. Use define-minor-mode to define it. + (dired-omit-files-p): Add as alias for dired-omit-mode. + (dired-omit-toggle): Delete. Replaced by dired-omit-mode and + dired-mark-omitted. + (dired-mark-omitted): Add. Bind to M-O. + +2004-06-05 Kenichi Handa <handa@m17n.org> + + * ps-print.el: Fix typos (kein'ichi -> ken'ichi) + +2004-06-05 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-argument-name): Reintroduce face. + (help-default-arg-highlight): Use it, now that + `face-differs-from-default-p' can be trusted. + +2004-06-05 Matt Hodges <matt@stchem.bham.ac.uk> (tiny change) + + * textmodes/table.el: Sentence commands added to Point Motion + group; kill and backward-kill commands added to Extraction group. + +2004-06-04 Mario Lang <mlang@delysid.org> + + * battery.el (battery-linux-proc-acpi): mA was hardcored, but some + systems appear to use mW, make the code handle this. Fix a + division-by-zero bug while at it, and handle kernels with + a slightly different layout in /proc/acpi. + +2004-06-04 Karl Fogel <kfogel@red-bean.com> + + * vc-svn.el (vc-svn-checkin): Use 'nconc' instead of 'list*', + because the latter is a CL-ism. This fixes the bug reported by + Shawn Boyette <mdxi@collapsar.net> in + http://lists.gnu.org/archive/html/emacs-devel/2004-05/msg00442.html. + +2004-06-04 Miles Bader <miles@gnu.org> + + * faces.el (display-supports-face-attributes-p): Function moved to + C code. Previously only the tty-related portion of this function + was done in C; however the previous attempt to do a halfway-proper + job for non-tty displays in lisp didn't work properly because of + funny conditions during Emacs startup. + (face-differs-from-default-p): Simplify, now that + display-supports-face-attributes-p works properly on all display + types. Remove :stipple from comparison; it doesn't really work + in emacs anyway. + +2004-06-04 Miles Bader <miles@gnu.org> + + * faces.el (face-differs-from-default-p): Use a different + implementation, so we can really check whether FACE displays + differently or not. + +2004-06-04 Miles Bader <miles@gnu.org> + + * faces.el (display-supports-face-attributes-p): Implement a + `different from default' check for non-tty displays. + +2004-06-03 David Kastrup <dak@gnu.org> + + * woman.el (woman-mapcan): More concise code. + (woman-topic-all-completions, woman-topic-all-completions-1) + (woman-topic-all-completions-merge): Replace by a simpler and + much faster implementation based on O(n log n) sort/merge instead + of the old O(n^2) behavior. + +2004-06-03 Miles Bader <miles@gnu.org> + + * subr.el (read-number): Use canonical format for default in prompt. + + * minibuf-eldef.el (minibuffer-default-in-prompt-regexps): Add + regexp for " [...]" style defaults. + +2004-06-02 Romain Francoise <romain@orebokech.com> + + * ibuf-ext.el (ibuffer-jump-to-buffer): Add support for filter + groups: if the user asks for a hidden buffer, open the + corresponding filter group to expose it. + + * ibuffer.el (ibuffer-mode-map): Add key binding `M-g' to + `ibuffer-jump-to-buffer'. + (ibuffer-jump-offer-only-visible-buffers): New user option. + +2004-06-02 Juanma Barranquero <lektu@terra.es> + + * faces.el (frame-update-faces): Add empty docstring so the one + for `ignore' doesn't show through. + + * subr.el (process-kill-without-query): Remove spurious "\n" on + obsolescence string. + (focus-frame, unfocus-frame): Add obsolescence declaration and + empty docstring. + + * international/mule.el (register-char-codings): Make alias for + `ignore'. Move docstring to obsolescence info and remove + redundancy. + +2004-06-02 Kim F. Storm <storm@cua.dk> + + * frame.el (blink-cursor-start): Turn cursor off initially so blink + starts after blink-cursor-delay rather than 2*blink-cursor-delay. + +2004-05-31 Stefan Monnier <monnier@iro.umontreal.ca> + + * vc-arch.el (vc-arch-state): Don't assume the file exists. + +2004-05-31 Lars Hansen <larsh@math.ku.dk> + + * desktop.el (desktop-save): Don't save minor modes without a + known mode initialization function. + +2004-05-30 Luc Teirlinck <teirllm@auburn.edu> + + * replace.el (query-replace-interactive): Convert defvar -> defcustom. + + * autorevert.el: Update `Commentary' section. + +2004-05-30 Juanma Barranquero <lektu@terra.es> + + * dos-fns.el (convert-standard-filename): + * files.el (convert-standard-filename): + * w32-fns.el (convert-standard-filename): + Rework docstring (wording by Eli Zaretskii and Kai Grossjohann). + +2004-05-30 Kai Grossjohann <kai.grossjohann@gmx.net> + + Sync with Tramp. + + * net/tramp.el (tramp-let-maybe): Reverse args of `get'. + (tramp-let-maybe): Move to an earlier spot in the file. + Patch by Andreas Schwab. + +2004-05-30 Andreas Schwab <schwab@suse.de> + + * dired.el (dired-get-filename): Don't use dired-re-dot. + +2004-05-30 Richard M. Stallman <rms@gnu.org> + + * files.el (find-file): Doc fix. + + * font-lock.el (lisp-font-lock-keywords-2): Add multiple-value-bind. + +2004-05-30 Nick Roberts <nickrob@gnu.org> + + * progmodes/gdb-ui.el (gdb-current-frame, gud-watch) + (gdb-locals-mode, gdb-frame-handler): Display current frame in the + modeline of the locals buffer. + (gdb-goto-breakpoint): Handle gdbmi. + (gdb-get-frame-number): Change for gdbmi. + +2004-05-30 Michael Albinus <michael.albinus@gmx.de> + + * files.el (file-remote-p): Apply file name handler for operation + `file-remote-p'. It isn' a property any longer. + (file-relative-name): `fh' and `fd' get the required value via + `find-file-name-handler' already. + + * ange-ftp.el (ange-ftp-file-remote-p): New defun. + (top): Remove setting of `file-remote-p' property for + `ange-ftp-hook-function'. Add `ange-ftp' property to `file-remote-p'. + +2004-05-29 Michael Albinus <michael.albinus@gmx.de> + + Version 2.0.41 of Tramp released. + + * tramp.el (tramp-wait-for-regexp, tramp-wait-for-output): + Throw away if process has died. + Reported by Luc Teirlinck <teirllm@dms.auburn.edu>. + (tramp-out-of-band-prompt-regexp): Rename to + `tramp-process-alive-regexp', because its usage is widen. + (tramp-actions-copy-out-of-band): Apply it. + (tramp-actions-before-shell, tramp-multi-actions): + Add `tramp-action-process-alive' action. + (tramp-action-process-alive): New defun. + (tramp-file-name-handler-alist, tramp-file-name-for-operation): + Add entry for `file-remote-p'. + (tramp-handle-file-remote-p): New defun. + (top): Remove setting of `file-remote-p'. Don't set + `inhibit-file-name-handlers' and `inhibit-file-name-operation'. + + * tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry for + `file-remote-p'. + + * tramp-uu.el (tramp-uuencode-region): Padding characters aren't + counted for (last) line. [They should or they shouldn't? --Stef] + Reported by Aaron Ucko <ucko@ncbi.nlm.nih.gov>. + +2004-05-29 Kai Grossjohann <kai.grossjohann@gmx.net> + + * tramp.el (tramp-initial-commands): Add "unset HISTFILE"; this is + not really necessary but seems to keep the shell history smaller + in some cases. It is no substitute for setting HISTFILE and + HISTSIZE from tramp-open-connection-setup-interactive-shell, + though. Suggested by Luc Teirlinck. + (tramp-open-connection-setup-interactive-shell): Export variables + HISTFILE and HISTSIZE, do not just set them. From Luc Teirlinck. + (tramp-set-process-query-on-exit-flag): New compat function. + (tramp-open-connection-multi, tramp-open-connection-su) + (tramp-open-connection-rsh, tramp-open-connection-telnet) + (tramp-do-copy-or-rename-file-out-of-band): Use it. + (tramp-let-maybe): New macro, let-binds a variable only if it + isn't obsolete. + (tramp-check-ls-commands, tramp-handle-expand-file-name) + (tramp-handle-file-truename): Use it. + (tramp-completion-file-name-regexp-unified): Avoid matching + filenames starting with "/:" -- those are reserved for + file-name-non-special. + + * tramp-smb.el (tramp-smb-open-connection): + Use tramp-set-process-query-on-exit-flag compat function. + +2004-05-29 Richard M. Stallman <rms@gnu.org> + + * net/browse-url.el (browse-url-interactive-arg): Doc fix. + + * emacs-lisp/lisp-mode.el (prin1-char): Catch errors from `string'. + (eval-last-sexp-print-value): Print char equivalent regardless + of standard-output value. + + * thumbs.el (thumbs-subst-char-in-string): Delete. + (thumbs-thumbname): Use subst-char-in-string. + (thumbs-resize-image): Use condition-case, not ignore-errors. + (thumbs-kill-buffer): Likewise. + + * thumbs.el: Don't include cl. Don't bother with old Emacs versions. + (thumbs-mode): Make buffer read-only. + (thumbs-make-thumb): Unconditionally accept an existing file. + (thumbs-insert-thumb): Add thumb-image-file property to the image. + (thumbs-do-thumbs-insertion): Be smarter about where to put newlines. + (thumbs-show-thumbs-list): Error if images not supported. + (thumbs-save-current-image): Improve prompt string. + (thumbs-mode-map): Define u, R, x. + (thumbs-unmark): New command. + (thumbs-emboss-image): Minor cleanup. + (thumbs-forward-char, thumbs-backward-char): Skip chars with no image. + (thumbs-rename-images): New command. + (thumbs-show-image-num): Rewrite. Don't rename the buffer. + + * thumbs.el (thumbs-current-image): New function. + (thumbs-file-list, thumbs-file-alist): New functions. + (thumbs-find-image): Delete arg L. + Don't set up thumbs-fileL as buffer-local global var. + (thumbs-find-image-at-point): Use thumbs-current-image. + (thumbs-set-image-at-point-to-root-window): Likewise. + (thumbs-delete-images): Use thumbs-current-image, thumbs-file-alist. + Record and warn about errors. Update thumbs-markedL for deletions. + (thumbs-next-image, thumbs-previous-image): Use thumbs-file-alist. + (thumbs-redraw-buffer): Use thumbs-file-list. + (thumbs-mark): Use thumbs-current-image. + (thumbs-show-name): Use thumbs-current-image. + + * imenu.el (imenu--menubar-select): Set imenu-menubar-modified-tick + and imenu--last-menubar-index-alist. + + * subr.el (with-selected-window): Undo previous change. + +2004-05-29 John Paul Wallington <jpw@gnu.org> + + * thumbs.el (thumbs-show-name): Do nothing if no image at point. + (thumbs-mouse-find-image): New command. + (thumbs-mode-map): Bind it to mouse-2. + (thumbs-mode): Make mode-class special. + (thumbs-view-image-mode): Likewise. + +2004-05-29 Pavel Kobiakov <pk_at_work@yahoo.com> + + * flymake.el: New file. + +2004-05-28 Luc Teirlinck <teirllm@auburn.edu> + + * files.el (find-file-noselect-1): Do not bind + `inhibit-read-only' to t during execution of + `find-file-not-found-functions'. + +2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * vc-mcvs.el (vc-mcvs-print-log, vc-mcvs-diff): + * vc-arch.el (vc-arch-diff): Add optional `buffer' arg. + +2004-05-28 Juri Linkov <juri@jurta.org> + + * simple.el (eval-expression-print-format): New fun. + + * simple.el (eval-expression): + * emacs-lisp/lisp-mode.el (eval-last-sexp-print-value): + * emacs-lisp/edebug.el (edebug-compute-previous-result) + (edebug-eval-expression): Print additionally the value returned by + `eval-expression-print-format'. + + * emacs-lisp/lisp.el (insert-pair-alist): New var. + (insert-pair): Make arguments optional. Find character pair + from `insert-pair-alist' according to the last input event. + (insert-parentheses): Make arguments optional. + (raise-sexp, delete-pair): New funs. + + * emacs-lisp/lisp-mode.el (indent-pp-sexp): New fun. + (emacs-lisp-mode-map, lisp-interaction-mode-map): + Bind C-M-q to `indent-pp-sexp'. + + * emacs-lisp/pp.el (pp-buffer): New fun created from the code in + `pp-to-string' modified to be able to format text with newlines. + (pp-to-string): Move the buffer-formatting part of the code to + `pp-buffer'. Call `pp-buffer'. + + * info.el (Info-desktop-buffer-misc-data): Don't save information + about virtual files. + (Info-restore-desktop-buffer): Restore Info buffers in prepared + buffers with names obtained from the desktop file instead of the + default *info* buffer. + +2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * subr.el (with-selected-window): Only save/restore the selected window. + + * progmodes/compile.el (compilation-error-regexp-alist): + Use expand-file-name and data-directory. + + * progmodes/grep.el (grep-tree): Rework previous fix. + + * mouse.el (mouse-set-region-1): Use temporary transient-mark-mode + after the user marked text with the mouse. + + * startup.el (command-line): Keep the first regexp of + auto-save-file-name-transforms intact. + +2004-05-28 Juanma Barranquero <lektu@terra.es> + + * cus-edit.el (customize-face, customize-face-other-window) + (custom-face-edit-delete): Make arguments match their use in + docstring. + (custom-unloaded-symbol-p, custom-unloaded-widget-p): Fix typo in + docstring. + + * cvs-status.el (cvs-tree-merge, cvs-tags->tree): Use `butlast', + not `cvs-butlast'. + + * pcvs-util.el (cvs-butlast, cvs-nbutlast): Remove (`butlast' and + `nbutlast' are in subr.el). + + * w32-fns.el (w32-using-nt, w32-shell-dos-semantics) + (set-w32-system-coding-system): Doc fixes. + + * textmodes/artist.el (artist-last, artist-remove-nulls): Simplify. + (artist-draw-ellipse-general, artist-draw-ellipse-with-0-height): + Make arguments match their use in docstring. + (artist-draw-region-trim-line-endings) + (artist-mouse-choose-operation): Fix typo in docstring. + (artist-key-set-point-common): Doc fix. + +2004-05-28 Simon Josefsson <jas@extundo.com> + + * mail/smtpmail.el (smtpmail-open-stream): + Bind starttls-extra-arguments too, if starttls.el uses GNUTLS. + +2004-05-26 Simon Josefsson <jas@extundo.com> + + * starttls.el: Merge with my GNUTLS based starttls.el. + (starttls-gnutls-program, starttls-use-gnutls) + (starttls-extra-arguments, starttls-process-connection-type) + (starttls-connect, starttls-failure, starttls-success): New variables. + (starttls-program, starttls-extra-args): Doc fix. + (starttls-negotiate-gnutls, starttls-open-stream-gnutls): New funs. + (starttls-negotiate, starttls-open-stream): Check `starttls-use-gnutls' + and pass on to corresponding *-gnutls function if it is set. + +2004-05-27 Luc Teirlinck <teirllm@auburn.edu> + + * autorevert.el (auto-revert-handler): Disable auto-reverting of + remote files. + +2004-05-27 Michael Albinus <michael.albinus@gmx.de> + + * files.el (file-name-non-special): There are more operations + which need handling: `find-backup-file-name', + `insert-file-contents', `verify-visited-file-modtime', + `write-region'. Rename t value of method to `add'. Add new + methods `quote' and `unquote-then-quote' to file-arg-indices. + +2004-05-25 Juri Linkov <juri@jurta.org> + + * info.el (Info-toc): Call Info-mode on intermediate buffer. + (Info-index-nodes): Enclose code in condition-case to catch errors. + (Info-index-node): Don't search all index nodes if request is only + for the current node and file is not in the cache of index nodes. + (Info-mode-map): Bind Info-copy-current-node-name to `w' + for consistency with dired-copy-filename-as-kill. + Bind `S' to Info-search-case-sensitively. + (Info-copy-current-node-name): New arg. With zero prefix arg put + the name inside a function call to `info'. Display copied text in + the echo area. + +2004-05-25 Sam Steingold <sds@gnu.org> + + * emacs-lisp/lisp-mode.el (lisp-find-tag-default): New function: + strip the package prefix from the symbol name, if any. + Make it the `find-tag-default-function' for `lisp-mode'. + +2004-05-25 John Paul Wallington <jpw@gnu.org> + + * gs.el (gs-load-image): Use `set-process-query-on-exit-flag' + instead of obsolete `process-kill-without-query'. + + * textmodes/texinfmt.el (texinfo-indexvar-alist): + Declare as variable, not constant. + +2004-05-25 Luc Teirlinck <teirllm@auburn.edu> + + * files.el (find-file-noselect-1): Fix bug introduced by + Revision 1.694. As a side effect, `inhibit-read-only' + is again, by default, t during execution of + `find-file-not-found-functions'. + (insert-directory): Check that lines were really inserted by + the --dired switch, before erasing them. + +2004-05-24 Nick Roberts <nickrob@gnu.org> + + * progmodes/gdb-ui.el (gdb-breakpoints-mode, gdb-frames-mode) + (gdb-locals-mode): Check gud-minor-mode in gud-comint-buffer. + (gdb-var-update, gdb-var-update-handler, gdb-var-delete) + (gdb-edit-value, gdb-speedbar-expand-node): Handle new value for + gud-minor-mode (gdbmi). + +2004-05-24 Yoichi NAKAYAMA <yoichi@geiin.org> (tiny change) + + * net/browse-url.el (browse-url-interactive-arg): Enable user to + explicitly select the text to be taken as URL. + +2004-05-23 Juri Linkov <juri@jurta.org> + + * info.el (Info-index-nodes): New var and fun. + (Info-goto-index, Info-index, info-apropos) + (Info-find-emacs-command-nodes): Rewrite to use Info-index-nodes. + (Info-index): Fix docstring. Store and restore Info-history-list. + (Info-complete-nodes): New var. + (Info-complete-menu-item): Use it. + (Info-index-node): New fun. + (Info-final-node, Info-forward-node, Info-backward-node) + (Info-build-toc, Info-try-follow-nearest-node, Info-fontify-node): + Use Info-index-node. + (Info-extract-menu-item, Info-extract-menu-counting): Set second + arg of `Info-extract-menu-node-name' to non-nil for index nodes. + (Info-find-node-2): If a node with period in its name not found, + try to find a node without the name part after period. + (Info-select-node): Call Info-fontify-node only if + Info-fontify-maximum-menu-size is not nil. + (info-apropos): Set Info-fontify-maximum-menu-size to nil. + (Info-find-emacs-command-nodes, Info-goto-emacs-command-node): + Preserve Info-history-list. + (Info-toc): Set Info-current-file. + (Info-build-toc): Move point to the beginning of the buffer. + Add main-file variable. + (Info-dir-remove-duplicates, Info-history, Info-toc, info-apropos): + Use backslashed representation of the control character ^_. + + * textmodes/texinfmt.el (texinfo-print-index): Print index line + numbers in the new Texinfo 4.7 format. + + * add-log.el (change-log-font-lock-keywords): Remove `:' from + regexps for function and variable names. + + * descr-text.el (describe-property-list): Add [show] button for + `syntax-table' property with action to pp to a separate buffer. + (describe-char): Replace search-forward by re-search-forward with + whitespace regexp after "character:" to not fail in too narrow windows. + + * simple.el (next-error-find-buffer): Add a rule to return + next-error capable buffer if one window on the selected frame + displays such buffer. + +2004-05-23 Nick Roberts <nickrob@gnu.org> + + * progmodes/gdb-ui.el (gdb-server-prefix): New variable. + (gud-watch, gdb-send-item, gdb-breakpoints-mode, gdb-frames-mode) + (gdb-locals-mode, gdb-send-item, gdb-toggle-breakpoint) + (gdb-delete-breakpoint, gdb-frames-select, gdb-threads-buffer) + (gdb-registers-buffer, gdb-reset, gdb-assembler-buffer): + Handle new value for gud-minor-mode (gdbmi). + (gdb-buffer-type, gdb-input-queue, gdb-prompting) + (gdb-output-sink, gdb-current-item, gdb-pending-triggers): + Change from local to global gdb variable set. + (gdb-ann3): Initialise above gdb variable set. + (gdb-var-update, gdb-var-update-handler, gdb-enqueue-input) + (gdb-dequeue-input, gdb-source, gdb-pre-prompt, gdb-prompt) + (gdb-subprompt, gdb-starting, gdb-stopping, gdb-frame-begin) + (gdb-stopped, gdb-post-prompt, gdb-concat-output) + (def-gdb-auto-update-trigger, def-gdb-auto-update-handler) + (gdb-info-locals-handler, gdb-invalidate-assembler) + (gdb-get-current-frame, gdb-frame-handler): Handle gdb variable + set as global variables. + (gdb-get-create-buffer): Don't make gud-comint buffer-local. + Handle gdbmi. + (gdb-info-breakpoints-custom): Fix regexp. + (def-gdb-var): Delete. + + * progmodes/gud.el (gud-menu-map, gud-speedbar-menu-items) + (gud-speedbar-buttons, gud-sentinel, gud-display-line) + (gud-basic-call): Handle new value for gud-minor-mode (gdbmi) for + a new mode. The file (gdb-mi.el) for this mode will be included + with the GDB distribution (6.2 onwards) and will use GDB/MI as its + primary interface. + +2004-05-23 Jesper Harder <harder@ifa.au.dk> + + * progmodes/grep.el (grep-tree): Ensure that DIR argument is + interpreted as a directory. + +2004-05-22 Richard M. Stallman <rms@gnu.org> + + * textmodes/paragraphs.el (sentence-end): Match unicode curly quotes + as a close quote. + + * textmodes/bibtex.el: Use assoc-string, not assoc-ignore-case. + + * progmodes/idlw-shell.el (idlwave-shell-get-object-class): + Use assoc-string, not assoc-ignore-case. + + * progmodes/ada-mode.el: Use assoc-string, not assoc-ignore-case. + + * emacs-lisp/lisp.el (mark-defun, narrow-to-defun): + If moving back then fwd gets a defun that ends before point, + try again moving fwd then back. + + * files.el (file-name-non-special): Allow t in file-arg-indices + to mean requote the return value. Use `identity' as an element + rather than as the whole value. + + * gs.el (gs-options): Add -dSAFER. Mark it risky. + +2004-05-22 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-add-fundoc-usage): Use %S only for output of + `help-make-usage'. + (help-highlight-arguments): Skip function name before searching + for arguments. + +2004-05-21 Juanma Barranquero <lektu@terra.es> + + * allout.el (allout-chart-subtree, allout-rebullet-topic-grunt): + Don't mention in the docstring these arguments meant for + internal (recursive) use only. + (allout-char-spec): Comment out (it's not implemented). + (allout-old-expose-topic, allout-exposure): Fix docstring and add + obsolescence declaration. + (allout-flatten-exposed-to-buffer) + (allout-indented-exposed-to-buffer): Fix typos in docstring. + (my-mark-marker): Doc fix. + (produce-allout-mode-map, allout-sibling-index) + (allout-isearch-expose, allout-distinctive-bullet) + (allout-open-topic, allout-reindent-body) + (allout-rebullet-heading, allout-process-exposed) + (allout-insert-listified, allout-latex-verb-quote) + (allout-insert-latex-header, allout-insert-latex-trailer): + Make arguments match their use in docstring. + (allout-primary-bullet, allout-old-style-prefixes) + (allout-inhibit-protection, allout-init, allout-mode) + (allout-before-change-protect, allout-flag-region): + Use "Emacs" instead of "emacs" in docstrings. + +2004-05-21 Masayuki Ataka <ataka@milk.freemail.ne.jp> (tiny change) + + * international/characters.el: Modify syntax of more characters. + +2004-05-21 Masatake YAMATO <jet@gyve.org> + + * progmodes/etags.el (tags-apropos, list-tags): Require apropos. + (etags-tags-completion-table): Show parsing progress. + +2004-05-20 Luc Teirlinck <teirllm@auburn.edu> + + * locate.el (locate-prompt-for-command): Shorten first line of + docstring. + (locate-mode): Expand docstring and include keymap summary. + + * files.el (find-file-noselect-1): Limit the scope of the + `inhibit-read-only' binding. Make sure that `inhibit-read-only' + is, by default, nil during the execution of + `find-file-not-found-functions' and `find-file-hook'. + +2004-05-20 Michael Mauger <mmaug@yahoo.com> + + * facemenu.el (facemenu-color-name-equal): New function. + (list-colors-display): Use it to compare colors instead of + facemenu-color-equal. + +2004-05-20 Dan Nicolaescu <dann@ics.uci.edu> + + * compare-w.el (compare-windows-face): Use min-colors instead of + checking for tty or pc types. + +2004-05-19 Stefan Monnier <monnier@iro.umontreal.ca> + + * simple.el (do-auto-fill): Remove unused vars `bol' and `opoint'. + (completion-setup-function): Use with-current-buffer. + Properly save excursion. Simplify. + Don't assume there is necessarily a `mouse-face' property somewhere. + + * progmodes/gud.el (gud-reset): Use unless & with-current-buffer. + + * progmodes/gdb-ui.el (gdb-reset): Use unless. Fix regexp. + + * emacs-lisp/bytecomp.el (byte-compile-log): Use backquotes. + (byte-compile-log-1): Don't call (byte-goto-log-buffer). + Use with-current-buffer. + (byte-goto-log-buffer): Delete. + (byte-compile-log-file): Call compilation-forget-errors. + +2004-05-19 Takaaki Ota <Takaaki.Ota@am.sony.com> (tiny change) + + * net/ldap.el (ldap-search-internal): Avoid mixing standard error + output messages into the search result. + +2004-05-19 Masatake YAMATO <jet@gyve.org> + + * wid-edit.el (widget-radio-button-notify): Revert my last + change. Reported by Katsumi Yamaoka <yamaoka@jpl.org>. + +2004-05-19 Kenichi Handa <handa@m17n.org> + + * international/characters.el: Fix syntax (open/close) of CJK chars. + +2004-05-18 Karl Chen <quarl@hkn.eecs.berkeley.edu> (tiny change) + + * help-mode.el (help-go-back): Don't depend on position of back button. + +2004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * files.el (auto-save-file-name-transforms): Make sure ange-ftp temp + files files don't contain an accidental additional /. + + * textmodes/tex-mode.el (tex-compilation-parse-errors): Save excursion + in source buffer. + +2004-05-18 Masatake YAMATO <jet@gyve.org> + + * wid-edit.el (widget-radio-button-notify): Don't pass `widget' + to widget-apply. :action method assumes 2 arguments, not 3. + +2004-05-17 Glenn Morris <gmorris@ast.cam.ac.uk> + + * progmodes/f90.el (f90-end-block-re, f90-start-block-re): + New constants. + (hs-special-modes-alist): Add an f90-mode entry. + +2004-05-17 Sam Steingold <sds@gnu.org> + + * emacs-lisp/cl-indent.el (common-lisp-indent-function-1): + Indent "without-" forms just like "with-" and "do-". Use regexp-opt. + +2004-05-16 Kim F. Storm <storm@cua.dk> + + * emacs-lisp/timer.el (timer-event-handler): Fix last change. + +2004-05-15 John Wiegley <johnw@newartisans.com> + + * eshell/esh-io.el (eshell-get-target): Whitespace changes. + (eshell-output-object-to-target): Improve output speed 20% by not + calling `eshell-stringify' if something is already known to be a string. + +2004-05-15 Alex Ott <ott@jet.msk.su> + + * textmodes/ispell.el (ispell-local-dictionary-alist): + Add windows-1251 to the choice of coding systems. + (ispell-dictionary-alist-6): Add support for "russianw.aff", + encoded in cp1251. + +2004-05-15 Dan Nicolaescu <dann@ics.uci.edu> + + * progmodes/compile.el (compilation-warning-face) + (compilation-info-face): Use min-colors. + +2004-05-15 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * toolbar/close.pbm, toolbar/close.xpm, toolbar/copy.pbm + * toolbar/copy.xpm, toolbar/cut.pbm, toolbar/cut.xpm + * toolbar/help.pbm, toolbar/help.xpm, toolbar/home.pbm + * toolbar/home.xpm, toolbar/index.pbm, toolbar/index.xpm + * toolbar/jump_to.pbm, toolbar/jump_to.xpm, toolbar/left_arrow.pbm + * toolbar/left_arrow.xpm, toolbar/new.pbm, toolbar/new.xpm + * toolbar/open.pbm, toolbar/open.xpm, toolbar/paste.pbm + * toolbar/paste.xpm, toolbar/preferences.pbm, toolbar/preferences.xpm + * toolbar/print.pbm, toolbar/print.xpm, toolbar/right_arrow.pbm + * toolbar/right_arrow.xpm, toolbar/save.pbm, toolbar/save.xpm + * toolbar/saveas.pbm, toolbar/saveas.xpm, toolbar/search.pbm + * toolbar/search.xpm, toolbar/spell.pbm, toolbar/spell.xpm + * toolbar/undo.pbm, toolbar/undo.xpm, toolbar/up_arrow.pbm + * toolbar/up_arrow.xpm: New icons from GTK+ version 2. + +2004-05-15 Kim F. Storm <storm@cua.dk> + + * emacs-lisp/timer.el (timer-activate): Add optional arg triggered-p. + Use it to set triggered-p element of timer. + (timer-event-handler): Set triggered-p element non-nil while running + the timer function. + +2004-05-14 David Ponce <david@dponce.com> + + * tree-widget.el: New file. + +2004-05-13 Marcelo Toledo <marcelo@marcelotoledo.org> + + * language/european.el ("Brazilian Portuguese"): Add support for + Brazilian Portuguese. + +2004-05-13 John Wiegley <johnw@newartisans.com> + + * iswitchb.el (iswitchb-use-virtual-buffers): Only turn on + `recentf-mode' if this variable has been customized to t. + + * eshell/esh-test.el (eshell-test): Call the function + `emacs-version' rather than trying to build a custom version string. + +2004-05-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * net/telnet.el (telnet-mode): Use define-derived-mode. + Don't modify the global value of comint-prompt-regexp. + +2004-05-13 John Paul Wallington <jpw@gnu.org> + + * version.el (emacs-version): Check for `gtk' feature before + `x-toolkit' feature. + +2004-05-13 Juanma Barranquero <lektu@terra.es> + + * files.el (file-truename): Don't mention COUNTER and PREV-DIRS + arguments in the docstring, they're used only in recursive calls. + + * help-fns.el (help-arg-highlighting-function) + (help-argument-name): Delete. + (help-default-arg-highlight): New function. + (help-do-arg-highlighting): Use it. + +2004-05-13 Glenn Morris <gmorris@ast.cam.ac.uk> + + * calendar/appt.el (appt-disp-window): + Use `calendar-set-mode-line' for a centered mode-line. + +2004-05-13 Takaaki Ota <Takaaki.Ota@am.sony.com> (tiny change) + + * calendar/appt.el (appt-disp-window): Do not split window + excessively when `split-height-threshold' is low. + +2004-05-12 Nick Roberts <nickrob@gnu.org> + + * progmodes/gud.el (gud-mode): Add gud-kill-buffer-hook to + kill-buffer-hook here and make it local. + (gud-kill-buffer-hook): Use kill-process for a sure kill. + +2004-05-12 Daniel Pfeiffer <occitan@esperanto.org> + + * progmodes/compile.el (compilation-set-window-height): + Use save-excursion to protect against misplaced marker. + +2004-05-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * custom.el (defface): Document that type can have value gtk. + + * faces.el (face-spec-set-match-display): Handle type gtk in display. + +2004-05-12 Kenichi Handa <handa@m17n.org> + + * descr-text.el: Require quail at comile time. + (describe-char): If an input method is on and it supports the + character, show how to input it. + + * international/quail.el (quail-install-decode-map): Accept a + char-table whose subtype is `quail-decode-map'. + (quail-store-decode-map-key, quail-gen-decode-map1) + (quail-gen-decode-map, quail-find-key1, quail-find-key) + (quail-show-key): New functions. + +2004-05-12 Juanma Barranquero <lektu@terra.es> + + * generic.el (define-generic-mode): Remove redundant arglist info. + + * help-fns.el (help-split-fundoc, help-add-fundoc-usage): + Make arguments match their use in docstring. + (help-arg-highlighting-function): New variable. + (help-argument-name): Mention it in the docstring. + (help-do-arg-highlight): Use it. Expand regexp to accept also + ARG-xxx and xxx-ARG references. + +2004-05-11 Yoichi NAKAYAMA <yoichi@geiin.org> (tiny change) + + * mail/rfc2368.el (rfc2368-parse-mailto-url): Make the results of + parsing "mailto:addr1%2C%20addr2", "mailto:?to=addr1%2C%20addr2", + and "mailto:addr1?to=addr2" equal. + +2004-05-11 Alexander Pohoyda <alexander.pohoyda@gmx.net> (tiny change) + + * man.el (Man-getpage-in-background): Use shell-file-name + and shell-command-switch variables instead of hard-coded values. + +2004-05-11 Eli Zaretskii <eliz@gnu.org> + + * iimage.el: New file. + +2004-05-11 Juanma Barranquero <lektu@terra.es> + + * custom.el (custom-initialize-default, defcustom): + Fix typo in docstring. + + * files.el (set-visited-file-name, file-expand-wildcards): + Fix docstring. + +2004-05-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/lisp-mode.el (prin1-char): Use eventp. + + * subr.el (eventp): Be more discriminating with integers. + +2004-05-10 Daniel Pfeiffer <occitan@esperanto.org> + + * progmodes/compile.el (compile): Add universal prefix arg. + (compilation-error-regexp-alist-alist): Add edg patterns. + +2004-05-10 Sam Steingold <sds@gnu.org> + + * textmodes/ispell.el (ispell-message): + Use `message-cite-prefix-regexp' instead of `message-yank-prefix'. + +2004-05-10 Dave Love <fx@gnu.org> + + * progmodes/python.el (help-buffer): Autoload when compiling. + (python-after-info-look): Don't assume Info-goto-node returns non-nil. + (run-python): Prepend to any existing PYTHONPATH. + +2004-05-10 Nick Roberts <nick@nick.uklinux.net> + + * progmodes/gdb-ui.el (gdb-annotation-rules): Add nquery annotation + for pending breakpoints. + +2004-05-10 Richard M. Stallman <rms@gnu.org> + + * mail/unrmail.el (unrmail): Mostly rewritten. Parses the file + directly without calling any functions in Rmail. + (unrmail-unprune): Function deleted. + +2004-05-10 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/python.el (inferior-python-mode-map): Remove erroneous + C-c C-z binding. + +2004-05-10 Kenichi Handa <handa@m17n.org> + + * descr-text.el (describe-char): Fix previous change. Don't make + a unibyte character to multibyte in the *Help* buffer. + +2004-05-10 Miles Bader <miles@gnu.org> + + * lisp/progmodes/gud.el (gud-common-init): Only consider an existing + buffer an error if the debugger process is actually running. + +2004-05-10 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-argument-name): Default to italic. + (help-highlight-arguments): Return always (usage . doc), even when + usage is nil. + + * ibuf-macs.el (define-ibuffer-column, define-ibuffer-sorter) + (define-ibuffer-filter): Add usage info. + (define-ibuffer-op): Add usage info (but CL-style defaults for + keyword args are not shown). + + * subr.el (remove-overlays, read-passwd): Fix docstring. + (start-process-shell-command): Fix docstring. Put usage info in a + format usable by `describe-function'. + (open-network-stream, open-network-stream-nowait) + (open-network-stream-server): Fix docstring. + +2004-05-09 Jason Rumney <jasonr@gnu.org> + + * international/code-pages (cp932, cp936, cp949, c950): Remove. + Only define cp125* if windows-125* is already defined. + + * language/korean.el (cp949): Add alias. + + * language/chinese.el (cp936, cp950): Add aliases. + + * language/japanese.el (cp932): Add alias. + + * term/w32-win.el: Require code-pages. + + * international/mule-cmds.el (set-locale-environment): + On MS-Windows use ansi code-page for default coding-systems. + Set up paper sizes for Windows 3 letter languages. + + * international/code-pages.el (cp932, cp936, cp949, cp950): + Add aliases. Also add cp125* if not already defined. + +2004-05-09 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-highlight-arguments): Don't try to highlight + missing or autoloaded arglists. Accept structured arguments, like + the first ones of `do' and `flet'. + + * pcvs.el (cvs-mode-run, cvs-is-within-p): Fix typo in docstring. + (cvs-get-marked): Remove redundant arglist info. + + * net/quickurl.el (quickurl, quickurl-browse-url, quickurl-read): + Don't use CL-style default args. + +2004-05-08 Andreas Schwab <schwab@suse.de> + + * emacs-lisp/checkdoc.el (checkdoc-minor-mode): Doc fix. + + * international/subst-ksc.el: Fix references to utf-translate-cjk + into utf-translate-cjk-mode. + * international/subst-big5.el: Likewise. + * international/subst-gb2312.el: Likewise. + * international/subst-jis.el: Likewise. + * international/utf-16.el: Likewise. + * international/utf-8.el: Likewise. + +2004-05-08 John Wiegley <johnw@newartisans.com> + + * iswitchb.el (iswitchb-use-virtual-buffers): Add support for + "virtual buffers" (off by default), which makes it possible to + switch to the "virtual" buffers of recently visited files. When a + buffer name search fails, and this option is on, iswitchb will + look at the list of recently visited files, and permit matching + against those names. When the user hits RET on a match, it will + revisit that file. + (iswitchb-read-buffer): Add two optional arguments, which makes + isearchb.el possible. + (iswitchb-completions, iswitchb-set-matches, iswitchb-prev-match) + (iswitchb-next-match): Add support for virtual buffers. + + * isearchb.el: This module extends iswitchb to provide "as you + type" buffer selection. + + * textmodes/flyspell.el (flyspell-highlight-incorrect-region): + Ignore the read-only property when flyspell highlighting is on. + Not ignoring it leads to a series of confusing errors. + (flyspell-highlight-duplicate-region): Ignore read-only, as above, + but also make sure to call flyspell-incorrect-hook. + (flyspell-maybe-correct-transposition): Perform transposition test + by bit twiddling a string, rather than using a temp buffer. + (flyspell-maybe-correct-doubling): Use a string rather than a temp + buffer. This is also the original version of the code, which + could not be checked in before due to a previous lack of + assignment papers. This version has seen heavy usage on my system + for several years now. + + * calendar/cal-bahai.el: New file, which adds support for the + Baha'i calendar to Emacs. This calendar is based on a solar year + of 19 months of 19 days, with 4 intercalary days. Each year + begins on March 21, with the calendar starting in 1844. + + * calendar/cal-menu.el, calendar/calendar.el, + calendar/diary-lib.el, calendar/holidays.el: Added support for + using cal-bahai.el. + + * eshell/em-glob.el (eshell-glob-initialize): Move initialization + of `eshell-glob-chars-regexp' into `eshell-glob-regexp', so that + function can be used outside of eshell buffers. + (eshell-glob-regexp): Initialize `eshell-glob-chars-regexp' here. + +2004-05-08 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-do-arg-highlight): Temporarily set ?\- to be a + word constituent so FOO-ARG is not recognized as an arg. + (help-highlight-arguments): Don't skip lists in mandatory arguments. + + * simple.el (next-error): Fix typo in docstring. + (open-line): Make argument names match their use in docstring. + (split-line): Fix docstring. + + * emacs-lisp/cl-macs.el (do, do*): Put usage info in a format + usable by `describe-function'. + (gensym, gentemp, typep, ignore-errors): Make argument names match + their use in docstring. + + * progmodes/python.el (python-describe-symbol): Pass INTERACTIVE-P + argument to `help-setup-xref'. + +2004-05-07 Kai Grossjohann <kai@emptydomain.de> + + Version 2.0.40 of Tramp released. + + * net/tramp.el (tramp-completion-mode, tramp-md5-function): + Use symbol-function to invoke functions only known on some Emacs + flavors. This avoids byte-compiler warnings. Reported by Kevin + Scaldeferri <kevin@scaldeferri.com>. + (tramp-do-copy-or-rename-file-via-buffer): Rename from + tramp-do-copy-or-rename-via-buffer (without `file'), to make it + consistent with the other tramp-do-* functions. + (tramp-do-copy-or-rename-file): Calls adjusted. + (tramp-process-initial-commands): Avoid liveness check on shell -- + we know that it must be alive since we're opening a connection at + this moment. + (tramp-last-cmd): New internal variable. + (tramp-process-echoes): New tunable. + (tramp-send-command): Set tramp-last-cmd. + (tramp-wait-for-output): Delete echo, if applicable. + (tramp-read-passwd): Construct the key for the password cache in a + way that works for multi methods, too. + (tramp-bug): Add backup-directory-alist and + bkup-backup-directory-info to bug reports, with Tramp counterparts. + +2004-05-07 Michael Albinus <michael.albinus@gmx.de> + + * net/tramp*.el: Suppress byte-compiler warnings where possible. + + * net/tramp.el (tramp-out-of-band-prompt-regexp) + (tramp-actions-copy-out-of-band): New defcustoms. + (tramp-do-copy-or-rename-file-out-of-band): Asynchronous process + used instead of a synchronous one. Allows password entering. + (tramp-action-out-of-band): New defun. + (tramp-open-connection-rsh, tramp-method-out-of-band-p): + Remove restriction with password from doc string. + (tramp-bug): Add variables `tramp-terminal-prompt-regexp', + `tramp-out-of-band-prompt-regexp', + `tramp-actions-copy-out-of-band', `password-cache' and + `password-cache-expiry'. + (toplevel): Remove todo item wrt ssh-agent. Obsolete due to + password caching. + (tramp-touch): FILE can be a local file, too. + (TODO): Remove items done. + (tramp-handle-insert-directory): Properly quote file name also if + not full-directory-p. Handle wildcard case. Reported by Andreas + Schwab <schwab@suse.de>. + (tramp-do-copy-or-rename-file-via-buffer): Set permissions of the + new file. + (tramp-handle-file-local-copy, tramp-handle-write-region): + The permissions of the temporary file are set if filename exists. + Reported by Ted Stern <stern@cray.com>. + (tramp-backup-directory-alist) + (tramp-bkup-backup-directory-info): New defcustoms. + (tramp-file-name-handler-alist): Add entry for `find-backup-file-name'. + (tramp-handle-find-backup-file-name): New function. + Implements Tramp's find-backup-file-name. + + * net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add entry + for `find-backup-file-name'. + + * net/tramp-vc.el (tramp-vc-workfile-unchanged-p): Correct typo + ("file" -> "filename"). Reported by Kim F. Storm <storm@cua.dk>. + +2004-05-07 Lars Hansen <larsh@math.ku.dk> + + * desktop.el (desktop-buffer-mode-handlers): Fix docstring. + +2004-05-07 Juanma Barranquero <lektu@terra.es> + + * subr.el (lambda): Add arglist description to docstring. + (declare): Fix typo in docstring. + (open-network-stream): Fix docstring. + (process-kill-without-query): Fix docstring and add obsolescence info. + (last, butlast, nbutlast): Make arguments match their use in docstring. + (insert-buffer-substring-no-properties): Likewise. + (insert-buffer-substring-as-yank): Likewise. + (split-string): Fix docstring. + + * emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable): + Make argument names match their use in docstring. + + * emacs-lisp/re-builder.el (reb-auto-update): Fix typo in docstring. + +2004-05-06 Nick Roberts <nickrob@gnu.org> + + * progmodes/gdb-ui.el: Improve/extend documentation strings. + Fit first sentence on one line for apropos-command. + +2004-05-06 Stefan Monnier <monnier@iro.umontreal.ca> + + Changes largely merged in from Dave Love's code. + * progmodes/python.el: Doc fixes. + (python-mode-map): Add python-complete-symbol. + (python-comment-line-p, python-beginning-of-string): Use syntax-ppss. + (python-comment-indent, python-complete-symbol) + (python-symbol-completions, python-partial-symbol) + (python-try-complete): New. + (python-indent-line): Remove optional arg. Use python-block-end-p. + (python-check): Bind compilation-error-regexp-alist. + (inferior-python-mode): Use rx. Move keybindings to top level. + Set comint-input-filter. + (python-preoutput-filter): Use rx. + (python-input-filter): Re-introduce. + (python-proc): Start new process if necessary. + Check python-buffer non-nil. + (view-return-to-alist): Defvar. + (python-send-receive): New. + (python-eldoc-function): Use it. + (python-mode-running): Don't defvar. + (python-mode): Set comment-indent-function. + Maybe update hippie-expand-try-functions-list. + (python-indentation-levels): Initialize differently. + (python-block-end-p): New. + (python-indent-line): Use it. + (python-compilation-regexp-alist): Augment. + (run-python): Import `emacs' module to Python rather than loading + code directly. Set python-buffer differently. + (python-send-region): Use emacs.eexecfile. Fix orig-start calculation. + Use python-proc. + (python-send-command): Go to end of comint buffer. + (python-load-file): Use python-proc, emacs.eimport. + (python-describe-symbol): Simplify interactive form. + Use emacs.help. Do use temp-buffer-show-hook. + Call print-help-return-message. + (hippie-exp): Require when compiling. + (python-preoutput-continuation): Use rx. + + * diff-mode.el (diff-make-unified): Fix regexp. + +2004-05-06 Romain Francoise <romain@orebokech.com> (tiny change) + + * ibuffer.el (ibuffer-redisplay-engine): Do not remove folded + filter groups from the buffer when rebuilding the Ibuffer buffer + and `ibuffer-show-empty-filter-groups' is nil. + +2004-05-06 Vinicius Jose Latorre <viniciusjl@ig.com.br> + + * ps-print.el (ps-print-quote): Call ps-value-string. + (ps-setup): Call ps-comment-string. + (ps-value-string, ps-comment-string): New funs. + +2004-05-06 Juanma Barranquero <lektu@terra.es> + + * ehelp.el (electric-help-command-loop): Check whether the last + character is visible, not (point-max). + + * help-fns.el (help-argument-name): Default to bold; don't inherit + from font-lock-variable-name-face. + (help-do-arg-highlight): Grok also ARGth occurrences in the docstring. + +2004-05-05 Kenichi Handa <handa@m17n.org> + + * descr-text.el (describe-char): Copy the character with text + properties and overlays into the first line, and call + describe-text-properties on it. + +2004-05-05 Stephen Eglen <stephen@anc.ed.ac.uk> + + * iswitchb.el (iswitchb-global-map): Fix typo. + Remove unwanted ###autoloads from source file. + +2004-05-05 Lars Hansen <larsh@math.ku.dk> + + * wdired.el (wdired-change-to-wdired-mode): Quote wdired-mode-hook + in run-hooks. Use substitute-command-keys in message. + (wdired-abort-changes): Add message. + +2004-05-03 Michael Mauger <mmaug@yahoo.com> + + * emacs/lisp/progmodes/sql.el (sql-xemacs-p, sql-emacs19-p) + (sql-emacs20-p): Remove. + (sql-mode-syntax-table): Use shared GNU EMacs/XEmacs syntax. + (sql-builtin-face, sql-doc-face): Remove. + (sql-mode-ansi-font-lock-keywords) + (sql-mode-oracle-font-lock-keywords) + (sql-mode-postgres-font-lock-keywords) + (sql-mode-linter-font-lock-keywords) + (sql-mode-ms-font-lock-keywords) + (sql-mode-mysql-font-lock-keywords): Use standard fonts. + (sql-product-font-lock): Fix font-lock reset when font rules change. + (sql-highlight-product): Remove incorrect font-lock reset logic. + +2004-05-04 Jonathan Yavner <jyavner@member.fsf.org> + + * ses.el (ses-set-parameter): Fix typo. + +2004-05-04 Kim F. Storm <storm@cua.dk> + + * ido.el (ido-read-internal): Fix call to read-file-name for edit. + Must expand directory for completion to work; and don't mess with + process-environment. + (ido-read-file-name): If command has ido property, don't use ido + if value is ignore, or read as directory if value is dir. + Set ido ignore property for dired-do-rename command. + +2004-05-04 Juanma Barranquero <lektu@terra.es> + + * ehelp.el (electric-help-command-loop, electric-help-undefined) + (electric-help-help): Check against unmapped commands. + + * help-fns.el (help-argument-name): New face, inheriting from + font-lock-variable-name-face, to highlight function arguments in + `describe-function' and `describe-key'. + (help-do-arg-highlight): Auxiliary function to highlight a given + list of arguments in a string. + (help-highlight-arguments): Highlight the function arguments and + all uses of them in the docstring. + (describe-function-1): Use it. Do docstring output via `insert', + not 'princ', so text attributes are preserved. + + * winner.el (winner-mode-map): Move `winner-undo' and + `winner-redo' to C-c <left> and C-c <right>, respectively (the + previous bindings conflict with `prev-buffer', `next-buffer'). + +2004-05-03 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> + + * textmodes/bibtex.el (bibtex-progress-message): Fix docstring. + (bibtex-entry-update): New command bound to C-c C-u. + (bibtex-text-in-string): Fix regexp. + (bibtex-assoc-of-regexp): Remove. + (bibtex-progress-message): Fix docstring. + (bibtex-inside-field): Use if. + (bibtex-assoc-regexp): New function. + (bibtex-format-entry): Make code more robust so that it formats + also old entries. + (bibtex-autokey-demangle-title): Merge with obsolete function + bibtex-assoc-of-regexp. + (bibtex-field-list): New function. + (bibtex-entry): Use bibtex-field-list. + (bibtex-parse-entry): Fix docstring. + (bibtex-print-help-message): Use bibtex-field-list. + (bibtex-make-field): Use bibtex-field-list. + (bibtex-entry-index): Bugfix. Return crossref key if required. + (bibtex-lessp): Fix docstring. + +2004-05-03 Luc Teirlinck <teirllm@auburn.edu> + + * select.el (xselect-convert-to-string): Move comment to intended line. + +2004-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * toolbar/tool-bar.el (tool-bar-setup): Use lookup-key for + cut/copy/paste in case menu-bar-enable-clipboard is in effect. + +2004-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * term/x-win.el (x-clipboard-yank): Don't exit on error from + x-get-selection. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.nt: Remove. + +2004-05-03 Kim F. Storm <storm@cua.dk> + + * emulation/cua-base.el (cua--update-indications): Fix last change. + (cua-mode): Deactivate mark when cua-mode is enabled. + +2004-05-02 Luc Teirlinck <teirllm@auburn.edu> + + * select.el (xselect-convert-to-string): Bind `inhibit-read-only' to t. + +2004-05-03 Nick Roberts <nickrob@gnu.org> + + * progmodes/gdb-ui.el (gud-watch, gdb-display-buffer) + (gdb-display-source-buffer, gdb-put-breakpoint-icon) + (gdb-remove-breakpoint-icons, gdb-assembler-custom): Look for + window over visible frames. + (gdb-goto-breakpoint): Make buffer display file at breakpoint. + +2004-05-02 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/compile.el (compilation-gcpro): New var. + (compilation-fake-loc): Use it. + (compilation-forget-errors): Reset it. + +2004-05-02 Dan Nicolaescu <dann@ics.uci.edu> + + * diff-mode.el (diff-header-face, diff-file-header-face): + Use min-colors. + +2004-05-02 Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> + + * textmodes/bibtex.el (bibtex-sort-buffer): Remove error message. + (bibtex-clean-entry): Disentangle code. + (bibtex-realign): New function. + (bibtex-reformat): Use mapcar and bibtex-realign. Do not use + bibtex-beginning-of-first-entry and bibtex-skip-to-valid-entry. + Remove undocumented optional arg called-by-convert-alien. + (bibtex-convert-alien): Use bibtex-realign. Use bibtex-reformat + for sorting instead of bibtex-sort-buffer. + +2004-05-02 Eli Zaretskii <eliz@gnu.org> + + * progmodes/compile.el (compilation-start): In the + no-async-subprocesses branch, call sit-for to give redisplay a + chance to show the updated process status in the mode line, and + fontify the buffer explicitly after the process exits. + +2004-05-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/python.el (python-compilation-line-number): Remove. + (python-compilation-regexp-alist): Don't use it any more. + (python-orig-start, python-input-filter): Remove. + (inferior-python-mode): Don't set up comint-input-filter-functions. + (python-send-region): Use compilation-fake-loc. + + * progmodes/compile.el (compilation-messages-start): New var. + (compilation-mode): Don't setup next-error-function here. + (compilation-setup): Set it up here instead (for minor modes as well). + Make compilation-messages-start buffer local. + (compilation-next-error-function): Use it. + (compilation-forget-errors): Set compilation-messages-start. + +2004-05-01 Luc Teirlinck <teirllm@auburn.edu> + + * ielm.el (ielm-prompt-read-only): Update docstring. + + * comint.el (comint-prompt-read-only): Update docstring. + (comint-update-fence, comint-kill-whole-line) + (comint-kill-region): New functions. + + * simple.el (kill-whole-line): Use "p" instead of "P" in + interactive form. + +2004-05-01 Juanma Barranquero <lektu@terra.es> + + * help-fns.el (help-add-fundoc-usage): Use %S instead of %s to + format arglist so default values in CL-style argument lists are + correctly shown. + +2004-05-01 Jason Rumney <jasonr@gnu.org> + + * term/w32-win.el (w32-drag-n-drop): Use x-dnd.el functions. + +2004-05-01 Kenichi Handa <handa@m17n.org> + + * international/titdic-cnv.el (miscdic-convert): Don't generate a + quail file if it is up to date. + +2004-04-30 Juri Linkov <juri@jurta.org> + + * cus-edit.el (custom-mode-map): + Add key binding `C-x C-s' to `Custom-save'. + + * outline.el (outline-blank-line): New var. + (outline-next-preface, outline-show-heading) + (outline-end-of-subtree): Use it. + + * dired-aux.el (dired-touch-initial): New fun. + (dired-do-chxxx): Call it for op-symbol `touch'. + (dired-diff): Use `dired-dwim-target-directory' + if current dired buffer has no buffer mark. + + * bindings.el (propertized-buffer-identification): + Replace `(:weight bold)' by `Buffer-menu-buffer-face'. + Add C-M-arrow keys for consistency. + + * files.el (confirm-kill-emacs): + Change group from top-level `emacs' to `convenience'. + + * emacs-lisp/lisp.el (beginning-of-defun, end-of-defun): + Push mark on the first call of successive command calls. + (insert-pair): New fun created from `insert-parentheses' with + `open' and `close' arguments added. Enclose active regions + in paired characters. Compare adjacent characters syntax with + inserted characters syntax before inserting a space. + (insert-parentheses): Call `insert-pair' with ?\( ?\). + + * delsel.el: Don't put `delete-selection' property + on `insert-parentheses' symbol to take advantage of + region handling in `insert-pair' function. + Suggested by Stephan Stahl <stahl@eos.franken.de>. + +2004-04-30 Kim F. Storm <storm@cua.dk> + + * emulation/cua-base.el: Add support for changing cursor types; + based on patch from Michael Mauger. + (cua-normal-cursor-color, cua-read-only-cursor-color) + (cua-overwrite-cursor-color, cua-global-mark-cursor-color): + Customization cursor type and/or cursor color. + (cua--update-indications): Handle cursor type changes. + (cua-mode): Update cursor indications if enabled. + + * menu-bar.el (menu-bar-options-menu): Change menu text for CUA. + + * mouse.el (mouse-drag-copy-region): New defcustom. + (mouse-set-region, mouse-drag-region-1): Use it. + + * simple.el (kill-ring-save): If region face background color is + unspecified (if no highlighting), show extent of fully visible + region even if transient-mark-mode is enabled. + + * emulation/cua-base.el (cua--standard-movement-commands): + Add cua-scroll-up and cua-scroll-down. + (cua-scroll-up, cua-scroll-down): New commands. + (cua--init-keymaps): Remap scroll-up and scroll-down. + + * emulation/cua-rect.el (cua--convert-rectangle-as): + New defmacro. + (cua-upcase-rectangle, cua-downcase-rectangle): Use it. + (cua-upcase-initials-rectangle, cua-capitalize-rectangle): + New commands (suggested by Jordan Breeding). + +2004-04-30 Juanma Barranquero <lektu@terra.es> + + * smerge-mode.el (smerge-diff-switches): Fix typo in docstring. + +2004-04-30 Mario Lang <mlang@delysid.org> + + * diff.el (diff-switches): Fix typo in docstring. + +2004-04-30 Alex Schroeder <alex@gnu.org> + + * xml.el (xml-debug-print-internal): Don't add newline and + indentation to text nodes and write empty elements as empty tags + instead of opening and closing tags. + (xml-debug-print): Take optional indent-string argument. + (xml-print): Alias for xml-debug-print. + +2004-04-30 Glenn Morris <gmorris@ast.cam.ac.uk> + + * progmodes/fortran.el (fortran-fill): Use local var `bol' rather + than duplicate call to `line-beginning-position'. + + * progmodes/f90.el (f90-get-present-comment-type): + Return whitespace, as well as comment chars, for consistent filling + of comment blocks. Use `match-string-no-properties'. + (f90-break-line): Trim trailing whitespace when filling comments. + +2004-04-30 Dave Love <fx@gnu.org> + + * calendar/diary-lib.el (diary-outlook-formats): New variable. + (diary-from-outlook-internal, diary-from-outlook) + (diary-from-outlook-gnus, diary-from-outlook-rmail): + New functions to import diary entries from Outlook-format + appointments in mail messages. + +2004-04-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/python.el (python-send-command): New fun. + (python-send-region, python-load-file): Use it. + + * progmodes/compile.el (compilation-last-buffer): Add var alias. + + * help-fns.el (help-C-file-name): Use new subr-name. + Prepend `src/' to the file name. + (help-C-source-directory, help-subr-name, help-find-C-source): Remove. + (describe-function-1, describe-variable): Only find a C source file + name if DOC is already loaded. + + * help-mode.el (help-function-def, help-variable-def): + Use the new find-function-search-for-symbol functionality. + Allow FILE to be `C-source'. + + * emacs-lisp/find-func.el (find-function-C-source-directory): New var. + (find-function-C-source): New fun. + (find-function-search-for-symbol): Use it. + +2004-03-29 Michael Mauger <mmaug@yahoo.com> + + * progmodes/sql.el (sql-product-alist): Rename variable + `sql-product-support'. Add Postgres login parameters. + (sql-set-product, sql-product-feature): Update with renamed variable. + (sql-connect-postgres): Add username prompt. + (sql-imenu-generic-expression, sql-mode-font-lock-object-name): + Make patterns less product specific. + (sql-xemacs-p, sql-emacs19-p): Add flags for Emacs variants. + (sql-mode-abbrev-table): Modify initialization. + (sql-builtin-face): Add variable. + (sql-keywords-re): Add macro. + (sql-mode-ansi-font-lock-keywords): Update for ANSI-92. + (sql-mode-oracle-font-lock-keywords): Update for Oracle 9i. + (sql-mode-postgres-font-lock-keywords): Update for Postgres 7.3. + (sql-mode-mysql-font-lock-keywords): Update for MySql 4.0. + (sql-mode-linter-font-lock-keywords) + (sql-mode-ms-font-lock-keywords): Use `sql-keywords-re' macro. + (sql-mode-sybase-font-lock-keywords) + (sql-mode-informix-font-lock-keywords) + (sql-mode-interbase-font-lock-keywords) + (sql-mode-ingres-font-lock-keywords) + (sql-mode-solid-font-lock-keywords) + (sql-mode-sqlite-font-lock-keywords) + (sql-mode-db2-font-lock-keywords): Default to nil. + (sql-product-font-lock): Always highlight ANSI keywords. + (sql-add-product-keywords): Made similar to `font-lock-add-keywords'. + (sql-send-string): Add function. + +2004-04-29 Dave Love <fx@gnu.org> + + * progmodes/cfengine.el (cfengine-beginning-of-defun) + (cfengine-end-of-defun): Ensure progress through buffer. + + * info-look.el (cfengine-mode): Accept a terminal (). + +2004-04-29 Juri Linkov <juri@jurta.org> + + * isearch.el (isearch-mode-map): Bind \C-w to isearch-yank-word + instead of isearch-yank-word-or-char. Add new key bindings for + isearch-yank-char to \C-f, and isearch-del-char to \C-b. + (isearch-del-char): New fun. + (isearch-forward, isearch-edit-string): Update docstring. + (isearch-yank-char): Doc fix. + (isearch-other-meta-char): Restore point after scrolling. + + * progmodes/compile.el (compilation-context-lines): Add nil option + to disable compilation output window scrolling. + (compilation-set-window): Use it. + + * outline.el (outline-next-preface, outline-show-heading): + Don't leave unhidden blank line before heading. + (outline-end-of-subtree): Include last newline into subtree. + (hide-entry): Leave point at beginning of heading instead of end. + (outline-up-heading): Push mark for the first call of successive + command calls. + +2004-04-28 Luc Teirlinck <teirllm@auburn.edu> + + * comint.el (comint-prompt-read-only): New variable. + (comint-output-filter): Implement it. + + * ielm.el (ielm-prompt-read-only, ielm-prompt): Update docstring. + (ielm-prompt-internal): New variable. + (ielm-font-lock-keywords): Remove irrelevant ielm-prompt keyword. + (ielm-send-input): Delete unused variable `buf'. + (ielm-eval-input): Use `ielm-prompt-internal'. + (inferior-emacs-lisp-mode): Use new variables + `comint-prompt-read-only' and `ielm-prompt-internal'. + Get rid of obsolete variable `directory-sep-char'. + (ielm): Use `zerop'. + +2004-04-29 John Paul Wallington <jpw@gnu.org> + + * thumbs.el (toplevel): Require cl at compile time. + Remove conditional definitions of `ignore-errors' and `caddar' + because they occur at run time. + +2004-04-28 Nick Roberts <nickrob@gnu.org> + + * progmodes/gdb-ui.el (gdb-frame-breakpoints-buffer) + (gdb-frame-assembler-buffer, gdb-frame-threads-buffer) + (gdb-frame-registers-buffer, gdb-frame-locals-buffer) + (gdb-frame-gdb-buffer, gdb-frame-stack-buffer): Use selected-window. + + * progmodes/gud.el (gud-common-init): Throw an error if program is + already running under gdb. + +2004-04-28 John Paul Wallington <jpw@gnu.org> + + * thumbs.el (thumbs-delete-images): Fix formatting of prompt. + (thumbs-show-image-num): Move assignment of + `thumbs-current-image-filename' within scope of `i'. + (thumbs-emboss-image): Don't use `evenp'. + +2004-04-28 Richard M. Stallman <rms@gnu.org> + + * progmodes/compile.el (compilation-context-lines): Default now 0. + +2004-04-28 Juanma Barranquero <lektu@terra.es> + + Use `time-less-p' from calendar/time-date.el instead of defining + custom versions of it. + + * pcomplete.el (pcomplete-time-less-p): Remove. + + * thumbs.el (time-less-p): Remove. + + * calendar/timeclock.el (timeclock-time-less-p): Remove. + (timeclock-generate-report): Use `time-less-p'. + + * emacs-lisp/autoload.el (autoload-before-p): Remove. + (update-file-autoloads, update-directory-autoloads): Use `time-less-p'. + +2004-04-28 Masatake YAMATO <jet@gyve.org> + + * subr.el (remove-overlays): Make arguments optional. + + * wid-edit.el (widget-specify-button): Put evaporate to the + overlay for sample. + (widget-specify-sample): Put evaporate to the overlay for sample. + (widget-specify-doc): Put evaporate to the overlay for documentation. + +2004-04-27 Jesper Harder <harder@ifa.au.dk> + + * info.el (info-apropos): Make it an index node. Align node names + like makeinfo. + +2004-04-27 Eli Zaretskii <eliz@gnu.org> + + * net/browse-url.el (browse-url-netscape-sentinel) + (browse-url-mozilla-sentinel, browse-url-galeon-sentinel) + (browse-url-epiphany-sentinel, browse-url-mosaic): + Use browse-url-*-program instead of a literal program name. + +2004-04-27 Kevin Ryde <user42@zip.com.au> + + * eshell/em-alias.el: + * eshell/em-dirs.el: + * eshell/em-hist.el: + * eshell/em-unix.el: Add "(require 'eshell)", to get necessary + features when M-x customize-group loads modules before the main + eshell.el. + +2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> + + * subr.el (momentary-string-display): Support EXIT-CHAR that is + either a character representation of an event or an event + description list. + + * type-break.el: Capitalise Emacs and Lisp. + (type-break-good-break-interval, type-break-demo-boring-stats) + (type-break-terse-messages, type-break-file-name): New defcustoms. + (type-break-post-command-hook) + (type-break-warning-countdown-string): Quote variable names in doc. + (type-break-interval-start, type-break-auto-save-file-name): New vars. + (type-break-mode): Document type-break-good-break-interval and the + "session" file. Schedule break according to the session file. + Kill session file buffer on exit. Organise for save-some-buffers + to always save the session file. + (type-break-mode-line-message-mode, type-break-query-mode): + Uppercase arguments. + (type-break-file-time, type-break-file-keystroke-count, timep) + (type-break-choose-file, type-break-get-previous-time) + (type-break-get-previous-count): New defuns. + (type-break): Avoid break querying after a completed break in the + case where the query was initiated during user invocation of the + break. Optional terse messages. + Use type-break-good-break-interval if type-break-good-rest-interval is + nil. File the break time. + (type-break-schedule): New optional args for overriding the use of + the current time. + (type-break-cancel-time-warning-schedule): Avoid leftover warnings + after a break. + (type-break-check): File the keystroke count. + (type-break-do-query): Prevent a second query when the break is + interrupted. Optional terse message. + (type-break-keystroke-reset): Record the start of a typing interval. + (type-break-demo-boring): Optional terse messages. Display word + per minute and keystroke counts according to + type-break-demo-boring-stats. + +2004-04-27 Daniel M Coffman <coffmand@us.ibm.com> (tiny change) + + * arc-mode.el (archive-maybe-copy): If ARCHIVE includes leading + directories, make sure they exist under archive-tmpdir. + +2004-04-27 Juri Linkov <juri@jurta.org> + + * help.el (view-emacs-news): With argument, display info for the + selected version by finding it among different NEWS files, and + narrowing the buffer to the selected version. + + * info.el: Add *info*<[0-9]+> to same-window-regexps instead of + same-window-buffer-names. + (info): New arg `buffer'. Use it. Doc fix. Read file name for + non-numeric prefix argument, append the number to the buffer name + for numeric prefix argument. + (info-other-window): Bind same-window-regexps to nil. + (Info-reference-name): Rename to Info-point-loc. + (Info-find-node-2): Call forward-line for numeric Info-point-loc, + and Info-find-index-name for stringy Info-point-loc. + (Info-extract-menu-node-name): New arg `index-node'. Use regexp + without middle `.', but with final `.' and optional line number + for it. Set Info-point-loc for index nodes. + (Info-index): Remove middle `.' from index entry regexp. + Modify line number regexp. + (Info-index-next): Decrement line number. + (info-apropos): Remove middle `.' from index entry regexp. + Add optional line number regexp at the end. Add matched value + for line number to the result list and insert it to the buffer. + Replace match-string by match-string-no-properties. + Reorder result list. + (Info-fontify-node): Hide index line numbers. + (Info-goto-node): Replace "\\s *\\'" by "\\s +\\'" to not trim + empty matches. + (Info-follow-reference): Use `str' instead of + Info-following-node-name-re. + (Info-toc): Use full file names. Set Info-current-node to "Top". + (Info-fontify-node): Compare file names without directory name. + (Info-try-follow-nearest-node): Don't set Info-reference-name. + Set second arg of Info-extract-menu-node-name for index nodes. + (info-xref-visited): Use magenta3 instead of magenta4. + (Info-mode): Add info-apropos to docstring. + + * log-view.el (log-view-diff): Replace interactive code "r" + by a list to allow to call it even if region is not active. + + * paren.el (show-paren-highlight-openparen): New var. + (show-paren-function): Turn on openparen highlighting when + matching forward if show-paren-highlight-openparen is non-nil. + + * simple.el (kill-ring-save): Use blink-matching-delay instead of + the constant value 1. + (completions-common-part): Expand docstring. + + * textmodes/picture.el (picture-mode-map): Add arrow keys. + +2004-04-27 Kim F. Storm <storm@cua.dk> + + * image.el (insert-sliced-image): Use line-height instead of + line-spacing property on newline. + +2004-04-26 Lars Hansen <larsh@math.ku.dk> + + * desktop.el (desktop-buffer-misc-data-function): Rename to + desktop-save-buffer and change docstring. + (desktop-buffer-modes-to-save): Delete. + (desktop-save-buffer-p): Use desktop-save-buffer instead of + desktop-buffer-modes-to-save. + (desktop-save): Rename desktop-buffer-misc-data-function to + desktop-save-buffer and allow non-function value. + (desktop-missing-file-warning): Correct docstring. + + * dired.el (dired-mode): Rename desktop-buffer-misc-data-function + to desktop-save-buffer. + + * info.el (Info-mode): Rename desktop-buffer-misc-data-function to + desktop-save-buffer. + + * mail/rmail.el (rmail-variables): Bind desktop-save-buffer to t. + + * mh-e/mh-e.el (mh-folder-mode): Bind desktop-save-buffer to t. + +2004-04-26 Eli Zaretskii <eliz@gnu.org> + + * progmodes/gud.el (gud-pdb-command-name): Change default to "pydb". + +2004-04-25 Luc Teirlinck <teirllm@auburn.edu> + + * ielm.el (ielm-prompt-read-only, ielm-prompt): Expand docstring. + (ielm): Only go to the end of the buffer when starting a new process. + +2004-04-25 Juanma Barranquero <lektu@terra.es> + + * ielm.el (inferior-emacs-lisp-mode): Display working buffer on the + mode line. Bind `inhibit-read-only' to t before modifying + properties of text in the buffer. + (ielm): Force point to the end of buffer, even when running ielm + from inside itself. + +2004-04-25 Jesper Harder <harder@ifa.au.dk> + + * info.el (info-apropos): Reset Info-complete-cache. + +2004-04-25 Daniel Pfeiffer <occitan@esperanto.org> + + * progmodes/compile.el (compilation-error-regexp-alist-alist): + Also recognize severe Irix et al. messages. + (compilation-normalize-filename, compile-abbreviate-directory): + Delete functions. + (compilation-get-file-structure): New function inherits + functionality of the two preceding ones. + (compilation-internal-error-properties, compilation-fake-loc): + Use it so that different paths to the same file share the same + markers. Also optimize finding adjacent marker slightly. + +2004-04-25 Kim F. Storm <storm@cua.dk> + + * image.el (insert-sliced-image): Add line-spacing t property + to newlines separating image lines. + +2004-04-24 Luc Teirlinck <teirllm@auburn.edu> + + * comint.el (comint-delete-output): Bind inhibit-read-only to t. + + * ielm.el (ielm-prompt-read-only): New user option. + (ielm-prompt): Expand docstring to describe new behavior. + (inferior-emacs-lisp-mode): Implement ielm-prompt-read-only and + mention it in the docstring. + +2004-04-24 Andreas Schwab <schwab@suse.de> + + * progmodes/sh-script.el (sh-leading-keywords) <sh>: Add "!". + + * diff.el (diff): Set default-directory in diff buffer. + +2004-04-24 Eli Zaretskii <eliz@gnu.org> + + * mail/sendmail.el (mail-bury): Don't delete the frame where the + mail was being composed if the terminal cannot display more than + one frame; instead, switch to previous frame. + + * mail/rmail.el (rmail-mail-new-frame): Doc fix. + (rmail-start-mail): Support rmail-mail-new-frame even on + terminals that can display only one frame at a time. + +2004-04-23 Stefan Monnier <monnier@iro.umontreal.ca> + + * emacs-lisp/checkdoc.el (checkdoc-output-error-regex-alist): New var. + (checkdoc-output-font-lock-keywords): Remove error regexp. + (checkdoc-output-mode-map): Remove. + (checkdoc-output-mode): Derive from compilation-mode. + (checkdoc-find-error-mouse, checkdoc-find-error): Remove. + + * dired.el (dired-mode-map): Add a menu entry for wdired. + + * emacs-lisp/rx.el (rx-syntax): Move sregex style syntax to code. + (rx-bracket, rx-check-any, rx-any): Clean up name space. + + * wdired.el: (wdired-mode-map): Move init into declaration. + Fix `return' binding. + (wdired-change-to-wdired-mode, wdired-change-to-dired-mode): + Use force-mode-line-update. + (wdired-get-filename): Use `unless'. + (wdired-preprocess-files): Don't assume names have no \n and use / for + dir separator. + (wdired-normalize-filename): Use replace-regexp-in-string. + (wdired-load-hooks): Remove. + (wdired-mode-hooks): Rename to wdired-mode-hook. + + * info-look.el: Add support for cfengine-mode. + (info-lookup-setup-mode): Use dolist. + +2004-04-23 Juan Le,As(Bn Lahoz Garc,Am(Ba <juan-leon.lahoz@tecsidel.es> + + * wdired.el: New file. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * ielm.el (inferior-emacs-lisp-mode): Fix docstring. + + * pcomplete.el (pcomplete-opt, pcomplete-actual-arg) + (pcomplete-match-string, pcomplete-comint-setup, pcomplete-here) + (pcomplete--help, pcomplete--here): Doc fixes. + +2004-04-23 Andre Spiegel <spiegel@gnu.org> + + * vc-hooks.el (vc-default-workfile-unchanged-p): Fix code that + handles wrong-number-of-arguments in backend call. + + * vc.el (vc-print-log): Likewise. + +2004-04-20 Dave Love <fx@gnu.org> + + * emacs-lisp/rx.el: Doc fixes. + (rx-constituents): Add/extend many forms. + (rx-check): Check form is a list. + (bracket): Defvar. + (rx-check-any, rx-any, rx-check-not): Modify. + (rx-not): Simplify. + (rx-trans-forms, rx-=, rx->=, rx-**, rx-not-char, rx-not-syntax): New. + (rx-kleene): Use rx-trans-forms. + (rx-quote-for-set): Delete. + (rx): Allow multiple args. + +2004-04-23 Kenichi Handa <handa@m17n.org> + + * international/mule-util.el (char-displayable-p): Simplify by + using internal-char-font. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-04-22 Stefan Monnier <monnier@iro.umontreal.ca> + + * diff-mode.el (diff-next-error): New fun. + (diff-mode): Use it. + + * simple.el (next-error): Change arg name. + Add support for the documented C-u C-x ` usage. + + * frame.el (special-display-popup-frame, next-multiframe-window) + (previous-multiframe-window): Only consider frames on same display. + +2004-04-22 Lars Hansen <larsh@math.ku.dk> + + * info.el (Info-restore-desktop-buffer): Delete with-no-warnings. + * mh-e/mh-e.el (mh-restore-desktop-buffer): Delete with-no-warnings. + +2004-04-22 Kim F. Storm <storm@cua.dk> + + * net/telnet.el (telnet): Add optional port arg. + +2004-04-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/compile.el (compilation-mode-font-lock-keywords): + Minor sanity check on the `hyperlink' slot. + + * Makefile.in (recompile): Compile new files. + + * emacs-lisp/bytecomp.el (batch-byte-recompile-directory): + Add byte-recompile-directory's optional `arg'. + + * cvs-status.el (cvs-tree-use-charset): New var. + (cvs-tree-char-space, cvs-tree-char-hbar, cvs-tree-char-vbar) + (cvs-tree-char-branch, cvs-tree-char-eob, cvs-tree-char-bob) + (cvs-status-cvstrees): Use it. + + * emacs-lisp/checkdoc.el (checkdoc-output-mode): + Make it a normal major mode. + (checkdoc-buffer-label): Make sure the file name is meaningful. + (checkdoc-output-to-error-buffer): Remove. + (checkdoc-error, checkdoc-start-section): Rewrite. + + * info.el (info-node, info-menu-5, info-xref, info-header-node) + (Info-title-1-face, Info-title-2-face, Info-title-3-face) + (Info-title-4-face): Use new syntax. + (info-xref-visited): Inherit from info-xref. + + * progmodes/python.el (python-maybe-jython): Don't assume point-min==1. + +2004-04-21 Teodor Zlatanov <tzz@lifelogs.com> + + * simple.el (next-error-last-buffer, next-error-function): + New variables for the next-error framework. + (next-error-buffer-p): New function. + (next-error-find-buffer): Generalize compilation-find-buffer. + (next-error, previous-error, first-error, next-error-no-select) + (previous-error-no-select): Move from compile.el. + + * replace.el (occur-next-error, occur-1): Hook into the next-error + framework. + + * progmodes/compile.el (compilation-start): + Set next-error-last-buffer so next-error knows where to jump. + (compilation-setup): Set the buffer-local variable + next-error-function to 'compilation-next-error-function. + (compilation-buffer-p, compilation-buffer-internal-p): Use an + alternate way to find if a buffer is a compilation buffer, for + next-error convenience. + (next-error-no-select, previous-error-no-select, next-error) + (previous-error, first-error): Move to simple.el. + (compilation-find-buffer): Move to next-error-find-buffer in simple.el. + (compilation-last-buffer): Remove. + (compilation-start, compilation-next-error, compilation-setup) + (compilation-next-error-function, compilation-find-buffer): + Remove compilation-last-buffer use. + +2004-04-21 Juanma Barranquero <lektu@terra.es> + + * font-lock.el (font-lock-preprocessor-face): Remove spurious quote. + (font-lock-warning-face): Fix spacing. + + * makefile.w32-in (WINS): Add url/ directory. + +2004-04-21 Lars Hansen <larsh@math.ku.dk> + + * desktop.el (desktop-buffer-mode-handlers): New variable. + Alist of major mode specific functions to restore a desktop buffer. + (desktop-buffer-handlers): Make variable obsolete. + (desktop-create-buffer): Use desktop-buffer-mode-handlers. + Catch errors signaled in handlers. Update buffer count. + Evaluate desktop-buffer-point. + (desktop-buffer-dired): Rename to dired-restore-desktop-buffer and + move to dired.el. + (desktop-buffer-info): Rename to Info-restore-desktop-buffer and + move to info.el. + (desktop-buffer-rmail): Rename to rmail-restore-desktop-buffer and + move to mail/rmail.el. + (desktop-buffer-mh): Rename to mh-restore-desktop-buffer and move + to mh-e/mh-e.el. + (desktop-buffer-file): Rename to desktop-restore-file-buffer. + On fail, print message (to message buffer) even if + desktop-missing-file-warning is nil. + (desktop-buffer-misc-data-function): New buffer local variable. + Function returning major mode specific data. + (desktop-buffer-misc-functions): Make variable obsolete. + (desktop-save): Use desktop-buffer-misc-data-function. + (desktop-buffer-dired-misc-data): Rename to + dired-desktop-buffer-misc-data and move to dired.el. + (desktop-buffer-info-misc-data): Rename to + Info-desktop-buffer-misc-data and move to info.el. + (desktop-read): Add message about number of buffers restored/failed. + + * dired.el (dired-restore-desktop-buffer) Move from desktop.el. + Add parameters. Pause to display error only when + desktop-missing-file-warning is non-nil. + (dired-desktop-buffer-misc-data): Move from desktop.el. Add parameter. + (dired-mode): Bind desktop-buffer-misc-data-function. + + * info.el (Info-restore-desktop-buffer): Move from desktop.el. + Add Parameters. + (Info-desktop-buffer-misc-data): Move from desktop.el. Add parameter. + (Info-mode): Bind desktop-buffer-misc-data-function. + + * mail/rmail.el (rmail-restore-desktop-buffer): Move from desktop.el. + Add Parameters. + + * mh-e/mh-e.el (mh-restore-desktop-buffer): Move from desktop.el. + Add Parameters. + +2003-04-21 Paul Pogonyshev <pogonyshev@gmx.net> + + * dabbrev.el (dabbrev--substitute-expansion): Don't lose + the case of letters in case-insensitive expansions when the + abbrev is preceded by characters with letter syntax. + +2004-04-21 Richard M. Stallman <rms@gnu.org> + + * progmodes/cperl-mode.el (cperl-putback-char): + Delete Emacs 18 definition. + + * international/mule.el (ctext-post-read-conversion): + Use assoc-string, not assoc-ignore-case. + + * international/mule-cmds.el: Use assoc-string, not assoc-ignore-case. + + * emacs-lisp/easymenu.el (easy-menu-add): + Do call x-popup-menu, but only if it's defined. + + * emacs-lisp/disass.el (disassemble): Handle lambda-exp as arg. + + * emacs-lisp/bytecomp.el (byte-compile-no-warnings): + Handle multiple args: compile like progn. + + * emacs-lisp/byte-run.el (with-no-warnings): Simplify: + take all args as &rest arg. + + * autoinsert.el (auto-insert-alist): Insert the user's name in + copyright notice, rather than Free Software Foundation. + +2004-04-21 Kenichi Handa <handa@m17n.org> + + * descr-text.el (describe-char): Make it work on *Help* buffer. + +2004-04-21 Kim F. Storm <storm@cua.dk> + + * image.el (insert-image): Add optional SLICE arg. + (insert-sliced-image): New defun. + +2004-04-20 Lawrence Mitchell <wence@gmx.li> (tiny change) + + * subr.el (read-number): Check whether `default' is nil. + +2004-04-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * progmodes/compile.el (compilation-error-properties): + Split into two. + (compilation-internal-error-properties): New one. + (compilation-compat-error-properties): Use it. Fix the non-marker case. + +2004-04-20 Richard M. Stallman <rms@gnu.org> + + * window.el (split-window-save-restore-data): + Don't update the data if OLD-INFO is nil. + + * view.el (view-return-to-alist): Mark it permanent local. + + * subr.el (event-modifiers): Fix the criterion for ASCII control chars. + + * recentf.el (recentf-save-list): Catch and warn about errors. + + * menu-bar.el (menu-bar-update-buffers): Call copy-sequence + so "Buffers" won't be pure. + + * help-mode.el (help-mode-finish): Set help-return-alist first + thing, setting only the entry for the selected window. + + * help-fns.el (describe-function-1): If many non-control non-meta + keys run the command, don't list all of them. + +2004-04-20 Juanma Barranquero <lektu@terra.es> + + * vc-svn.el (vc-svn-print-log, vc-svn-diff): Add optional BUFFER + arg. Copied from Andre Spiegel's patch of 2004-03-21. + + * calendar/time-date.el (time-to-day-in-year): Fix docstring. + +2004-04-20 Kenichi Handa <handa@m17n.org> + + * international/quail.el (quail-lookup-key): New optional arg + NOT-RESET-INDICES. + (quail-get-translations): Call quail-lookup-key with + NOT-RESET-INDICES t. + (quail-completion): Likewise. + (quail-lookup-map-and-concat): Likewise. + +2004-04-20 Kenichi Handa <handa@m17n.org> + + * international/quail.el (quail-update-translation): Don't insert + such an unsupported multibyte char in a unibyte buffer. + +2004-04-20 Nick Roberts <nick@nick.uklinux.net> + + * progmodes/gdb-ui.el (gdb-frame-parameters): New constant. + (gdb-frame-breakpoints-buffer, gdb-frame-stack-buffer) + (gdb-frame-threads-buffer, gdb-frame-registers-buffer) + (gdb-frame-locals-buffer, gdb-frame-gdb-buffer) + (gdb-frame-assembler-buffer): Improve behaviour with + multiple frames. + (gdb-display-buffer): Extend search to all visible frames. + +2004-04-19 Eli Zaretskii <eliz@gnu.org> + + * mail/rmail.el (rmail-convert-to-babyl-format): Don't remove ^M + characters left after base64 decoding. + (rmail-decode-region): Use -dos variety of `coding', to remove any + ^M characters left after qp or base64 decoding. + +2004-04-19 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * x-dnd.el (x-dnd-open-local-file, x-dnd-open-file): Improve error + messages. + +2004-04-19 Stephen Eglen <stephen@gnu.org> + + * add-log.el (add-change-log-entry): Update doc string to mention + add-log-full-name and add-log-mailing-address. + +2004-04-18 Juri Linkov <juri@jurta.org> + + * info.el (Info-find-file, Info-find-node-2): Add history and toc. + (Info-find-node-2): Simplify error message. + (Info-insert-dir): Use Info-following-node-name. + (Info-goto-node): Remove *info-history* and *info-toc*. + (Info-history): Create a node of the virtual history file. + (Info-toc): Create a node of the virtual toc file. + (Info-insert-toc): New arg `curr-file' for reference file names. + (info-apropos): Remove redundant var binding for temp-file. + (Info-index, Info-index-next, Info-mode): Doc fix. + (Info-goto-emacs-command-node): Don't jump to *info* from + non-*info* Info buffers. + (Info-fontify-node): Don't show the file name of external + references if `Info-hide-note-references' is `hide'. Don't hide + newlines at the end of paragraphs. + + * international/mule-diag.el (list-input-methods): + Fix args to help-xref-button. + + * help-fns.el (help-with-tutorial): Call `hack-local-variables' + to put into effect local variables from TUTORIAL files. + + * textmodes/paragraphs.el (sentence-end) <function>: New fun + with default value taken from the variable `sentence-end'. + (sentence-end) <defcustom>: Set default to nil. Doc fix. + Add nil const to :type. + (sentence-end-without-period, sentence-end-double-space) + (sentence-end-without-space): Doc fix. + + * textmodes/paragraphs.el (forward-sentence): + * textmodes/fill.el (canonically-space-region, fill-nobreak-p) + (fill-delete-newlines): + * progmodes/cc-cmds.el (c-beginning-of-statement): + Use function `sentence-end' instead of variable `sentence-end'. + +2004-04-18 Andreas Schwab <schwab@suse.de> + + * progmodes/compile.el (compilation-start): Set window start to + point-min if compilation-scroll-output is nil. + +2004-04-18 John Wiegley <johnw@newartisans.com> + + * iswitchb.el (iswitchb-completions): Remove dependency on cl. + +2004-04-18 Nick Roberts <nick@nick.uklinux.net> + + * progmodes/gdb-ui.el (gdb-goto-info): Require 'info. + (gdb-info-breakpoints-custom): Revert previous change. + (gdb-view-assembler): Update assembler if necessary. + (gdb-frame-handler): Parse correctly for gdb-current-frame. + (gdb-display-source-buffer): Update properly when both source and + assembler are visible. + +2004-04-17 John Wiegley <johnw@newartisans.com> + + * iswitchb.el (iswitchb-max-to-show): Add a new config variable + which limits the number of names shown in the minibuffer. Off by + default. + (iswitchb-completions): Use `iswitchb-max-to-show'. This speeds + up iswitchb for users with a multitude of open buffers by showing + only the first and last N/2 buffers in the completion list (which + is enough to aid C-s/C-r, and to know that more characters are + needed to refine the completion list). + +2004-04-17 Richard M. Stallman <rms@gnu.org> + + * files.el (locate-file-completion): Handle nil in path-and-suffixes. + (file-truename): Expand all ~ constructs directly. + (insert-directory): Delete any error msg output by the + `insert-directory-program'. + + * allout.el (allout-mode-exposure-menu, allout-mode-editing-menu): + (allout-mode-navigation-menu, allout-mode-misc-menu): New defvars. + (allout-prior-bindings, allout-added-bindings): Defvars deleted. + (allout-init): Use find-file-hook, not find-file-hooks. + (allout-mode): Eliminate Emacs 18 support. + Use write-contents-functions, not local-write-file-hooks. + +2004-04-17 Daniel Pfeiffer <occitan@esperanto.org> + + * progmodes/compile.el (compilation-error-properties): Fix for + adding messages when there are already markers for their file. + (compilation-fake-loc): New function. + +2004-04-16 Dave Love <fx@gnu.org> + + * progmodes/python.el (python-compilation-line-number): Fix braindamage. + (python-load-file): Fix python-orig-start setting. + + * progmodes/compile.el: Doc fixes. + (compilation-error-regexp-alist-alist) + (compilation-mode-font-lock-keywords): Allow non-ASCII where possible. + (compilation-assq): Wrap in eval-when-compile. + (compilation-mode-font-lock-keywords): Don't use list*. + (compilation-start): Avoid warning. + (compilation-compat-error-properties) + (compilation-directory-properties): Add keymap property. + (compilation-parsing-end): Make it a marker for better compatibility. + + * progmodes/python.el (python-after-info-look): Use with-no-warnings. + +2004-04-16 Mark A. Hershberger <mah@everybody.org> + + * xml.el: Doc fixes. + (xml-get-children): Only looks at sub-tags and ignore strings. + + * xml.el (xml-parse-tag): Avoid overwriting node-name. + +2004-04-16 Stefan Monnier <monnier@iro.umontreal.ca> + + * url/url-util.el (url-debug): Use with-current-buffer. + + * url/url-nfs.el (url-nfs-file-attributes): Add id-format parameter. + (url-nfs-create-wrapper): Use new backquote syntax. + + * url/url-https.el (url-https-file-attributes): Add id-format param. + + * url/url-http.el (url-http-head-file-attributes) + (url-http-file-attributes): Add id-format parameter. + + * url/url-handlers.el: Use new find-file-hook. + (url-file-attributes): Add id-format parameter. + + * url/url-file.el (url-file-create-wrapper): Use new backquote syntax. + (url-file-file-attributes): Add id-format parameter. + + * url/url-dav.el: Use with-current-buffer. + (url-dav-process-response): Fix regexps and spurious quote. + (url-dav-file-attributes): Add id-format param. + + * diff-mode.el (diff-end-of-hunk): Be more careful with unified hunks. + +2004-04-16 Andre Spiegel <spiegel@gnu.org> + + * vc-hooks.el (vc-default-workfile-unchanged-p): Quote signal. + + * vc.el (vc-print-log): Likewise. + +2004-04-16 Masatake YAMATO <jet@gyve.org> + + * simple.el (completion-setup-function): Set an initial value + to `element-common-end' before entering loop. Set a value + to `element-common-end' at the end of loop. + The bug is reported by Juri Linkov <juri@jurta.org> in emacs-devel list. + (completions-common-part): Rename from completion-de-emphasis. + (completions-first-difference): Rename from completion-emphasis. + Suggested by RMS. + +2004-04-16 Juanma Barranquero <lektu@terra.es> + + * bookmark.el (bookmark-send-edited-annotation): Fix docstring. + (bookmark-edit-annotation-mode): Add mode name. + +2004-04-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * smerge-mode.el (smerge-match-conflict): Try to do something sensible + for nested conflict markers. + (smerge-find-conflict): Better handle errors in smerge-match-conflict. + +2004-04-15 Nick Roberts <nick@nick.uklinux.net> + + * progmodes/gdb-ui.el (gdb-goto-info): New function. + + * progmodes/gud.el (gud-menu-map, gud-tool-bar-map): Add help button. + 2004-04-14 Stefan Monnier <monnier@iro.umontreal.ca> * emacs-lisp/bytecomp.el (batch-byte-compile-file): @@ -91,7 +2802,7 @@ in addition it also disables menu-bar, tool-bar, scroll-bars, tool-tips, and the blinking cursor. (command-line-1): Skip startup screen if -Q. - (fancy-splash-head): Use :align-to center prop to center splash image. + (fancy-splash-head): Use ":align-to center" prop to center splash image. * emulation/cua-base.el (cua-read-only-cursor-color) (cua-overwrite-cursor-color, cua-global-mark-cursor-color): Doc fix. @@ -126,6 +2837,10 @@ * progmodes/python.el (run-python): Use compilation-shell-minor-mode. Set compilation-error-regexp-alist earlier. + * progmodes/compile.el (compilation-minor-mode-map) + (compilation-shell-minor-mode-map, compile-mouse-goto-error) + (compile-goto-error): Re-merge the mouse and non-mouse commands. + 2004-04-12 Stefan Monnier <monnier@iro.umontreal.ca> * progmodes/compile.el (compile-goto-error): Select the buffer/window @@ -288,7 +3003,7 @@ 2004-04-08 Nick Roberts <nick@nick.uklinux.net> - * progmodes/gdb-ui.el (gdb-source-window): Remove variable + * progmodes/gdb-ui.el (gdb-source-window): Remove variable. (gdb-goto-breakpoint, gdb-display-buffer) (gdb-display-source-buffer, gdb-view-source-function) (gdb-view-assembler, gdb-setup-windows, gdb-restore-windows) @@ -327,7 +3042,8 @@ Use Info-search-whitespace-regexp. Set Info-search-case-fold. (Info-search-case-sensitively, Info-search-next): New fun. (Info-up): Move point to the menu item of the current node. - (Info-history): New fun. Add *info-history* to same-window-buffer-names. + (Info-history): New fun. Add *info-history* to + same-window-buffer-names. (Info-toc): New fun. Add *info-toc* to same-window-buffer-names. (Info-insert-toc): New fun. (Info-build-toc): New fun. @@ -375,19 +3091,6 @@ * help-mode.el (help-function-def, help-variable-def): Handle hyperrefs to C source files specially. -2004-04-07 Stefan Monnier <monnier@iro.umontreal.ca> - - * progmodes/compile.el: Require CL. - (compilation-mode-font-lock-keywords): Re-install the "line as - function" patch. - - * help-fns.el (help-C-source-directory): New var. - (help-subr-name, help-C-file-name, help-find-C-source): New funs. - (describe-function-1, describe-variable): Use them. - - * help-mode.el (help-function-def, help-variable-def): Handle hyperrefs - to C source files specially. - 2004-04-07 Jan Nieuwenhuizen <janneke@gnu.org> * info.el (Info-hide-cookies-node): New function. @@ -424,7 +3127,7 @@ 2004-04-05 Vinicius Jose Latorre <viniciusjl@ig.com.br> - * printing.el: Dox fix. + * printing.el: Doc fix. 2004-04-05 Nick Roberts <nick@nick.uklinux.net> @@ -667,14 +3370,14 @@ * progmodes/gdb-ui.el (gdb-ann3, gdb-send-item) (gud-gdba-marker-filter): Log the process input and output, if - required. (from Stefan Monnier) + required. From Stefan Monnier. (gdb-debug-log, gdb-enable-debug-log): New variables. (gdb-post-prompt): Don't do gdb-var-update on Mac OS X. 2004-03-28 Stefan Monnier <monnier@iro.umontreal.ca> * vc-hooks.el (vc-file-not-found-hook): Fix typo. - From lorentey@elte.hu (L,Bu(Brentey K,Ba(Broly). + From lorentey@elte.hu (L$,1 q(Brentey K,Aa(Broly). 2004-03-27 Luc Teirlinck <teirllm@auburn.edu> @@ -989,7 +3692,7 @@ if the source location can't be found. (edebug-compute-previous-result): Use prin1-char. - * emacs-lisp/checkdoc.el (checkdoc-error): Dont' assume point-min == 1. + * emacs-lisp/checkdoc.el (checkdoc-error): Don't assume point-min == 1. (debug-ignored-errors): Add an entry. * emacs-lisp/bytecomp.el (byte-recompile-directory): Ignore hidden dir. @@ -1026,7 +3729,7 @@ 2004-03-21 Andre Spiegel <spiegel@gnu.org> - * vc.el Add new optional BUFFER argument to vc-BACKEND-print-log + * vc.el: Add new optional BUFFER argument to vc-BACKEND-print-log and vc-BACKEND-diff. (vc-print-log): If the print-log implementation supports it, use the new BUFFER argument to direct output to *vc-change-log*, not *vc*. @@ -1505,7 +4208,7 @@ * printing.el: Replace "As Is..." in PostScript file print/preview by "No Preprocessing...". Suggested by Colin Marquardt - <marquardt@zmd.de>. + <_marquardt_@zmd.de>. (pr-insert-section-4): Adjust buffer interface. 2004-02-29 Kai Grossjohann <kai.grossjohann@gmx.net> @@ -1590,7 +4293,7 @@ (top-level): Require password.el if visible. Should be mandatory once No Gnus has found its way into (X)Emacs. (tramp-read-passwd): Invoke `password-read' if available, - `read-passwd' otherwise. `ange-ftp-read-passwd' isn't used as + `read-passwd' otherwise. `ange-ftp-read-passwd' isn't used as fallback any longer. (tramp-clear-passwd): New function. (tramp-process-actions, tramp-process-multi-actions): @@ -3012,7 +5715,7 @@ * gdb-ui.el (gdb-prompt): Change filter for level 3 annotations, if necessary. - (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if + (gdb-ann3): New function. Initialise M-x gdb as for M-x gdba if annotations are detected. (gud-gdba-marker-filter): Use global variable gud-marker-acc instead of a local one to allow transition from @@ -3106,7 +5809,7 @@ * gdb-ui.el (gdba, gdb-assembler-mode): Call the mode "Machine" as a mode called "Assembler" already exists. (gdb-use-colon-colon-notation, gdb-show-changed-values): New options. - (gud-watch): Use format option. Remove font properties from string. + (gud-watch): Use format option. Remove font properties from string. (gdb-var-create-handler, gdb-var-list-children-handler): Don't bother about properties as there are none. (gdb-var-create-handler, gdb-var-list-children-handler) @@ -3199,7 +5902,7 @@ (tramp-handle-file-attributes): Replace proprietary optional parameter NONNUMERIC by the recently (Emacs 21.4) introduced ID-FORMAT. (tramp-handle-file-attributes-with-perl): Handle parameter - NONNUMERIC if set. This wasn't done in the past. + NONNUMERIC if set. This wasn't done in the past. (tramp-post-connection): Apply second parameter "$2" if `tramp-remote-perl' is called. @@ -3973,7 +6676,7 @@ * progmodes/gud.el (gud-menu-map, gud-tool-bar-map): Replace gud-display with gud-watch. (gud-speedbar-buttons): Add stuff for watching expressions - in the speedbar when using M-x gdba. Use dolist on old part + in the speedbar when using M-x gdba. Use dolist on old part of this function. * gdb-ui.el (gdb-var-list, gdb-var-changed, gdb-update-flag) @@ -4208,9 +6911,9 @@ * ffap.el (ffap-shell-prompt-regexp): Add regexp to identify common shell prompts that are not common filename or URL characters. (ffap-file-at-point): Use the new regexp to strip the prompts from - the file names. This is an issue mostly for user prompts that + the file names. This is an issue mostly for user prompts that don't have a trailing space and find-file-at-point is invoked from - within a shell inside emacs. + within a shell inside Emacs. 2003-09-24 Andre Spiegel <spiegel@gnu.org> @@ -4425,7 +7128,7 @@ * gdb-ui.el (gud-display1): Use gud-call to prevent extra prompt being displayed in GUD buffer. - (gdb-idle-input-queue): Remove var. Use just one queue. + (gdb-idle-input-queue): Remove var. Use just one queue. (gdb-enqueue-idle-input,gdb-dequeue-idle-input): Remove functions. Use just one queue. (gdb-prompt, gdb-subprompt, def-gdb-auto-update-trigger) @@ -4609,7 +7312,7 @@ 2003-08-24 Nick Roberts <nick@nick.uklinux.net> * progmodes/gud.el (gud-display-line): Don't set window-point if - source buffer is not visible. (Only happens with M-x gdba). + source buffer is not visible. (Only happens with M-x gdba.) * gdb-ui.el (gdba): Remove gdb-quit (previously removed) from documentation. @@ -4857,7 +7560,7 @@ 2003-08-12 Juri Linkov <juri@jurta.org> (tiny change) * simple.el (backward-word, forward-to-indentation) - (backward-to-indentation): Argument changed to optional. + (backward-to-indentation): Argument changed to optional. (next-line, previous-line): Use `or' instead of `unless'. 2003-08-12 Vinicius Jose Latorre <viniciusjl@ig.com.br> @@ -5039,7 +7742,7 @@ behaviour of `calendar-day-name' and `calendar-month-name' functions. (diary-name-pattern): Use abbrev arrays, rather than fixing abbrevs at three chars. Calling syntax change. - (mark-diary-entries): Adapt for new behaviours of + (mark-diary-entries): Adapt for new behaviours of `diary-name-pattern' and `calendar-make-alist' functions. (fancy-diary-font-lock-keywords): Adapt for new behaviour of `diary-name-pattern' function. @@ -5426,7 +8129,7 @@ 2003-07-10 Vinicius Jose Latorre <viniciusjl@ig.com.br> * ps-print.el: Print line number correctly in a region. Reported by - Tim Allen <timallen@ls83.fsnet.co.uk> + Tim Allen <timallen@ls83.fsnet.co.uk>. (ps-print-version): New version number (6.6.2). (ps-printing-region): Code fix. @@ -5490,7 +8193,7 @@ 2003-07-08 Markus Rost <rost@math.ohio-state.edu> - * subr.el (dolist, dotimes): Doc fix. + * subr.el (dolist, dotimes): Doc fix. 2003-07-08 Kim F. Storm <storm@cua.dk> @@ -5648,33 +8351,33 @@ (bibtex-autokey-get-names): Fiddle with regexps. (bibtex-generate-autokey): Use identity. (bibtex-parse-keys): Use simplified parsing algorithm if - bibtex-parse-keys-fast is non-nil. Simplify. Change order of - arguments. Return alist of keys. - (bibtex-parse-strings): Simplify. Return alist of strings. + bibtex-parse-keys-fast is non-nil. Simplify. Change order of + arguments. Return alist of keys. + (bibtex-parse-strings): Simplify. Return alist of strings. (bibtex-complete-string-cleanup): Fix docstring. (bibtex-read-key): New function. - (bibtex-mode): Fix docstring. Do not parse for keys and - strings when the mode is entered. Set fill-paragraph-function to - bibtex-fill-field. Setup font-lock-mark-block-function the way + (bibtex-mode): Fix docstring. Do not parse for keys and + strings when the mode is entered. Set fill-paragraph-function to + bibtex-fill-field. Setup font-lock-mark-block-function the way font-lock intended. - (bibtex-entry): Use bibtex-read-key. Obey bibtex-autofill-types. + (bibtex-entry): Use bibtex-read-key. Obey bibtex-autofill-types. (bibtex-parse-entry, bibtex-autofill-entry): New functions. (bibtex-print-help-message, bibtex-remove-OPT-or-ALT) (bibtex-Preamble): Avoid hard coded constants. - (bibtex-make-field): Fix docstring. Simplify. + (bibtex-make-field): Fix docstring. Simplify. (bibtex-beginning-of-entry): Always return new position of point. (bibtex-end-of-entry): Rearrange cond clauses. (bibtex-count-entries, bibtex-validate, bibtex-reformat): Update for changes of bibtex-map-entries. (bibtex-ispell-abstract): Do not move point. - (bibtex-entry-index): Use downcase. Simplify. + (bibtex-entry-index): Use downcase. Simplify. (bibtex-lessp): Handle catch-all. (bibtex-find-crossref): Turn into a command. - (bibtex-find-entry): Simplify. Use bibtex-read-key. Fix regexp. - (bibtex-clean-entry): Use bibtex-read-key. Handle string and + (bibtex-find-entry): Simplify. Use bibtex-read-key. Fix regexp. + (bibtex-clean-entry): Use bibtex-read-key. Handle string and preamble entries. (bibtex-fill-field-bounds): New function. - (bibtex-fill-field): New command. Bound to fill-paragraph-function. + (bibtex-fill-field): New command. Bound to fill-paragraph-function. (bibtex-fill-entry): Use bibtex-fill-field-bounds (bibtex-String): Use bibtex-strings. Always obey bibtex-sort-ignore-string-entries. @@ -5782,7 +8485,7 @@ See ChangeLog.10 for earlier changes. ;; coding: iso-2022-7bit ;; End: - Copyright (C) 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2001, 02, 04 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted provided the copyright notice and this notice are preserved. diff --git a/lisp/ChangeLog.10 b/lisp/ChangeLog.10 index cdf6d2966f3..0f0b626eb33 100644 --- a/lisp/ChangeLog.10 +++ b/lisp/ChangeLog.10 @@ -8320,17 +8320,27 @@ indicating source of entry to add-to-diary-list. (diary-button-face, diary-entry, diary-goto-entry): New, to support click to diary file. - (fancy-diary-display): Buttonize diary entries. + (fancy-diary-display): Buttonize diary entries. Use new mode + fancy-diary-display-mode. (list-sexp-diary-entries): Pass a marker indicating source of entry to add-to-diary-list. (diary-date): Return mark as well as entry. + (add-to-diary-list): Add new marker argument, appended to + diary-entries-list. + (diary-mode, fancy-diary-display-mode): New derived modes, for + diary file and fancy diary buffer respectively. + (fancy-diary-font-lock-keywords, diary-font-lock-keywords): New + variables. + (font-lock-diary-sexps, font-lock-diary-date-forms): New + functions, used in diary-font-lock-keywords. * calendar/calendar.el (diary-face): New. (european-calendar-display-form, describe-calendar-mode) (mark-visible-calendar-date, calendar-mark-today): Tidy doc string. - (calendar-make-alist): New. - (calendar-mode): Set up font-lock mode. + (calendar-mode): Set up font-lock mode, using new variable + calendar-font-lock-keywords. (generate-calendar-window): Fontify if font-lock-mode is on. + (calendar-font-lock-keywords): New variable. 2002-11-16 Ivan Zakharyaschev <imz@altlinux.org> (tiny change) diff --git a/lisp/Makefile.in b/lisp/Makefile.in index e1db260776b..d43f47871c2 100644 --- a/lisp/Makefile.in +++ b/lisp/Makefile.in @@ -279,7 +279,7 @@ compile-after-backup: backup-compiled-files compile-always # .elc is present. recompile: doit $(lisp)/progmodes/cc-mode.elc - LC_ALL=C $(EMACS) $(EMACSOPT) -f batch-byte-recompile-directory $(lisp) + LC_ALL=C $(EMACS) $(EMACSOPT) --eval "(batch-byte-recompile-directory 0)" $(lisp) # CC Mode uses a compile time macro system which causes a compile time # dependency in cc-mode.elc on the macros in cc-langs.el and the @@ -324,5 +324,4 @@ bootstrap-after: finder-data custom-deps distclean: -rm -f ./Makefile -# arch-tag: d4ea703a-b91c-405c-a171-8dde30b163a7 # Makefile ends here. diff --git a/lisp/abbrev.el b/lisp/abbrev.el index 1e3eea0e359..3be0014fd0e 100644 --- a/lisp/abbrev.el +++ b/lisp/abbrev.el @@ -37,9 +37,9 @@ define global abbrevs instead." :group 'convenience) (defun abbrev-mode (&optional arg) - "Toggle abbrev mode. + "Toggle Abbrev mode in the current buffer. With argument ARG, turn abbrev mode on iff ARG is positive. -In abbrev mode, inserting an abbreviation causes it to expand +In Abbrev mode, inserting an abbreviation causes it to expand and be replaced by its expansion." (interactive "P") (setq abbrev-mode @@ -48,18 +48,19 @@ and be replaced by its expansion." (force-mode-line-update)) (defcustom abbrev-mode nil - "Toggle abbrev mode. + "Enable or disable Abbrev mode. Non-nil means automatically expand abbrevs as they are inserted. +Setting this variable with `setq' changes it for the current buffer. Changing it with \\[customize] sets the default value. -Use the command `abbrev-mode' to enable or disable Abbrev mode in the current -buffer." +Interactively, use the command `abbrev-mode' +to enable or disable Abbrev mode in the current buffer." :type 'boolean :group 'abbrev-mode) (defvar edit-abbrevs-map nil - "Keymap used in edit-abbrevs.") + "Keymap used in `edit-abbrevs'.") (if edit-abbrevs-map nil (setq edit-abbrevs-map (make-sparse-keymap)) diff --git a/lisp/add-log.el b/lisp/add-log.el index 609dfde5f65..3c29e8a465e 100644 --- a/lisp/add-log.el +++ b/lisp/add-log.el @@ -230,13 +230,13 @@ Note: The search is conducted only within 10%, at the beginning of the file." ;; Possibly further names in a list: ("\\=, \\([^ ,:([\n]+\\)" nil nil (1 'change-log-file-face)) ;; Possibly a parenthesized list of names: - ("\\= (\\([^) ,:\n]+\\)" nil nil (1 'change-log-list-face)) - ("\\=, *\\([^) ,:\n]+\\)" nil nil (1 'change-log-list-face))) + ("\\= (\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face)) + ("\\=, *\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face))) ;; ;; Function or variable names. - ("^\t(\\([^) ,:\n]+\\)" + ("^\t(\\([^) ,\n]+\\)" (1 'change-log-list-face) - ("\\=, *\\([^) ,:\n]+\\)" nil nil (1 'change-log-list-face))) + ("\\=, *\\([^) ,\n]+\\)" nil nil (1 'change-log-list-face))) ;; ;; Conditionals. ("\\[!?\\([^]\n]+\\)\\]\\(:\\| (\\)" (1 'change-log-conditionals-face)) @@ -445,7 +445,7 @@ Optional arg BUFFER-FILE overrides `buffer-file-name'." (defun add-change-log-entry (&optional whoami file-name other-window new-entry) "Find change log file, and add an entry for today and an item for this file. Optional arg WHOAMI (interactive prefix) non-nil means prompt for user -name and site. +name and email (stored in `add-log-full-name' and `add-log-mailing-address'). Second arg FILE-NAME is file name of the change log. If nil, use the value of `change-log-default-name'. diff --git a/lisp/allout.el b/lisp/allout.el index 3fa04449e16..dd4495cfa84 100644 --- a/lisp/allout.el +++ b/lisp/allout.el @@ -1,6 +1,6 @@ ;;; allout.el --- extensive outline mode for use alone and with other modes -;; Copyright (C) 1992, 1993, 1994, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 1992, 93, 94, 2001, 02, 2004 Free Software Foundation, Inc. ;; Author: Ken Manheimer <klm@zope.com> ;; Maintainer: Ken Manheimer <klm@zope.com> @@ -46,7 +46,7 @@ ;; ;; The outline menubar additions provide quick reference to many of ;; the features, and see the docstring of the function `allout-init' -;; for instructions on priming your emacs session for automatic +;; for instructions on priming your Emacs session for automatic ;; activation of `allout-mode'. ;; ;; See the docstring of the variables `allout-layout' and @@ -83,7 +83,7 @@ dictated by `allout-layout' should be imposed on mode activation. With value t, auto-mode-activation and auto-layout are enabled. \(This also depends on `allout-find-file-hook' being installed in -`find-file-hooks', which is also done by `allout-init'.) +`find-file-hook', which is also done by `allout-init'.) With value `ask', auto-mode-activation is enabled, and endorsement for performing auto-layout is asked of the user each time. @@ -162,7 +162,7 @@ prefix, which is concluded by bullets that includes the value of this var and the respective allout-*-bullets-string vars. The value of an asterisk (`*') provides for backwards compatibility -with the original emacs outline mode. See `allout-plain-bullets-string' +with the original Emacs outline mode. See `allout-plain-bullets-string' and `allout-distinctive-bullets-string' for the range of available bullets." :type 'string @@ -263,7 +263,7 @@ from regular comments that start at bol.") Non-nil restricts the topic creation and modification functions to asterix-padded prefixes, so they look exactly -like the original emacs-outline style prefixes. +like the original Emacs-outline style prefixes. Whatever the setting of this variable, both old and new style prefixes are always respected by the topic maneuvering functions." @@ -491,7 +491,7 @@ those that do not have the variable `comment-start' set. A value of (defcustom allout-inhibit-protection nil "*Non-nil disables warnings and confirmation-checks for concealed-text edits. -Outline mode uses emacs change-triggered functions to detect unruly +Outline mode uses Emacs change-triggered functions to detect unruly changes to concealed regions. Set this var non-nil to disable the protection, potentially increasing text-entry responsiveness a bit. @@ -507,7 +507,7 @@ behavior." ;;;_ : Version ;;;_ = allout-version (defvar allout-version - (let ((rcs-rev "$Revision: 1.47 $")) + (let ((rcs-rev "$Revision$")) (condition-case err (save-match-data (string-match "Revision: \\([0-9]+\\.[0-9]+\\)" rcs-rev) @@ -708,7 +708,7 @@ Works with respect to `allout-plain-bullets-string' and (defvar allout-mode-map nil "Keybindings for (allout) outline minor mode.") ;;;_ > produce-allout-mode-map (keymap-alist &optional base-map) (defun produce-allout-mode-map (keymap-list &optional base-map) - "Produce keymap for use as allout-mode-map, from keymap-list. + "Produce keymap for use as allout-mode-map, from KEYMAP-LIST. Built on top of optional BASE-MAP, or empty sparse map if none specified. See doc string for allout-keybindings-list for format of binding list." @@ -726,17 +726,12 @@ See doc string for allout-keybindings-list for format of binding list." (car (cdr cell))))))) keymap-list) map)) -;;;_ = allout-prior-bindings - being deprecated. -(defvar allout-prior-bindings nil - "Variable for use in V18, with `allout-added-bindings', for -resurrecting, on mode deactivation, bindings that existed before -activation. Being deprecated.") -;;;_ = allout-added-bindings - being deprecated -(defvar allout-added-bindings nil - "Variable for use in V18, with `allout-prior-bindings', for -resurrecting, on mode deactivation, bindings that existed before -activation. Being deprecated.") + ;;;_ : Menu bar +(defvar allout-mode-exposure-menu) +(defvar allout-mode-editing-menu) +(defvar allout-mode-navigation-menu) +(defvar allout-mode-misc-menu) (defun produce-allout-mode-menubar-entries () (require 'easymenu) (easy-menu-define allout-mode-exposure-menu @@ -909,7 +904,7 @@ mode from prop-line file-var activation. Used by `allout-mode' function to track repeats.") ;;;_ > allout-write-file-hook () (defun allout-write-file-hook () - "In `allout-mode', run as a `local-write-file-hooks' activity. + "In `allout-mode', run as a `write-contents-functions' activity. Currently just sets `allout-during-write-cue', so outline change-protection knows to keep inactive during file write." @@ -944,17 +939,17 @@ MODE is one of the following symbols: - anything else \(eg, t) for auto-activation and auto-layout, without any confirmation check. -Use this function to setup your emacs session for automatic activation +Use this function to setup your Emacs session for automatic activation of allout outline mode, contingent to the buffer-specific setting of the `allout-layout' variable. (See `allout-layout' and `allout-expose-topic' docstrings for more details on auto layout). `allout-init' works by setting up (or removing) -`allout-find-file-hook' in `find-file-hooks', and giving +`allout-find-file-hook' in `find-file-hook', and giving `allout-auto-activation' a suitable setting. -To prime your emacs session for full auto-outline operation, include -the following two lines in your emacs init file: +To prime your Emacs session for full auto-outline operation, include +the following two lines in your Emacs init file: \(require 'allout) \(allout-init t)" @@ -979,16 +974,16 @@ the following two lines in your emacs init file: (curr-mode 'allout-auto-activation)) (cond ((not mode) - (setq find-file-hooks (delq hook find-file-hooks)) + (setq find-file-hook (delq hook find-file-hook)) (if (interactive-p) (message "Allout outline mode auto-activation inhibited."))) ((eq mode 'report) - (if (memq hook find-file-hooks) + (if (memq hook find-file-hook) ;; Just punt and use the reports from each of the modes: (allout-init (symbol-value curr-mode)) (allout-init nil) (message "Allout outline mode auto-activation inhibited."))) - (t (add-hook 'find-file-hooks hook) + (t (add-hook 'find-file-hook hook) (set curr-mode ; `set', not `setq'! (cond ((eq mode 'activate) (message @@ -1049,7 +1044,7 @@ Below is a description of the bindings, and then explanation of special `allout-mode' features and terminology. See also the outline menubar additions for quick reference to many of the features, and see the docstring of the function `allout-init' for instructions on -priming your emacs session for automatic activation of `allout-mode'. +priming your Emacs session for automatic activation of `allout-mode'. The bindings are dictated by the `allout-keybindings-list' and @@ -1107,7 +1102,7 @@ C-c = p allout-flatten-exposed-to-buffer Like above 'copy-exposed', but convert topic prefixes to section.subsection... numeric format. -ESC ESC (allout-init t) Setup emacs session for outline mode +ESC ESC (allout-init t) Setup Emacs session for outline mode auto-activation. HOT-SPOT Operation @@ -1137,7 +1132,7 @@ twice in a row to get to the hot-spot. Topic hierarchy constituents - TOPICS and SUBTOPICS: -TOPIC: A basic, coherent component of an emacs outline. It can +TOPIC: A basic, coherent component of an Emacs outline. It can contain other topics, and it can be subsumed by other topics, CURRENT topic: The visible topic most immediately containing the cursor. @@ -1252,19 +1247,6 @@ OPEN: A topic that is not closed, though its offspring or body may be." ; active state or *de*activation ; specifically requested: (setq allout-explicitly-deactivated t) - (if (string-match "^18\." emacs-version) - ; Revoke those keys that remain - ; as we set them: - (let ((curr-loc (current-local-map))) - (mapcar (function - (lambda (cell) - (if (eq (lookup-key curr-loc (car cell)) - (car (cdr cell))) - (define-key curr-loc (car cell) - (assq (car cell) allout-prior-bindings))))) - allout-added-bindings) - (allout-resumptions 'allout-added-bindings) - (allout-resumptions 'allout-prior-bindings))) (if allout-old-style-prefixes (progn @@ -1273,9 +1255,9 @@ OPEN: A topic that is not closed, though its offspring or body may be." (allout-resumptions 'selective-display) (if (and (boundp 'before-change-functions) before-change-functions) (allout-resumptions 'before-change-functions)) - (setq local-write-file-hooks - (delq 'allout-write-file-hook - local-write-file-hooks)) + (setq write-contents-functions + (delq 'allout-write-file-hook + write-contents-functions)) (allout-resumptions 'paragraph-start) (allout-resumptions 'paragraph-separate) (allout-resumptions (if (string-match "^18" emacs-version) @@ -1315,20 +1297,13 @@ OPEN: A topic that is not closed, though its offspring or body may be." (cons '(allout-mode . allout-mode-map) minor-mode-map-alist)))) - ; V18 minor-mode key bindings: - ; Stash record of added bindings - ; for later revocation: - (allout-resumptions 'allout-added-bindings - (list allout-keybindings-list)) - (allout-resumptions 'allout-prior-bindings - (list (current-local-map))) ; and add them: (use-local-map (produce-allout-mode-map allout-keybindings-list (current-local-map))) ) ; selective-display is the - ; emacs conditional exposure + ; Emacs conditional exposure ; mechanism: (allout-resumptions 'selective-display '(t)) (if allout-inhibit-protection @@ -1340,7 +1315,7 @@ OPEN: A topic that is not closed, though its offspring or body may be." ; Temporarily set by any outline ; functions that can be trusted to ; deal properly with concealed text. - (add-hook 'local-write-file-hooks 'allout-write-file-hook) + (add-hook 'write-contents-functions 'allout-write-file-hook) ; Custom auto-fill func, to support ; respect for topic headline, ; hanging-indents, etc: @@ -1562,7 +1537,7 @@ Actually, returns prefix beginning point." (defun allout-sibling-index (&optional depth) "Item number of this prospective topic among its siblings. -If optional arg depth is greater than current depth, then we're +If optional arg DEPTH is greater than current depth, then we're opening a new level, and return 0. If less than this depth, ascend to that depth and count..." @@ -1647,8 +1622,7 @@ Return the location of the beginning of the heading, or nil if not found." "Produce a location \"chart\" of subtopics of the containing topic. Optional argument LEVELS specifies the depth \(relative to start -depth) for the chart. Subsequent optional args are not for public -use. +depth) for the chart. Charts are used to capture outline structure, so that outline altering routines need assess the structure only once, and then use the chart @@ -1661,9 +1635,11 @@ list containing, recursively, the charts for the respective subtopics. The chart for a topics' offspring precedes the entry for the topic itself. -The other function parameters are for internal recursion, and should -not be specified by external callers. ORIG-DEPTH is depth of topic at -starting point, and PREV-DEPTH is depth of prior topic." +\(fn &optional levels)" + + ;; The other function parameters are for internal recursion, and should + ;; not be specified by external callers. ORIG-DEPTH is depth of topic at + ;; starting point, and PREV-DEPTH is depth of prior topic." (let ((original (not orig-depth)) ; `orig-depth' set only in recursion. chart curr-depth) @@ -1677,7 +1653,7 @@ starting point, and PREV-DEPTH is depth of prior topic." ;; Loop over the current levels' siblings. Besides being more ;; efficient than tail-recursing over a level, it avoids exceeding - ;; the typically quite constrained emacs max-lisp-eval-depth. + ;; the typically quite constrained Emacs max-lisp-eval-depth. ;; ;; Probably would speed things up to implement loop-based stack ;; operation rather than recursing for lower levels. Bah. @@ -1766,36 +1742,36 @@ start point." (setq chart (cdr chart)))) result)) ;;;_ X allout-chart-spec (chart spec &optional exposing) -(defun allout-chart-spec (chart spec &optional exposing) - "Not yet \(if ever) implemented. - -Produce exposure directives given topic/subtree CHART and an exposure SPEC. - -Exposure spec indicates the locations to be exposed and the prescribed -exposure status. Optional arg EXPOSING is an integer, with 0 -indicating pending concealment, anything higher indicating depth to -which subtopic headers should be exposed, and negative numbers -indicating (negative of) the depth to which subtopic headers and -bodies should be exposed. - -The produced list can have two types of entries. Bare numbers -indicate points in the buffer where topic headers that should be -exposed reside. - - - bare negative numbers indicates that the topic starting at the - point which is the negative of the number should be opened, - including their entries. - - bare positive values indicate that this topic header should be - opened. - - Lists signify the beginning and end points of regions that should - be flagged, and the flag to employ. (For concealment: `\(\?r\)', and - exposure:" - (while spec - (cond ((listp spec) - ) - ) - (setq spec (cdr spec))) - ) +;; (defun allout-chart-spec (chart spec &optional exposing) +;; "Not yet \(if ever) implemented. + +;; Produce exposure directives given topic/subtree CHART and an exposure SPEC. + +;; Exposure spec indicates the locations to be exposed and the prescribed +;; exposure status. Optional arg EXPOSING is an integer, with 0 +;; indicating pending concealment, anything higher indicating depth to +;; which subtopic headers should be exposed, and negative numbers +;; indicating (negative of) the depth to which subtopic headers and +;; bodies should be exposed. + +;; The produced list can have two types of entries. Bare numbers +;; indicate points in the buffer where topic headers that should be +;; exposed reside. + +;; - bare negative numbers indicates that the topic starting at the +;; point which is the negative of the number should be opened, +;; including their entries. +;; - bare positive values indicate that this topic header should be +;; opened. +;; - Lists signify the beginning and end points of regions that should +;; be flagged, and the flag to employ. (For concealment: `\(\?r\)', and +;; exposure:" +;; (while spec +;; (cond ((listp spec) +;; ) +;; ) +;; (setq spec (cdr spec))) +;; ) ;;;_ - Within Topic ;;;_ > allout-goto-prefix () @@ -2163,7 +2139,7 @@ Changes to concealed regions are ignored while file is being written. writes, like crypt and zip modes.) Locally bound in outline buffers to `before-change-functions', which -in emacs 19 is run before any change to the buffer. +in Emacs 19 is run before any change to the buffer. Any functions which set [`this-command' to `undo', or which set] `allout-override-protect' non-nil (as does, eg, allout-flag-chars) @@ -2178,7 +2154,7 @@ are exempt from this restriction." ; Both beginning and end chars must ; be exposed: (save-excursion (if (memq this-command '(newline open-line)) - ;; Compensate for stupid emacs {new, + ;; Compensate for stupid Emacs {new, ;; open-}line display optimization: (setq beg (1+ beg) end (1+ end))) @@ -2190,7 +2166,7 @@ are exempt from this restriction." (save-match-data (if (equal this-command 'undo) ;; Allow undo without inhibition. - ;; - Undoing new and open-line hits stupid emacs redisplay + ;; - Undoing new and open-line hits stupid Emacs redisplay ;; optimization (em 19 cmds.c, ~ line 200). ;; - Presumably, undoing what was properly protected when ;; done. @@ -2356,7 +2332,7 @@ return to regular interpretation of self-insert characters." (let* ((this-key-num (cond ((numberp last-command-char) last-command-char) - ;; XXX Only xemacs has characterp. + ;; XXX Only XEmacs has characterp. ((and (fboundp 'characterp) (characterp last-command-char)) (char-to-int last-command-char)) @@ -2410,7 +2386,7 @@ Called as part of `allout-post-command-business'." ;;;_ > allout-flag-region (from to flag) (defmacro allout-flag-region (from to flag) - "Hide or show lines from FROM to TO, via emacs selective-display FLAG char. + "Hide or show lines from FROM to TO, via Emacs selective-display FLAG char. Ie, text following flag C-m \(carriage-return) is hidden until the next C-j (newline) char. @@ -2423,7 +2399,7 @@ Returns the endpoint of the region." ;;;_ > allout-isearch-expose (mode) (defun allout-isearch-expose (mode) - "Mode is either 'clear, 'start, 'continue, or 'final." + "MODE is either 'clear, 'start, 'continue, or 'final." ;; allout-isearch-prior-pos encodes exposure status of prior pos: ;; (pos was-vis header-pos end-pos) ;; pos - point of concern @@ -2532,7 +2508,7 @@ Offer one suitable for current depth DEPTH as default." ) ;;;_ > allout-distinctive-bullet (bullet) (defun allout-distinctive-bullet (bullet) - "True if bullet is one of those on `allout-distinctive-bullets-string'." + "True if BULLET is one of those on `allout-distinctive-bullets-string'." (string-match (regexp-quote bullet) allout-distinctive-bullets-string)) ;;;_ > allout-numbered-type-prefix (&optional prefix) (defun allout-numbered-type-prefix (&optional prefix) @@ -2704,7 +2680,7 @@ index for each successive sibling)." ) ;;;_ > allout-open-topic (relative-depth &optional before use_sib_bullet) (defun allout-open-topic (relative-depth &optional before use_sib_bullet) - "Open a new topic at depth DEPTH. + "Open a new topic at depth RELATIVE-DEPTH. New topic is situated after current one, unless optional flag BEFORE is non-nil, or unless current line is complete empty (not even @@ -2925,7 +2901,7 @@ Maintains outline hanging topic indentation if (do-auto-fill)))) ;;;_ > allout-reindent-body (old-depth new-depth &optional number) (defun allout-reindent-body (old-depth new-depth &optional number) - "Reindent body lines which were indented at old-depth to new-depth. + "Reindent body lines which were indented at OLD-DEPTH to NEW-DEPTH. Optional arg NUMBER indicates numbering is being added, and it must be accommodated. @@ -2999,15 +2975,13 @@ Note that refill of indented paragraphs is not done." "Adjust bullet of current topic prefix. -All args are optional. - If SOLICIT is non-nil, then the choice of bullet is solicited from user. If it's a character, then that character is offered as the default, otherwise the one suited to the context \(according to distinction or depth) is offered. If non-nil, then the context-specific bullet is just used. -Second arg DEPTH forces the topic prefix to that depth, regardless +Second arg NEW-DEPTH forces the topic prefix to that depth, regardless of the topic's current depth. Third arg NUMBER-CONTROL can force the prefix to or away from @@ -3120,13 +3094,13 @@ With repeat count, shift topic depth by that amount." contained subtopics. See `allout-rebullet-heading' for rebulleting behavior. -All arguments are optional. - -First arg RELATIVE-DEPTH means to shift the depth of the entire +Arg RELATIVE-DEPTH means to shift the depth of the entire topic that amount. -The rest of the args are for internal recursive use by the function -itself. The are STARTING-DEPTH, STARTING-POINT, and INDEX." +\(fn &optional RELATIVE-DEPTH)" + + ;; All args except the first one are for internal recursive use by the + ;; function itself. (let* ((relative-depth (or relative-depth 0)) (new-depth (allout-depth)) @@ -3925,11 +3899,7 @@ Examples: max-pos))) ;;;_ > allout-old-expose-topic (spec &rest followers) (defun allout-old-expose-topic (spec &rest followers) - - "Deprecated. Use `allout-expose-topic' \(with different schema -format) instead. - -Dictate wholesale exposure scheme for current topic, according to SPEC. + "Dictate wholesale exposure scheme for current topic, according to SPEC. SPEC is either a number or a list. Optional successive args dictate exposure for subsequent siblings of current topic. @@ -3956,7 +3926,7 @@ dictates the exposure depth of the topic as a whole. Subsequent elements of the list are nested SPECs, dictating the specific exposure for the corresponding offspring of the topic. -Optional FOLLOWER arguments dictate exposure for succeeding siblings." +Optional FOLLOWERS arguments dictate exposure for succeeding siblings." (interactive "xExposure spec: ") (let ((depth (allout-current-depth)) @@ -4001,6 +3971,9 @@ Optional FOLLOWER arguments dictate exposure for succeeding siblings." (allout-old-expose-topic (car followers)) (setq followers (cdr followers))) max-pos)) +(make-obsolete 'allout-old-expose-topic + "use `allout-expose-topic' (with different schema format) instead." + "19.23") ;;;_ > allout-new-exposure '() (defmacro allout-new-exposure (&rest spec) "Literal frontend for `allout-expose-topic', doesn't evaluate arguments. @@ -4031,9 +4004,7 @@ Examples: (list 'allout-expose-topic (list 'quote spec)))) ;;;_ > allout-exposure '() (defmacro allout-exposure (&rest spec) - "Being deprecated - use more recent `allout-new-exposure' instead. - -Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments + "Literal frontend for `allout-old-expose-topic', doesn't evaluate arguments and retains start position." (list 'save-excursion '(if (not (or (allout-goto-prefix) @@ -4041,6 +4012,7 @@ and retains start position." (error "Can't find any outline topics")) (cons 'allout-old-expose-topic (mapcar (function (lambda (x) (list 'quote x))) spec)))) +(make-obsolete 'allout-exposure 'allout-new-exposure "19.23") ;;;_ #7 Systematic outline presentation - copying, printing, flattening @@ -4248,12 +4220,10 @@ header and body. The elements of that list are: ;;;_ > allout-process-exposed (&optional func from to frombuf ;;; tobuf format) (defun allout-process-exposed (&optional func from to frombuf tobuf - format &optional start-num) + format start-num) "Map function on exposed parts of current topic; results to another buffer. -All args are options; default values itemized below. - -Apply FUNCTION to exposed portions FROM position TO position in buffer +Apply FUNC to exposed portions FROM position TO position in buffer FROMBUF to buffer TOBUF. Sixth optional arg, FORMAT, designates an alternate presentation form: @@ -4266,7 +4236,7 @@ alternate presentation form: except for distinctive bullets. Defaults: - FUNCTION: `allout-insert-listified' + FUNC: `allout-insert-listified' FROM: region start, if region active, else start of buffer TO: region end, if region active, else end of buffer FROMBUF: current buffer @@ -4311,11 +4281,13 @@ Defaults: (defun allout-insert-listified (listified) "Insert contents of listified outline portion in current buffer. -Listified is a list representing each topic header and body: +LISTIFIED is a list representing each topic header and body: \`(depth prefix text)' -or \`(depth prefix text bullet-plus)' +or + + \`(depth prefix text bullet-plus)' If `bullet-plus' is specified, it is inserted just after the entire prefix." (setq listified (cdr listified)) @@ -4381,14 +4353,14 @@ alternate presentation format for the outline: (defun allout-flatten-exposed-to-buffer (&optional arg tobuf) "Present numeric outline of outline's exposed portions in another buffer. -The resulting outline is not compatable with outline mode - use +The resulting outline is not compatible with outline mode - use `allout-copy-exposed-to-buffer' if you want that. Use `allout-indented-exposed-to-buffer' for indented presentation. With repeat count, copy the exposed portions of only current topic. -Other buffer has current buffers name with \" exposed\" appended to +Other buffer has current buffer's name with \" exposed\" appended to it, unless optional second arg TOBUF is specified, in which case it is used verbatim." (interactive "P") @@ -4397,22 +4369,22 @@ used verbatim." (defun allout-indented-exposed-to-buffer (&optional arg tobuf) "Present indented outline of outline's exposed portions in another buffer. -The resulting outline is not compatable with outline mode - use +The resulting outline is not compatible with outline mode - use `allout-copy-exposed-to-buffer' if you want that. Use `allout-flatten-exposed-to-buffer' for numeric sectional presentation. With repeat count, copy the exposed portions of only current topic. -Other buffer has current buffers name with \" exposed\" appended to +Other buffer has current buffer's name with \" exposed\" appended to it, unless optional second arg TOBUF is specified, in which case it is used verbatim." (interactive "P") (allout-copy-exposed-to-buffer arg tobuf 'indent)) ;;;_ - LaTeX formatting -;;;_ > allout-latex-verb-quote (str &optional flow) -(defun allout-latex-verb-quote (str &optional flow) +;;;_ > allout-latex-verb-quote (string &optional flow) +(defun allout-latex-verb-quote (string &optional flow) "Return copy of STRING for literal reproduction across latex processing. Expresses the original characters \(including carriage returns) of the string across latex processing." @@ -4422,7 +4394,7 @@ string across latex processing." (concat "\\char" (number-to-string char) "{}")) ((= char ?\n) "\\\\") (t (char-to-string char))))) - str + string "")) ;;;_ > allout-latex-verbatim-quote-curr-line () (defun allout-latex-verbatim-quote-curr-line () @@ -4443,12 +4415,12 @@ environment. Leaves point at the end of the line." (insert "\\") (setq end (1+ end)) (goto-char (1+ (match-end 0)))))) -;;;_ > allout-insert-latex-header (buf) -(defun allout-insert-latex-header (buf) +;;;_ > allout-insert-latex-header (buffer) +(defun allout-insert-latex-header (buffer) "Insert initial latex commands at point in BUFFER." ;; Much of this is being derived from the stuff in appendix of E in ;; the TeXBook, pg 421. - (set-buffer buf) + (set-buffer buffer) (let ((doc-style (format "\n\\documentstyle{%s}\n" "report")) (page-numbering (if allout-number-pages @@ -4517,10 +4489,10 @@ environment. Leaves point at the end of the line." hoffset vspace) ))) -;;;_ > allout-insert-latex-trailer (buf) -(defun allout-insert-latex-trailer (buf) +;;;_ > allout-insert-latex-trailer (buffer) +(defun allout-insert-latex-trailer (buffer) "Insert concluding latex commands at point in BUFFER." - (set-buffer buf) + (set-buffer buffer) (insert "\n\\end{document}\n")) ;;;_ > allout-latexify-one-item (depth prefix bullet text) (defun allout-latexify-one-item (depth prefix bullet text) @@ -4731,9 +4703,9 @@ function. If HOOK is void, it is first set to nil." (cons function (symbol-value hook))))))) ;;;_ : my-mark-marker to accommodate divergent emacsen: (defun my-mark-marker (&optional force buffer) - "Accommodate the different signature for mark-marker across emacsen. + "Accommodate the different signature for mark-marker across Emacsen. -GNU XEmacs takes two optional args, while mainline GNU Emacs does not, +XEmacs takes two optional args, while GNU Emacs does not, so pass them along when appropriate." (if (featurep 'xemacs) (mark-marker force buffer) diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index ba00d915d73..6c20cf41165 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -837,6 +837,14 @@ using `make-temp-file', and the generated name is returned." (or (and archive-subfile-mode (aref archive-subfile-mode 0)) archive))) (make-directory archive-tmpdir t) + ;; If ARCHIVE includes leading directories, make sure they + ;; exist under archive-tmpdir. + (let ((arch-dir (file-name-directory archive))) + (if arch-dir + (make-directory (concat + (file-name-as-directory archive-tmpdir) + arch-dir) + t))) (setq archive-local-name (archive-unique-fname archive-name archive-tmpdir)) (save-restriction diff --git a/lisp/autoinsert.el b/lisp/autoinsert.el index 489593aa925..88acbd04792 100644 --- a/lisp/autoinsert.el +++ b/lisp/autoinsert.el @@ -136,7 +136,7 @@ If this contains a %s, that will be replaced by the matching rule." (("\\.[1-9]\\'" . "Man page skeleton") "Short description: " ".\\\" Copyright (C), " (substring (current-time-string) -4) " " - (getenv "ORGANIZATION") | "Free Software Foundation, Inc." + (getenv "ORGANIZATION") | (progn user-full-name) " .\\\" You may distribute this file under the terms of the GNU Free .\\\" Documentation Licence. diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 58bb6d29705..7b786882cf6 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -36,8 +36,12 @@ ;; Auto-Revert Mode. Both modes automatically revert buffers ;; whenever the corresponding files have been changed on disk. ;; -;; Auto-Revert Mode can be activated for individual buffers. -;; Global Auto-Revert Mode applies to all file buffers. +;; Auto-Revert Mode can be activated for individual buffers. Global +;; Auto-Revert Mode applies to all file buffers. (If the user option +;; `global-auto-revert-non-file-buffers' is non-nil, it also applies +;; to some non-file buffers. This option is disabled by default.) +;; Since checking a remote file is too slow, these modes do not check +;; or revert remote files. ;; ;; Both modes operate by checking the time stamp of all files at ;; intervals of `auto-revert-interval'. The default is every five @@ -170,20 +174,21 @@ would only waste precious space." :type 'hook) (defcustom global-auto-revert-non-file-buffers nil - "When nil only file buffers are reverted by Global Auto-Revert Mode. + "When nil, Global Auto-Revert mode operates only on file-visiting buffers. When non-nil, both file buffers and buffers with a custom `revert-buffer-function' and a `buffer-stale-function' are -reverted by Global Auto-Revert Mode. - -Use this option with care since it could lead to excessive reverts. -Note also that for some non-file buffers the check whether the -buffer needs updating may be imperfect, due to efficiency -considerations, and may not take all information listed in the -buffer into account. Hence, a non-nil value for this option does -not necessarily make manual updates useless for non-file buffers." +reverted by Global Auto-Revert mode. These include the Buffer +List buffer, and Dired buffers showing complete local +directories. Dired buffers do not auto-revert as a result of +changes in subdirectories or in the contents, size, modes, etc., +of files. You may still sometimes want to revert them manually. + +Use this option with care since it could lead to excessive auto-reverts. +For more information, see Info node `(emacs-xtra)Autorevert'." :group 'auto-revert - :type 'boolean) + :type 'boolean + :link '(info-link "(emacs-xtra)Autorevert")) (defcustom global-auto-revert-ignore-modes '() "List of major modes Global Auto-Revert Mode should not check." @@ -311,6 +316,7 @@ This is an internal function used by Auto-Revert Mode." (unless (buffer-modified-p) (let ((buffer (current-buffer)) revert eob eoblist) (or (and buffer-file-name + (not (file-remote-p buffer-file-name)) (file-readable-p buffer-file-name) (not (verify-visited-file-modtime buffer)) (setq revert t)) diff --git a/lisp/battery.el b/lisp/battery.el index c82d3ac02b3..73d78067571 100644 --- a/lisp/battery.el +++ b/lisp/battery.el @@ -61,7 +61,7 @@ introduced by a `%' character in a control string." (cond ((eq battery-status-function 'battery-linux-proc-apm) "Power %L, battery %B (%p%% load, remaining time %t)") ((eq battery-status-function 'battery-linux-proc-acpi) - "Power %L, battery %B at %r mA (%p%% load, remaining time %t)")) + "Power %L, battery %B at %r (%p%% load, remaining time %t)")) "*Control string formatting the string to display in the echo area. Ordinary characters in the control string are printed as-is, while conversion specifications introduced by a `%' character in the control @@ -243,7 +243,8 @@ The following %-sequences are provided: %m Remaining time in minutes %h Remaining time in hours %t Remaining time in the form `h:min'" - (let (capacity design-capacity rate charging-state warn low minutes hours) + (let (capacity design-capacity rate rate-type charging-state warn low + minutes hours) (when (file-directory-p "/proc/acpi/battery/") ;; ACPI provides information about each battery present in the system in ;; a separate subdirectory. We are going to merge the available @@ -261,32 +262,41 @@ The following %-sequences are provided: ;; battery is "charging"/"discharging", the others are ;; "unknown". (setq charging-state (match-string 1))) - (when (re-search-forward "present rate: +\\([0-9]+\\) mA$" nil t) - (setq rate (+ (or rate 0) (string-to-int (match-string 1))))) - (when (re-search-forward "remaining capacity: +\\([0-9]+\\) mAh$" + (when (re-search-forward "present rate: +\\([0-9]+\\) \\(m[AW]\\)$" + nil t) + (setq rate (+ (or rate 0) (string-to-int (match-string 1))) + rate-type (or (and rate-type + (if (string= rate-type (match-string 2)) + rate-type + (error + "Inconsistent rate types (%s vs. %s)" + rate-type (match-string 2)))) + (match-string 2)))) + (when (re-search-forward "remaining capacity: +\\([0-9]+\\) m[AW]h$" nil t) (setq capacity (+ (or capacity 0) (string-to-int (match-string 1)))))) (goto-char (point-max)) (insert-file-contents (expand-file-name "info" dir)) (when (re-search-forward "present: +yes$" nil t) - (when (re-search-forward "design capacity: +\\([0-9]+\\) mAh$" + (when (re-search-forward "design capacity: +\\([0-9]+\\) m[AW]h$" nil t) (setq design-capacity (+ (or design-capacity 0) (string-to-int (match-string 1))))) - (when (re-search-forward "design capacity warning: +\\([0-9]+\\) mAh$" + (when (re-search-forward "design capacity warning: +\\([0-9]+\\) m[AW]h$" nil t) (setq warn (+ (or warn 0) (string-to-int (match-string 1))))) - (when (re-search-forward "design capacity low: +\\([0-9]+\\) mAh$" + (when (re-search-forward "design capacity low: +\\([0-9]+\\) m[AW]h$" nil t) (setq low (+ (or low 0) (string-to-int (match-string 1)))))))) (directory-files "/proc/acpi/battery/" t "BAT"))) (and capacity rate - (setq minutes (floor (* (/ (float (if (string= charging-state - "charging") - (- design-capacity capacity) - capacity)) rate) 60)) + (setq minutes (if (zerop rate) 0 + (floor (* (/ (float (if (string= charging-state + "charging") + (- design-capacity capacity) + capacity)) rate) 60))) hours (/ minutes 60))) (list (cons ?c (or (and capacity (number-to-string capacity)) "N/A")) (cons ?L (or (when (file-exists-p "/proc/acpi/ac_adapter/AC/state") @@ -304,8 +314,17 @@ The following %-sequences are provided: (when (re-search-forward "temperature: +\\([0-9]+\\) C$" nil t) (match-string 1)))) + (when (file-exists-p + "/proc/acpi/thermal_zone/THM/temperature") + (with-temp-buffer + (insert-file-contents + "/proc/acpi/thermal_zone/THM/temperature") + (when (re-search-forward + "temperature: +\\([0-9]+\\) C$" nil t) + (match-string 1)))) "N/A")) - (cons ?r (or (and rate (number-to-string rate)) "N/A")) + (cons ?r (or (and rate (concat (number-to-string rate) " " + rate-type)) "N/A")) (cons ?B (or charging-state "N/A")) (cons ?b (or (and (string= charging-state "charging") "+") (and low (< capacity low) "!") diff --git a/lisp/bindings.el b/lisp/bindings.el index a20b45bfe81..caf857c63e7 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -460,7 +460,7 @@ Menu of mode operations in the mode line.") FMT is a format specifier such as \"%12b\". This function adds text properties for face, help-echo, and local-map to it." (list (propertize fmt - 'face '(:weight bold) + 'face 'Buffer-menu-buffer-face 'help-echo (purecopy "mouse-1: previous buffer, mouse-3: next buffer") 'local-map mode-line-buffer-identification-keymap))) @@ -524,7 +524,9 @@ is okay. See `mode-line-format'.") ;; files you do want to see, not just TeX stuff. -- fx ".toc" ".aux" ".cp" ".fn" ".ky" ".pg" ".tp" ".vr" - ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs"))) + ".cps" ".fns" ".kys" ".pgs" ".tps" ".vrs" + ;; Python byte-compiled + ".pyc" ".pyo"))) ;; Suffixes used for executables. (setq exec-suffixes @@ -542,63 +544,20 @@ is okay. See `mode-line-format'.") file-supersession "^Previous command was not a yank$" "^Minibuffer window is not active$" + "^No previous history search regexp$" + "^No later matching history item$" + "^No earlier matching history item$" + "^End of history; no default available$" "^End of history; no next item$" "^Beginning of history; no preceding item$" "^No recursive edit is in progress$" "^Changes to be undone are outside visible portion of buffer$" "^No undo information in this buffer$" - "^No further undo information$" + "^No further undo information" "^Save not confirmed$" "^Recover-file cancelled\\.$" "^Cannot switch buffers in a dedicated window$" - - ;; ediff - "^Errors in diff output. Diff output is in " - "^Hmm... I don't see an Ediff command around here...$" - "^Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer$" - ": This command runs in Ediff Control Buffer only!$" - ": Invalid op in ediff-check-version$" - "^ediff-shrink-window-C can be used only for merging jobs$" - "^Lost difference info on these directories$" - "^This command is inapplicable in the present context$" - "^This session group has no parent$" - "^Can't hide active session, $" - "^Ediff: something wrong--no multiple diffs buffer$" - "^Can't make context diff for Session $" - "^The patch buffer wasn't found$" - "^Aborted$" - "^This Ediff session is not part of a session group$" - "^No active Ediff sessions or corrupted session registry$" - "^No session info in this line$" - "^`.*' is not an ordinary file$" - "^Patch appears to have failed$" - "^Recomputation of differences cancelled$" - "^No fine differences in this mode$" - "^Lost connection to ancestor buffer...sorry$" - "^Not merging with ancestor$" - "^Don't know how to toggle read-only in buffer " - "Emacs is not running as a window application$" - "^This command makes sense only when merging with an ancestor$" - "^At end of the difference list$" - "^At beginning of the difference list$" - "^Nothing saved for diff .* in buffer " - "^Buffer is out of sync for file " - "^Buffer out of sync for file " - "^Output from `diff' not found$" - "^You forgot to specify a region in buffer " - "^All right. Make up your mind and come back...$" - "^Current buffer is not visiting any file$" - "^Failed to retrieve revision: $" - "^Can't determine display width.$" - "^File `.*' does not exist or is not readable$" - "^File `.*' is a directory$" - "^Buffer .* doesn't exist$" - "^Directories . and . are the same: " - "^Directory merge aborted$" - "^Merge of directory revisions aborted$" - "^Buffer .* doesn't exist$" - "^There is no file to merge$" - "^Version control package .*.el not found. Use vc.el instead$")) + )) (make-variable-buffer-local 'indent-tabs-mode) @@ -939,6 +898,13 @@ language you are using." ;; This is "move to the clipboard", or as close as we come. (global-set-key [S-delete] 'kill-region) +(global-set-key [C-M-left] 'backward-sexp) +(global-set-key [C-M-right] 'forward-sexp) +(global-set-key [C-M-up] 'backward-up-list) +(global-set-key [C-M-down] 'down-list) +(global-set-key [C-M-home] 'beginning-of-defun) +(global-set-key [C-M-end] 'end-of-defun) + (define-key esc-map "\C-f" 'forward-sexp) (define-key esc-map "\C-b" 'backward-sexp) (define-key esc-map "\C-u" 'backward-up-list) diff --git a/lisp/bookmark.el b/lisp/bookmark.el index 67ae2c84865..b25c261c1e7 100644 --- a/lisp/bookmark.el +++ b/lisp/bookmark.el @@ -376,7 +376,11 @@ That is, all information but the name." (if cell (setcdr cell filename) (nconc (bookmark-get-bookmark-record bookmark) - (list (cons 'filename filename)))))) + (list (cons 'filename filename)))) + (setq bookmark-alist-modification-count + (1+ bookmark-alist-modification-count)) + (if (bookmark-time-to-save-p) + (bookmark-save)))) (defun bookmark-get-position (bookmark) @@ -893,7 +897,8 @@ When you have finished composing, type \\[bookmark-send-annotation]. (make-local-variable 'bookmark-annotation-name) (setq bookmark-annotation-name bookmark) (use-local-map bookmark-edit-annotation-mode-map) - (setq major-mode 'bookmark-edit-annotation-mode) + (setq major-mode 'bookmark-edit-annotation-mode + mode-name "Edit Bookmark Annotation") (insert (funcall bookmark-read-annotation-text-func bookmark)) (let ((annotation (bookmark-get-annotation bookmark))) (if (and annotation (not (string-equal annotation ""))) @@ -902,7 +907,8 @@ When you have finished composing, type \\[bookmark-send-annotation]. (defun bookmark-send-edited-annotation () - "Use buffer contents (minus beginning with `#' as annotation for a bookmark." + "Use buffer contents as annotation for a bookmark. +Lines beginning with `#' are ignored." (interactive) (if (not (eq major-mode 'bookmark-edit-annotation-mode)) (error "Not in bookmark-edit-annotation-mode")) @@ -1489,6 +1495,7 @@ method buffers use to resolve name collisions." (define-key bookmark-bmenu-mode-map "m" 'bookmark-bmenu-mark) (define-key bookmark-bmenu-mode-map "l" 'bookmark-bmenu-load) (define-key bookmark-bmenu-mode-map "r" 'bookmark-bmenu-rename) + (define-key bookmark-bmenu-mode-map "R" 'bookmark-bmenu-relocate) (define-key bookmark-bmenu-mode-map "t" 'bookmark-bmenu-toggle-filenames) (define-key bookmark-bmenu-mode-map "a" 'bookmark-bmenu-show-annotation) (define-key bookmark-bmenu-mode-map "A" 'bookmark-bmenu-show-all-annotations) @@ -1587,6 +1594,7 @@ Bookmark names preceded by a \"*\" have annotations. so the bookmark menu bookmark remains visible in its window. \\[bookmark-bmenu-switch-other-window] -- switch the other window to this bookmark. \\[bookmark-bmenu-rename] -- rename this bookmark \(prompts for new name\). +\\[bookmark-bmenu-relocate] -- relocate this bookmark's file \(prompts for new file\). \\[bookmark-bmenu-delete] -- mark this bookmark to be deleted, and move down. \\[bookmark-bmenu-delete-backwards] -- mark this bookmark to be deleted, and move up. \\[bookmark-bmenu-execute-deletions] -- delete bookmarks marked with `\\[bookmark-bmenu-delete]'. @@ -2039,6 +2047,15 @@ To carry out the deletions that you've marked, use \\<bookmark-bmenu-mode-map>\\ (let ((bmrk (bookmark-bmenu-bookmark))) (message (bookmark-location bmrk))))) +(defun bookmark-bmenu-relocate () + "Change the file path of the bookmark on the current line, + prompting with completion for the new path." + (interactive) + (if (bookmark-bmenu-check-position) + (let ((bmrk (bookmark-bmenu-bookmark)) + (thispoint (point))) + (bookmark-relocate bmrk) + (goto-char thispoint)))) ;;; Menu bar stuff. Prefix is "bookmark-menu". diff --git a/lisp/calendar/appt.el b/lisp/calendar/appt.el index 002aec878ca..0c911ca8b7d 100644 --- a/lisp/calendar/appt.el +++ b/lisp/calendar/appt.el @@ -449,11 +449,10 @@ NEW-TIME is a string giving the date." (same-window-p (buffer-name appt-disp-buf))) ;; By default, split the bottom window and use the lower part. (appt-select-lowest-window) - (split-window)) - (pop-to-buffer appt-disp-buf)) - (setq mode-line-format - (concat "-------------------- Appointment in " - min-to-app " minutes. " new-time " %-")) + (select-window (split-window))) + (switch-to-buffer appt-disp-buf)) + (calendar-set-mode-line + (format " Appointment in %s minutes. %s " min-to-app new-time)) (erase-buffer) (insert appt-msg) (shrink-window-if-larger-than-buffer (get-buffer-window appt-disp-buf t)) diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el new file mode 100644 index 00000000000..4dfd8eb16e5 --- /dev/null +++ b/lisp/calendar/cal-bahai.el @@ -0,0 +1,507 @@ +;;; cal-bahai.el --- calendar functions for the Baha'i calendar. + +;; Copyright (C) 2001 Free Software Foundation, Inc. + +;; Author: John Wiegley <johnw@gnu.org> +;; Keywords: calendar +;; Human-Keywords: Baha'i calendar, Baha'i, Bahai, calendar, diary + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This collection of functions implements the features of calendar.el +;; and diary.el that deal with the Baha'i calendar. + +;; The Baha'i (http://www.bahai.org) calendar system is based on a +;; solar cycle of 19 months with 19 days each. The four remaining +;; "intercalary" days are called the Ayyam-i-Ha (days of Ha), and are +;; placed between the 18th and 19th months. They are meant as a time +;; of festivals preceding the 19th month, which is the month of +;; fasting. In Gregorian leap years, there are 5 of these days (Ha +;; has the numerical value of 5 in the arabic abjad, or +;; letter-to-number, reckoning). + +;; Each month is named after an attribute of God, as are the 19 days +;; -- which have the same names as the months. There is also a name +;; for each year in every 19 year cycle. These cycles are called +;; Vahids. A cycle of 19 Vahids (361 years) is called a Kullu-Shay, +;; which means "all things". + +;; The calendar was named the "Badi calendar" by its author, the Bab. +;; It uses a week of seven days, corresponding to the Gregorian week, +;; each of which has its own name, again patterned after the +;; attributes of God. + +;; Note: The days of Ayyam-i-Ha are encoded as zero and negative +;; offsets from the first day of the final month. So, (19 -3 157) is +;; the first day of Ayyam-i-Ha, in the year 157 BE. + +;;; Code: + +(require 'cal-julian) + +(defvar bahai-calendar-month-name-array + ["Baha" "Jalal" "Jamal" "`Azamat" "Nur" "Rahmat" "Kalimat" "Kamal" + "Asma" "`Izzat" "Mashiyyat" "`Ilm" "Qudrat" "Qawl" "Masa'il" + "Sharaf" "Sultan" "Mulk" "`Ala"]) + +(defvar calendar-bahai-epoch (calendar-absolute-from-gregorian '(3 21 1844)) + "Absolute date of start of Baha'i calendar = March 19, 622 A.D. (Julian).") + +(defun bahai-calendar-leap-year-p (year) + "True if YEAR is a leap year on the Baha'i calendar." + (calendar-leap-year-p (+ year 1844))) + +(defvar bahai-calendar-leap-base + (+ (/ 1844 4) (- (/ 1844 100)) (/ 1844 400))) + +(defun calendar-absolute-from-bahai (date) + "Compute absolute date from Baha'i date DATE. +The absolute date is the number of days elapsed since the (imaginary) +Gregorian date Sunday, December 31, 1 BC." + (let* ((month (extract-calendar-month date)) + (day (extract-calendar-day date)) + (year (extract-calendar-year date)) + (prior-years (+ (1- year) 1844)) + (leap-days (- (+ (/ prior-years 4) ; Leap days in prior years. + (- (/ prior-years 100)) + (/ prior-years 400)) + bahai-calendar-leap-base))) + (+ (1- calendar-bahai-epoch) ; Days before epoch + (* 365 (1- year)) ; Days in prior years. + leap-days + (calendar-sum m 1 (< m month) 19) + (if (= month 19) 4 0) + day))) ; Days so far this month. + +(defun calendar-bahai-from-absolute (date) + "Baha'i year corresponding to the absolute DATE." + (if (< date calendar-bahai-epoch) + (list 0 0 0) ;; pre-Baha'i date + (let* ((greg (calendar-gregorian-from-absolute date)) + (year (+ (- (extract-calendar-year greg) 1844) + (if (or (> (extract-calendar-month greg) 3) + (and (= (extract-calendar-month greg) 3) + (>= (extract-calendar-day greg) 21))) + 1 0))) + (month ;; Search forward from Baha. + (1+ (calendar-sum m 1 + (> date + (calendar-absolute-from-bahai + (list m 19 year))) + 1))) + (day ;; Calculate the day by subtraction. + (- date + (1- (calendar-absolute-from-bahai (list month 1 year)))))) + (list month day year)))) + +(defun calendar-bahai-date-string (&optional date) + "String of Baha'i date of Gregorian DATE. +Defaults to today's date if DATE is not given." + (let* ((bahai-date (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (or date (calendar-current-date))))) + (y (extract-calendar-year bahai-date)) + (m (extract-calendar-month bahai-date)) + (d (extract-calendar-day bahai-date))) + (let ((monthname + (if (and (= m 19) + (<= d 0)) + "Ayyam-i-Ha" + (aref bahai-calendar-month-name-array (1- m)))) + (day (int-to-string + (if (<= d 0) + (if (bahai-calendar-leap-year-p y) + (+ d 5) + (+ d 4)) + d))) + (dayname nil) + (month (int-to-string m)) + (year (int-to-string y))) + (mapconcat 'eval calendar-date-display-form "")))) + +(defun calendar-print-bahai-date () + "Show the Baha'i calendar equivalent of the selected date." + (interactive) + (message "Baha'i date: %s" + (calendar-bahai-date-string (calendar-cursor-to-date t)))) + +(defun calendar-goto-bahai-date (date &optional noecho) + "Move cursor to Baha'i date DATE. +Echo Baha'i date unless NOECHO is t." + (interactive (bahai-prompt-for-date)) + (calendar-goto-date (calendar-gregorian-from-absolute + (calendar-absolute-from-bahai date))) + (or noecho (calendar-print-bahai-date))) + +(defun bahai-prompt-for-date () + "Ask for a Baha'i date." + (let* ((today (calendar-current-date)) + (year (calendar-read + "Baha'i calendar year (not 0): " + '(lambda (x) (/= x 0)) + (int-to-string + (extract-calendar-year + (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian today)))))) + (completion-ignore-case t) + (month (cdr (assoc + (completing-read + "Baha'i calendar month name: " + (mapcar 'list + (append bahai-calendar-month-name-array nil)) + nil t) + (calendar-make-alist bahai-calendar-month-name-array + 1)))) + (day (calendar-read "Baha'i calendar day (1-19): " + '(lambda (x) (and (< 0 x) (<= x 19)))))) + (list (list month day year)))) + +(defun diary-bahai-date () + "Baha'i calendar equivalent of date diary entry." + (format "Baha'i date: %s" (calendar-bahai-date-string date))) + +(defun holiday-bahai (month day string) + "Holiday on MONTH, DAY (Baha'i) called STRING. +If MONTH, DAY (Baha'i) is visible, the value returned is corresponding +Gregorian date in the form of the list (((month day year) STRING)). Returns +nil if it is not visible in the current calendar window." + (let* ((bahai-date (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (list displayed-month 15 displayed-year)))) + (m (extract-calendar-month bahai-date)) + (y (extract-calendar-year bahai-date)) + (date)) + (if (< m 1) + nil ;; Baha'i calendar doesn't apply. + (increment-calendar-month m y (- 10 month)) + (if (> m 7) ;; Baha'i date might be visible + (let ((date (calendar-gregorian-from-absolute + (calendar-absolute-from-bahai (list month day y))))) + (if (calendar-date-is-visible-p date) + (list (list date string)))))))) + +(defun list-bahai-diary-entries () + "Add any Baha'i date entries from the diary file to `diary-entries-list'. +Baha'i date diary entries must be prefaced by an +`bahai-diary-entry-symbol' (normally a `B'). The same diary date +forms govern the style of the Baha'i calendar entries, except that the +Baha'i month names must be given numerically. The Baha'i months are +numbered from 1 to 19 with Baha being 1 and 19 being `Ala. If a +Baha'i date diary entry begins with a `diary-nonmarking-symbol', the +entry will appear in the diary listing, but will not be marked in the +calendar. This function is provided for use with the +`nongregorian-diary-listing-hook'." + (if (< 0 number) + (let ((buffer-read-only nil) + (diary-modified (buffer-modified-p)) + (gdate original-date) + (mark (regexp-quote diary-nonmarking-symbol))) + (calendar-for-loop i from 1 to number do + (let* ((d diary-date-forms) + (bdate (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian gdate))) + (month (extract-calendar-month bdate)) + (day (extract-calendar-day bdate)) + (year (extract-calendar-year bdate))) + (while d + (let* + ((date-form (if (equal (car (car d)) 'backup) + (cdr (car d)) + (car d))) + (backup (equal (car (car d)) 'backup)) + (dayname + (concat + (calendar-day-name gdate) "\\|" + (substring (calendar-day-name gdate) 0 3) ".?")) + (calendar-month-name-array + bahai-calendar-month-name-array) + (monthname + (concat + "\\*\\|" + (calendar-month-name month))) + (month (concat "\\*\\|0*" (int-to-string month))) + (day (concat "\\*\\|0*" (int-to-string day))) + (year + (concat + "\\*\\|0*" (int-to-string year) + (if abbreviated-calendar-year + (concat "\\|" (int-to-string (% year 100))) + ""))) + (regexp + (concat + "\\(\\`\\|\^M\\|\n\\)" mark "?" + (regexp-quote bahai-diary-entry-symbol) + "\\(" + (mapconcat 'eval date-form "\\)\\(") + "\\)")) + (case-fold-search t)) + (goto-char (point-min)) + (while (re-search-forward regexp nil t) + (if backup (re-search-backward "\\<" nil t)) + (if (and (or (char-equal (preceding-char) ?\^M) + (char-equal (preceding-char) ?\n)) + (not (looking-at " \\|\^I"))) + ;; Diary entry that consists only of date. + (backward-char 1) + ;; Found a nonempty diary entry--make it visible and + ;; add it to the list. + (let ((entry-start (point)) + (date-start)) + (re-search-backward "\^M\\|\n\\|\\`") + (setq date-start (point)) + (re-search-forward "\^M\\|\n" nil t 2) + (while (looking-at " \\|\^I") + (re-search-forward "\^M\\|\n" nil t)) + (backward-char 1) + (subst-char-in-region date-start (point) ?\^M ?\n t) + (add-to-diary-list + gdate + (buffer-substring-no-properties entry-start (point)) + (buffer-substring-no-properties + (1+ date-start) (1- entry-start))))))) + (setq d (cdr d)))) + (setq gdate + (calendar-gregorian-from-absolute + (1+ (calendar-absolute-from-gregorian gdate))))) + (set-buffer-modified-p diary-modified)) + (goto-char (point-min)))) + +(defun mark-bahai-diary-entries () + "Mark days in the calendar window that have Baha'i date diary entries. +Each entry in diary-file (or included files) visible in the calendar +window is marked. Baha'i date entries are prefaced by a +bahai-diary-entry-symbol \(normally a B`I'). The same +diary-date-forms govern the style of the Baha'i calendar entries, +except that the Baha'i month names must be spelled in full. The +Baha'i months are numbered from 1 to 12 with Baha being 1 and 12 being +`Ala. Baha'i date diary entries that begin with a +diary-nonmarking-symbol will not be marked in the calendar. This +function is provided for use as part of the +nongregorian-diary-marking-hook." + (let ((d diary-date-forms)) + (while d + (let* + ((date-form (if (equal (car (car d)) 'backup) + (cdr (car d)) + (car d)));; ignore 'backup directive + (dayname (diary-name-pattern calendar-day-name-array)) + (monthname + (concat + (diary-name-pattern bahai-calendar-month-name-array t) + "\\|\\*")) + (month "[0-9]+\\|\\*") + (day "[0-9]+\\|\\*") + (year "[0-9]+\\|\\*") + (l (length date-form)) + (d-name-pos (- l (length (memq 'dayname date-form)))) + (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos))) + (m-name-pos (- l (length (memq 'monthname date-form)))) + (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos))) + (d-pos (- l (length (memq 'day date-form)))) + (d-pos (if (/= l d-pos) (+ 2 d-pos))) + (m-pos (- l (length (memq 'month date-form)))) + (m-pos (if (/= l m-pos) (+ 2 m-pos))) + (y-pos (- l (length (memq 'year date-form)))) + (y-pos (if (/= l y-pos) (+ 2 y-pos))) + (regexp + (concat + "\\(\\`\\|\^M\\|\n\\)" + (regexp-quote bahai-diary-entry-symbol) + "\\(" + (mapconcat 'eval date-form "\\)\\(") + "\\)")) + (case-fold-search t)) + (goto-char (point-min)) + (while (re-search-forward regexp nil t) + (let* ((dd-name + (if d-name-pos + (buffer-substring + (match-beginning d-name-pos) + (match-end d-name-pos)))) + (mm-name + (if m-name-pos + (buffer-substring + (match-beginning m-name-pos) + (match-end m-name-pos)))) + (mm (string-to-int + (if m-pos + (buffer-substring + (match-beginning m-pos) + (match-end m-pos)) + ""))) + (dd (string-to-int + (if d-pos + (buffer-substring + (match-beginning d-pos) + (match-end d-pos)) + ""))) + (y-str (if y-pos + (buffer-substring + (match-beginning y-pos) + (match-end y-pos)))) + (yy (if (not y-str) + 0 + (if (and (= (length y-str) 2) + abbreviated-calendar-year) + (let* ((current-y + (extract-calendar-year + (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (calendar-current-date))))) + (y (+ (string-to-int y-str) + (* 100 (/ current-y 100))))) + (if (> (- y current-y) 50) + (- y 100) + (if (> (- current-y y) 50) + (+ y 100) + y))) + (string-to-int y-str))))) + (if dd-name + (mark-calendar-days-named + (cdr (assoc-ignore-case (substring dd-name 0 3) + (calendar-make-alist + calendar-day-name-array + 0 + '(lambda (x) (substring x 0 3)))))) + (if mm-name + (if (string-equal mm-name "*") + (setq mm 0) + (setq mm + (cdr (assoc-ignore-case + mm-name + (calendar-make-alist + bahai-calendar-month-name-array)))))) + (mark-bahai-calendar-date-pattern mm dd yy))))) + (setq d (cdr d))))) + +(defun mark-bahai-calendar-date-pattern (month day year) + "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR. +A value of 0 in any position is a wildcard." + (save-excursion + (set-buffer calendar-buffer) + (if (and (/= 0 month) (/= 0 day)) + (if (/= 0 year) + ;; Fully specified Baha'i date. + (let ((date (calendar-gregorian-from-absolute + (calendar-absolute-from-bahai + (list month day year))))) + (if (calendar-date-is-visible-p date) + (mark-visible-calendar-date date))) + ;; Month and day in any year--this taken from the holiday stuff. + (let* ((bahai-date (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (list displayed-month 15 displayed-year)))) + (m (extract-calendar-month bahai-date)) + (y (extract-calendar-year bahai-date)) + (date)) + (if (< m 1) + nil;; Baha'i calendar doesn't apply. + (increment-calendar-month m y (- 10 month)) + (if (> m 7);; Baha'i date might be visible + (let ((date (calendar-gregorian-from-absolute + (calendar-absolute-from-bahai + (list month day y))))) + (if (calendar-date-is-visible-p date) + (mark-visible-calendar-date date))))))) + ;; Not one of the simple cases--check all visible dates for match. + ;; Actually, the following code takes care of ALL of the cases, but + ;; it's much too slow to be used for the simple (common) cases. + (let ((m displayed-month) + (y displayed-year) + (first-date) + (last-date)) + (increment-calendar-month m y -1) + (setq first-date + (calendar-absolute-from-gregorian + (list m 1 y))) + (increment-calendar-month m y 2) + (setq last-date + (calendar-absolute-from-gregorian + (list m (calendar-last-day-of-month m y) y))) + (calendar-for-loop date from first-date to last-date do + (let* ((b-date (calendar-bahai-from-absolute date)) + (i-month (extract-calendar-month b-date)) + (i-day (extract-calendar-day b-date)) + (i-year (extract-calendar-year b-date))) + (and (or (zerop month) + (= month i-month)) + (or (zerop day) + (= day i-day)) + (or (zerop year) + (= year i-year)) + (mark-visible-calendar-date + (calendar-gregorian-from-absolute date))))))))) + +(defun insert-bahai-diary-entry (arg) + "Insert a diary entry. +For the Baha'i date corresponding to the date indicated by point. +Prefix arg will make the entry nonmarking." + (interactive "P") + (let* ((calendar-month-name-array bahai-calendar-month-name-array)) + (make-diary-entry + (concat + bahai-diary-entry-symbol + (calendar-date-string + (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t))) + nil t)) + arg))) + +(defun insert-monthly-bahai-diary-entry (arg) + "Insert a monthly diary entry. +For the day of the Baha'i month corresponding to the date indicated by point. +Prefix arg will make the entry nonmarking." + (interactive "P") + (let* ((calendar-date-display-form + (if european-calendar-style '(day " * ") '("* " day ))) + (calendar-month-name-array bahai-calendar-month-name-array)) + (make-diary-entry + (concat + bahai-diary-entry-symbol + (calendar-date-string + (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t))))) + arg))) + +(defun insert-yearly-bahai-diary-entry (arg) + "Insert an annual diary entry. +For the day of the Baha'i year corresponding to the date indicated by point. +Prefix arg will make the entry nonmarking." + (interactive "P") + (let* ((calendar-date-display-form + (if european-calendar-style + '(day " " monthname) + '(monthname " " day))) + (calendar-month-name-array bahai-calendar-month-name-array)) + (make-diary-entry + (concat + bahai-diary-entry-symbol + (calendar-date-string + (calendar-bahai-from-absolute + (calendar-absolute-from-gregorian + (calendar-cursor-to-date t))))) + arg))) + +(provide 'cal-bahai) + +;;; arch-tag: c1cb1d67-862a-4264-a01c-41cb4df01f14 +;;; cal-bahai.el ends here diff --git a/lisp/calendar/cal-menu.el b/lisp/calendar/cal-menu.el index 3c6cc78eb7b..a652e7ca768 100644 --- a/lisp/calendar/cal-menu.el +++ b/lisp/calendar/cal-menu.el @@ -66,6 +66,8 @@ '("Insert Hebrew" . calendar-mouse-insert-hebrew-diary-entry)) (define-key calendar-mode-map [menu-bar diary isl] '("Insert Islamic" . calendar-mouse-insert-islamic-diary-entry)) +(define-key calendar-mode-map [menu-bar diary baha] + '("Insert Baha'i" . calendar-mouse-insert-bahai-diary-entry)) (define-key calendar-mode-map [menu-bar diary cyc] '("Insert Cyclic" . insert-cyclic-diary-entry)) (define-key calendar-mode-map [menu-bar diary blk] @@ -110,6 +112,8 @@ (define-key calendar-mode-map [menu-bar goto islamic] '("Islamic Date" . calendar-goto-islamic-date)) (define-key calendar-mode-map [menu-bar goto persian] + '("Baha'i Date" . calendar-goto-bahai-date)) +(define-key calendar-mode-map [menu-bar goto persian] '("Persian Date" . calendar-goto-persian-date)) (define-key calendar-mode-map [menu-bar goto hebrew] '("Hebrew Date" . calendar-goto-hebrew-date)) @@ -288,6 +292,19 @@ ERROR is t, otherwise just returns nil." '("Yearly" . insert-yearly-islamic-diary-entry)))))) (and islamic-selection (call-interactively islamic-selection)))) +(defun calendar-mouse-insert-bahai-diary-entry (event) + "Pop up menu to insert an Baha'i-date diary entry." + (interactive "e") + (let ((bahai-selection + (x-popup-menu + event + (list "Baha'i insert menu" + (list (calendar-bahai-date-string (calendar-cursor-to-date)) + '("One time" . insert-bahai-diary-entry) + '("Monthly" . insert-monthly-bahai-diary-entry) + '("Yearly" . insert-yearly-bahai-diary-entry)))))) + (and bahai-selection (call-interactively bahai-selection)))) + (defun calendar-mouse-sunrise/sunset () "Show sunrise/sunset times for mouse-selected date." (interactive) @@ -496,7 +513,9 @@ The output is in landscape format, one month to a page." (list (format "Hebrew date (before sunset): %s" (calendar-hebrew-date-string date))) (list (format "Persian date: %s" - (calendar-persian-date-string date)))) + (calendar-persian-date-string date))) + (list (format "Baha'i date (before sunset): %s" + (calendar-bahai-date-string date)))) (let ((i (calendar-islamic-date-string date))) (if (not (string-equal i "")) (list (list (format "Islamic date (before sunset): %s" i))))) diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 0d38563e637..43171255bbe 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -26,26 +26,29 @@ ;;; Commentary: -;; This collection of functions implements a calendar window. It generates a -;; calendar for the current month, together with the previous and coming -;; months, or for any other three-month period. The calendar can be scrolled -;; forward and backward in the window to show months in the past or future; -;; the cursor can move forward and backward by days, weeks, or months, making -;; it possible, for instance, to jump to the date a specified number of days, -;; weeks, or months from the date under the cursor. The user can display a -;; list of holidays and other notable days for the period shown; the notable -;; days can be marked on the calendar, if desired. The user can also specify -;; that dates having corresponding diary entries (in a file that the user -;; specifies) be marked; the diary entries for any date can be viewed in a -;; separate window. The diary and the notable days can be viewed -;; independently of the calendar. Dates can be translated from the (usual) -;; Gregorian calendar to the day of the year/days remaining in year, to the -;; ISO commercial calendar, to the Julian (old style) calendar, to the Hebrew -;; calendar, to the Islamic calendar, to the French Revolutionary calendar, to -;; the Mayan calendar, to the Chinese calendar, to the Coptic calendar, to the -;; Ethiopic calendar, and to the astronomical (Julian) day number. When -;; floating point is available, times of sunrise/sunset can be displayed, as -;; can the phases of the moon. Appointment notification for diary entries is +;; This collection of functions implements a calendar window. It +;; generates a calendar for the current month, together with the +;; previous and coming months, or for any other three-month period. +;; The calendar can be scrolled forward and backward in the window to +;; show months in the past or future; the cursor can move forward and +;; backward by days, weeks, or months, making it possible, for +;; instance, to jump to the date a specified number of days, weeks, or +;; months from the date under the cursor. The user can display a list +;; of holidays and other notable days for the period shown; the +;; notable days can be marked on the calendar, if desired. The user +;; can also specify that dates having corresponding diary entries (in +;; a file that the user specifies) be marked; the diary entries for +;; any date can be viewed in a separate window. The diary and the +;; notable days can be viewed independently of the calendar. Dates +;; can be translated from the (usual) Gregorian calendar to the day of +;; the year/days remaining in year, to the ISO commercial calendar, to +;; the Julian (old style) calendar, to the Hebrew calendar, to the +;; Islamic calendar, to the Baha'i calendar, to the French +;; Revolutionary calendar, to the Mayan calendar, to the Chinese +;; calendar, to the Coptic calendar, to the Ethiopic calendar, and to +;; the astronomical (Julian) day number. When floating point is +;; available, times of sunrise/sunset can be displayed, as can the +;; phases of the moon. Appointment notification for diary entries is ;; available. Calendar printing via LaTeX is available. ;; The following files are part of the calendar/diary code: @@ -56,6 +59,7 @@ ;; cal-dst.el Daylight savings time rules ;; cal-hebrew.el Hebrew calendar ;; cal-islam.el Islamic calendar +;; cal-bahai.el Baha'i calendar ;; cal-iso.el ISO calendar ;; cal-julian.el Julian/astronomical calendars ;; cal-mayan.el Mayan calendars @@ -317,6 +321,16 @@ calendar." :group 'diary) ;;;###autoload +(defcustom all-bahai-calendar-holidays nil + "*If nil, show only major holidays from the Baha'i calendar. +These are the days on which work and school must be suspended. + +If t, show all the holidays that would appear in a complete Baha'i +calendar." + :type 'boolean + :group 'holidays) + +;;;###autoload (defcustom calendar-load-hook nil "*List of functions to be called after the calendar is first loaded. This is the place to add key bindings to `calendar-mode-map'." @@ -463,21 +477,23 @@ Diary entries can be based on Lisp sexps. For example, the diary entry %%(diary-block 11 1 1990 11 10 1990) Vacation -causes the diary entry \"Vacation\" to appear from November 1 through November -10, 1990. Other functions available are `diary-float', `diary-anniversary', -`diary-cyclic', `diary-day-of-year', `diary-iso-date', `diary-french-date', -`diary-hebrew-date', `diary-islamic-date', `diary-mayan-date', +causes the diary entry \"Vacation\" to appear from November 1 through +November 10, 1990. Other functions available are `diary-float', +`diary-anniversary', `diary-cyclic', `diary-day-of-year', +`diary-iso-date', `diary-french-date', `diary-hebrew-date', +`diary-islamic-date', `diary-bahai-date', `diary-mayan-date', `diary-chinese-date', `diary-coptic-date', `diary-ethiopic-date', `diary-persian-date', `diary-yahrzeit', `diary-sunrise-sunset', -`diary-phases-of-moon', `diary-parasha', `diary-omer', `diary-rosh-hodesh', -and `diary-sabbath-candles'. See the documentation for the function -`list-sexp-diary-entries' for more details. +`diary-phases-of-moon', `diary-parasha', `diary-omer', +`diary-rosh-hodesh', and `diary-sabbath-candles'. See the +documentation for the function `list-sexp-diary-entries' for more +details. -Diary entries based on the Hebrew and/or the Islamic calendar are also -possible, but because these are somewhat slow, they are ignored -unless you set the `nongregorian-diary-listing-hook' and the -`nongregorian-diary-marking-hook' appropriately. See the documentation -for these functions for details. +Diary entries based on the Hebrew, the Islamic and/or the Baha'i +calendar are also possible, but because these are somewhat slow, they +are ignored unless you set the `nongregorian-diary-listing-hook' and +the `nongregorian-diary-marking-hook' appropriately. See the +documentation for these functions for details. Diary files can contain directives to include the contents of other files; for details, see the documentation for the variable `list-diary-entries-hook'." @@ -503,6 +519,12 @@ details, see the documentation for the variable `list-diary-entries-hook'." :group 'diary) ;;;###autoload +(defcustom bahai-diary-entry-symbol "B" + "*Symbol indicating a diary entry according to the Baha'i calendar." + :type 'string + :group 'diary) + +;;;###autoload (defcustom diary-include-string "#include" "*The string indicating inclusion of another file of diary entries. See the documentation for the function `include-other-diary-files'." @@ -554,8 +576,9 @@ See the documentation for the function `list-sexp-diary-entries'." ;;;###autoload (defcustom abbreviated-calendar-year t "*Interpret a two-digit year DD in a diary entry as either 19DD or 20DD. -For the Gregorian calendar; similarly for the Hebrew and Islamic calendars. -If this variable is nil, years must be written in full." +For the Gregorian calendar; similarly for the Hebrew, Islamic and +Baha'i calendars. If this variable is nil, years must be written in +full." :type 'boolean :group 'diary) @@ -796,12 +819,15 @@ diary buffer, set the variable `diary-list-include-blanks' to t." ;;;###autoload (defcustom nongregorian-diary-listing-hook nil "*List of functions called for listing diary file and included files. -As the files are processed for diary entries, these functions are used to cull -relevant entries. You can use either or both of `list-hebrew-diary-entries' -and `list-islamic-diary-entries'. The documentation for these functions +As the files are processed for diary entries, these functions are used +to cull relevant entries. You can use either or both of +`list-hebrew-diary-entries', `list-islamic-diary-entries' and +`list-bahai-diary-entries'. The documentation for these functions describes the style of such diary entries." :type 'hook - :options '(list-hebrew-diary-entries list-islamic-diary-entries) + :options '(list-hebrew-diary-entries + list-islamic-diary-entries + list-bahai-diary-entries) :group 'diary) ;;;###autoload @@ -825,12 +851,15 @@ function `include-other-diary-files' as part of `list-diary-entries-hook'." ;;;###autoload (defcustom nongregorian-diary-marking-hook nil "*List of functions called for marking diary file and included files. -As the files are processed for diary entries, these functions are used to cull -relevant entries. You can use either or both of `mark-hebrew-diary-entries' -and `mark-islamic-diary-entries'. The documentation for these functions +As the files are processed for diary entries, these functions are used +to cull relevant entries. You can use either or both of +`mark-hebrew-diary-entries', `mark-islamic-diary-entries' and +`mark-bahai-diary-entries'. The documentation for these functions describes the style of such diary entries." :type 'hook - :options '(mark-hebrew-diary-entries mark-islamic-diary-entries) + :options '(mark-hebrew-diary-entries + mark-islamic-diary-entries + mark-bahai-diary-entries) :group 'diary) ;;;###autoload @@ -1068,6 +1097,48 @@ See the documentation for `calendar-holidays' for details." :group 'holidays) ;;;###autoload +(put 'bahai-holidays 'risky-local-variable t) +;;;###autoload +(defcustom bahai-holidays + '((holiday-fixed + 3 21 + (format "Baha'i New Year (Naw-Ruz) %d" (- displayed-year (1- 1844)))) + (holiday-fixed 4 21 "First Day of Ridvan") + (if all-bahai-calendar-holidays + (holiday-fixed 4 22 "Second Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 4 23 "Third Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 4 24 "Fourth Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 4 25 "Fifth Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 4 26 "Sixth Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 4 27 "Seventh Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 4 28 "Eighth Day of Ridvan")) + (holiday-fixed 4 29 "Ninth Day of Ridvan") + (if all-bahai-calendar-holidays + (holiday-fixed 4 30 "Tenth Day of Ridvan")) + (if all-bahai-calendar-holidays + (holiday-fixed 5 1 "Eleventh Day of Ridvan")) + (holiday-fixed 5 2 "Twelfth Day of Ridvan") + (holiday-fixed 5 23 "Declaration of the Bab") + (holiday-fixed 5 29 "Ascension of Baha'u'llah") + (holiday-fixed 7 9 "Martyrdom of the Bab") + (holiday-fixed 10 20 "Birth of the Bab") + (holiday-fixed 11 12 "Birth of Baha'u'llah") + (if all-bahai-calendar-holidays + (holiday-fixed 11 26 "Day of the Covenant")) + (if all-bahai-calendar-holidays + (holiday-fixed 11 28 "Ascension of `Abdu'l-Baha"))) + "*Baha'i holidays. +See the documentation for `calendar-holidays' for details." + :type 'sexp + :group 'holidays) + +;;;###autoload (put 'solar-holidays 'risky-local-variable t) ;;;###autoload (defcustom solar-holidays @@ -1104,15 +1175,16 @@ See the documentation for `calendar-holidays' for details." (defcustom calendar-holidays (append general-holidays local-holidays other-holidays christian-holidays hebrew-holidays islamic-holidays - oriental-holidays solar-holidays) + bahai-holidays oriental-holidays solar-holidays) "*List of notable days for the command \\[holidays]. -Additional holidays are easy to add to the list, just put them in the list -`other-holidays' in your .emacs file. Similarly, by setting any of -`general-holidays', `local-holidays' `christian-holidays', `hebrew-holidays', -`islamic-holidays', `oriental-holidays', or `solar-holidays' to nil in your -.emacs file, you can eliminate unwanted categories of holidays. The intention -is that (in the US) `local-holidays' be set in site-init.el and +Additional holidays are easy to add to the list, just put them in the +list `other-holidays' in your .emacs file. Similarly, by setting any +of `general-holidays', `local-holidays' `christian-holidays', +`hebrew-holidays', `islamic-holidays', `bahai-holidays', +`oriental-holidays', or `solar-holidays' to nil in your .emacs file, +you can eliminate unwanted categories of holidays. The intention is +that (in the US) `local-holidays' be set in site-init.el and `other-holidays' be set by the user. Entries on the list are expressions that return (possibly empty) lists of @@ -1128,6 +1200,7 @@ Several basic functions are provided for this purpose: DAYNAME after/before MONTH DAY. (holiday-hebrew MONTH DAY STRING) a fixed date on the Hebrew calendar (holiday-islamic MONTH DAY STRING) a fixed date on the Islamic calendar + (holiday-bahai MONTH DAY STRING) a fixed date on the Baha'i calendar (holiday-julian MONTH DAY STRING) a fixed date on the Julian calendar (holiday-sexp SEXP STRING) SEXP is a Gregorian-date-valued expression in the variable `year'; if it evaluates to @@ -1155,6 +1228,11 @@ add the Islamic feast celebrating Mohammed's birthday use (holiday-islamic 3 12 \"Mohammed's Birthday\") since the Islamic months are numbered from 1 starting with Muharram. To +add an entry for the Baha'i festival of Ridvan, use + + (holiday-bahai 2 13 \"Festival of Ridvan\") + +since the Baha'i months are numbered from 1 starting with Baha. To add Thomas Jefferson's birthday, April 2, 1743 (Julian), use (holiday-julian 4 2 \"Jefferson's Birthday\") @@ -1680,6 +1758,14 @@ Driven by the variable `calendar-date-display-form'.") "String of Islamic date of Gregorian date." t) +(autoload 'calendar-print-bahai-date "cal-bahai" + "Show the Baha'i date equivalents of date." + t) + +(autoload 'calendar-bahai-date-string "cal-bahai" + "String of Baha'i date of Gregorian date." + t) + (autoload 'calendar-goto-hebrew-date "cal-hebrew" "Move cursor to Hebrew date date." t) @@ -1803,6 +1889,21 @@ to the date indicated by point." to the date indicated by point." t) +(autoload 'insert-bahai-diary-entry "cal-bahai" + "Insert a diary entry for the Baha'i date corresponding to the date +indicated by point." + t) + +(autoload 'insert-monthly-bahai-diary-entry "cal-bahai" + "Insert a monthly diary entry for the day of the Baha'i month corresponding +to the date indicated by point." + t) + +(autoload 'insert-yearly-bahai-diary-entry "cal-bahai" + "Insert an annual diary entry for the day of the Baha'i year corresponding +to the date indicated by point." + t) + (autoload 'list-calendar-holidays "holidays" "Create a buffer containing the holidays for the current calendar window. The holidays are those in the list `calendar-notable-days'. Returns t if any @@ -2066,6 +2167,7 @@ the inserted text. Value is always t." (define-key calendar-mode-map "ga" 'calendar-goto-astro-day-number) (define-key calendar-mode-map "gh" 'calendar-goto-hebrew-date) (define-key calendar-mode-map "gi" 'calendar-goto-islamic-date) + (define-key calendar-mode-map "gb" 'calendar-goto-bahai-date) (define-key calendar-mode-map "gC" 'calendar-goto-chinese-date) (define-key calendar-mode-map "gk" 'calendar-goto-coptic-date) (define-key calendar-mode-map "ge" 'calendar-goto-ethiopic-date) @@ -2106,6 +2208,7 @@ the inserted text. Value is always t." (define-key calendar-mode-map "pa" 'calendar-print-astro-day-number) (define-key calendar-mode-map "ph" 'calendar-print-hebrew-date) (define-key calendar-mode-map "pi" 'calendar-print-islamic-date) + (define-key calendar-mode-map "pb" 'calendar-print-bahai-date) (define-key calendar-mode-map "pf" 'calendar-print-french-date) (define-key calendar-mode-map "pm" 'calendar-print-mayan-date) (define-key calendar-mode-map "po" 'calendar-print-other-dates) @@ -2122,6 +2225,9 @@ the inserted text. Value is always t." (define-key calendar-mode-map "iid" 'insert-islamic-diary-entry) (define-key calendar-mode-map "iim" 'insert-monthly-islamic-diary-entry) (define-key calendar-mode-map "iiy" 'insert-yearly-islamic-diary-entry) + (define-key calendar-mode-map "iBd" 'insert-bahai-diary-entry) + (define-key calendar-mode-map "iBm" 'insert-monthly-bahai-diary-entry) + (define-key calendar-mode-map "iBy" 'insert-yearly-bahai-diary-entry) (define-key calendar-mode-map "?" 'calendar-goto-info-node) (define-key calendar-mode-map "tm" 'cal-tex-cursor-month) (define-key calendar-mode-map "tM" 'cal-tex-cursor-month-landscape) @@ -2907,6 +3013,9 @@ Defaults to today's date if DATE is not given." (let ((i (calendar-islamic-date-string date))) (if (not (string-equal i "")) (format "Islamic date (before sunset): %s" i))) + (let ((b (calendar-bahai-date-string date))) + (if (not (string-equal b "")) + (format "Baha'i date (before sunset): %s" b))) (format "Chinese date: %s" (calendar-chinese-date-string date)) (let ((c (calendar-coptic-date-string date))) diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index eba932847c0..45bb3c0e4c0 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -123,6 +123,22 @@ The holidays are those in the list `calendar-holidays'.") (autoload 'mark-islamic-calendar-date-pattern "cal-islam" "Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR.") +(autoload 'diary-bahai-date "cal-bahai" + "Baha'i calendar equivalent of date diary entry." + t) + +(autoload 'list-bahai-diary-entries "cal-bahai" + "Add any Baha'i date entries from the diary file to `diary-entries-list'." + t) + +(autoload 'mark-bahai-diary-entries "cal-bahai" + "Mark days in the calendar window that have Baha'i date diary entries." + t) + +(autoload 'mark-bahai-calendar-date-pattern "cal-bahai" + "Mark dates in calendar window that conform to Baha'i date MONTH/DAY/YEAR." + t) + (autoload 'diary-hebrew-date "cal-hebrew" "Hebrew calendar equivalent of date diary entry.") @@ -1129,6 +1145,8 @@ be used instead of a colon (:) to separate the hour and minute parts." 0 1200))) (t diary-unknown-time)))) ; Unrecognizable +;; Unrecognizable + (defun list-sexp-diary-entries (date) "Add sexp entries for DATE from the diary file to `diary-entries-list'. Also, Make them visible in the diary file. Returns t if any entries were @@ -1859,6 +1877,155 @@ names." "Forms to highlight in diary-mode") +;; Following code from Dave Love <fx@gnu.org>. +;; Import Outlook-format appointments from mail messages in Gnus or +;; Rmail using command `diary-from-outlook'. This, or the specialized +;; functions `diary-from-outlook-gnus' and `diary-from-outlook-rmail', +;; could be run from hooks to notice appointments automatically (in +;; which case they will prompt about adding to the diary). The +;; message formats recognized are customizable through +;; `diary-outlook-formats'. + +(defcustom diary-outlook-formats + '( + ;; When: 11 October 2001 12:00-14:00 (GMT) Greenwich Mean Time : Dublin, ... + ;; [Current UK format? The timezone is meaningless. Sometimes the + ;; Where is missing.] + ("When: \\([0-9]+ [[:alpha:]]+ [0-9]+\\) \ +\\([^ ]+\\) [^\n]+ +\[^\n]+ +\\(?:Where: \\([^\n]+\\)\n+\\)? +\\*~\\*~\\*~\\*~\\*~\\*~\\*~\\*~\\*~\\*" + . "\\1\n \\2 %s, \\3") + ;; When: Tuesday, April 30, 2002 03:00 PM-03:30 PM (GMT) Greenwich Mean ... + ;; [Old UK format?] + ("^When: [[:alpha:]]+, \\([[:alpha:]]+\\) \\([0-9][0-9]*\\), \\([0-9]\\{4\\}\\) \ +\\([^ ]+\\) [^\n]+ +\[^\n]+ +\\(?:Where: \\([^\n]+\\)\\)?\n+" + . "\\2 \\1 \\3\n \\4 %s, \\5") + ( + ;; German format, apparently. + "^Zeit: [^ ]+, +\\([0-9]+\\)\. +\\([[:upper:]][[:lower:]][[:lower:]]\\)[^ ]* +\\([0-9]+\\) +\\([^ ]+\\).*$" + . "\\1 \\2 \\3\n \\4 %s")) + "Alist of regexps matching message text and replacement text. + +The regexp must match the start of the message text containing an +appointment, but need not include a leading `^'. If it matches the +current message, a diary entry is made from the corresponding +template. If the template is a string, it should be suitable for +passing to `replace-match', and so will have occurrences of `\\D' to +substitute the match for the Dth subexpression. It must also contain +a single `%s' which will be replaced with the text of the message's +Subject field. Any other `%' characters must be doubled, so that the +template can be passed to `format'. + +If the template is actually a function, it is called with the message +body text as argument, and may use `match-string' etc. to make a +template following the rules above." + :type '(alist :key-type (regexp :tag "Regexp matching time/place") + :value-type (choice + (string :tag "Template for entry") + (function :tag "Unary function providing template"))) + :version "21.4" + :group 'diary) + + +;; Dynamically bound. +(defvar body) +(defvar subject) + +(defun diary-from-outlook-internal (&optional test-only) + "Snarf a diary entry from a message assumed to be from MS Outlook. +Assumes `body' is bound to a string comprising the body of the message and +`subject' is bound to a string comprising its subject. +Arg TEST-ONLY non-nil means return non-nil if and only if the +message contains an appointment, don't make a diary entry." + (catch 'finished + (let (format-string) + (dotimes (i (length diary-outlook-formats)) + (when (eq 0 (string-match (car (nth i diary-outlook-formats)) + body)) + (unless test-only + (setq format-string (cdr (nth i diary-outlook-formats))) + (save-excursion + (save-window-excursion + ;; Fixme: References to optional fields in the format + ;; are treated literally, not replaced by the empty + ;; string. I think this is an Emacs bug. + (make-diary-entry + (format (replace-match (if (functionp format-string) + (funcall format-string body) + format-string) + t nil (match-string 0 body)) + subject)) + (save-buffer)))) + (throw 'finished t)))) + nil)) + +(defun diary-from-outlook () + "Maybe snarf diary entry from current Outlook-generated message. +Currently knows about Gnus and Rmail modes." + (interactive) + (let ((func (cond + ((eq major-mode 'rmail-mode) + #'diary-from-outlook-rmail) + ((memq major-mode '(gnus-summary-mode gnus-article-mode)) + #'diary-from-outlook-gnus) + (t (error "Don't know how to snarf in `%s'" major-mode))))) + (if (interactive-p) + (call-interactively func) + (funcall func)))) + + +(defvar gnus-article-mime-handles) +(defvar gnus-article-buffer) + +(autoload 'gnus-fetch-field "gnus-util") +(autoload 'gnus-narrow-to-body "gnus") +(autoload 'mm-get-part "mm-decode") + +(defun diary-from-outlook-gnus () + "Maybe snarf diary entry from Outlook-generated message in Gnus. +Add this to `gnus-article-prepare-hook' to notice appointments +automatically." + (interactive) + (with-current-buffer gnus-article-buffer + (let ((subject (gnus-fetch-field "subject")) + (body (if gnus-article-mime-handles + ;; We're multipart. Don't get confused by part + ;; buttons &c. Assume info is in first part. + (mm-get-part (nth 1 gnus-article-mime-handles)) + (save-restriction + (gnus-narrow-to-body) + (buffer-string))))) + (when (diary-from-outlook-internal t) + (when (or (interactive-p) + (y-or-n-p "Snarf diary entry? ")) + (diary-from-outlook-internal) + (message "Diary entry added")))))) + +(custom-add-option 'gnus-article-prepare-hook 'diary-from-outlook-gnus) + + +(defvar rmail-buffer) + +(defun diary-from-outlook-rmail () + "Maybe snarf diary entry from Outlook-generated message in Rmail." + (interactive) + (with-current-buffer rmail-buffer + (let ((subject (mail-fetch-field "subject")) + (body (buffer-substring (save-excursion + (rfc822-goto-eoh) + (point)) + (point-max)))) + (when (diary-from-outlook-internal t) + (when (or (interactive-p) + (y-or-n-p "Snarf diary entry? ")) + (diary-from-outlook-internal) + (message "Diary entry added")))))) + + (provide 'diary-lib) ;;; arch-tag: 22dd506e-2e33-410d-9ae1-095a0c1b2010 diff --git a/lisp/calendar/holidays.el b/lisp/calendar/holidays.el index b262ac50a38..71f73f24b75 100644 --- a/lisp/calendar/holidays.el +++ b/lisp/calendar/holidays.el @@ -84,6 +84,10 @@ "Holiday on MONTH, DAY (Islamic) called STRING." t) +(autoload 'holiday-bahai "cal-bahai" + "Holiday on MONTH, DAY (Baha'i) called STRING." + t) + (autoload 'holiday-chinese-new-year "cal-china" "Date of Chinese New Year." t) @@ -141,6 +145,7 @@ The optional LABEL is used to label the buffer created." (if christian-holidays (cons "Christian" christian-holidays)) (if hebrew-holidays (cons "Hebrew" hebrew-holidays)) (if islamic-holidays (cons "Islamic" islamic-holidays)) + (if bahai-holidays (cons "Baha'i" bahai-holidays)) (if oriental-holidays (cons "Oriental" oriental-holidays)) (if solar-holidays (cons "Solar" solar-holidays)) (cons "Ask" nil))) diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index b36d5ab2f31..846231befe6 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el @@ -149,7 +149,7 @@ DATE1 and DATE2 should be date-time strings." ;;;###autoload (defun time-to-day-in-year (time) - "Return the day number within the year of the date month/day/year." + "Return the day number within the year corresponding to TIME." (let* ((tim (decode-time time)) (month (nth 4 tim)) (day (nth 3 tim)) diff --git a/lisp/calendar/timeclock.el b/lisp/calendar/timeclock.el index 0507ddab64a..709ea25fbcb 100644 --- a/lisp/calendar/timeclock.el +++ b/lisp/calendar/timeclock.el @@ -1129,12 +1129,6 @@ discrepancy, today's discrepancy, and the time worked today." ;;; A reporting function that uses timeclock-log-data -(defun timeclock-time-less-p (t1 t2) - "Say whether time T1 is less than time T2." - (or (< (car t1) (car t2)) - (and (= (car t1) (car t2)) - (< (nth 1 t1) (nth 1 t2))))) - (defun timeclock-day-base (&optional time) "Given a time within a day, return 0:0:0 within that day. If optional argument TIME is non-nil, use that instead of the current time." @@ -1190,12 +1184,12 @@ HTML-P is non-nil, HTML markup is added." (* 2 7 24 60 60)))) two-week-len today-len) (while proj-data - (if (not (timeclock-time-less-p + (if (not (time-less-p (timeclock-entry-begin (car proj-data)) today)) (setq today-len (timeclock-entry-list-length proj-data) proj-data nil) (if (and (null two-week-len) - (not (timeclock-time-less-p + (not (time-less-p (timeclock-entry-begin (car proj-data)) two-weeks-ago))) (setq two-week-len (timeclock-entry-list-length proj-data))) @@ -1260,7 +1254,7 @@ HTML-P is non-nil, HTML markup is added." (while day-list (let ((i 0) (l 5)) (while (< i l) - (unless (timeclock-time-less-p + (unless (time-less-p (timeclock-day-begin (car day-list)) (aref lengths i)) (let ((base (timeclock-time-to-seconds diff --git a/lisp/comint.el b/lisp/comint.el index 57e785dce47..12d8e1fcbb7 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -171,6 +171,31 @@ Good choices: This is a good thing to set in mode hooks.") +(defcustom comint-prompt-read-only nil + "If non-nil, the comint prompt is read only. +The read only region includes the newline before the prompt. +This does not affect existing prompts. +Certain derived modes may override this option. + +If you set this option to t, then the safe way to temporarily +override the read-only-ness of comint prompts is to call +`comint-kill-whole-line' or `comint-kill-region' with no +narrowing in effect. This way you will be certain that none of +the remaining prompts will be accidentally messed up. You may +wish to put something like the following in your `.emacs' file: + +\(add-hook 'comint-mode-hook + '(lambda () + (define-key comint-mode-map \"\C-w\" 'comint-kill-region) + (define-key comint-mode-map [C-S-backspace] + 'comint-kill-whole-line))) + +If you sometimes use comint-mode on text-only terminals or with `emacs-nw', +you might wish to use another binding for `comint-kill-whole-line'." + :type 'boolean + :group 'comint + :version "21.4") + (defvar comint-delimiter-argument-list () "List of characters to recognise as separate arguments in input. Strings comprising a character in this list will separate the arguments @@ -1157,7 +1182,7 @@ start of the text to scan for history references, rather than the logical beginning of line." (save-excursion (let ((toend (- (line-end-position) (point))) - (start (comint-line-beginning-position))) + (start (or start (comint-line-beginning-position)))) (goto-char start) (while (progn (skip-chars-forward "^!^" (- (line-end-position) toend)) @@ -1457,7 +1482,8 @@ Similarly for Soar, Scheme, etc." (concat input "\n"))) (let ((beg (marker-position pmark)) - (end (if no-newline (point) (1- (point))))) + (end (if no-newline (point) (1- (point)))) + (inhibit-modification-hooks t)) (when (> end beg) ;; Set text-properties for the input field (add-text-properties @@ -1553,7 +1579,8 @@ See `comint-carriage-motion' for details.") freeze its attributes in place, even when more input comes a long and moves the prompt overlay." (when comint-last-prompt-overlay - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) (add-text-properties (overlay-start comint-last-prompt-overlay) (overlay-end comint-last-prompt-overlay) (overlay-properties comint-last-prompt-overlay))))) @@ -1684,19 +1711,30 @@ Make backspaces delete the previous character." (goto-char (process-mark process)) ; in case a filter moved it (unless comint-use-prompt-regexp-instead-of-fields - (let ((inhibit-read-only t)) + (let ((inhibit-read-only t) + (inhibit-modification-hooks t)) (add-text-properties comint-last-output-start (point) '(rear-nonsticky t - field output - inhibit-line-move-field-capture t)))) + field output + inhibit-line-move-field-capture t)))) ;; Highlight the prompt, where we define `prompt' to mean ;; the most recent output that doesn't end with a newline. - (unless (and (bolp) (null comint-last-prompt-overlay)) - ;; Need to create or move the prompt overlay (in the case - ;; where there is no prompt ((bolp) == t), we still do - ;; this if there's already an existing overlay). - (let ((prompt-start (save-excursion (forward-line 0) (point)))) + (let ((prompt-start (save-excursion (forward-line 0) (point))) + (inhibit-read-only t) + (inhibit-modification-hooks t)) + (when comint-prompt-read-only + (or (= (point-min) prompt-start) + (get-text-property (1- prompt-start) 'read-only) + (put-text-property + (1- prompt-start) prompt-start 'read-only 'fence)) + (add-text-properties + prompt-start (point) + '(read-only t rear-non-sticky t front-sticky (read-only)))) + (unless (and (bolp) (null comint-last-prompt-overlay)) + ;; Need to create or move the prompt overlay (in the case + ;; where there is no prompt ((bolp) == t), we still do + ;; this if there's already an existing overlay). (if comint-last-prompt-overlay ;; Just move an existing overlay (move-overlay comint-last-prompt-overlay @@ -2006,7 +2044,8 @@ This function could be in the list `comint-output-filter-functions'." Does not delete the prompt." (interactive) (let ((proc (get-buffer-process (current-buffer))) - (replacement nil)) + (replacement nil) + (inhibit-read-only t)) (save-excursion (let ((pmark (progn (goto-char (process-mark proc)) (forward-line 0) @@ -2293,6 +2332,84 @@ This command is like `M-.' in bash." (just-one-space))) +;; Support editing with `comint-prompt-read-only' set to t. + +(defun comint-update-fence () + "Update read-only status of newline before point. +The `fence' read-only property is used to indicate that a newline +is read-only for no other reason than to \"fence off\" a +following front-sticky read-only region. This is used to +implement comint read-only prompts. If the text after a newline +changes, the read-only status of that newline may need updating. +That is what this function does. + +This function does nothing if point is not at the beginning of a +line, or is at the beginning of the accessible portion of the buffer. +Otherwise, if the character after point has a front-sticky +read-only property, then the preceding newline is given a +read-only property of `fence', unless it already is read-only. +If the character after point does not have a front-sticky +read-only property, any read-only property of `fence' on the +preceding newline is removed." + (let* ((pt (point)) (lst (get-text-property pt 'front-sticky)) + (inhibit-modification-hooks t)) + (and (bolp) + (not (bobp)) + (if (and (get-text-property pt 'read-only) + (if (listp lst) (memq 'read-only lst) t)) + (unless (get-text-property (1- pt) 'read-only) + (put-text-property (1- pt) pt 'read-only 'fence)) + (when (eq (get-text-property (1- pt) 'read-only) 'fence) + (remove-list-of-text-properties (1- pt) pt '(read-only))))))) + +(defun comint-kill-whole-line (&optional arg) + "Kill current line, ignoring read-only and field properties. +With prefix arg, kill that many lines starting from the current line. +If arg is negative, kill backward. Also kill the preceding newline, +instead of the trailing one. \(This is meant to make C-x z work well +with negative arguments.) +If arg is zero, kill current line but exclude the trailing newline. +The read-only status of newlines is updated with `comint-update-fence', +if necessary." + (interactive "p") + (let ((inhibit-read-only t) (inhibit-field-text-motion t)) + (kill-whole-line arg) + (when (>= arg 0) (comint-update-fence)))) + +(defun comint-kill-region (beg end &optional yank-handler) + "Like `kill-region', but ignores read-only properties, if safe. +This command assumes that the buffer contains read-only +\"prompts\" which are regions with front-sticky read-only +properties at the beginning of a line, with the preceding newline +being read-only to protect the prompt. This is true of the +comint prompts if `comint-prompt-read-only' is non-nil. This +command will not delete the region if this would create mutilated +or out of place prompts. That is, if any part of a prompt is +deleted, the entire prompt must be deleted and all remaining +prompts should stay at the beginning of a line. If this is not +the case, this command just calls `kill-region' with all +read-only properties intact. The read-only status of newlines is +updated using `comint-update-fence', if necessary." + (interactive "r") + (save-excursion + (let* ((true-beg (min beg end)) + (true-end (max beg end)) + (beg-bolp (progn (goto-char true-beg) (bolp))) + (beg-lst (get-text-property true-beg 'front-sticky)) + (beg-bad (and (get-text-property true-beg 'read-only) + (if (listp beg-lst) (memq 'read-only beg-lst) t))) + (end-bolp (progn (goto-char true-end) (bolp))) + (end-lst (get-text-property true-end 'front-sticky)) + (end-bad (and (get-text-property true-end 'read-only) + (if (listp end-lst) (memq 'read-only end-lst) t)))) + (if (or (and (not beg-bolp) (or beg-bad end-bad)) + (and (not end-bolp) end-bad)) + (kill-region beg end yank-handler) + (let ((inhibit-read-only t)) + (kill-region beg end yank-handler) + (comint-update-fence)))))) + + ;; Support for source-file processing commands. ;;============================================================================ ;; Many command-interpreters (e.g., Lisp, Scheme, Soar) have @@ -2854,10 +2971,8 @@ Typing SPC flushes the help buffer." ;; Read the next key, to process SPC. (let (key first) - (if (save-excursion - (set-buffer (get-buffer "*Completions*")) - (set (make-local-variable - 'comint-displayed-dynamic-completions) + (if (with-current-buffer (get-buffer "*Completions*") + (set (make-local-variable 'comint-displayed-dynamic-completions) completions) (setq key (read-key-sequence nil) first (aref key 0)) diff --git a/lisp/compare-w.el b/lisp/compare-w.el index d283016750f..7e23c9efedf 100644 --- a/lisp/compare-w.el +++ b/lisp/compare-w.el @@ -1,6 +1,6 @@ ;;; compare-w.el --- compare text between windows for Emacs -;; Copyright (C) 1986, 1989, 1993, 1997, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1986,1989,1993,1997,2003,2004 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: convenience files @@ -117,12 +117,12 @@ and the value `((4) (4))' for horizontally split windows." :group 'compare-w) (defface compare-windows-face - '((((type tty pc) (class color)) - (:background "turquoise3")) - (((class color) (background light)) + '((((class color) (min-colors 88) (background light)) (:background "paleturquoise")) - (((class color) (background dark)) + (((class color) (min-colors 88) (background dark)) (:background "paleturquoise4")) + (((class color)) + (:background "turquoise3")) (t (:underline t))) "Face for highlighting of compare-windows difference regions." :group 'compare-w) diff --git a/lisp/completion.el b/lisp/completion.el index 2fb0ef0a3b2..d7f728821f9 100644 --- a/lisp/completion.el +++ b/lisp/completion.el @@ -1,6 +1,6 @@ ;;; completion.el --- dynamic word-completion code -;; Copyright (C) 1990, 1993, 1995, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1990, 1993, 1995, 1997, 2004 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: abbrev convenience @@ -2251,7 +2251,7 @@ The command \\[yank] can retrieve it from there. /(If you want to kill and then yank immediately, use \\[copy-region-as-kill].) This is the primitive for programs to kill text (as opposed to deleting it). -Supply two arguments, character numbers indicating the stretch of text +Supply two arguments, character positions indicating the stretch of text to be killed. Any command that calls this function is a \"kill command\". If the previous command was also a kill command, diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 951b14f7f05..9e0efc5d3d0 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el @@ -1012,11 +1012,11 @@ version." ;;;###autoload (defun customize-face (&optional face) - "Customize SYMBOL, which should be a face name or nil. -If SYMBOL is nil, customize all faces. + "Customize FACE, which should be a face name or nil. +If FACE is nil, customize all faces. Interactively, when point is on text which has a face specified, -suggest to customized that face, if it's customizable." +suggest to customize that face, if it's customizable." (interactive (list (read-face-name "Customize face" "all faces" t))) (if (member face '(nil "")) @@ -1038,10 +1038,10 @@ suggest to customized that face, if it's customizable." ;;;###autoload (defun customize-face-other-window (&optional face) - "Show customization buffer for face SYMBOL in other window. + "Show customization buffer for face FACE in other window. Interactively, when point is on text which has a face specified, -suggest to customized that face, if it's customizable." +suggest to customize that face, if it's customizable." (interactive (list (read-face-name "Customize face" "all faces" t))) (if (member face '(nil "")) @@ -1093,7 +1093,7 @@ suggest to customized that face, if it's customizable." (get symbol 'standard-value)))) (when (and cval ;Declared with defcustom. (default-boundp symbol) ;Has a value. - (not (equal (eval (car cval)) + (not (equal (eval (car cval)) ;; Which does not match customize. (default-value symbol)))) (push (list symbol 'custom-variable) found))))) @@ -1876,7 +1876,7 @@ and `face'." (custom-load-symbol (widget-value widget))) (defun custom-unloaded-symbol-p (symbol) - "Return non-nil if the dependencies of SYMBOL has not yet been loaded." + "Return non-nil if the dependencies of SYMBOL have not yet been loaded." (let ((found nil) (loads (get symbol 'custom-loads)) load) @@ -1894,7 +1894,7 @@ and `face'." found)) (defun custom-unloaded-widget-p (widget) - "Return non-nil if the dependencies of WIDGET has not yet been loaded." + "Return non-nil if the dependencies of WIDGET have not yet been loaded." (custom-unloaded-symbol-p (widget-value widget))) (defun custom-toggle-hide (widget) @@ -2074,11 +2074,25 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"." :group 'custom-buffer :version "20.3") +(defun custom-variable-documentation (variable) + "Return documentation of VARIABLE for use in Custom buffer. +Normally just return the docstring. But if VARIABLE automatically +becomes buffer local when set, append a message to that effect." + (if (and (local-variable-if-set-p variable) + (or (not (local-variable-p variable)) + (with-temp-buffer + (local-variable-if-set-p variable)))) + (concat (documentation-property variable 'variable-documentation) + "\n +This variable automatically becomes buffer-local when set outside Custom. +However, setting it through Custom sets the default value.") + (documentation-property variable 'variable-documentation))) + (define-widget 'custom-variable 'custom "Customize variable." :format "%v" :help-echo "Set or reset this variable." - :documentation-property 'variable-documentation + :documentation-property #'custom-variable-documentation :custom-category 'option :custom-state nil :custom-menu 'custom-variable-menu-create @@ -2646,7 +2660,7 @@ Also change :reverse-video to :inverse-video." (widget-setup))))) (defun custom-face-edit-delete (widget) - "Remove widget from the buffer." + "Remove WIDGET from the buffer." (let ((inactive (widget-get widget :inactive)) (inhibit-read-only t) (inhibit-modification-hooks t)) @@ -2729,6 +2743,10 @@ Match grayscale frames.") Match frames with no color support.") mono))) (group :sibling-args (:help-echo "\ +The minimum number of colors the frame should support.") + (const :format "" min-colors) + (integer :tag "Minimum number of colors" )) + (group :sibling-args (:help-echo "\ Only match frames with the specified intensity.") (const :format "\ Background brightness: " @@ -4023,6 +4041,7 @@ The format is suitable for use with `easy-menu-define'." (suppress-keymap custom-mode-map) (define-key custom-mode-map " " 'scroll-up) (define-key custom-mode-map "\177" 'scroll-down) + (define-key custom-mode-map "\C-x\C-s" 'Custom-save) (define-key custom-mode-map "q" 'Custom-buffer-done) (define-key custom-mode-map "u" 'Custom-goto-parent) (define-key custom-mode-map "n" 'widget-forward) diff --git a/lisp/cus-face.el b/lisp/cus-face.el index 1ff07c4c361..e3134e8f1ea 100644 --- a/lisp/cus-face.el +++ b/lisp/cus-face.el @@ -39,15 +39,11 @@ (when (fboundp 'facep) (unless (facep face) ;; If the user has already created the face, respect that. - (let ((value (or (get face 'saved-face) spec)) - (frames (frame-list)) - frame) + (let ((value (or (get face 'saved-face) spec))) ;; Create global face. (make-empty-face face) ;; Create frame-local faces - (while frames - (setq frame (car frames) - frames (cdr frames)) + (dolist (frame (frame-list)) (face-spec-set face value frame))) ;; When making a face after frames already exist (if (memq window-system '(x w32)) diff --git a/lisp/custom.el b/lisp/custom.el index f5cfd55400a..e86308c95e7 100644 --- a/lisp/custom.el +++ b/lisp/custom.el @@ -54,7 +54,7 @@ Users should not set it.") "Initialize SYMBOL with VALUE. This will do nothing if symbol already has a default binding. Otherwise, if symbol has a `saved-value' property, it will evaluate -the car of that and used as the default binding for symbol. +the car of that and use it as the default binding for symbol. Otherwise, VALUE will be evaluated and used as the default binding for symbol." (unless (default-boundp symbol) @@ -176,7 +176,7 @@ set to nil, as the value is no longer rogue." "Declare SYMBOL as a customizable variable that defaults to VALUE. DOC is the variable documentation. -Neither SYMBOL nor VALUE needs to be quoted. +Neither SYMBOL nor VALUE need to be quoted. If SYMBOL is not already bound, initialize it to VALUE. The remaining arguments should have the form @@ -298,8 +298,8 @@ following REQ are defined: `type' (the value of `window-system') Under X, in addition to the values `window-system' can take, - `motif', `lucid' and `x-toolkit' are allowed, and match when - the Motif toolkit, Lucid toolkit, or any X toolkit is in use. + `motif', `lucid', `gtk' and `x-toolkit' are allowed, and match when + the Motif toolkit, Lucid toolkit, GTK toolkit or any X toolkit is in use. `class' (the frame's color support) Should be one of `color', `grayscale', or `mono'. @@ -311,6 +311,11 @@ following REQ are defined: Should be an integer, it is compared with the result of `display-color-cells'. +`supports' (only match frames that support the specified face attributes) + Should be a list of face attributes. See the documentation for + the function `display-supports-face-attributes-p' for more + information on exactly how testing is done. + Read the section about customization in the Emacs Lisp manual for more information." ;; It is better not to use backquote in this file, diff --git a/lisp/cvs-status.el b/lisp/cvs-status.el index 528ab74e509..b03182d87e4 100644 --- a/lisp/cvs-status.el +++ b/lisp/cvs-status.el @@ -1,4 +1,4 @@ -;;; cvs-status.el --- major mode for browsing `cvs status' output +;;; cvs-status.el --- major mode for browsing `cvs status' output -*- coding: utf-8 -*- ;; Copyright (C) 1999, 2000, 03, 2004 Free Software Foundation, Inc. @@ -277,10 +277,10 @@ BEWARE: because of stability issues, this is not a symetric operation." (cvs-tree-merge (cdr tree1) (cdr tree2)))))) ((> l1 l2) (cvs-tree-merge - (list (cons (cvs-tag-make (cvs-butlast vl1)) tree1)) tree2)) + (list (cons (cvs-tag-make (butlast vl1)) tree1)) tree2)) ((< l1 l2) (cvs-tree-merge - tree1 (list (cons (cvs-tag-make (cvs-butlast vl2)) tree2))))))))) + tree1 (list (cons (cvs-tag-make (butlast vl2)) tree2))))))))) (defun cvs-tag-make-tag (tag) (let ((vl (mapcar 'string-to-number (split-string (nth 2 tag) "\\.")))) @@ -293,7 +293,7 @@ BEWARE: because of stability issues, this is not a symetric operation." (lambda (tag) (let ((tag (cvs-tag-make-tag tag))) (list (if (not (eq (cvs-tag->type tag) 'branch)) tag - (list (cvs-tag-make (cvs-butlast (cvs-tag->vlist tag))) + (list (cvs-tag-make (butlast (cvs-tag->vlist tag))) tag))))) tags))) (while (cdr tags) @@ -384,23 +384,45 @@ the list is a three-string list TAG, KIND, REV." ;;;; CVSTree-style trees ;;;; -(defvar cvs-tree-use-jisx0208 - (and (char-displayable-p (make-char 'japanese-jisx0208 40 44)) t) +(defvar cvs-tree-use-jisx0208 nil) ;Old compat var. +(defvar cvs-tree-use-charset + (cond + (cvs-tree-use-jisx0208 'jisx0208) + ((char-displayable-p ?â”) 'unicode) + ((char-displayable-p (make-char 'japanese-jisx0208 40 44)) 'jisx0208)) "*Non-nil if we should use the graphical glyphs from `japanese-jisx0208'. Otherwise, default to ASCII chars like +, - and |.") (defconst cvs-tree-char-space - (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 33 33) " ")) + (case cvs-tree-use-charset + (jisx0208 (make-char 'japanese-jisx0208 33 33)) + (unicode " ") + (t " "))) (defconst cvs-tree-char-hbar - (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 44) "--")) + (case cvs-tree-use-charset + (jisx0208 (make-char 'japanese-jisx0208 40 44)) + (unicode "â”") + (t "--"))) (defconst cvs-tree-char-vbar - (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 45) "| ")) + (case cvs-tree-use-charset + (jisx0208 (make-char 'japanese-jisx0208 40 45)) + (unicode "┃") + (t "| "))) (defconst cvs-tree-char-branch - (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 50) "+-")) + (case cvs-tree-use-charset + (jisx0208 (make-char 'japanese-jisx0208 40 50)) + (unicode "┣") + (t "+-"))) (defconst cvs-tree-char-eob ;end of branch - (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 49) "`-")) + (case cvs-tree-use-charset + (jisx0208 (make-char 'japanese-jisx0208 40 49)) + (unicode "â”—") + (t "`-"))) (defconst cvs-tree-char-bob ;beginning of branch - (if cvs-tree-use-jisx0208 (make-char 'japanese-jisx0208 40 51) "+-")) + (case cvs-tree-use-charset + (jisx0208 (make-char 'japanese-jisx0208 40 51)) + (unicode "┳") + (t "+-"))) (defun cvs-tag-lessp (tag1 tag2) (eq (cvs-tag-compare tag1 tag2) 'more2)) @@ -411,7 +433,7 @@ Otherwise, default to ASCII chars like +, - and |.") "Look for a list of tags, and replace it with a tree. Optional prefix ARG chooses between two representations." (interactive "P") - (when (and cvs-tree-use-jisx0208 + (when (and cvs-tree-use-charset (not enable-multibyte-characters)) ;; We need to convert the buffer from unibyte to multibyte ;; since we'll use multibyte chars for the tree. diff --git a/lisp/dabbrev.el b/lisp/dabbrev.el index 3763f2ccab8..47ffba9873d 100644 --- a/lisp/dabbrev.el +++ b/lisp/dabbrev.el @@ -888,23 +888,28 @@ to record whether we upcased the expansion, downcased it, or did neither." ;; matches the start of the expansion, ;; copy the expansion's case ;; instead of downcasing all the rest. - ;; Treat a one-capital-letter abbrev as "not all upper case", - ;; so as to force preservation of the expansion's pattern - ;; if the expansion starts with a capital letter. - (let ((expansion-rest (substring expansion 1))) - (if (and (not (and (or (string= expansion-rest (downcase expansion-rest)) - (string= expansion-rest (upcase expansion-rest))) - (or (string= abbrev (downcase abbrev)) - (and (string= abbrev (upcase abbrev)) - (> (length abbrev) 1))))) - (string= abbrev - (substring expansion 0 (length abbrev)))) + ;; + ;; Treat a one-capital-letter (possibly with preceding non-letter + ;; characters) abbrev as "not all upper case", so as to force + ;; preservation of the expansion's pattern if the expansion starts + ;; with a capital letter. + (let ((expansion-rest (substring expansion 1)) + (first-letter-position (string-match "[[:alpha:]]" abbrev))) + (if (or (null first-letter-position) + (and (not (and (or (string= expansion-rest (downcase expansion-rest)) + (string= expansion-rest (upcase expansion-rest))) + (or (string= abbrev (downcase abbrev)) + (and (string= abbrev (upcase abbrev)) + (> (- (length abbrev) first-letter-position) + 1))))) + (string= abbrev + (substring expansion 0 (length abbrev))))) (setq use-case-replace nil))) ;; If the abbrev and the expansion are both all-lower-case ;; then don't do any conversion. The conversion would be a no-op ;; for this replacement, but it would carry forward to subsequent words. - ;; The goal of this is to preven that carrying forward. + ;; The goal of this is to prevent that carrying forward. (if (and (string= expansion (downcase expansion)) (string= abbrev (downcase abbrev))) (setq use-case-replace nil)) diff --git a/lisp/delsel.el b/lisp/delsel.el index 88e23cb218e..d8e034a5f9f 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -123,8 +123,6 @@ any selection." (put 'newline 'delete-selection t) (put 'open-line 'delete-selection 'kill) -(put 'insert-parentheses 'delete-selection t) - ;; This is very useful for cancelling a selection in the minibuffer without ;; aborting the minibuffer. (defun minibuffer-keyboard-quit () diff --git a/lisp/descr-text.el b/lisp/descr-text.el index 7e90e989b3e..5ce8cabed55 100644 --- a/lisp/descr-text.el +++ b/lisp/descr-text.el @@ -28,7 +28,7 @@ ;;; Code: -(eval-when-compile (require 'button)) +(eval-when-compile (require 'button) (require 'quail)) (defun describe-text-done () "Delete the current window or bury the current buffer." @@ -111,7 +111,8 @@ into widget buttons that call `describe-text-category' or (setq key (pop properties) val (pop properties) len 0) - (unless (or (memq key '(category face font-lock-face)) + (unless (or (memq key '(category face font-lock-face + syntax-table)) (widgetp val)) (setq val (pp-to-string val) len (length val))) @@ -134,7 +135,15 @@ into widget buttons that call `describe-text-category' or :notify `(lambda (&rest ignore) (describe-face ',value)) (format "%S" value))) - ((widgetp value) + ((eq key 'syntax-table) + (widget-create 'push-button + :tag "show" + :action (lambda (widget &optional event) + (with-output-to-temp-buffer + "*Pp Eval Output*" + (pp (widget-get widget :value)))) + value)) + ((widgetp value) (describe-text-widget value)) (t (widget-insert value)))) @@ -183,7 +192,6 @@ otherwise." (defun describe-text-properties-1 (pos output-buffer) (let* ((properties (text-properties-at pos)) (overlays (overlays-at pos)) - overlay (wid-field (get-char-property pos 'field)) (wid-button (get-char-property pos 'button)) (wid-doc (get-char-property pos 'widget-doc)) @@ -225,221 +233,214 @@ otherwise." (widget-insert "There are text properties here:\n") (describe-property-list properties))))) -;;; We cannot use the UnicodeData.txt file as such; it is not free. -;;; We can turn that info a different format and release the result -;;; as free data. When that is done, we could reinstate the code below. -;;; For the mean time, here is a dummy placeholder. -;;; -- rms -(defun describe-char-unicode-data (char) nil) - -;;; (defcustom describe-char-unicodedata-file nil -;;; "Location of Unicode data file. -;;; This is the UnicodeData.txt file from the Unicode consortium, used for -;;; diagnostics. If it is non-nil `describe-char-after' will print data -;;; looked up from it. This facility is mostly of use to people doing -;;; multilingual development. - -;;; This is a fairly large file, not typically present on GNU systems. At -;;; the time of writing it is at -;;; <URL:ftp://www.unicode.org/Public/UNIDATA/UnicodeData.txt>." -;;; :group 'mule -;;; :version "21.5" -;;; :type '(choice (const :tag "None" nil) -;;; file)) - -;;; ;; We could convert the unidata file into a Lispy form once-for-all -;;; ;; and distribute it for loading on demand. It might be made more -;;; ;; space-efficient by splitting strings word-wise and replacing them -;;; ;; with lists of symbols interned in a private obarray, e.g. -;;; ;; "LATIN SMALL LETTER A" => '(LATIN SMALL LETTER A). - -;;; ;; Fixme: Check whether this needs updating for Unicode 4. -;;; (defun describe-char-unicode-data (char) -;;; "Return a list of Unicode data for unicode CHAR. -;;; Each element is a list of a property description and the property value. -;;; The list is null if CHAR isn't found in `describe-char-unicodedata-file'." -;;; (when describe-char-unicodedata-file -;;; (unless (file-exists-p describe-char-unicodedata-file) -;;; (error "`unicodedata-file' %s not found" describe-char-unicodedata-file)) -;;; (save-excursion -;;; ;; Find file in fundamental mode to avoid, e.g. flyspell turned -;;; ;; on for .txt. Don't use RAWFILE arg in case of DOS line endings. -;;; (set-buffer (let ((auto-mode-alist)) -;;; (find-file-noselect describe-char-unicodedata-file))) -;;; (goto-char (point-min)) -;;; (let ((hex (format "%04X" char)) -;;; found first last) -;;; (if (re-search-forward (concat "^" hex) nil t) -;;; (setq found t) -;;; ;; It's not listed explicitly. Look for ranges, e.g. CJK -;;; ;; ideographs, and check whether it's in one of them. -;;; (while (and (re-search-forward "^\\([^;]+\\);[^;]+First>;" nil t) -;;; (>= char (setq first -;;; (string-to-number (match-string 1) 16))) -;;; (progn -;;; (forward-line 1) -;;; (looking-at "^\\([^;]+\\);[^;]+Last>;") -;;; (> char -;;; (setq last -;;; (string-to-number (match-string 1) 16)))))) -;;; (if (and (>= char first) -;;; (<= char last)) -;;; (setq found t))) -;;; (if found -;;; (let ((fields (mapcar (lambda (elt) -;;; (if (> (length elt) 0) -;;; elt)) -;;; (cdr (split-string -;;; (buffer-substring -;;; (line-beginning-position) -;;; (line-end-position)) -;;; ";"))))) -;;; ;; The length depends on whether the last field was empty. -;;; (unless (or (= 13 (length fields)) -;;; (= 14 (length fields))) -;;; (error "Invalid contents in %s" describe-char-unicodedata-file)) -;;; ;; The field names and values lists are slightly -;;; ;; modified from Mule-UCS unidata.el. -;;; (list -;;; (list "Name" (let ((name (nth 0 fields))) -;;; ;; Check for <..., First>, <..., Last> -;;; (if (string-match "\\`\\(<[^,]+\\)," name) -;;; (concat (match-string 1 name) ">") -;;; name))) -;;; (list "Category" -;;; (cdr (assoc -;;; (nth 1 fields) -;;; '(("Lu" . "uppercase letter") -;;; ("Ll" . "lowercase letter") -;;; ("Lt" . "titlecase letter") -;;; ("Mn" . "non-spacing mark") -;;; ("Mc" . "spacing-combining mark") -;;; ("Me" . "enclosing mark") -;;; ("Nd" . "decimal digit") -;;; ("Nl" . "letter number") -;;; ("No" . "other number") -;;; ("Zs" . "space separator") -;;; ("Zl" . "line separator") -;;; ("Zp" . "paragraph separator") -;;; ("Cc" . "other control") -;;; ("Cf" . "other format") -;;; ("Cs" . "surrogate") -;;; ("Co" . "private use") -;;; ("Cn" . "not assigned") -;;; ("Lm" . "modifier letter") -;;; ("Lo" . "other letter") -;;; ("Pc" . "connector punctuation") -;;; ("Pd" . "dash punctuation") -;;; ("Ps" . "open punctuation") -;;; ("Pe" . "close punctuation") -;;; ("Pi" . "initial-quotation punctuation") -;;; ("Pf" . "final-quotation punctuation") -;;; ("Po" . "other punctuation") -;;; ("Sm" . "math symbol") -;;; ("Sc" . "currency symbol") -;;; ("Sk" . "modifier symbol") -;;; ("So" . "other symbol"))))) -;;; (list "Combining class" -;;; (cdr (assoc -;;; (string-to-number (nth 2 fields)) -;;; '((0 . "Spacing") -;;; (1 . "Overlays and interior") -;;; (7 . "Nuktas") -;;; (8 . "Hiragana/Katakana voicing marks") -;;; (9 . "Viramas") -;;; (10 . "Start of fixed position classes") -;;; (199 . "End of fixed position classes") -;;; (200 . "Below left attached") -;;; (202 . "Below attached") -;;; (204 . "Below right attached") -;;; (208 . "Left attached (reordrant around \ -;;; single base character)") -;;; (210 . "Right attached") -;;; (212 . "Above left attached") -;;; (214 . "Above attached") -;;; (216 . "Above right attached") -;;; (218 . "Below left") -;;; (220 . "Below") -;;; (222 . "Below right") -;;; (224 . "Left (reordrant around single base \ -;;; character)") -;;; (226 . "Right") -;;; (228 . "Above left") -;;; (230 . "Above") -;;; (232 . "Above right") -;;; (233 . "Double below") -;;; (234 . "Double above") -;;; (240 . "Below (iota subscript)"))))) -;;; (list "Bidi category" -;;; (cdr (assoc -;;; (nth 3 fields) -;;; '(("L" . "Left-to-Right") -;;; ("LRE" . "Left-to-Right Embedding") -;;; ("LRO" . "Left-to-Right Override") -;;; ("R" . "Right-to-Left") -;;; ("AL" . "Right-to-Left Arabic") -;;; ("RLE" . "Right-to-Left Embedding") -;;; ("RLO" . "Right-to-Left Override") -;;; ("PDF" . "Pop Directional Format") -;;; ("EN" . "European Number") -;;; ("ES" . "European Number Separator") -;;; ("ET" . "European Number Terminator") -;;; ("AN" . "Arabic Number") -;;; ("CS" . "Common Number Separator") -;;; ("NSM" . "Non-Spacing Mark") -;;; ("BN" . "Boundary Neutral") -;;; ("B" . "Paragraph Separator") -;;; ("S" . "Segment Separator") -;;; ("WS" . "Whitespace") -;;; ("ON" . "Other Neutrals"))))) -;;; (list -;;; "Decomposition" -;;; (if (nth 4 fields) -;;; (let* ((parts (split-string (nth 4 fields))) -;;; (info (car parts))) -;;; (if (string-match "\\`<\\(.+\\)>\\'" info) -;;; (setq info (match-string 1 info)) -;;; (setq info nil)) -;;; (if info (setq parts (cdr parts))) -;;; ;; Maybe printing ? for unrepresentable unicodes -;;; ;; here and below should be changed? -;;; (setq parts (mapconcat -;;; (lambda (arg) -;;; (string (or (decode-char -;;; 'ucs -;;; (string-to-number arg 16)) -;;; ??))) -;;; parts " ")) -;;; (concat info parts)))) -;;; (list "Decimal digit value" -;;; (nth 5 fields)) -;;; (list "Digit value" -;;; (nth 6 fields)) -;;; (list "Numeric value" -;;; (nth 7 fields)) -;;; (list "Mirrored" -;;; (if (equal "Y" (nth 8 fields)) -;;; "yes")) -;;; (list "Old name" (nth 9 fields)) -;;; (list "ISO 10646 comment" (nth 10 fields)) -;;; (list "Uppercase" (and (nth 11 fields) -;;; (string (or (decode-char -;;; 'ucs -;;; (string-to-number -;;; (nth 11 fields) 16)) -;;; ??)))) -;;; (list "Lowercase" (and (nth 12 fields) -;;; (string (or (decode-char -;;; 'ucs -;;; (string-to-number -;;; (nth 12 fields) 16)) -;;; ??)))) -;;; (list "Titlecase" (and (nth 13 fields) -;;; (string (or (decode-char -;;; 'ucs -;;; (string-to-number -;;; (nth 13 fields) 16)) -;;; ??))))))))))) +(defcustom describe-char-unicodedata-file nil + "Location of Unicode data file. +This is the UnicodeData.txt file from the Unicode consortium, used for +diagnostics. If it is non-nil `describe-char-after' will print data +looked up from it. This facility is mostly of use to people doing +multilingual development. + +This is a fairly large file, not typically present on GNU systems. At +the time of writing it is at +<URL:http://www.unicode.org/Public/UNIDATA/UnicodeData.txt>." + :group 'mule + :version "21.4" + :type '(choice (const :tag "None" nil) + file)) + +;; We could convert the unidata file into a Lispy form once-for-all +;; and distribute it for loading on demand. It might be made more +;; space-efficient by splitting strings word-wise and replacing them +;; with lists of symbols interned in a private obarray, e.g. +;; "LATIN SMALL LETTER A" => '(LATIN SMALL LETTER A). + +;; Fixme: Check whether this needs updating for Unicode 4. +(defun describe-char-unicode-data (char) + "Return a list of Unicode data for unicode CHAR. +Each element is a list of a property description and the property value. +The list is null if CHAR isn't found in `describe-char-unicodedata-file'." + (when describe-char-unicodedata-file + (unless (file-exists-p describe-char-unicodedata-file) + (error "`unicodedata-file' %s not found" describe-char-unicodedata-file)) + (with-current-buffer + ;; Find file in fundamental mode to avoid, e.g. flyspell turned + ;; on for .txt. Don't use RAWFILE arg in case of DOS line endings. + (let ((auto-mode-alist)) + (find-file-noselect describe-char-unicodedata-file)) + (goto-char (point-min)) + (let ((hex (format "%04X" char)) + found first last) + (if (re-search-forward (concat "^" hex) nil t) + (setq found t) + ;; It's not listed explicitly. Look for ranges, e.g. CJK + ;; ideographs, and check whether it's in one of them. + (while (and (re-search-forward "^\\([^;]+\\);[^;]+First>;" nil t) + (>= char (setq first + (string-to-number (match-string 1) 16))) + (progn + (forward-line 1) + (looking-at "^\\([^;]+\\);[^;]+Last>;") + (> char + (setq last + (string-to-number (match-string 1) 16)))))) + (if (and (>= char first) + (<= char last)) + (setq found t))) + (if found + (let ((fields (mapcar (lambda (elt) + (if (> (length elt) 0) + elt)) + (cdr (split-string + (buffer-substring + (line-beginning-position) + (line-end-position)) + ";"))))) + ;; The length depends on whether the last field was empty. + (unless (or (= 13 (length fields)) + (= 14 (length fields))) + (error "Invalid contents in %s" describe-char-unicodedata-file)) + ;; The field names and values lists are slightly + ;; modified from Mule-UCS unidata.el. + (list + (list "Name" (let ((name (nth 0 fields))) + ;; Check for <..., First>, <..., Last> + (if (string-match "\\`\\(<[^,]+\\)," name) + (concat (match-string 1 name) ">") + name))) + (list "Category" + (cdr (assoc + (nth 1 fields) + '(("Lu" . "uppercase letter") + ("Ll" . "lowercase letter") + ("Lt" . "titlecase letter") + ("Mn" . "non-spacing mark") + ("Mc" . "spacing-combining mark") + ("Me" . "enclosing mark") + ("Nd" . "decimal digit") + ("Nl" . "letter number") + ("No" . "other number") + ("Zs" . "space separator") + ("Zl" . "line separator") + ("Zp" . "paragraph separator") + ("Cc" . "other control") + ("Cf" . "other format") + ("Cs" . "surrogate") + ("Co" . "private use") + ("Cn" . "not assigned") + ("Lm" . "modifier letter") + ("Lo" . "other letter") + ("Pc" . "connector punctuation") + ("Pd" . "dash punctuation") + ("Ps" . "open punctuation") + ("Pe" . "close punctuation") + ("Pi" . "initial-quotation punctuation") + ("Pf" . "final-quotation punctuation") + ("Po" . "other punctuation") + ("Sm" . "math symbol") + ("Sc" . "currency symbol") + ("Sk" . "modifier symbol") + ("So" . "other symbol"))))) + (list "Combining class" + (cdr (assoc + (string-to-number (nth 2 fields)) + '((0 . "Spacing") + (1 . "Overlays and interior") + (7 . "Nuktas") + (8 . "Hiragana/Katakana voicing marks") + (9 . "Viramas") + (10 . "Start of fixed position classes") + (199 . "End of fixed position classes") + (200 . "Below left attached") + (202 . "Below attached") + (204 . "Below right attached") + (208 . "Left attached (reordrant around \ +single base character)") + (210 . "Right attached") + (212 . "Above left attached") + (214 . "Above attached") + (216 . "Above right attached") + (218 . "Below left") + (220 . "Below") + (222 . "Below right") + (224 . "Left (reordrant around single base \ +character)") + (226 . "Right") + (228 . "Above left") + (230 . "Above") + (232 . "Above right") + (233 . "Double below") + (234 . "Double above") + (240 . "Below (iota subscript)"))))) + (list "Bidi category" + (cdr (assoc + (nth 3 fields) + '(("L" . "Left-to-Right") + ("LRE" . "Left-to-Right Embedding") + ("LRO" . "Left-to-Right Override") + ("R" . "Right-to-Left") + ("AL" . "Right-to-Left Arabic") + ("RLE" . "Right-to-Left Embedding") + ("RLO" . "Right-to-Left Override") + ("PDF" . "Pop Directional Format") + ("EN" . "European Number") + ("ES" . "European Number Separator") + ("ET" . "European Number Terminator") + ("AN" . "Arabic Number") + ("CS" . "Common Number Separator") + ("NSM" . "Non-Spacing Mark") + ("BN" . "Boundary Neutral") + ("B" . "Paragraph Separator") + ("S" . "Segment Separator") + ("WS" . "Whitespace") + ("ON" . "Other Neutrals"))))) + (list + "Decomposition" + (if (nth 4 fields) + (let* ((parts (split-string (nth 4 fields))) + (info (car parts))) + (if (string-match "\\`<\\(.+\\)>\\'" info) + (setq info (match-string 1 info)) + (setq info nil)) + (if info (setq parts (cdr parts))) + ;; Maybe printing ? for unrepresentable unicodes + ;; here and below should be changed? + (setq parts (mapconcat + (lambda (arg) + (string (or (decode-char + 'ucs + (string-to-number arg 16)) + ??))) + parts " ")) + (concat info parts)))) + (list "Decimal digit value" + (nth 5 fields)) + (list "Digit value" + (nth 6 fields)) + (list "Numeric value" + (nth 7 fields)) + (list "Mirrored" + (if (equal "Y" (nth 8 fields)) + "yes")) + (list "Old name" (nth 9 fields)) + (list "ISO 10646 comment" (nth 10 fields)) + (list "Uppercase" (and (nth 11 fields) + (string (or (decode-char + 'ucs + (string-to-number + (nth 11 fields) 16)) + ??)))) + (list "Lowercase" (and (nth 12 fields) + (string (or (decode-char + 'ucs + (string-to-number + (nth 12 fields) 16)) + ??)))) + (list "Titlecase" (and (nth 13 fields) + (string (or (decode-char + 'ucs + (string-to-number + (nth 13 fields) 16)) + ??))))))))))) ;; Return information about how CHAR is displayed at the buffer ;; position POS. If the selected frame is on a graphic display, @@ -465,8 +466,7 @@ as well as widgets, buttons, overlays, and text properties." (if (>= pos (point-max)) (error "No character follows specified position")) (let* ((char (char-after pos)) - (charset (get-char-property pos 'charset)) - (buffer (current-buffer)) + (charset (char-charset char)) (composition (find-composition pos nil nil t)) (component-chars nil) (display-table (or (window-display-table) @@ -474,116 +474,109 @@ as well as widgets, buttons, overlays, and text properties." standard-display-table)) (disp-vector (and display-table (aref display-table char))) (multibyte-p enable-multibyte-characters) - text-prop-description - code item-list max-width) - (or (and (charsetp charset) (encode-char char charset)) - (setq charset (char-charset char))) - (if (eq charset 'eight-bit) - (setq item-list - `(("character" - ,(format "%s (0%o, %d, 0x%x) -- raw byte 0x%x" - (char-to-string char) char char char - (multibyte-char-to-unibyte char))))) - - (setq code (encode-char char charset)) - (setq item-list - `(("character" - ,(format "%s (0%o, %d, 0x%x)" (if (< char 256) - (single-key-description char) - (char-to-string char)) - char char char)) - ("preferred charset" - ,(symbol-name charset) - ,(format "(%s)" (charset-description charset))) - ("code point" - ,(format (if (< code 256) "0x%02X" "0x%04X") code)) - ("syntax" - ,(let ((syntax (syntax-after pos))) - (with-temp-buffer - (internal-describe-syntax-value syntax) - (buffer-string)))) - ("category" - ,@(let ((category-set (char-category-set char))) - (if (not category-set) - '("-- none --") - (mapcar #'(lambda (x) (format "%c:%s " - x (category-docstring x))) - (category-set-mnemonics category-set))))) - ,@(let ((props (aref char-code-property-table char)) - ps) - (when props - (while props - (push (format "%s:" (pop props)) ps) - (push (format "%s;" (pop props)) ps)) - (list (cons "Properties" (nreverse ps))))) - ("buffer code" - ,(encoded-string-description - (string-as-unibyte (char-to-string char)) nil)) - ("file code" - ,@(let* ((coding buffer-file-coding-system) - (encoded (encode-coding-char char coding))) - (if encoded - (list (encoded-string-description encoded coding) - (format "(encoded by coding system %S)" coding)) - (list "not encodable by coding system" - (symbol-name coding))))) - ("display" - ,(cond - (disp-vector - (setq disp-vector (copy-sequence disp-vector)) - (dotimes (i (length disp-vector)) - (setq char (aref disp-vector i)) - (aset disp-vector i - (cons char (describe-char-display pos char)))) - (format "by display table entry [%s] (see below)" - (mapconcat #'(lambda (x) (format "?%c" (car x))) - disp-vector " "))) - (composition - (let ((from (car composition)) - (to (nth 1 composition)) - (next (1+ pos)) - (components (nth 2 composition)) - ch) - (setcar composition - (and (< from pos) (buffer-substring from pos))) - (setcar (cdr composition) - (and (< next to) (buffer-substring next to))) - (dotimes (i (length components)) - (if (integerp (setq ch (aref components i))) - (push (cons ch (describe-char-display pos ch)) - component-chars))) - (setq component-chars (nreverse component-chars)) - (format "composed to form \"%s\" (see below)" - (buffer-substring from to)))) - (t - (let ((display (describe-char-display pos char))) - (if (display-graphic-p (selected-frame)) - (if display - (concat - "by this font (glyph code)\n" - (format " %s (0x%02X)" - (car display) (cdr display))) - "no font available") + (overlays (mapcar #'(lambda (o) (overlay-properties o)) + (overlays-at pos))) + item-list max-width code) + + (setq code (encode-char char charset)) + (setq item-list + `(("character" + ,(format "%s (0%o, %d, 0x%x)" + (apply 'propertize (if (not multibyte-p) + (single-key-description char) + (if (< char 128) + (single-key-description char) + (string-to-multibyte + (char-to-string char)))) + (text-properties-at pos)) + char char char)) + ("preferred charset" + ,(symbol-name charset) + ,(format "(%s)" (charset-description charset))) + ("code point" + ,(format (if (< code 256) "0x%02X" "0x%04X") code)) + ("syntax" + ,(let ((syntax (syntax-after pos))) + (with-temp-buffer + (internal-describe-syntax-value syntax) + (buffer-string)))) + ("category" + ,@(let ((category-set (char-category-set char))) + (if (not category-set) + '("-- none --") + (mapcar #'(lambda (x) (format "%c:%s " + x (category-docstring x))) + (category-set-mnemonics category-set))))) + ,@(let ((props (aref char-code-property-table char)) + ps) + (when props + (while props + (push (format "%s:" (pop props)) ps) + (push (format "%s;" (pop props)) ps)) + (list (cons "Properties" (nreverse ps))))) + ("to input" + ,@(let ((key-list (and current-input-method + (quail-find-key char)))) + (if (consp key-list) + (list "type" + (mapconcat #'(lambda (x) (concat "\"" x "\"")) + key-list " or "))))) + ("buffer code" + ,(encoded-string-description + (string-as-unibyte (char-to-string char)) nil)) + ("file code" + ,@(let* ((coding buffer-file-coding-system) + (encoded (encode-coding-char char coding))) + (if encoded + (list (encoded-string-description encoded coding) + (format "(encoded by coding system %S)" coding)) + (list "not encodable by coding system" + (symbol-name coding))))) + ("display" + ,(cond + (disp-vector + (setq disp-vector (copy-sequence disp-vector)) + (dotimes (i (length disp-vector)) + (setq char (aref disp-vector i)) + (aset disp-vector i + (cons char (describe-char-display pos char)))) + (format "by display table entry [%s] (see below)" + (mapconcat #'(lambda (x) (format "?%c" (car x))) + disp-vector " "))) + (composition + (let ((from (car composition)) + (to (nth 1 composition)) + (next (1+ pos)) + (components (nth 2 composition)) + ch) + (setcar composition + (and (< from pos) (buffer-substring from pos))) + (setcar (cdr composition) + (and (< next to) (buffer-substring next to))) + (dotimes (i (length components)) + (if (integerp (setq ch (aref components i))) + (push (cons ch (describe-char-display pos ch)) + component-chars))) + (setq component-chars (nreverse component-chars)) + (format "composed to form \"%s\" (see below)" + (buffer-substring from to)))) + (t + (let ((display (describe-char-display pos char))) + (if (display-graphic-p (selected-frame)) (if display - (format "terminal code %s" display) - "not encodable for terminal")))))) - ,@(let ((unicodedata (unicode-data char))) - (if unicodedata - (cons (list "Unicode data" " ") unicodedata)))))) - (setq max-width (apply #'max (mapcar #'(lambda (x) - (if (cadr x) - (length (car x)) - 0)) + (concat + "by this font (glyph code)\n" + (format " %s (0x%02X)" + (car display) (cdr display))) + "no font available") + (if display + (format "terminal code %s" display) + "not encodable for terminal")))))) + ,@(let ((unicodedata (describe-char-unicode-data char))) + (if unicodedata + (cons (list "Unicode data" " ") unicodedata))))) + (setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x))) item-list))) - - (setq text-prop-description - (with-temp-buffer - (let ((buf (current-buffer))) - (save-excursion - (set-buffer buffer) - (describe-text-properties pos buf))) - (buffer-string))) - (with-output-to-temp-buffer "*Help*" (with-current-buffer standard-output (set-buffer-multibyte multibyte-p) @@ -601,6 +594,18 @@ as well as widgets, buttons, overlays, and text properties." (insert " " clm)) (insert "\n")))) + (save-excursion + (goto-char (point-min)) + (re-search-forward "character:[ \t\n]+") + (setq pos (point))) + (if overlays + (mapc #'(lambda (props) + (let ((o (make-overlay pos (1+ pos)))) + (while props + (overlay-put o (car props) (nth 1 props)) + (setq props (cddr props))))) + overlays)) + (when disp-vector (insert "\nThe display table entry is displayed by ") @@ -622,7 +627,6 @@ as well as widgets, buttons, overlays, and text properties." (or (cdr (aref disp-vector i)) "-- not encodable --") "\n")))) - (setq pos (point)) (when composition (insert "\nComposed") (if (car composition) @@ -658,12 +662,10 @@ as well as widgets, buttons, overlays, and text properties." (or (cdr elt) "-- not encodable --")))) (insert "\nSee the variable `reference-point-alist' for " "the meaning of the rule.\n")) - (put-text-property pos (point) 'auto-composed t) - (insert text-prop-description) + (describe-text-properties pos (current-buffer)) (describe-text-mode))))) - (defalias 'describe-char-after 'describe-char) (make-obsolete 'describe-char-after 'describe-char "21.5") diff --git a/lisp/desktop.el b/lisp/desktop.el index 45f951883c6..a71fc6c79fe 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -83,12 +83,6 @@ ;;; Code: -;; Make the compilation more silent -(eval-when-compile - ;; We use functions from these modules - ;; We can't (require 'mh-e) since that wants to load something. - (mapcar 'require '(info dired reporter))) - (defvar desktop-file-version "206" "Version number of desktop file format. Written into the desktop file and used at desktop read to provide @@ -151,8 +145,11 @@ The base name of the file is specified in `desktop-base-file-name'." :group 'desktop) (defcustom desktop-missing-file-warning nil - "*If non-nil then `desktop-read' warns when a file no longer exists. -Otherwise it simply ignores that file." + "*If non-nil then `desktop-read' asks if a non-existent file should be recreated. +Also pause for a moment to display message about errors signaled in +`desktop-buffer-mode-handlers'. + +If nil, just print error messages in the message buffer." :type 'boolean :group 'desktop) @@ -250,14 +247,6 @@ The variables are saved only when they really are local." :type 'regexp :group 'desktop) -(defcustom desktop-buffer-modes-to-save - '(Info-mode rmail-mode) - "If a buffer is of one of these major modes, save the buffer state. -It is up to the functions in `desktop-buffer-handlers' to decide -whether the buffer should be recreated or not, and how." - :type '(repeat symbol) - :group 'desktop) - (defcustom desktop-modes-not-to-save nil "List of major modes whose buffers should not be saved." :type '(repeat symbol) @@ -272,53 +261,61 @@ Possible values are: :type '(choice (const absolute) (const tilde) (const local)) :group 'desktop) -(defcustom desktop-buffer-misc-functions - '(desktop-buffer-info-misc-data - desktop-buffer-dired-misc-data) - "*Functions used to determine auxiliary information for a buffer. -These functions are called by `desktop-save' in order, with no -arguments. If a function returns non-nil, its value is saved along -with the state of the buffer for which it was called; no further -functions will be called. +;;;###autoload +(defvar desktop-save-buffer nil + "When non-nil, save buffer status in desktop file. +This variable becomes buffer local when set. + +If the value is a function, it called by `desktop-save' with argument +DESKTOP-DIRNAME to obtain auxiliary information to saved in the desktop +file along with the state of the buffer for which it was called. When file names are returned, they should be formatted using the call -\"(desktop-file-name FILE-NAME dirname)\". +\"(desktop-file-name FILE-NAME DESKTOP-DIRNAME)\". -Later, when `desktop-read' restores buffers, each of the functions in -`desktop-buffer-handlers' will have access to a buffer local variable, -named `desktop-buffer-misc', whose value is what the function in -`desktop-buffer-misc-functions' returned." - :type '(repeat function) - :group 'desktop) +Later, when `desktop-read' calls a function in `desktop-buffer-mode-handlers' +to restore the buffer, the auxiliary information is passed as the argument +DESKTOP-BUFFER-MISC.") +(make-variable-buffer-local 'desktop-save-buffer) +(make-obsolete-variable 'desktop-buffer-modes-to-save + 'desktop-save-buffer) +(make-obsolete-variable 'desktop-buffer-misc-functions + 'desktop-save-buffer) -(defcustom desktop-buffer-handlers - '(desktop-buffer-dired - desktop-buffer-rmail - desktop-buffer-mh - desktop-buffer-info - desktop-buffer-file) - "*Functions called by `desktop-read' in order to create a buffer. -The functions are called without explicit parameters but can use the -following variables: +(defcustom desktop-buffer-mode-handlers '( + (dired-mode . dired-restore-desktop-buffer) + (rmail-mode . rmail-restore-desktop-buffer) + (mh-folder-mode . mh-restore-desktop-buffer) + (Info-mode . Info-restore-desktop-buffer)) + "Alist of major mode specific functions to restore a desktop buffer. +Functions are called by `desktop-read'. List elements must have the form +\(MAJOR-MODE . RESTORE-BUFFER-FUNCTION). + +Buffers with a major mode not specified here, are restored by the default +handler `desktop-restore-file-buffer'. + +Handlers are called with argument list + + (DESKTOP-BUFFER-FILE-NAME DESKTOP-BUFFER-NAME DESKTOP-BUFFER-MISC) + +Furthermore, they may use the following variables: desktop-file-version - desktop-buffer-file-name - desktop-buffer-name desktop-buffer-major-mode desktop-buffer-minor-modes desktop-buffer-point desktop-buffer-mark desktop-buffer-read-only - desktop-buffer-misc desktop-buffer-locals -If one function returns non-nil, no further functions are called. -If the function returns a buffer, then the saved mode settings +If a handler returns a buffer, then the saved mode settings and variable values for that buffer are copied into it." - :type '(repeat function) + :type 'alist :group 'desktop) -(put 'desktop-buffer-handlers 'risky-local-variable t) +(put 'desktop-buffer-mode-handlers 'risky-local-variable t) +(make-obsolete-variable 'desktop-buffer-handlers + 'desktop-buffer-mode-handlers) (defcustom desktop-minor-mode-table '((auto-fill-function auto-fill-mode) @@ -329,7 +326,7 @@ NAME is the name of the buffer-local variable indicating that the minor mode is active. RESTORE-FUNCTION is the function to activate the minor mode. called. RESTORE-FUNCTION nil means don't try to restore the minor mode. Only minor modes for which the name of the buffer-local variable -and the name of the minor mode function are different have to added to +and the name of the minor mode function are different have to be added to this table." :type 'sexp :group 'desktop) @@ -540,21 +537,20 @@ which means to truncate VAR's value to at most MAX-SIZE elements ;; ---------------------------------------------------------------------------- (defun desktop-save-buffer-p (filename bufname mode &rest dummy) - "Return t if the desktop should record a particular buffer for next startup. + "Return t if buffer should have its state saved in the desktop file. FILENAME is the visited file name, BUFNAME is the buffer name, and MODE is the major mode." (let ((case-fold-search nil)) (and (not (string-match desktop-buffers-not-to-save bufname)) - (not (memq mode desktop-modes-not-to-save)) - (or (and filename - (not (string-match desktop-files-not-to-save filename))) - (and (eq mode 'dired-mode) - (save-excursion - (set-buffer (get-buffer bufname)) - (not (string-match desktop-files-not-to-save - default-directory)))) - (and (null filename) - (memq mode desktop-buffer-modes-to-save)))))) + (not (memq mode desktop-modes-not-to-save)) + (or (and filename + (not (string-match desktop-files-not-to-save filename))) + (and (eq mode 'dired-mode) + (with-current-buffer bufname + (not (string-match desktop-files-not-to-save + default-directory)))) + (and (null filename) + (with-current-buffer bufname desktop-save-buffer)))))) ;; ---------------------------------------------------------------------------- (defun desktop-file-name (filename dirname) @@ -593,22 +589,25 @@ See also `desktop-base-file-name'." major-mode ;; minor modes (let (ret) - (mapcar - #'(lambda (mim) + (mapc + #'(lambda (minor-mode) (and - (boundp mim) - (symbol-value mim) - (setq ret - (cons - (let ((special (assq mim desktop-minor-mode-table))) - (if special (cadr special) mim)) - ret)))) + (boundp minor-mode) + (symbol-value minor-mode) + (let ((special (assq minor-mode desktop-minor-mode-table))) + (when (or special (functionp minor-mode)) + (setq ret + (cons + (if special (cadr special) minor-mode) + ret)))))) (mapcar #'car minor-mode-alist)) ret) (point) (list (mark t) mark-active) buffer-read-only - (run-hook-with-args-until-success 'desktop-buffer-misc-functions) + ;; Auxiliary information + (when (functionp desktop-save-buffer) + (funcall desktop-save-buffer dirname)) (let ((locals desktop-locals-to-save) (loclist (buffer-local-variables)) (ll)) @@ -703,7 +702,9 @@ It returns t if a desktop file was loaded, nil otherwise." "~")))) (if (file-exists-p (expand-file-name desktop-base-file-name desktop-dirname)) ;; Desktop file found, process it. - (let ((desktop-first-buffer nil)) + (let ((desktop-first-buffer nil) + (desktop-buffer-ok-count 0) + (desktop-buffer-fail-count 0)) ;; Evaluate desktop buffer. (load (expand-file-name desktop-base-file-name desktop-dirname) t t t) ;; `desktop-create-buffer' puts buffers at end of the buffer list. @@ -715,7 +716,12 @@ It returns t if a desktop file was loaded, nil otherwise." (run-hooks 'desktop-delay-hook) (setq desktop-delay-hook nil) (run-hooks 'desktop-after-read-hook) - (message "Desktop loaded.") + (message "Desktop: %d buffer%s restored%s." + desktop-buffer-ok-count + (if (= 1 desktop-buffer-ok-count) "" "s") + (if (< 0 desktop-buffer-fail-count) + (format ", %d failed to restore" desktop-buffer-fail-count) + "")) t) ;; No desktop file found. (desktop-clear) @@ -772,106 +778,21 @@ directory DIRNAME." (desktop-read desktop-dirname)) ;; ---------------------------------------------------------------------------- -;; Note: the following functions use the dynamic variable binding in Lisp. -;; - -(eval-when-compile ; Just to silence the byte compiler - (defvar desktop-file-version) - (defvar desktop-buffer-file-name) - (defvar desktop-buffer-name) - (defvar desktop-buffer-major-mode) - (defvar desktop-buffer-minor-modes) - (defvar desktop-buffer-point) - (defvar desktop-buffer-mark) - (defvar desktop-buffer-read-only) - (defvar desktop-buffer-misc) - (defvar desktop-buffer-locals) -) - -(defun desktop-buffer-info-misc-data () - (if (eq major-mode 'Info-mode) - (list Info-current-file - Info-current-node))) - -;; ---------------------------------------------------------------------------- -(defun desktop-buffer-dired-misc-data () - (when (eq major-mode 'dired-mode) - (eval-when-compile (defvar dirname)) - (cons - ;; Value of `dired-directory'. - (if (consp dired-directory) - ;; Directory name followed by list of files. - (cons (desktop-file-name (car dired-directory) dirname) (cdr dired-directory)) - ;; Directory name, optionally with with shell wildcard. - (desktop-file-name dired-directory dirname)) - ;; Subdirectories in `dired-subdir-alist'. - (cdr - (nreverse - (mapcar - (function (lambda (f) (desktop-file-name (car f) dirname))) - dired-subdir-alist)))))) - -;; ---------------------------------------------------------------------------- -(defun desktop-buffer-info () "Load an info file." - (if (eq 'Info-mode desktop-buffer-major-mode) - (progn - (let ((first (nth 0 desktop-buffer-misc)) - (second (nth 1 desktop-buffer-misc))) - (when (and first second) - (require 'info) - (with-no-warnings - (Info-find-node first second)) - (current-buffer)))))) - -;; ---------------------------------------------------------------------------- -(eval-when-compile (defvar rmail-buffer)) ; Just to silence the byte compiler. -(defun desktop-buffer-rmail () "Load an RMAIL file." - (if (eq 'rmail-mode desktop-buffer-major-mode) - (condition-case error - (progn (rmail-input desktop-buffer-file-name) - (if (eq major-mode 'rmail-mode) - (current-buffer) - rmail-buffer)) - (file-locked - (kill-buffer (current-buffer)) - 'ignored)))) - -;; ---------------------------------------------------------------------------- -(defun desktop-buffer-mh () "Load a folder in the mh system." - (if (eq 'mh-folder-mode desktop-buffer-major-mode) - (with-no-warnings - (mh-find-path) - (mh-visit-folder desktop-buffer-name) - (current-buffer)))) - -;; ---------------------------------------------------------------------------- -(defun desktop-buffer-dired () "Load a directory using dired." - (if (eq 'dired-mode desktop-buffer-major-mode) - ;; First element of `desktop-buffer-misc' is the value of `dired-directory'. - ;; This value is a directory name, optionally with with shell wildcard or - ;; a directory name followed by list of files. - (let* ((dired-dir (car desktop-buffer-misc)) - (dir (if (consp dired-dir) (car dired-dir) dired-dir))) - (if (file-directory-p (file-name-directory dir)) - (progn - (dired dired-dir) - ;; The following elements of `desktop-buffer-misc' are the keys - ;; from `dired-subdir-alist'. - (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc)) - (current-buffer)) - (message "Directory %s no longer exists." dir) - (sit-for 1) - 'ignored)))) - -;; ---------------------------------------------------------------------------- -(defun desktop-buffer-file () - "Load a file." +(defun desktop-restore-file-buffer (desktop-buffer-file-name + desktop-buffer-name + desktop-buffer-misc) + "Restore a file buffer." + (eval-when-compile ; Just to silence the byte compiler + (defvar desktop-buffer-major-mode) + (defvar desktop-buffer-locals)) (if desktop-buffer-file-name (if (or (file-exists-p desktop-buffer-file-name) - (and desktop-missing-file-warning - (y-or-n-p (format - "File \"%s\" no longer exists. Re-create? " - desktop-buffer-file-name)))) + (let ((msg (format "Desktop: File \"%s\" no longer exists." + desktop-buffer-file-name))) + (if desktop-missing-file-warning + (y-or-n-p (concat msg " Re-create? ")) + (message msg) + nil))) (let* ((auto-insert nil) ; Disable auto insertion (coding-system-for-read (or coding-system-for-read @@ -885,11 +806,11 @@ directory DIRNAME." (functionp desktop-buffer-major-mode) (funcall desktop-buffer-major-mode)) buf) - 'ignored))) + nil))) ;; ---------------------------------------------------------------------------- -;; Create a buffer, load its file, set is mode, ...; called from Desktop file -;; only. +;; Create a buffer, load its file, set its mode, ...; +;; called from Desktop file only. (eval-when-compile ; Just to silence the byte compiler (defvar desktop-first-buffer) ;; Dynamically bound in `desktop-read' @@ -907,20 +828,32 @@ directory DIRNAME." desktop-buffer-misc &optional desktop-buffer-locals) + ;; Just to silence the byte compiler. Bound locally in `desktop-read'. + (eval-when-compile + (defvar desktop-buffer-ok-count) + (defvar desktop-buffer-fail-count)) ;; To make desktop files with relative file names possible, we cannot ;; allow `default-directory' to change. Therefore we save current buffer. (save-current-buffer (let ( (buffer-list (buffer-list)) - (hlist desktop-buffer-handlers) - (result) - (handler) + (result + (condition-case err + (funcall (or (cdr (assq desktop-buffer-major-mode desktop-buffer-mode-handlers)) + 'desktop-restore-file-buffer) + desktop-buffer-file-name + desktop-buffer-name + desktop-buffer-misc) + (error + (message "Desktop: Can't load buffer %s: %s" + desktop-buffer-name (error-message-string err)) + (when desktop-missing-file-warning (sit-for 1)) + nil))) ) - ;; Call desktop-buffer-handlers to create buffer. - (while (and (not result) hlist) - (setq handler (car hlist)) - (setq result (funcall handler)) - (setq hlist (cdr hlist))) + (if (bufferp result) + (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count)) + (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count)) + (setq result nil)) (unless (bufferp result) (setq result nil)) ;; Restore buffer list order with new buffer at end. Don't change ;; the order for old desktop files (old desktop module behaviour). @@ -947,7 +880,12 @@ directory DIRNAME." desktop-buffer-minor-modes))) ;; Even though point and mark are non-nil when written by `desktop-save' ;; they may be modified by handlers wanting to set point or mark themselves. - (when desktop-buffer-point (goto-char desktop-buffer-point)) + (when desktop-buffer-point + (goto-char + (condition-case err + ;; Evaluate point. Thus point can be something like '(search-forward ... + (eval desktop-buffer-point) + (error (message "%s" (error-message-string err)) 1)))) (when desktop-buffer-mark (if (consp desktop-buffer-mark) (progn diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el index f6b2520a112..26ff5441baf 100644 --- a/lisp/diff-mode.el +++ b/lisp/diff-mode.el @@ -48,7 +48,6 @@ ;; ;; - Refine hunk on a word-by-word basis. ;; -;; - Use the new next-error-function to allow C-x `. ;; - Handle `diff -b' output in context->unified. ;;; Code: @@ -170,27 +169,27 @@ when editing big diffs)." ;;;; (defface diff-header-face - '((((type tty pc) (class color) (background light)) - (:foreground "blue1" :weight bold)) - (((type tty pc) (class color) (background dark)) - (:foreground "green" :weight bold)) - (((class color) (background light)) + '((((class color) (min-colors 88) (background light)) (:background "grey85")) - (((class color) (background dark)) + (((class color) (min-colors 88) (background dark)) (:background "grey45")) + (((class color) (background light)) + (:foreground "blue1" :weight bold)) + (((class color) (background dark)) + (:foreground "green" :weight bold)) (t (:weight bold))) "`diff-mode' face inherited by hunk and index header faces.") (defvar diff-header-face 'diff-header-face) (defface diff-file-header-face - '((((type tty pc) (class color) (background light)) - (:foreground "yellow" :weight bold)) - (((type tty pc) (class color) (background dark)) - (:foreground "cyan" :weight bold)) - (((class color) (background light)) + '((((class color) (min-colors 88) (background light)) (:background "grey70" :weight bold)) - (((class color) (background dark)) + (((class color) (min-colors 88) (background dark)) (:background "grey60" :weight bold)) + (((class color) (background light)) + (:foreground "yellow" :weight bold)) + (((class color) (background dark)) + (:foreground "cyan" :weight bold)) (t (:weight bold))) ; :height 1.3 "`diff-mode' face used to highlight file header lines.") (defvar diff-file-header-face 'diff-file-header-face) @@ -305,7 +304,11 @@ when editing big diffs)." (defvar diff-narrowed-to nil) (defun diff-end-of-hunk (&optional style) - (if (looking-at diff-hunk-header-re) (goto-char (match-end 0))) + (when (looking-at diff-hunk-header-re) + (unless style + ;; Especially important for unified (because headers are ambiguous). + (setq style (cdr (assq (char-after) '((?@ . unified) (?* . context)))))) + (goto-char (match-end 0))) (let ((end (and (re-search-forward (case style ;; A `unified' header is ambiguous. (unified (concat "^[^-+# \\]\\|" @@ -882,9 +885,14 @@ See `after-change-functions' for the meaning of BEG, END and LEN." (diff-fixup-modifs (point) (cdr diff-unhandled-changes))))) (setq diff-unhandled-changes nil))) -;;;; -;;;; The main function -;;;; +(defun diff-next-error (arg reset) + ;; Select a window that displays the current buffer so that point + ;; movements are reflected in that window. Otherwise, the user might + ;; never see the hunk corresponding to the source she's jumping to. + (pop-to-buffer (current-buffer)) + (if reset (goto-char (point-min))) + (diff-hunk-next arg) + (diff-goto-source)) ;;;###autoload (define-derived-mode diff-mode fundamental-mode "Diff" @@ -912,6 +920,7 @@ a diff with \\[diff-reverse-direction]." ;; (set (make-local-variable 'paragraph-separate) paragraph-start) ;; (set (make-local-variable 'page-delimiter) "--- [^\t]+\t") ;; compile support + (set (make-local-variable 'next-error-function) 'diff-next-error) (when (and (> (point-max) (point-min)) diff-default-read-only) (toggle-read-only t)) @@ -967,7 +976,7 @@ a diff with \\[diff-reverse-direction]." "Turn context diffs into unified diffs if applicable." (if (save-excursion (goto-char (point-min)) - (looking-at "\\*\\*\\* ")) + (and (looking-at diff-hunk-header-re) (eq (char-after) ?*))) (let ((mod (buffer-modified-p))) (unwind-protect (diff-context->unified (point-min) (point-max)) @@ -1239,9 +1248,12 @@ If the prefix arg is bigger than 8 (for example with \\[universal-argument] \\[u (defun diff-current-defun () "Find the name of function at point. For use in `add-log-current-defun-function'." - (destructuring-bind (buf line-offset pos src dst &optional switched) - (diff-find-source-location) - (save-excursion + (save-excursion + (when (looking-at diff-hunk-header-re) + (forward-line 1) + (while (and (looking-at " ") (not (zerop (forward-line 1)))))) + (destructuring-bind (buf line-offset pos src dst &optional switched) + (diff-find-source-location) (beginning-of-line) (or (when (memq (char-after) '(?< ?-)) ;; Cursor is pointing at removed text. This could be a removed diff --git a/lisp/diff.el b/lisp/diff.el index 231130db212..c985b66036e 100644 --- a/lisp/diff.el +++ b/lisp/diff.el @@ -36,7 +36,7 @@ ;;;###autoload (defcustom diff-switches "-c" - "*A string or list of strings specifying switches to be be passed to diff." + "*A string or list of strings specifying switches to be passed to diff." :type '(choice string (repeat string)) :group 'diff) @@ -111,6 +111,7 @@ With prefix arg, prompt for diff switches." ,(shell-quote-argument (or new-alt new))) " ")) (buf (get-buffer-create "*Diff*")) + (thisdir default-directory) proc) (save-excursion (display-buffer buf) @@ -125,6 +126,7 @@ With prefix arg, prompt for diff switches." (diff ',old ',new ',switches ',no-async))) (set (make-local-variable 'diff-old-temp-file) old-alt) (set (make-local-variable 'diff-new-temp-file) new-alt) + (setq default-directory thisdir) (insert command "\n") (if (and (not no-async) (fboundp 'start-process)) (progn diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 0709e0cfe1c..bf7c9c00d18 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -64,7 +64,10 @@ With prefix arg, prompt for second argument SWITCHES, (if default (concat "(default " default ") ") "")) - (dired-current-directory) default t) + (if default + (dired-current-directory) + (dired-dwim-target-directory)) + default t) (if current-prefix-arg (read-string "Options for diff: " (if (stringp diff-switches) @@ -185,6 +188,18 @@ List has a form of (file-name full-file-name (attribute-list))" (file-attributes full-file-name)))) (directory-files dir))) + +(defun dired-touch-initial (files) + "Create initial input value for `touch' command." + (let (initial) + (while files + (let ((current (nth 5 (file-attributes (car files))))) + (if (and initial (not (equal initial current))) + (setq initial (current-time) files nil) + (setq initial current)) + (setq files (cdr files)))) + (format-time-string "%Y%m%d%H%M.%S" initial))) + (defun dired-do-chxxx (attribute-name program op-symbol arg) ;; Change file attributes (mode, group, owner, timestamp) of marked files and ;; refresh their file lines. @@ -196,7 +211,8 @@ List has a form of (file-name full-file-name (attribute-list))" (new-attribute (dired-mark-read-string (concat "Change " attribute-name " of %s to: ") - nil op-symbol arg files)) + (if (eq op-symbol 'touch) (dired-touch-initial files)) + op-symbol arg files)) (operation (concat program " " new-attribute)) failures) (setq failures @@ -239,6 +255,7 @@ This calls chmod, thus symbolic modes like `g+w' are allowed." (error "chown not supported on this system")) (dired-do-chxxx "Owner" dired-chown-program 'chown arg)) +;;;###autoload (defun dired-do-touch (&optional arg) "Change the timestamp of the marked (or next ARG) files. This calls touch." @@ -326,6 +343,7 @@ Uses the shell command coming from variables `lpr-command' and (defvar dired-file-version-alist) +;;;###autoload (defun dired-clean-directory (keep) "Flag numerical backups for deletion. Spares `dired-kept-versions' latest versions, and `kept-old-versions' oldest. @@ -535,6 +553,7 @@ the list of file names explicitly with the FILE-LIST argument." (funcall stuff-it files))))) ;; This is an extra function so that it can be redefined by ange-ftp. +;;;###autoload (defun dired-run-shell-command (command) (let ((handler (find-file-name-handler (directory-file-name default-directory) @@ -789,6 +808,7 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.") ;; None of these keys quit - use C-g for that. )) +;;;###autoload (defun dired-query (qs-var qs-prompt &rest qs-args) ;; Query user and return nil or t. ;; Store answer in symbol VAR (which must initially be bound to nil). @@ -875,13 +895,27 @@ Otherwise, the rule is a compression rule, and compression is done with gzip.") (defun dired-do-redisplay (&optional arg test-for-subdir) "Redisplay all marked (or next ARG) files. If on a subdir line, redisplay that subdirectory. In that case, -a prefix arg lets you edit the `ls' switches used for the new listing." +a prefix arg lets you edit the `ls' switches used for the new listing. + +Dired remembers switches specified with a prefix arg, so that reverting +the buffer will not reset them. However, using `dired-undo' to re-insert +or delete subdirectories can bypass this machinery. Hence, you sometimes +may have to reset some subdirectory switches after a `dired-undo'. +You can reset all subdirectory switches to the default using +\\<dired-mode-map>\\[dired-reset-subdir-switches]. +See Info node `(emacs-xtra)Subdir switches' for more details." ;; Moves point if the next ARG files are redisplayed. (interactive "P\np") (if (and test-for-subdir (dired-get-subdir)) - (dired-insert-subdir - (dired-get-subdir) - (if arg (read-string "Switches for listing: " dired-actual-switches))) + (let* ((dir (dired-get-subdir)) + (switches (cdr (assoc-string dir dired-switches-alist)))) + (dired-insert-subdir + dir + (when arg + (read-string "Switches for listing: " + (or switches + dired-subdir-switches + dired-actual-switches))))) (message "Redisplaying...") ;; message much faster than making dired-map-over-marks show progress (dired-uncache @@ -892,6 +926,12 @@ a prefix arg lets you edit the `ls' switches used for the new listing." arg) (dired-move-to-filename) (message "Redisplaying...done"))) + +(defun dired-reset-subdir-switches () + "Set `dired-switches-alist' to nil and revert dired buffer." + (interactive) + (setq dired-switches-alist nil) + (revert-buffer)) (defun dired-update-file-line (file) ;; Delete the current line, and insert an entry for FILE. @@ -1191,9 +1231,10 @@ Special value `always' suppresses confirmation." (dired-advertise))))) (defun dired-rename-subdir-2 (elt dir to) - ;; Update the headerline and dired-subdir-alist element of directory - ;; described by alist-element ELT to reflect the moving of DIR to TO. - ;; Thus, ELT describes either DIR itself or a subdir of DIR. + ;; Update the headerline and dired-subdir-alist element, as well as + ;; dired-switches-alist element, of directory described by + ;; alist-element ELT to reflect the moving of DIR to TO. Thus, ELT + ;; describes either DIR itself or a subdir of DIR. (save-excursion (let ((regexp (regexp-quote (directory-file-name dir))) (newtext (directory-file-name to)) @@ -1207,10 +1248,12 @@ Special value `always' suppresses confirmation." (if (re-search-forward regexp (match-end 1) t) (replace-match newtext t t) (error "Expected to find `%s' in headerline of %s" dir (car elt)))) - ;; Update buffer-local dired-subdir-alist - (setcar elt - (dired-normalize-subdir - (dired-replace-in-string regexp newtext (car elt))))))) + ;; Update buffer-local dired-subdir-alist and dired-switches-alist + (let ((cons (assoc-string (car elt) dired-switches-alist)) + (cur-dir (dired-normalize-subdir + (dired-replace-in-string regexp newtext (car elt))))) + (setcar elt cur-dir) + (when cons (setcar cons cur-dir)))))) ;; The basic function for half a dozen variations on cp/mv/ln/ln -s. (defun dired-create-files (file-creator operation fn-list name-constructor @@ -1702,11 +1745,20 @@ If it is already present, just move to it (type \\[dired-do-redisplay] to refres With a prefix arg, you may edit the ls switches used for this listing. You can add `R' to the switches to expand the whole tree starting at this subdirectory. -This function takes some pains to conform to `ls -lR' output." +This function takes some pains to conform to `ls -lR' output. + +Dired remembers switches specified with a prefix arg, so that reverting +the buffer will not reset them. However, using `dired-undo' to re-insert +or delete subdirectories can bypass this machinery. Hence, you sometimes +may have to reset some subdirectory switches after a `dired-undo'. +You can reset all subdirectory switches to the default using +\\<dired-mode-map>\\[dired-reset-subdir-switches]. +See Info node `(emacs-xtra)Subdir switches' for more details." (interactive (list (dired-get-filename) (if current-prefix-arg - (read-string "Switches for listing: " dired-actual-switches)))) + (read-string "Switches for listing: " + (or dired-subdir-switches dired-actual-switches))))) (let ((opoint (point))) ;; We don't need a marker for opoint as the subdir is always ;; inserted *after* opoint. @@ -1733,14 +1785,19 @@ This function takes some pains to conform to `ls -lR' output." (interactive (list (dired-get-filename) (if current-prefix-arg - (read-string "Switches for listing: " dired-actual-switches)))) + (read-string "Switches for listing: " + (or dired-subdir-switches dired-actual-switches))))) (setq dirname (file-name-as-directory (expand-file-name dirname))) - (dired-insert-subdir-validate dirname switches) (or no-error-if-not-dir-p (file-directory-p dirname) (error "Attempt to insert a non-directory: %s" dirname)) (let ((elt (assoc dirname dired-subdir-alist)) - switches-have-R mark-alist case-fold-search buffer-read-only) + (cons (assoc-string dirname dired-switches-alist)) + (modflag (buffer-modified-p)) + (old-switches switches) + switches-have-R mark-alist case-fold-search buffer-read-only) + (and (not switches) cons (setq switches (cdr cons))) + (dired-insert-subdir-validate dirname switches) ;; case-fold-search is nil now, so we can test for capital `R': (if (setq switches-have-R (and switches (string-match "R" switches))) ;; avoid duplicated subdirs @@ -1751,9 +1808,23 @@ This function takes some pains to conform to `ls -lR' output." (dired-insert-subdir-newpos dirname)) ; else compute new position (dired-insert-subdir-doupdate dirname elt (dired-insert-subdir-doinsert dirname switches)) - (if switches-have-R (dired-build-subdir-alist switches)) + (when old-switches + (if cons + (setcdr cons switches) + (push (cons dirname switches) dired-switches-alist))) + (when switches-have-R + (dired-build-subdir-alist switches) + (setq switches (dired-replace-in-string "R" "" switches)) + (dolist (cur-ass dired-subdir-alist) + (let ((cur-dir (car cur-ass))) + (and (dired-in-this-tree cur-dir dirname) + (let ((cur-cons (assoc-string cur-dir dired-switches-alist))) + (if cur-cons + (setcdr cur-cons switches) + (push (cons cur-dir switches) dired-switches-alist))))))) (dired-initial-position dirname) - (save-excursion (dired-mark-remembered mark-alist)))) + (save-excursion (dired-mark-remembered mark-alist)) + (restore-buffer-modified-p modflag))) ;; This is a separate function for dired-vms. (defun dired-insert-subdir-validate (dirname &optional switches) @@ -1761,17 +1832,18 @@ This function takes some pains to conform to `ls -lR' output." ;; Signal an error if invalid (e.g. user typed `i' on `..'). (or (dired-in-this-tree dirname (expand-file-name default-directory)) (error "%s: not in this directory tree" dirname)) - (if switches + (let ((real-switches (or switches dired-subdir-switches))) + (when real-switches (let (case-fold-search) (mapcar (function (lambda (x) - (or (eq (null (string-match x switches)) + (or (eq (null (string-match x real-switches)) (null (string-match x dired-actual-switches))) - (error "Can't have dirs with and without -%s switches together" - x)))) + (error + "Can't have dirs with and without -%s switches together" x)))) ;; all switches that make a difference to dired-get-filename: - '("F" "b"))))) + '("F" "b")))))) (defun dired-alist-add (dir new-marker) ;; Add new DIR at NEW-MARKER. Sort alist. @@ -1786,19 +1858,23 @@ This function takes some pains to conform to `ls -lR' output." (> (dired-get-subdir-min elt1) (dired-get-subdir-min elt2))))))) -(defun dired-kill-tree (dirname &optional remember-marks) +(defun dired-kill-tree (dirname &optional remember-marks kill-root) "Kill all proper subdirs of DIRNAME, excluding DIRNAME itself. -With optional arg REMEMBER-MARKS, return an alist of marked files." - (interactive "DKill tree below directory: ") - (setq dirname (expand-file-name dirname)) +Interactively, you can kill DIRNAME as well by using a prefix argument. +In interactive use, the command prompts for DIRNAME. + +When called from Lisp, if REMEMBER-MARKS is non-nil, return an alist +of marked files. If KILL-ROOT is non-nil, kill DIRNAME as well." + (interactive "DKill tree below directory: \ni\nP") + (setq dirname (file-name-as-directory (expand-file-name dirname))) (let ((s-alist dired-subdir-alist) dir m-alist) (while s-alist (setq dir (car (car s-alist)) s-alist (cdr s-alist)) - (if (and (not (string-equal dir dirname)) - (dired-in-this-tree dir dirname) - (dired-goto-subdir dir)) - (setq m-alist (nconc (dired-kill-subdir remember-marks) m-alist)))) + (and (or kill-root (not (string-equal dir dirname))) + (dired-in-this-tree dir dirname) + (dired-goto-subdir dir) + (setq m-alist (nconc (dired-kill-subdir remember-marks) m-alist)))) m-alist)) (defun dired-insert-subdir-newpos (new-dir) @@ -1839,16 +1915,15 @@ With optional arg REMEMBER-MARKS, return an alist of marked files." ;; Return the boundary of the inserted text (as list of BEG and END). (save-excursion (let ((begin (point))) - (message "Reading directory %s..." dirname) (let ((dired-actual-switches (or switches + dired-subdir-switches (dired-replace-in-string "R" "" dired-actual-switches)))) (if (equal dirname (car (car (last dired-subdir-alist)))) ;; If doing the top level directory of the buffer, ;; redo it as specified in dired-directory. (dired-readin-insert) (dired-insert-directory dirname dired-actual-switches nil nil t))) - (message "Reading directory %s...done" dirname) (list begin (point))))) (defun dired-insert-subdir-doupdate (dirname elt beg-end) @@ -1991,10 +2066,12 @@ marks the files listed in the subdirectory that point is in." Lower levels are unaffected." ;; With optional REMEMBER-MARKS, return a mark-alist. (interactive) - (let ((beg (dired-subdir-min)) - (end (dired-subdir-max)) - buffer-read-only cur-dir) - (setq cur-dir (dired-current-directory)) + (let* ((beg (dired-subdir-min)) + (end (dired-subdir-max)) + (modflag (buffer-modified-p)) + (cur-dir (dired-current-directory)) + (cons (assoc-string cur-dir dired-switches-alist)) + buffer-read-only) (if (equal cur-dir default-directory) (error "Attempt to kill top level directory")) (prog1 @@ -2002,7 +2079,10 @@ Lower levels are unaffected." (delete-region beg end) (if (eobp) ; don't leave final blank line (delete-char -1)) - (dired-unsubdir cur-dir)))) + (dired-unsubdir cur-dir) + (when cons + (setq dired-switches-alist (delete cons dired-switches-alist))) + (restore-buffer-modified-p modflag)))) (defun dired-unsubdir (dir) ;; Remove DIR from the alist @@ -2061,19 +2141,21 @@ Optional prefix arg is a repeat factor. Use \\[dired-hide-all] to (un)hide all directories." (interactive "p") (dired-hide-check) - (while (>= (setq arg (1- arg)) 0) - (let* ((cur-dir (dired-current-directory)) - (hidden-p (dired-subdir-hidden-p cur-dir)) - (elt (assoc cur-dir dired-subdir-alist)) - (end-pos (1- (dired-get-subdir-max elt))) - buffer-read-only) - ;; keep header line visible, hide rest - (goto-char (dired-get-subdir-min elt)) - (skip-chars-forward "^\n\r") - (if hidden-p - (subst-char-in-region (point) end-pos ?\r ?\n) - (subst-char-in-region (point) end-pos ?\n ?\r))) - (dired-next-subdir 1 t))) + (let ((modflag (buffer-modified-p))) + (while (>= (setq arg (1- arg)) 0) + (let* ((cur-dir (dired-current-directory)) + (hidden-p (dired-subdir-hidden-p cur-dir)) + (elt (assoc cur-dir dired-subdir-alist)) + (end-pos (1- (dired-get-subdir-max elt))) + buffer-read-only) + ;; keep header line visible, hide rest + (goto-char (dired-get-subdir-min elt)) + (skip-chars-forward "^\n\r") + (if hidden-p + (subst-char-in-region (point) end-pos ?\r ?\n) + (subst-char-in-region (point) end-pos ?\n ?\r))) + (dired-next-subdir 1 t)) + (restore-buffer-modified-p modflag))) ;;;###autoload (defun dired-hide-all (arg) @@ -2082,7 +2164,8 @@ If there is already something hidden, make everything visible again. Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." (interactive "P") (dired-hide-check) - (let (buffer-read-only) + (let ((modflag (buffer-modified-p)) + buffer-read-only) (if (save-excursion (goto-char (point-min)) (search-forward "\r" nil t)) @@ -2091,7 +2174,7 @@ Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." ;; hide (let ((pos (point-max)) ; pos of end of last directory (alist dired-subdir-alist)) - (while alist ; while there are dirs before pos + (while alist ; while there are dirs before pos (subst-char-in-region (dired-get-subdir-min (car alist)) ; pos of prev dir (save-excursion (goto-char pos) ; current dir @@ -2100,7 +2183,8 @@ Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." (point)) ?\n ?\r) (setq pos (dired-get-subdir-min (car alist))) ; prev dir gets current dir - (setq alist (cdr alist))))))) + (setq alist (cdr alist))))) + (restore-buffer-modified-p modflag))) ;;;###end dired-ins.el diff --git a/lisp/dired-x.el b/lisp/dired-x.el index 21fe4902e58..6b44b73b170 100644 --- a/lisp/dired-x.el +++ b/lisp/dired-x.el @@ -50,7 +50,7 @@ ;; (add-hook 'dired-mode-hook ;; (function (lambda () ;; ;; Set buffer-local variables here. For example: -;; ;; (setq dired-omit-files-p t) +;; ;; (dired-omit-mode 1) ;; ))) ;; ;; At load time dired-x.el will install itself, redefine some functions, and @@ -74,7 +74,7 @@ ;; dired-guess-shell-znew-switches ;; dired-guess-shell-alist-user ;; dired-clean-up-buffers-too -;; dired-omit-files-p +;; dired-omit-mode ;; dired-omit-files ;; dired-omit-extensions ;; dired-omit-size-limit @@ -154,19 +154,27 @@ Read-only folders only work in VM 5, not in VM 4." (other :tag "non-writable only" if-file-read-only)) :group 'dired-x) -(defcustom dired-omit-files-p nil - "*If non-nil, \"uninteresting\" files are not listed (buffer-local). -Use \\[dired-omit-toggle] to toggle its value. +(define-minor-mode dired-omit-mode + "Toggle Dired-Omit mode. +With numeric ARG, enable Dired-Omit mode if ARG is positive, disable +otherwise. Enabling and disabling is buffer-local. +If enabled, \"uninteresting\" files are not listed. Uninteresting files are those whose filenames match regexp `dired-omit-files', plus those ending with extensions in `dired-omit-extensions'." - :type 'boolean - :group 'dired-x) -(make-variable-buffer-local 'dired-omit-files-p) + :group 'dired-x + (if dired-omit-mode + ;; This will mention how many lines were omitted: + (let ((dired-omit-size-limit nil)) (dired-omit-expunge)) + (revert-buffer))) + +;; For backward compatibility +(defvaralias 'dired-omit-files-p 'dired-omit-mode) +(make-obsolete-variable 'dired-omit-files-p 'dired-omit-mode) (defcustom dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.$" "*Filenames matching this regexp will not be displayed. -This only has effect when `dired-omit-files-p' is t. See interactive function -`dired-omit-toggle' \(\\[dired-omit-toggle]\) and variable +This only has effect when `dired-omit-mode' is t. See interactive function +`dired-omit-mode' \(\\[dired-omit-mode]\) and variable `dired-omit-extensions'. The default is to omit `.', `..', auto-save files and lock files." :type 'regexp @@ -230,7 +238,8 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used." ;;; KEY BINDINGS. -(define-key dired-mode-map "\M-o" 'dired-omit-toggle) +(define-key dired-mode-map "\M-o" 'dired-omit-mode) +(define-key dired-mode-map "*O" 'dired-mark-omitted) (define-key dired-mode-map "\M-(" 'dired-mark-sexp) (define-key dired-mode-map "*(" 'dired-mark-sexp) (define-key dired-mode-map "*." 'dired-mark-extension) @@ -268,7 +277,7 @@ to nil: a pipe using `zcat' or `gunzip -c' will be used." \\[dired-info]\t-- run info on file \\[dired-man]\t-- run man on file \\[dired-do-find-marked-files]\t-- visit all marked files simultaneously - \\[dired-omit-toggle]\t-- toggle omitting of files + \\[dired-omit-mode]\t-- toggle omitting of files \\[dired-mark-sexp]\t-- mark by Lisp expression \\[dired-copy-filename-as-kill]\t-- copy the file or subdir names into the kill ring. \t You can feed it to other commands using \\[yank]. @@ -280,7 +289,7 @@ For more features, see variables `dired-bind-info' `dired-bind-man' `dired-vm-read-only-folders' - `dired-omit-files-p' + `dired-omit-mode' `dired-omit-files' `dired-omit-extensions' `dired-omit-size-limit' @@ -450,9 +459,9 @@ buffer and try again." (dired-insert-subdir (file-name-directory file)) (dired-goto-file file)) ;; Toggle omitting, if it is on, and try again. - (if dired-omit-files-p + (if dired-omit-mode (progn - (dired-omit-toggle) + (dired-omit-mode) (dired-goto-file file)))))))) (defun dired-jump-other-window () @@ -479,31 +488,18 @@ need to match the entire file name.") Should never be used as marker by the user or other packages.") (defun dired-omit-startup () - (or (assq 'dired-omit-files-p minor-mode-alist) + (or (assq 'dired-omit-mode minor-mode-alist) (setq minor-mode-alist - (append '((dired-omit-files-p + (append '((dired-omit-mode (:eval (if (eq major-mode 'dired-mode) " Omit" "")))) minor-mode-alist)))) -(defun dired-omit-toggle (&optional flag) - "Toggle omitting files matching `dired-omit-files' and `dired-omit-extensions'. -With an arg, and if omitting was off, don't toggle and just mark the - files but don't actually omit them. -With an arg, and if omitting was on, turn it off but don't refresh the buffer." - (interactive "P") - (if flag - (if dired-omit-files-p - (setq dired-omit-files-p (not dired-omit-files-p)) - (dired-mark-unmarked-files (dired-omit-regexp) nil nil - dired-omit-localp)) - ;; no FLAG - (setq dired-omit-files-p (not dired-omit-files-p)) - (if (not dired-omit-files-p) - (revert-buffer) - ;; this will mention how many were omitted: - (let ((dired-omit-size-limit nil)) - (dired-omit-expunge))))) +(defun dired-mark-omitted () + "Mark files matching `dired-omit-files' and `dired-omit-extensions'." + (interactive) + (let ((dired-omit-mode nil)) (revert-buffer)) ;; Show omitted files + (dired-mark-unmarked-files (dired-omit-regexp) nil nil dired-omit-localp)) (defvar dired-omit-extensions (append completion-ignored-extensions @@ -515,12 +511,12 @@ Defaults to elements of `completion-ignored-extensions', `dired-latex-unclean-extensions', `dired-bibtex-unclean-extensions', and `dired-texinfo-unclean-extensions'. -See interactive function `dired-omit-toggle' \(\\[dired-omit-toggle]\) and -variables `dired-omit-files-p' and `dired-omit-files'.") +See interactive function `dired-omit-mode' \(\\[dired-omit-mode]\) and +variables `dired-omit-mode' and `dired-omit-files'.") (defun dired-omit-expunge (&optional regexp) "Erases all unmarked files matching REGEXP. -Does nothing if global variable `dired-omit-files-p' is nil, or if called +Does nothing if global variable `dired-omit-mode' is nil, or if called non-interactively and buffer is bigger than `dired-omit-size-limit'. If REGEXP is nil or not specified, uses `dired-omit-files', and also omits filenames ending in `dired-omit-extensions'. @@ -529,14 +525,14 @@ If REGEXP is the empty string, this function is a no-op. This functions works by temporarily binding `dired-marker-char' to `dired-omit-marker-char' and calling `dired-do-kill-lines'." (interactive "sOmit files (regexp): ") - (if (and dired-omit-files-p + (if (and dired-omit-mode (or (interactive-p) (not dired-omit-size-limit) (< (buffer-size) dired-omit-size-limit) (progn (message "Not omitting: directory larger than %d characters." dired-omit-size-limit) - (setq dired-omit-files-p nil) + (setq dired-omit-mode nil) nil))) (let ((omit-re (or regexp (dired-omit-regexp))) (old-modified-p (buffer-modified-p)) @@ -589,7 +585,7 @@ Second optional argument LOCALP is as in `dired-get-filename'." (defun dired-omit-new-add-entry (filename &optional marker-char relative) ;; This redefines dired-aux.el's dired-add-entry to avoid calling ls for ;; files that are going to be omitted anyway. - (if dired-omit-files-p + (if dired-omit-mode ;; perhaps return t without calling ls (let ((omit-re (dired-omit-regexp))) (if (or (string= omit-re "") @@ -842,7 +838,7 @@ dired." (save-excursion (set-buffer (get-buffer-create " *dot-dired*")) (erase-buffer) - (insert "Local Variables:\ndired-omit-files-p: t\nEnd:\n") + (insert "Local Variables:\ndired-omit-mode: t\nEnd:\n") (write-file dired-local-variables-file) (kill-buffer (current-buffer))) @@ -1692,7 +1688,7 @@ If `current-prefix-arg' is non-nil, uses name at point as guess." 'dired-guess-shell-znew-switches 'dired-guess-shell-alist-user 'dired-clean-up-buffers-too - 'dired-omit-files-p + 'dired-omit-mode 'dired-omit-files 'dired-omit-extensions ) diff --git a/lisp/dired.el b/lisp/dired.el index f562a0492eb..e5e23dfe2d6 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -60,6 +60,10 @@ some of the `ls' switches are not supported; see the doc string of :type 'string :group 'dired) +(defvar dired-subdir-switches nil + "If non-nil, switches passed to `ls' for inserting subdirectories. +If nil, `dired-listing-switches' is used.") + ; Don't use absolute file names as /bin should be in any PATH and people ; may prefer /usr/local/gnu/bin or whatever. However, chown is ; usually not in PATH. @@ -274,13 +278,18 @@ The directory name must be absolute, but need not be fully expanded.") (defvar dired-re-perms "[-bcdlps][-r][-w].[-r][-w].[-r][-w].") (defvar dired-re-dot "^.* \\.\\.?/?$") -;; The subdirectory names in this list are expanded. +;; The subdirectory names in the next two lists are expanded. (defvar dired-subdir-alist nil "Association list of subdirectories and their buffer positions. Each subdirectory has an element: (DIRNAME . STARTMARKER). The order of elements is the reverse of the order in the buffer. In simple cases, this list contains one element.") +(defvar dired-switches-alist nil + "Keeps track of which switches to use for inserted subdirectories. +This is an alist of the form (SUBDIR . SWITCHES).") +(make-variable-buffer-local 'dired-switches-alist) + (defvar dired-subdir-regexp "^. \\([^\n\r]+\\)\\(:\\)[\n\r]" "Regexp matching a maybe hidden subdirectory line in `ls -lR' output. Subexpression 1 is the subdirectory proper, no trailing colon. @@ -871,7 +880,8 @@ Must also be called after dired-actual-switches have changed. Should not fail even on completely garbaged buffers. Preserves old cursor, marks/flags, hidden-p." (widen) ; just in case user narrowed - (let ((opoint (point)) + (let ((modflag (buffer-modified-p)) + (opoint (point)) (ofile (dired-get-filename nil t)) (mark-alist nil) ; save marked files (hidden-subdirs (dired-remember-hidden)) @@ -898,9 +908,10 @@ Preserves old cursor, marks/flags, hidden-p." (save-excursion ; hide subdirs that were hidden (dolist (dir hidden-subdirs) (if (dired-goto-subdir dir) - (dired-hide-subdir 1))))) + (dired-hide-subdir 1)))) + (unless modflag (restore-buffer-modified-p nil))) ;; outside of the let scope -;;; Might as well not override the user if the user changed this. +;;; Might as well not override the user if the user changed this. ;;; (setq buffer-read-only t) ) @@ -1160,6 +1171,8 @@ Do so according to the former subdir alist OLD-SUBDIR-ALIST." :help "Edit file at cursor")) (define-key map [menu-bar immediate create-directory] '(menu-item "Create Directory..." dired-create-directory)) + (define-key map [menu-bar immediate wdired-mode] + '(menu-item "Edit File Names" wdired-change-to-wdired-mode)) (define-key map [menu-bar regexp] (cons "Regexp" (make-sparse-keymap "Regexp"))) @@ -1402,6 +1415,9 @@ Keybindings: (or switches dired-listing-switches)) (set (make-local-variable 'font-lock-defaults) '(dired-font-lock-keywords t nil nil beginning-of-line)) + (set (make-local-variable 'desktop-save-buffer) + 'dired-desktop-buffer-misc-data) + (setq dired-switches-alist nil) (dired-sort-other dired-actual-switches t) (run-mode-hooks 'dired-mode-hook) (when (featurep 'x-dnd) @@ -1427,14 +1443,13 @@ Keybindings: (defun dired-undo () "Undo in a dired buffer. This doesn't recover lost files, it just undoes changes in the buffer itself. -You can use it to recover marks, killed lines or subdirs. -In the latter case, you have to do \\[dired-build-subdir-alist] to -parse the buffer again." +You can use it to recover marks, killed lines or subdirs." (interactive) (let (buffer-read-only) - (undo) - (message "Change in Dired buffer undone. -Actual changes in files cannot be undone by Emacs."))) + (undo)) + (dired-build-subdir-alist) + (message "Change in Dired buffer undone. +Actual changes in files cannot be undone by Emacs.")) (defun dired-next-line (arg) "Move down lines then position at filename. @@ -1630,9 +1645,7 @@ Otherwise, an error occurs in these cases." ((eq localp 'verbatim) file) ((and (not no-error-if-not-filep) - (save-excursion - (beginning-of-line) - (looking-at dired-re-dot))) + (member file '("." ".."))) (error "Cannot operate on `.' or `..'")) ((and (eq localp 'no-dir) already-absolute) (file-name-nondirectory file)) @@ -1696,7 +1709,7 @@ DIR must be a directory name, not a file name." (setq dir (expand-file-name dir))) (if (string-match (concat "^" (regexp-quote dir)) file) (substring file (match-end 0)) -;;; (or no-error +;;; (or no-error ;;; (error "%s: not in directory tree growing at %s" file dir)) file)) @@ -2071,7 +2084,7 @@ instead of `dired-actual-switches'." (goto-char (match-beginning 0)) (beginning-of-line) (point-marker)))) - (if (> count 1) + (if (and (> count 1) (interactive-p)) (message "Buffer includes %d directories" count)) ;; We don't need to sort it because it is in buffer order per ;; constructionem. Return new alist: @@ -3018,244 +3031,6 @@ To be called first in body of `dired-sort-other', etc." ;; listing: (list (car (reverse dired-subdir-alist)))))))) -;; To make this file smaller, the less common commands -;; go in a separate file. But autoload them here -;; to make the separation invisible. - -(autoload 'dired-diff "dired-aux" - "Compare file at point with file FILE using `diff'. -FILE defaults to the file at the mark. (That's the mark set by -\\[set-mark-command], not by Dired's \\[dired-mark] command.) -The prompted-for file is the first file given to `diff'." - t) - -(autoload 'dired-backup-diff "dired-aux" - "Diff this file with its backup file or vice versa. -Uses the latest backup, if there are several numerical backups. -If this file is a backup, diff it with its original. -The backup file is the first file given to `diff'." - t) - -(autoload 'dired-clean-directory "dired-aux" - "Flag numerical backups for deletion. -Spares `dired-kept-versions' latest versions, and `kept-old-versions' oldest. -Positive prefix arg KEEP overrides `dired-kept-versions'; -Negative prefix arg KEEP overrides `kept-old-versions' with KEEP made positive. - -To clear the flags on these files, you can use \\[dired-flag-backup-files] -with a prefix argument." - t) - -(autoload 'dired-do-chmod "dired-aux" - "Change the mode of the marked (or next ARG) files. -This calls chmod, thus symbolic modes like `g+w' are allowed." - t) - -(autoload 'dired-do-chgrp "dired-aux" - "Change the group of the marked (or next ARG) files." - t) - -(autoload 'dired-do-chown "dired-aux" - "Change the owner of the marked (or next ARG) files." - t) - -(autoload 'dired-do-touch "dired-aux" - "Change the timestamp of the marked (or next ARG) files." - t) - -(autoload 'dired-do-print "dired-aux" - "Print the marked (or next ARG) files. -Uses the shell command coming from variables `lpr-command' and -`lpr-switches' as default." - t) - -(autoload 'dired-do-shell-command "dired-aux" - "Run a shell command COMMAND on the marked files. -If no files are marked or a specific numeric prefix arg is given, -the next ARG files are used. Just \\[universal-argument] means the current file. -The prompt mentions the file(s) or the marker, as appropriate. - -If there is a `*' in COMMAND, surrounded by whitespace, this runs -COMMAND just once with the entire file list substituted there. - -If there is no `*', but there is a `?' in COMMAND, surrounded by -whitespace, this runs COMMAND on each file individually with the -file name substituted for `?'. - -Otherwise, this runs COMMAND on each file individually with the -file name added at the end of COMMAND (separated by a space). - -`*' and `?' when not surrounded by whitespace have no special -significance for `dired-do-shell-command', and are passed through -normally to the shell, but you must confirm first. To pass `*' by -itself to the shell as a wildcard, type `*\"\"'. - -If COMMAND produces output, it goes to a separate buffer. - -This feature does not try to redisplay Dired buffers afterward, as -there's no telling what files COMMAND may have changed. -Type \\[dired-do-redisplay] to redisplay the marked files. - -When COMMAND runs, its working directory is the top-level directory of -the Dired buffer, so output files usually are created there instead of -in a subdir. - -In a noninteractive call (from Lisp code), you must specify -the list of file names explicitly with the FILE-LIST argument." - t) - -(autoload 'dired-do-kill-lines "dired-aux" - "Kill all marked lines (not the files). -With a prefix arg, kill all lines not marked or flagged." - t) - -(autoload 'dired-do-compress "dired-aux" - "Compress or uncompress marked (or next ARG) files." - t) - -(autoload 'dired-do-byte-compile "dired-aux" - "Byte compile marked (or next ARG) Emacs Lisp files." - t) - -(autoload 'dired-do-load "dired-aux" - "Load the marked (or next ARG) Emacs Lisp files." - t) - -(autoload 'dired-do-redisplay "dired-aux" - "Redisplay all marked (or next ARG) files. -If on a subdir line, redisplay that subdirectory. In that case, -a prefix arg lets you edit the `ls' switches used for the new listing." - t) - -(autoload 'dired-create-directory "dired-aux" - "Create a directory called DIRECTORY." - t) - -(autoload 'dired-do-copy "dired-aux" - "Copy all marked (or next ARG) files, or copy the current file. -Thus, a zero prefix argument copies nothing. But it toggles the -variable `dired-copy-preserve-time' (which see)." - t) - -(autoload 'dired-do-symlink "dired-aux" - "Make symbolic links to current file or all marked (or next ARG) files. -When operating on just the current file, you specify the new name. -When operating on multiple or marked files, you specify a directory -and new symbolic links are made in that directory -with the same names that the files currently have." - t) - -(autoload 'dired-do-hardlink "dired-aux" - "Add names (hard links) current file or all marked (or next ARG) files. -When operating on just the current file, you specify the new name. -When operating on multiple or marked files, you specify a directory -and new hard links are made in that directory -with the same names that the files currently have." - t) - -(autoload 'dired-do-rename "dired-aux" - "Rename current file or all marked (or next ARG) files. -When renaming just the current file, you specify the new name. -When renaming multiple or marked files, you specify a directory." - t) - -(autoload 'dired-do-rename-regexp "dired-aux" - "Rename marked files containing REGEXP to NEWNAME. -As each match is found, the user must type a character saying - what to do with it. For directions, type \\[help-command] at that time. -NEWNAME may contain \\=\\<n> or \\& as in `query-replace-regexp'. -REGEXP defaults to the last regexp used. -With a zero prefix arg, renaming by regexp affects the full file name; -usually only the non-directory part of file names is used and changed." - t) - -(autoload 'dired-do-copy-regexp "dired-aux" - "Copy all marked files containing REGEXP to NEWNAME. -See function `dired-do-rename-regexp' for more info." - t) - -(autoload 'dired-do-hardlink-regexp "dired-aux" - "Hardlink all marked files containing REGEXP to NEWNAME. -See function `dired-do-rename-regexp' for more info." - t) - -(autoload 'dired-do-symlink-regexp "dired-aux" - "Symlink all marked files containing REGEXP to NEWNAME. -See function `dired-do-rename-regexp' for more info." - t) - -(autoload 'dired-upcase "dired-aux" - "Rename all marked (or next ARG) files to upper case." - t) - -(autoload 'dired-downcase "dired-aux" - "Rename all marked (or next ARG) files to lower case." - t) - -(autoload 'dired-maybe-insert-subdir "dired-aux" - "Insert this subdirectory into the same dired buffer. -If it is already present, just move to it (type \\[dired-do-redisplay] to refresh), - else inserts it at its natural place (as `ls -lR' would have done). -With a prefix arg, you may edit the ls switches used for this listing. - You can add `R' to the switches to expand the whole tree starting at - this subdirectory. -This function takes some pains to conform to `ls -lR' output." - t) - -(autoload 'dired-next-subdir "dired-aux" - "Go to next subdirectory, regardless of level." - t) - -(autoload 'dired-prev-subdir "dired-aux" - "Go to previous subdirectory, regardless of level. -When called interactively and not on a subdir line, go to this subdir's line." - t) - -(autoload 'dired-goto-subdir "dired-aux" - "Go to end of header line of DIR in this dired buffer. -Return value of point on success, otherwise return nil. -The next char is either \\n, or \\r if DIR is hidden." - t) - -(autoload 'dired-mark-subdir-files "dired-aux" - "Mark all files except `.' and `..'." - t) - -(autoload 'dired-kill-subdir "dired-aux" - "Remove all lines of current subdirectory. -Lower levels are unaffected." - t) - -(autoload 'dired-tree-up "dired-aux" - "Go up ARG levels in the dired tree." - t) - -(autoload 'dired-tree-down "dired-aux" - "Go down in the dired tree." - t) - -(autoload 'dired-hide-subdir "dired-aux" - "Hide or unhide the current subdirectory and move to next directory. -Optional prefix arg is a repeat factor. -Use \\[dired-hide-all] to (un)hide all directories." - t) - -(autoload 'dired-hide-all "dired-aux" - "Hide all subdirectories, leaving only their header lines. -If there is already something hidden, make everything visible again. -Use \\[dired-hide-subdir] to (un)hide a particular subdirectory." - t) - -(autoload 'dired-show-file-type "dired-aux" - "Print the type of FILE, according to the `file' command. -If FILE is a symbolic link and the optional argument DEREF-SYMLINKS is -true then the type of the file linked to by FILE is printed instead." - t) - -(autoload 'dired-run-shell-command "dired-aux") - -(autoload 'dired-query "dired-aux") - ;;;; Drag and drop support @@ -3272,16 +3047,16 @@ types in `x-dnd-known-types'. It returns the action suggested by the source." nil))) (defun dired-dnd-popup-notice () - (x-popup-dialog + (x-popup-dialog t - '("Recursive copies not enabled.\nSee variable dired-recursive-copies." + '("Recursive copies not enabled.\nSee variable dired-recursive-copies." ("Ok" . nil)))) (defun dired-dnd-do-ask-action (uri) ;; No need to get actions and descriptions from the source, ;; we only have three actions anyway. - (let ((action (x-popup-menu + (let ((action (x-popup-menu t (list "What action?" (cons "" @@ -3340,7 +3115,49 @@ Ask means pop up a menu for the user to select one of copy, move or link." (let ((local-file (x-dnd-get-local-file-uri uri))) (if local-file (dired-dnd-handle-local-file local-file action) nil))) + + +;;;; Desktop support + +(eval-when-compile (require 'desktop)) + +(defun dired-desktop-buffer-misc-data (desktop-dirname) + "Auxiliary information to be saved in desktop file." + (cons + ;; Value of `dired-directory'. + (if (consp dired-directory) + ;; Directory name followed by list of files. + (cons (desktop-file-name (car dired-directory) desktop-dirname) + (cdr dired-directory)) + ;; Directory name, optionally with with shell wildcard. + (desktop-file-name dired-directory desktop-dirname)) + ;; Subdirectories in `dired-subdir-alist'. + (cdr + (nreverse + (mapcar + (function (lambda (f) (desktop-file-name (car f) desktop-dirname))) + dired-subdir-alist))))) +;;;###autoload +(defun dired-restore-desktop-buffer (desktop-buffer-file-name + desktop-buffer-name + desktop-buffer-misc) + "Restore a dired buffer specified in a desktop file." + ;; First element of `desktop-buffer-misc' is the value of `dired-directory'. + ;; This value is a directory name, optionally with with shell wildcard or + ;; a directory name followed by list of files. + (let* ((dired-dir (car desktop-buffer-misc)) + (dir (if (consp dired-dir) (car dired-dir) dired-dir))) + (if (file-directory-p (file-name-directory dir)) + (progn + (dired dired-dir) + ;; The following elements of `desktop-buffer-misc' are the keys + ;; from `dired-subdir-alist'. + (mapcar 'dired-maybe-insert-subdir (cdr desktop-buffer-misc)) + (current-buffer)) + (message "Desktop: Directory %s no longer exists." dir) + (when desktop-missing-file-warning (sit-for 1)) + nil))) (if (eq system-type 'vax-vms) diff --git a/lisp/dos-fns.el b/lisp/dos-fns.el index 65b6c0063c0..1253b7b5811 100644 --- a/lisp/dos-fns.el +++ b/lisp/dos-fns.el @@ -31,9 +31,13 @@ ;; This overrides a trivial definition in files.el. (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the current OS. -This function's standard definition is trivial; it just returns the argument. -However, on some systems, the function is redefined -with a definition that really does change some file names." +This means to guarantee valid names and perhaps to canonicalize +certain patterns. + +On Windows and DOS, replace invalid characters. On DOS, make +sure to obey the 8.3 limitations. On Windows, turn Cygwin names +into native names, and also turn slashes into backslashes if the +shell requires it (see `w32-shell-dos-semantics')." (if (or (not (stringp filename)) ;; This catches the case where FILENAME is "x:" or "x:/" or ;; "/", thus preventing infinite recursion. diff --git a/lisp/ediff.el b/lisp/ediff.el index 78ea48f4a1c..c98974923f1 100644 --- a/lisp/ediff.el +++ b/lisp/ediff.el @@ -1474,6 +1474,53 @@ With optional NODE, goes to that node." (set-window-buffer ctl-window ctl-buf))))))) +(dolist (mess '("^Errors in diff output. Diff output is in " + "^Hmm... I don't see an Ediff command around here...$" + "^Undocumented command! Type `G' in Ediff Control Panel to drop a note to the Ediff maintainer$" + ": This command runs in Ediff Control Buffer only!$" + ": Invalid op in ediff-check-version$" + "^ediff-shrink-window-C can be used only for merging jobs$" + "^Lost difference info on these directories$" + "^This command is inapplicable in the present context$" + "^This session group has no parent$" + "^Can't hide active session, $" + "^Ediff: something wrong--no multiple diffs buffer$" + "^Can't make context diff for Session $" + "^The patch buffer wasn't found$" + "^Aborted$" + "^This Ediff session is not part of a session group$" + "^No active Ediff sessions or corrupted session registry$" + "^No session info in this line$" + "^`.*' is not an ordinary file$" + "^Patch appears to have failed$" + "^Recomputation of differences cancelled$" + "^No fine differences in this mode$" + "^Lost connection to ancestor buffer...sorry$" + "^Not merging with ancestor$" + "^Don't know how to toggle read-only in buffer " + "Emacs is not running as a window application$" + "^This command makes sense only when merging with an ancestor$" + "^At end of the difference list$" + "^At beginning of the difference list$" + "^Nothing saved for diff .* in buffer " + "^Buffer is out of sync for file " + "^Buffer out of sync for file " + "^Output from `diff' not found$" + "^You forgot to specify a region in buffer " + "^All right. Make up your mind and come back...$" + "^Current buffer is not visiting any file$" + "^Failed to retrieve revision: $" + "^Can't determine display width.$" + "^File `.*' does not exist or is not readable$" + "^File `.*' is a directory$" + "^Buffer .* doesn't exist$" + "^Directories . and . are the same: " + "^Directory merge aborted$" + "^Merge of directory revisions aborted$" + "^Buffer .* doesn't exist$" + "^There is no file to merge$" + "^Version control package .*.el not found. Use vc.el instead$")) + (add-to-list 'debug-ignored-errors mess)) ;;; Local Variables: diff --git a/lisp/ehelp.el b/lisp/ehelp.el index 12ebbeb0c0d..e80c129d3ea 100644 --- a/lisp/ehelp.el +++ b/lisp/ehelp.el @@ -1,6 +1,6 @@ ;;; ehelp.el --- bindings for electric-help mode -;; Copyright (C) 1986, 1995, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1986, 1995, 2000, 2001, 2004 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: help, extensions @@ -200,13 +200,13 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit." (progn (setq unread-command-events nil) (throw 'exit t))))) (let (up down both neither - (standard (and (eq (key-binding " ") + (standard (and (eq (key-binding " " nil t) 'scroll-up) - (eq (key-binding "\^?") + (eq (key-binding "\^?" nil t) 'scroll-down) - (eq (key-binding "q") + (eq (key-binding "q" nil t) 'electric-help-exit) - (eq (key-binding "r") + (eq (key-binding "r" nil t) 'electric-help-retain)))) (Electric-command-loop 'exit @@ -215,7 +215,7 @@ BUFFER is put into `default-major-mode' (or `fundamental-mode') when we exit." ;beginning-of-buffer - otherwise pos-visible-in-window-p ;will yield a wrong result. (let ((min (pos-visible-in-window-p (point-min))) - (max (pos-visible-in-window-p (point-max)))) + (max (pos-visible-in-window-p (1- (point-max))))) (cond (isearch-mode 'noprompt) ((and min max) (cond (standard "Press q to exit, r to retain ") @@ -272,7 +272,7 @@ will select it.)" (interactive) (error "%s is undefined -- Press %s to exit" (mapconcat 'single-key-description (this-command-keys) " ") - (if (eq (key-binding "q") 'electric-help-exit) + (if (eq (key-binding "q" nil t) 'electric-help-exit) "q" (substitute-command-keys "\\[electric-help-exit]")))) @@ -280,10 +280,10 @@ will select it.)" ;>>> this needs to be hairified (recursive help, anybody?) (defun electric-help-help () (interactive) - (if (and (eq (key-binding "q") 'electric-help-exit) - (eq (key-binding " ") 'scroll-up) - (eq (key-binding "\^?") 'scroll-down) - (eq (key-binding "r") 'electric-help-retain)) + (if (and (eq (key-binding "q" nil t) 'electric-help-exit) + (eq (key-binding " " nil t) 'scroll-up) + (eq (key-binding "\^?" nil t) 'scroll-down) + (eq (key-binding "r" nil t) 'electric-help-retain)) (message "SPC scrolls up, DEL scrolls down, q exits burying help buffer, r exits") (message "%s" (substitute-command-keys "\\[scroll-up] scrolls up, \\[scroll-down] scrolls down, \\[electric-help-exit] exits burying help buffer, \\[electric-help-retain] exits"))) (sit-for 2)) diff --git a/lisp/emacs-lisp/autoload.el b/lisp/emacs-lisp/autoload.el index 43da3d09827..21843c9601d 100644 --- a/lisp/emacs-lisp/autoload.el +++ b/lisp/emacs-lisp/autoload.el @@ -1,6 +1,6 @@ ;; autoload.el --- maintain autoloads in loaddefs.el -;; Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2003 +;; Copyright (C) 1991,92,93,94,95,96,97, 2001,02,03,04 ;; Free Software Foundation, Inc. ;; Author: Roland McGrath <roland@gnu.org> @@ -407,7 +407,7 @@ Return FILE if there was no autoload cookie in it." (if (and (or (null existing-buffer) (not (buffer-modified-p existing-buffer))) (listp last-time) (= (length last-time) 2) - (not (autoload-before-p last-time file-time))) + (not (time-less-p last-time file-time))) (progn (if (interactive-p) (message "\ @@ -468,11 +468,6 @@ Autoload section for %s is up to date." (if no-autoloads file)))) -(defun autoload-before-p (time1 time2) - (or (< (car time1) (car time2)) - (and (= (car time1) (car time2)) - (< (nth 1 time1) (nth 1 time2))))) - (defun autoload-remove-section (begin) (goto-char begin) (search-forward generate-autoload-section-trailer) @@ -527,8 +522,7 @@ directory or directories specified." (dolist (file file) (let ((file-time (nth 5 (file-attributes file)))) (when (and file-time - (not (autoload-before-p last-time - file-time))) + (not (time-less-p last-time file-time))) ;; file unchanged (push file no-autoloads) (setq files (delete file files))))))) diff --git a/lisp/emacs-lisp/byte-run.el b/lisp/emacs-lisp/byte-run.el index 9956d5003cc..2cd0896c835 100644 --- a/lisp/emacs-lisp/byte-run.el +++ b/lisp/emacs-lisp/byte-run.el @@ -76,21 +76,21 @@ (eval-and-compile (put ',name 'byte-optimizer 'byte-compile-inline-expand)))) -(defun make-obsolete (fn new &optional when) +(defun make-obsolete (function new &optional when) "Make the byte-compiler warn that FUNCTION is obsolete. The warning will say that NEW should be used instead. If NEW is a string, that is the `use instead' message. If provided, WHEN should be a string indicating when the function was first made obsolete, for example a date or a release number." (interactive "aMake function obsolete: \nxObsoletion replacement: ") - (let ((handler (get fn 'byte-compile))) + (let ((handler (get function 'byte-compile))) (if (eq 'byte-compile-obsolete handler) - (setq handler (nth 1 (get fn 'byte-obsolete-info))) - (put fn 'byte-compile 'byte-compile-obsolete)) - (put fn 'byte-obsolete-info (list new handler when))) - fn) + (setq handler (nth 1 (get function 'byte-obsolete-info))) + (put function 'byte-compile 'byte-compile-obsolete)) + (put function 'byte-obsolete-info (list new handler when))) + function) -(defun make-obsolete-variable (var new &optional when) +(defun make-obsolete-variable (variable new &optional when) "Make the byte-compiler warn that VARIABLE is obsolete. The warning will say that NEW should be used instead. If NEW is a string, that is the `use instead' message. @@ -102,8 +102,8 @@ was first made obsolete, for example a date or a release number." (if (equal str "") (error "")) (intern str)) (car (read-from-string (read-string "Obsoletion replacement: "))))) - (put var 'byte-obsolete-variable (cons new when)) - var) + (put variable 'byte-obsolete-variable (cons new when)) + variable) (put 'dont-compile 'lisp-indent-hook 0) (defmacro dont-compile (&rest body) @@ -134,11 +134,10 @@ The result of the body appears to the compiler as a quoted constant." ;; Remember, it's magic. (cons 'progn body)) -(defun with-no-warnings (&optional first &rest body) +(defun with-no-warnings (&rest body) "Like `progn', but prevents compiler warnings in the body." ;; The implementation for the interpreter is basically trivial. - (if body (car (last body)) - first)) + (car (last body))) ;;; I nuked this because it's not a good idea for users to think of using it. diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 3e3bfe2a074..c1a43722415 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -832,24 +832,22 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; Log something that isn't a warning. (defmacro byte-compile-log (format-string &rest args) - (list 'and - 'byte-optimize - '(memq byte-optimize-log '(t source)) - (list 'let '((print-escape-newlines t) - (print-level 4) - (print-length 4)) - (list 'byte-compile-log-1 - (cons 'format - (cons format-string - (mapcar - (lambda (x) - (if (symbolp x) (list 'prin1-to-string x) x)) - args))))))) + `(and + byte-optimize + (memq byte-optimize-log '(t source)) + (let ((print-escape-newlines t) + (print-level 4) + (print-length 4)) + (byte-compile-log-1 + (format + ,format-string + ,@(mapcar + (lambda (x) (if (symbolp x) (list 'prin1-to-string x) x)) + args)))))) ;; Log something that isn't a warning. (defun byte-compile-log-1 (string) - (save-excursion - (byte-goto-log-buffer) + (with-current-buffer "*Compile-Log*" (goto-char (point-max)) (byte-compile-warning-prefix nil nil) (cond (noninteractive @@ -903,11 +901,6 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (defvar byte-compile-last-warned-form nil) (defvar byte-compile-last-logged-file nil) -(defun byte-goto-log-buffer () - (set-buffer (get-buffer-create "*Compile-Log*")) - (unless (eq major-mode 'compilation-mode) - (compilation-mode))) - ;; This is used as warning-prefix for the compiler. ;; It is always called with the warnings buffer current. (defun byte-compile-warning-prefix (level entry) @@ -983,6 +976,7 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." ;; Do this after setting default-directory. (unless (eq major-mode 'compilation-mode) (compilation-mode)) + (compilation-forget-errors) pt)))) ;; Log a message STRING in *Compile-Log*. @@ -1014,11 +1008,11 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'." (when (nth 2 new))) (byte-compile-set-symbol-position (car form)) (if (memq 'obsolete byte-compile-warnings) - (byte-compile-warn "%s is an obsolete function%s; %s" (car form) + (byte-compile-warn "`%s' is an obsolete function%s; %s" (car form) (if when (concat " since " when) "") (if (stringp (car new)) (car new) - (format "use %s instead." (car new))))) + (format "use `%s' instead." (car new))))) (funcall (or handler 'byte-compile-normal-call) form))) ;; Compiler options @@ -2082,7 +2076,7 @@ list that represents a doc string reference. (defun byte-compile-file-form-defsubst (form) (when (assq (nth 1 form) byte-compile-unresolved-functions) (setq byte-compile-current-form (nth 1 form)) - (byte-compile-warn "defsubst %s was used before it was defined" + (byte-compile-warn "defsubst `%s' was used before it was defined" (nth 1 form))) (byte-compile-file-form (macroexpand form byte-compile-macro-environment)) @@ -2212,7 +2206,7 @@ list that represents a doc string reference. (not (assq (nth 1 form) byte-compile-initial-macro-environment))) (byte-compile-warn - "%s defined multiple times, as both function and macro" + "`%s' defined multiple times, as both function and macro" (nth 1 form))) (setcdr that-one nil)) (this-one @@ -2221,14 +2215,14 @@ list that represents a doc string reference. ;; byte-compiler macros in byte-run.el... (not (assq (nth 1 form) byte-compile-initial-macro-environment))) - (byte-compile-warn "%s %s defined multiple times in this file" + (byte-compile-warn "%s `%s' defined multiple times in this file" (if macrop "macro" "function") (nth 1 form)))) ((and (fboundp name) (eq (car-safe (symbol-function name)) (if macrop 'lambda 'macro))) (when (memq 'redefine byte-compile-warnings) - (byte-compile-warn "%s %s being redefined as a %s" + (byte-compile-warn "%s `%s' being redefined as a %s" (if macrop "function" "macro") (nth 1 form) (if macrop "macro" "function"))) @@ -2701,7 +2695,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (handler (get fn 'byte-compile))) (byte-compile-set-symbol-position fn) (when (byte-compile-const-symbol-p fn) - (byte-compile-warn "%s called as a function" fn)) + (byte-compile-warn "`%s' called as a function" fn)) (if (and handler (or (not (byte-compile-version-cond byte-compile-compatibility)) @@ -2736,9 +2730,9 @@ If FORM is a lambda or a macro, byte-compile it as a function." (if (or (not (symbolp var)) (byte-compile-const-symbol-p var (not (eq base-op 'byte-varref)))) (byte-compile-warn - (cond ((eq base-op 'byte-varbind) "attempt to let-bind %s %s") - ((eq base-op 'byte-varset) "variable assignment to %s %s") - (t "variable reference to %s %s")) + (cond ((eq base-op 'byte-varbind) "attempt to let-bind %s `%s'") + ((eq base-op 'byte-varset) "variable assignment to %s `%s'") + (t "variable reference to %s `%s'")) (if (symbolp var) "constant" "nonvariable") (prin1-to-string var)) (if (and (get var 'byte-obsolete-variable) @@ -2746,11 +2740,11 @@ If FORM is a lambda or a macro, byte-compile it as a function." (not (eq var byte-compile-not-obsolete-var))) (let* ((ob (get var 'byte-obsolete-variable)) (when (cdr ob))) - (byte-compile-warn "%s is an obsolete variable%s; %s" var + (byte-compile-warn "`%s' is an obsolete variable%s; %s" var (if when (concat " since " when) "") (if (stringp (car ob)) (car ob) - (format "use %s instead." (car ob)))))) + (format "use `%s' instead." (car ob)))))) (if (memq 'free-vars byte-compile-warnings) (if (eq base-op 'byte-varbind) (push var byte-compile-bound-variables) @@ -2759,11 +2753,11 @@ If FORM is a lambda or a macro, byte-compile it as a function." (if (eq base-op 'byte-varset) (or (memq var byte-compile-free-assignments) (progn - (byte-compile-warn "assignment to free variable %s" var) + (byte-compile-warn "assignment to free variable `%s'" var) (push var byte-compile-free-assignments))) (or (memq var byte-compile-free-references) (progn - (byte-compile-warn "reference to free variable %s" var) + (byte-compile-warn "reference to free variable `%s'" var) (push var byte-compile-free-references)))))))) (let ((tmp (assq var byte-compile-variables))) (unless tmp @@ -2964,7 +2958,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (defun byte-compile-subr-wrong-args (form n) (byte-compile-set-symbol-position (car form)) - (byte-compile-warn "%s called with %d arg%s, but requires %s" + (byte-compile-warn "`%s' called with %d arg%s, but requires %s" (car form) (length (cdr form)) (if (= 1 (length (cdr form))) "" "s") n) ;; get run-time wrong-number-of-args error. @@ -3130,7 +3124,7 @@ If FORM is a lambda or a macro, byte-compile it as a function." (if (and (consp (car body)) (not (eq 'byte-code (car (car body))))) (byte-compile-warn - "A quoted lambda form is the second argument of fset. This is probably + "A quoted lambda form is the second argument of `fset'. This is probably not what you want, as that lambda cannot be compiled. Consider using the syntax (function (lambda (...) ...)) instead."))))) (byte-compile-two-args form)) @@ -3515,7 +3509,7 @@ being undefined will be suppressed." (byte-compile-set-symbol-position 'condition-case) (unless (symbolp var) (byte-compile-warn - "%s is not a variable-name or nil (in condition-case)" var)) + "`%s' is not a variable-name or nil (in condition-case)" var)) (byte-compile-push-constant var) (byte-compile-push-constant (byte-compile-top-level (nth 2 form) for-effect)) @@ -3533,13 +3527,13 @@ being undefined will be suppressed." (setq syms (cdr syms))) ok)))) (byte-compile-warn - "%s is not a condition name or list of such (in condition-case)" + "`%s' is not a condition name or list of such (in condition-case)" (prin1-to-string condition))) ;; ((not (or (eq condition 't) ;; (and (stringp (get condition 'error-message)) ;; (consp (get condition 'error-conditions))))) ;; (byte-compile-warn -;; "%s is not a known condition name (in condition-case)" +;; "`%s' is not a known condition name (in condition-case)" ;; condition)) ) (setq compiled-clauses @@ -3635,7 +3629,7 @@ being undefined will be suppressed." (and (eq fun 'defconst) (null (cddr form)))) (let ((ncall (length (cdr form)))) (byte-compile-warn - "%s called with %d argument%s, but %s %s" + "`%s' called with %d argument%s, but %s %s" fun ncall (if (= 1 ncall) "" "s") (if (< ncall 2) "requires" "accepts only") @@ -3652,7 +3646,7 @@ being undefined will be suppressed." `(push ',var current-load-list)) (when (> (length form) 3) (when (and string (not (stringp string))) - (byte-compile-warn "third arg to %s %s is not a string: %s" + (byte-compile-warn "third arg to `%s %s' is not a string: %s" fun var string)) `(put ',var 'variable-documentation ,string)) (if (cddr form) ; `value' provided @@ -3718,7 +3712,7 @@ being undefined will be suppressed." (byte-defop-compiler-1 with-no-warnings byte-compile-no-warnings) (defun byte-compile-no-warnings (form) (let (byte-compile-warnings) - (byte-compile-form (cadr form)))) + (byte-compile-form (cons 'progn (cdr form))))) ;;; tags @@ -3993,7 +3987,7 @@ already up-to-date." nil)))) ;;;###autoload -(defun batch-byte-recompile-directory () +(defun batch-byte-recompile-directory (&optional arg) "Run `byte-recompile-directory' on the dirs remaining on the command line. Must be used only with `-batch', and kills Emacs on completion. For example, invoke `emacs -batch -f batch-byte-recompile-directory .'." @@ -4004,7 +3998,7 @@ For example, invoke `emacs -batch -f batch-byte-recompile-directory .'." (or command-line-args-left (setq command-line-args-left '("."))) (while command-line-args-left - (byte-recompile-directory (car command-line-args-left)) + (byte-recompile-directory (car command-line-args-left) arg) (setq command-line-args-left (cdr command-line-args-left))) (kill-emacs 0)) diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index fddab94dfd4..2aba3ea254c 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el @@ -1246,7 +1246,7 @@ generating a buffered list of errors." With prefix ARG, turn Checkdoc minor mode on iff ARG is positive. In Checkdoc minor mode, the usual bindings for `eval-defun' which is -bound to \\<checkdoc-minor-mode-map> \\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include +bound to \\<checkdoc-minor-mode-map>\\[checkdoc-eval-defun] and `checkdoc-eval-current-buffer' are overridden to include checking of documentation strings. \\{checkdoc-minor-mode-map}" @@ -2579,86 +2579,52 @@ This function will not modify `match-data'." ;;; Warning management ;; (defvar checkdoc-output-font-lock-keywords - '(("\\(\\w+\\.el\\): \\(\\w+\\)" + '(("^\\*\\*\\* \\(.+\\.el\\): \\([^ \n]+\\)" (1 font-lock-function-name-face) - (2 font-lock-comment-face)) - ("^\\(\\w+\\.el\\):" 1 font-lock-function-name-face) - (":\\([0-9]+\\):" 1 font-lock-constant-face)) + (2 font-lock-comment-face))) "Keywords used to highlight a checkdoc diagnostic buffer.") -(defvar checkdoc-output-mode-map nil - "Keymap used in `checkdoc-output-mode'.") +(defvar checkdoc-output-error-regex-alist + '(("^\\(.+\\.el\\):\\([0-9]+\\): " 1 2))) (defvar checkdoc-pending-errors nil "Non-nil when there are errors that have not been displayed yet.") -(if checkdoc-output-mode-map - nil - (setq checkdoc-output-mode-map (make-sparse-keymap)) - (if (not (string-match "XEmacs" emacs-version)) - (define-key checkdoc-output-mode-map [mouse-2] - 'checkdoc-find-error)) - (define-key checkdoc-output-mode-map "\C-c\C-c" 'checkdoc-find-error) - (define-key checkdoc-output-mode-map "\C-m" 'checkdoc-find-error)) - -(defun checkdoc-output-mode () - "Create and setup the buffer used to maintain checkdoc warnings. -\\<checkdoc-output-mode-map>\\[checkdoc-find-error] - Go to this error location." - (if (get-buffer checkdoc-diagnostic-buffer) - (get-buffer checkdoc-diagnostic-buffer) - (save-excursion - (set-buffer (get-buffer-create checkdoc-diagnostic-buffer)) - (kill-all-local-variables) - (setq mode-name "Checkdoc" - major-mode 'checkdoc-output-mode) - (set (make-local-variable 'font-lock-defaults) - '((checkdoc-output-font-lock-keywords) t t ((?- . "w") (?_ . "w")))) - (use-local-map checkdoc-output-mode-map) - (run-hooks 'checkdoc-output-mode-hook) - (current-buffer)))) - -(defalias 'checkdoc-find-error-mouse 'checkdoc-find-error) -(defun checkdoc-find-error (&optional event) - "In a checkdoc diagnostic buffer, find the error under point." - (interactive (list last-input-event)) - (if event (posn-set-point (event-end e))) - (beginning-of-line) - (if (looking-at "\\(\\(\\w+\\|\\s_\\)+\\.el\\):\\([0-9]+\\):") - (let ((l (string-to-int (match-string 3))) - (f (match-string 1))) - (if (not (get-file-buffer f)) - (error "Can't find buffer %s" f)) - (switch-to-buffer-other-window (get-file-buffer f)) - (goto-line l)))) +(define-derived-mode checkdoc-output-mode compilation-mode "Checkdoc" + "Set up the major mode for the buffer containing the list of errors." + (set (make-local-variable 'compilation-error-regexp-alist) + checkdoc-output-error-regex-alist) + (set (make-local-variable 'compilation-mode-font-lock-keywords) + checkdoc-output-font-lock-keywords)) (defun checkdoc-buffer-label () "The name to use for a checkdoc buffer in the error list." (if (buffer-file-name) - (file-name-nondirectory (buffer-file-name)) + (file-relative-name (buffer-file-name)) (concat "#<buffer "(buffer-name) ">"))) (defun checkdoc-start-section (check-type) "Initialize the checkdoc diagnostic buffer for a pass. Create the header so that the string CHECK-TYPE is displayed as the function called to create the messages." - (checkdoc-output-to-error-buffer - "\n\n\C-l\n*** " - (checkdoc-buffer-label) ": " check-type " V " checkdoc-version)) + (let ((dir default-directory) + (label (checkdoc-buffer-label))) + (with-current-buffer (get-buffer-create checkdoc-diagnostic-buffer) + (checkdoc-output-mode) + (setq default-directory dir) + (goto-char (point-max)) + (insert "\n\n\C-l\n*** " label ": " check-type " V " checkdoc-version)))) (defun checkdoc-error (point msg) "Store POINT and MSG as errors in the checkdoc diagnostic buffer." (setq checkdoc-pending-errors t) - (checkdoc-output-to-error-buffer - "\n" (checkdoc-buffer-label) ":" - (int-to-string (count-lines (point-min) (or point (point-min)))) ": " - msg)) - -(defun checkdoc-output-to-error-buffer (&rest text) - "Place TEXT into the checkdoc diagnostic buffer." - (save-excursion - (set-buffer (checkdoc-output-mode)) - (goto-char (point-max)) - (apply 'insert text))) + (let ((text (list "\n" (checkdoc-buffer-label) ":" + (int-to-string + (count-lines (point-min) (or point (point-min)))) + ": " msg))) + (with-current-buffer (get-buffer checkdoc-diagnostic-buffer) + (goto-char (point-max)) + (apply 'insert text)))) (defun checkdoc-show-diagnostics () "Display the checkdoc diagnostic buffer in a temporary window." diff --git a/lisp/emacs-lisp/cl-indent.el b/lisp/emacs-lisp/cl-indent.el index 2e6265d4dfd..c5e13a4c00f 100644 --- a/lisp/emacs-lisp/cl-indent.el +++ b/lisp/emacs-lisp/cl-indent.el @@ -216,8 +216,12 @@ If nil, indent backquoted lists as data, i.e., like quoted lists." (cond ((string-match "\\`def" function) (setq tentative-defun t)) - ((string-match "\\`\\(with\\|do\\)-" - function) + ((string-match + (eval-when-compile + (concat "\\`\\(" + (regexp-opt '("with" "without" "do")) + "\\)-")) + function) (setq method '(&lambda &body)))))) ;; backwards compatibility. Bletch. ((eq method 'defun) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index c61c275f2b0..68f823b88f3 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -164,21 +164,21 @@ ;;; Symbols. (defvar *gensym-counter*) -(defun gensym (&optional arg) +(defun gensym (&optional prefix) "Generate a new uninterned symbol. The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) - (num (if (integerp arg) arg + (let ((pfix (if (stringp prefix) prefix "G")) + (num (if (integerp prefix) prefix (prog1 *gensym-counter* (setq *gensym-counter* (1+ *gensym-counter*)))))) - (make-symbol (format "%s%d" prefix num)))) + (make-symbol (format "%s%d" pfix num)))) -(defun gentemp (&optional arg) +(defun gentemp (&optional prefix) "Generate a new interned symbol with a unique name. The name is made by appending a number to PREFIX, default \"G\"." - (let ((prefix (if (stringp arg) arg "G")) + (let ((pfix (if (stringp prefix) prefix "G")) name) - (while (intern-soft (setq name (format "%s%d" prefix *gensym-counter*))) + (while (intern-soft (setq name (format "%s%d" pfix *gensym-counter*))) (setq *gensym-counter* (1+ *gensym-counter*))) (intern name))) @@ -1177,12 +1177,14 @@ Valid clauses are: (defmacro do (steps endtest &rest body) "The Common Lisp `do' loop. -Format is: (do ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" + +\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" (cl-expand-do-loop steps endtest body nil)) (defmacro do* (steps endtest &rest body) "The Common Lisp `do*' loop. -Format is: (do* ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" + +\(fn ((VAR INIT [STEP])...) (END-TEST [RESULT...]) BODY...)" (cl-expand-do-loop steps endtest body t)) (defun cl-expand-do-loop (steps endtest body star) @@ -2398,10 +2400,10 @@ The type name can then be used in `typecase', `check-type', etc." ((eq (car type) 'satisfies) (list (cadr type) val)) (t (error "Bad type spec: %s" type))))) -(defun typep (val type) ; See compiler macro below. +(defun typep (object type) ; See compiler macro below. "Check that OBJECT is of type TYPE. TYPE is a Common Lisp-style type specifier." - (eval (cl-make-type-test 'val type))) + (eval (cl-make-type-test 'object type))) (defmacro check-type (form type &optional string) "Verify that FORM is of type TYPE; signal an error if not. @@ -2438,8 +2440,8 @@ omitted, a default message listing FORM itself is used." nil)))) (defmacro ignore-errors (&rest body) - "Execute FORMS; if an error occurs, return nil. -Otherwise, return result of last FORM." + "Execute BODY; if an error occurs, return nil. +Otherwise, return result of last form in BODY." `(condition-case nil (progn ,@body) (error nil))) diff --git a/lisp/emacs-lisp/disass.el b/lisp/emacs-lisp/disass.el index d8890bd0239..ed632b14cd4 100644 --- a/lisp/emacs-lisp/disass.el +++ b/lisp/emacs-lisp/disass.el @@ -4,7 +4,7 @@ ;; Author: Doug Cutting <doug@csli.stanford.edu> ;; Jamie Zawinski <jwz@lucid.com> -;; Maintainer: Jamie Zawinski <jwz@lucid.com> +;; Maintainer: FSF ;; Keywords: internal ;; This file is part of GNU Emacs. @@ -57,7 +57,7 @@ redefine OBJECT if it is a symbol." (interactive (list (intern (completing-read "Disassemble function: " obarray 'fboundp t)) nil 0 t)) - (if (consp object) + (if (and (consp object) (not (eq (car object) 'lambda))) (setq object (list 'lambda () object))) (or indent (setq indent 0)) ;Default indent to zero (save-excursion diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 88f7657b6bf..dbd7194f50a 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el @@ -478,8 +478,8 @@ Do it only if `easy-menu-precalculate-equivalent-keybindings' is on." (when easy-menu-precalculate-equivalent-keybindings (if (and (symbolp menu) (not (keymapp menu)) (boundp menu)) (setq menu (symbol-value menu))) - ;; x-popup-menu does not exist on tty-only Emacs. - ;; (if (keymapp menu) (x-popup-menu nil menu)) + (and (keymapp menu) (fboundp 'x-popup-menu) + (x-popup-menu nil menu)) )) (defun add-submenu (menu-path submenu &optional before in-menu) diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el index 8a924d045f7..9a7b9efc333 100644 --- a/lisp/emacs-lisp/edebug.el +++ b/lisp/emacs-lisp/edebug.el @@ -477,7 +477,8 @@ also dependent on the values of `edebug-all-defs' and If the current defun is actually a call to `defvar', then reset the variable using its initial value expression even if the variable already has some other value. (Normally `defvar' does not change the -variable's value if it already has a value.) +variable's value if it already has a value.) Treat `defcustom' +similarly. Reinitialize the face according to `defface' specification. With a prefix argument, instrument the code for Edebug. @@ -507,7 +508,12 @@ the minibuffer." ((and (eq (car form) 'defcustom) (default-boundp (nth 1 form))) ;; Force variable to be bound. - (set-default (nth 1 form) (eval (nth 2 form))))) + (set-default (nth 1 form) (eval (nth 2 form)))) + ((eq (car form) 'defface) + ;; Reset the face. + (put (nth 1 form) 'face-defface-spec nil) + (setq face-new-frame-defaults + (assq-delete-all (nth 1 form) face-new-frame-defaults)))) (setq edebug-result (eval form)) (if (not edebugging) (princ edebug-result) @@ -3692,8 +3698,7 @@ Return the result of the last expression." (setq edebug-previous-result (concat "Result: " (edebug-safe-prin1-to-string edebug-previous-value) - (let ((name (prin1-char edebug-previous-value))) - (if name (concat " = " name)))))) + (eval-expression-print-format edebug-previous-value)))) (defun edebug-previous-result () "Print the previous result." @@ -3712,7 +3717,8 @@ Print result in minibuffer." (princ (edebug-outside-excursion (setq values (cons (edebug-eval edebug-expr) values)) - (edebug-safe-prin1-to-string (car values))))) + (concat (edebug-safe-prin1-to-string (car values)) + (eval-expression-print-format (car values)))))) (defun edebug-eval-last-sexp () "Evaluate sexp before point in the outside environment; value in minibuffer." diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index a0c2e3c0d70..a2cb4e9fe46 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -1,6 +1,7 @@ ;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer -;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation +;; Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 04 +;; Free Software Foundation ;; Author: Per Cederqvist <ceder@lysator.liu.se> ;; Inge Wallin <inge@lysator.liu.se> @@ -244,7 +245,7 @@ BUT if it is the header or the footer in EWOC return nil instead." (defun ewoc--create-node (data pretty-printer pos) "Call PRETTY-PRINTER with point set at POS in current buffer. -Remember the start position. Create a wrapper containing that +Remember the start position. Create a wrapper containing that start position and the element DATA." (save-excursion ;; Remember the position as a number so that it doesn't move @@ -263,7 +264,7 @@ start position and the element DATA." (defun ewoc--delete-node-internal (ewoc node) "Delete a data string from EWOC. -Can not be used on the footer. Returns the wrapper that is deleted. +Can not be used on the footer. Returns the wrapper that is deleted. The start-marker in the wrapper is set to nil, so that it doesn't consume any more resources." (let ((dll (ewoc--dll ewoc)) @@ -303,14 +304,14 @@ The ewoc will be inserted in the current buffer at the current position. PRETTY-PRINTER should be a function that takes one argument, an element, and inserts a string representing it in the buffer (at -point). The string PRETTY-PRINTER inserts may be empty or span -several linse. A trailing newline will always be inserted -automatically. The PRETTY-PRINTER should use insert, and not -insert-before-markers. - -Optional third argument HEADER is a string that will always be -present at the top of the ewoc. HEADER should end with a -newline. Optionaly fourth argument FOOTER is similar, and will +point). The string PRETTY-PRINTER inserts may be empty or span +several lines. A trailing newline will always be inserted +automatically. The PRETTY-PRINTER should use `insert', and not +`insert-before-markers'. + +Optional second argument HEADER is a string that will always be +present at the top of the ewoc. HEADER should end with a +newline. Optional third argument FOOTER is similar, and will be inserted at the bottom of the ewoc." (let ((new-ewoc (ewoc--create (current-buffer) @@ -394,9 +395,9 @@ MAP-FUNCTION is applied to the first element first. If MAP-FUNCTION returns non-nil the element will be refreshed (its pretty-printer will be called once again). -Note that the buffer for EWOC will be current buffer when MAP-FUNCTION -is called. MAP-FUNCTION must restore the current buffer to BUFFER before -it returns, if it changes it. +Note that the buffer for EWOC will be the current buffer when +MAP-FUNCTION is called. MAP-FUNCTION must restore the current +buffer before it returns, if it changes it. If more than two arguments are given, the remaining arguments will be passed to MAP-FUNCTION." @@ -411,9 +412,9 @@ arguments will be passed to MAP-FUNCTION." (defun ewoc-filter (ewoc predicate &rest args) "Remove all elements in EWOC for which PREDICATE returns nil. Note that the buffer for EWOC will be current-buffer when PREDICATE -is called. PREDICATE must restore the current buffer before it returns +is called. PREDICATE must restore the current buffer before it returns if it changes it. -The PREDICATE is called with the element as its first argument. If any +The PREDICATE is called with the element as its first argument. If any ARGS are given they will be passed to the PREDICATE." (ewoc--set-buffer-bind-dll-let* ewoc ((node (ewoc--node-nth dll 1)) @@ -428,7 +429,7 @@ ARGS are given they will be passed to the PREDICATE." (defun ewoc-locate (ewoc &optional pos guess) "Return the node that POS (a buffer position) is within. POS may be a marker or an integer. It defaults to point. -GUESS should be a node that it is likely that POS is near. +GUESS should be a node that it is likely to be near POS. If POS points before the first element, the first node is returned. If POS points after the last element, the last node is returned. @@ -497,7 +498,7 @@ If the EWOC is empty, nil is returned." (defun ewoc-invalidate (ewoc &rest nodes) "Refresh some elements. -The pretty-printer that for EWOC will be called for all NODES." +The pretty-printer set for EWOC will be called for all NODES." (ewoc--set-buffer-bind-dll ewoc (dolist (node nodes) (ewoc--refresh-node (ewoc--pretty-printer ewoc) node)))) @@ -564,13 +565,13 @@ number of elements needs to be refreshed." (defun ewoc-collect (ewoc predicate &rest args) "Select elements from EWOC using PREDICATE. Return a list of all selected data elements. -PREDICATE is a function that takes a data element as its first argument. -The elements on the returned list will appear in the same order as in -the buffer. You should not rely on in which order PREDICATE is -called. -Note that the buffer the EWOC is displayed in is current-buffer -when PREDICATE is called. If PREDICATE must restore current-buffer if -it changes it. +PREDICATE is a function that takes a data element as its first +argument. The elements on the returned list will appear in the +same order as in the buffer. You should not rely on the order of +calls to PREDICATE. +Note that the buffer the EWOC is displayed in is the current +buffer when PREDICATE is called. PREDICATE must restore it if it +changes it. If more than two arguments are given the remaining arguments will be passed to PREDICATE." (ewoc--set-buffer-bind-dll-let* ewoc diff --git a/lisp/emacs-lisp/find-func.el b/lisp/emacs-lisp/find-func.el index 5a7cd1093c4..54efd14b358 100644 --- a/lisp/emacs-lisp/find-func.el +++ b/lisp/emacs-lisp/find-func.el @@ -1,6 +1,6 @@ ;;; find-func.el --- find the definition of the Emacs Lisp function near point -;; Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999, 2001, 2004 Free Software Foundation, Inc. ;; Author: Jens Petersen <petersen@kurims.kyoto-u.ac.jp> ;; Maintainer: petersen@kurims.kyoto-u.ac.jp @@ -128,6 +128,40 @@ See the functions `find-function' and `find-variable'." (append (find-library-suffixes) '(""))) (error "Can't find library %s" library))) +(defvar find-function-C-source-directory + (let ((dir (expand-file-name "src" source-directory))) + (when (and (file-directory-p dir) (file-readable-p dir)) + dir)) + "Directory where the C source files of Emacs can be found. +If nil, do not try to find the source code of functions and variables +defined in C.") + +(defun find-function-C-source (fun-or-var file variable-p) + "Find the source location where SUBR-OR-VAR is defined in FILE. +VARIABLE-P should be non-nil for a variable or nil for a subroutine." + (unless find-function-C-source-directory + (setq find-function-C-source-directory + (read-directory-name "Emacs C source dir: " nil nil t))) + (setq file (expand-file-name file find-function-C-source-directory)) + (unless (file-readable-p file) + (error "The C source file %s is not available" + (file-name-nondirectory file))) + (unless variable-p + (setq fun-or-var (indirect-function fun-or-var))) + (with-current-buffer (find-file-noselect file) + (goto-char (point-min)) + (unless (re-search-forward + (if variable-p + (concat "DEFVAR[A-Z_]*[ \t\n]*([ \t\n]*\"" + (regexp-quote (symbol-name fun-or-var)) + "\"") + (concat "DEFUN[ \t\n]*([ \t\n]*\"" + (regexp-quote (subr-name fun-or-var)) + "\"")) + nil t) + (error "Can't find source for %s" fun-or-var)) + (cons (current-buffer) (match-beginning 0)))) + ;;;###autoload (defun find-library (library) "Find the elisp source of LIBRARY." @@ -149,9 +183,10 @@ If VARIABLE-P is nil, `find-function-regexp' is used, otherwise (error "Don't know where `%s' is defined" symbol)) ;; Some functions are defined as part of the construct ;; that defines something else. - (while (get symbol 'definition-name) + (while (and (symbolp symbol) (get symbol 'definition-name)) (setq symbol (get symbol 'definition-name))) - (save-match-data + (if (string-match "\\`src/\\(.*\\.c\\)\\'" library) + (find-function-C-source symbol (match-string 1 library) variable-p) (if (string-match "\\.el\\(c\\)\\'" library) (setq library (substring library 0 (match-beginning 1)))) (let* ((filename (find-library-name library))) diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el index 8cd0fdf0da0..d471ad79538 100644 --- a/lisp/emacs-lisp/lisp-mode.el +++ b/lisp/emacs-lisp/lisp-mode.el @@ -239,6 +239,7 @@ All commands in `lisp-mode-shared-map' are inherited by this map.") (set-keymap-parent emacs-lisp-mode-map lisp-mode-shared-map) (define-key emacs-lisp-mode-map "\e\t" 'lisp-complete-symbol) (define-key emacs-lisp-mode-map "\e\C-x" 'eval-defun) + (define-key emacs-lisp-mode-map "\e\C-q" 'indent-pp-sexp) (define-key emacs-lisp-mode-map [menu-bar] (make-sparse-keymap)) (define-key emacs-lisp-mode-map [menu-bar emacs-lisp] (cons "Emacs-Lisp" map)) @@ -355,6 +356,14 @@ if that value is non-nil." (setq imenu-case-fold-search t) (set-syntax-table lisp-mode-syntax-table) (run-mode-hooks 'lisp-mode-hook)) +(put 'lisp-mode 'find-tag-default-function 'lisp-find-tag-default) + +(defun lisp-find-tag-default () + (let ((default (find-tag-default))) + (when (stringp default) + (if (string-match ":+" default) + (substring default (match-end 0)) + default)))) ;; Used in old LispM code. (defalias 'common-lisp-mode 'lisp-mode) @@ -369,6 +378,7 @@ if that value is non-nil." (let ((map (make-sparse-keymap))) (set-keymap-parent map lisp-mode-shared-map) (define-key map "\e\C-x" 'eval-defun) + (define-key map "\e\C-q" 'indent-pp-sexp) (define-key map "\e\t" 'lisp-complete-symbol) (define-key map "\n" 'eval-print-last-sexp) map) @@ -448,7 +458,7 @@ alternative printed representations that can be displayed." "Return a string representing CHAR as a character rather than as an integer. If CHAR is not a character, return nil." (and (integerp char) - (characterp (event-basic-type char)) + (eventp char) (let ((c (event-basic-type char))) (concat "?" @@ -460,7 +470,10 @@ If CHAR is not a character, return nil." (cond ((memq c '(?\; ?\( ?\) ?\{ ?\} ?\[ ?\] ?\" ?\' ?\\)) (string ?\\ c)) ((eq c 127) "\\C-?") - (t (string c))))))) + (t + (condition-case nil + (string c) + (error nil)))))))) (defun eval-last-sexp-1 (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in minibuffer. @@ -524,13 +537,12 @@ With argument, print output into current buffer." (prin1-to-string value))) (print-length eval-expression-print-length) (print-level eval-expression-print-level) - (char-string (prin1-char value)) (beg (point)) end) (prog1 (prin1 value) - (if (and (eq standard-output t) char-string) - (princ (concat " = " char-string))) + (let ((str (eval-expression-print-format value))) + (if str (princ str))) (setq end (point)) (when (and (bufferp standard-output) (or (not (null print-length)) @@ -558,8 +570,9 @@ Interactively, with prefix argument, print output into current buffer." value))) (defun eval-defun-1 (form) - "Change defvar into defconst within FORM. -Likewise for other constructs as necessary." + "Treat some expressions specially. +Reset the `defvar' and `defcustom' variables to the initial value. +Reinitialize the face according to the `defface' specification." ;; The code in edebug-defun should be consistent with this, but not ;; the same, since this gets a macroexpended form. (cond ((not (listp form)) @@ -577,6 +590,13 @@ Likewise for other constructs as necessary." ;; Force variable to be bound. (set-default (eval (nth 1 form)) (eval (nth 1 (nth 2 form)))) form) + ;; `defface' is macroexpanded to `custom-declare-face'. + ((eq (car form) 'custom-declare-face) + ;; Reset the face. + (put (eval (nth 1 form)) 'face-defface-spec nil) + (setq face-new-frame-defaults + (assq-delete-all (eval (nth 1 form)) face-new-frame-defaults)) + form) ((eq (car form) 'progn) (cons 'progn (mapcar 'eval-defun-1 (cdr form)))) (t form))) @@ -612,7 +632,7 @@ Return the result of evaluation." (setq beg (point)) (setq form (read (current-buffer))) (setq end (point))) - ;; Alter the form if necessary, changing defvar into defconst, etc. + ;; Alter the form if necessary. (setq form (eval-defun-1 (macroexpand form))) (list beg end standard-output `(lambda (ignore) @@ -1084,6 +1104,19 @@ ENDPOS is encountered." (indent-sexp endmark) (set-marker endmark nil)))) +(defun indent-pp-sexp (&optional arg) + "Indent each line of the list or, with prefix ARG, pretty-printify the list." + (interactive "P") + (if arg + (save-excursion + (save-restriction + (narrow-to-region (point) (progn (forward-sexp 1) (point))) + (pp-buffer) + (goto-char (point-max)) + (if (eq (char-before) ?\n) + (delete-char -1))))) + (indent-sexp)) + ;;;; Lisp paragraph filling commands. (defcustom emacs-lisp-docstring-fill-column 65 diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index e1ed508b865..25fde86cd96 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el @@ -175,6 +175,8 @@ open-parenthesis, and point ends up at the beginning of the line. If variable `beginning-of-defun-function' is non-nil, its value is called as a function to find the defun's beginning." (interactive "p") + (and (eq this-command 'beginning-of-defun) + (or (eq last-command 'beginning-of-defun) (push-mark))) (and (beginning-of-defun-raw arg) (progn (beginning-of-line) t))) @@ -223,6 +225,8 @@ matches the open-parenthesis that starts a defun; see function If variable `end-of-defun-function' is non-nil, its value is called as a function to find the defun's end." (interactive "p") + (and (eq this-command 'end-of-defun) + (or (eq last-command 'end-of-defun) (push-mark))) (if (or (null arg) (= arg 0)) (setq arg 1)) (if end-of-defun-function (if (> arg 0) @@ -277,15 +281,31 @@ already marked." (end-of-defun) (point)))) (t - ;; Do it in this order for the sake of languages with nested - ;; functions where several can end at the same place as with - ;; the offside rule, e.g. Python. - (push-mark (point)) - (beginning-of-defun) - (push-mark (point) nil t) - (end-of-defun) - (exchange-point-and-mark) - (re-search-backward "^\n" (- (point) 1) t)))) + (let ((opoint (point)) + beg end) + (push-mark opoint) + ;; Try first in this order for the sake of languages with nested + ;; functions where several can end at the same place as with + ;; the offside rule, e.g. Python. + (beginning-of-defun) + (setq beg (point)) + (end-of-defun) + (setq end (point)) + (while (looking-at "^\n") + (forward-line 1)) + (if (> (point) opoint) + (progn + ;; We got the right defun. + (push-mark beg nil t) + (goto-char end) + (exchange-point-and-mark)) + ;; beginning-of-defun moved back one defun + ;; so we got the wrong one. + (goto-char opoint) + (end-of-defun) + (push-mark (point) nil t) + (beginning-of-defun)) + (re-search-backward "^\n" (- (point) 1) t))))) (defun narrow-to-defun (&optional arg) "Make text outside current defun invisible. @@ -294,37 +314,112 @@ Optional ARG is ignored." (interactive) (save-excursion (widen) - ;; Do it in this order for the sake of languages with nested - ;; functions where several can end at the same place as with the - ;; offside rule, e.g. Python. - (beginning-of-defun) - (let ((beg (point))) + (let ((opoint (point)) + beg end) + ;; Try first in this order for the sake of languages with nested + ;; functions where several can end at the same place as with + ;; the offside rule, e.g. Python. + (beginning-of-defun) + (setq beg (point)) (end-of-defun) - (narrow-to-region beg (point))))) - -(defun insert-parentheses (arg) + (setq end (point)) + (while (looking-at "^\n") + (forward-line 1)) + (unless (> (point) opoint) + ;; beginning-of-defun moved back one defun + ;; so we got the wrong one. + (goto-char opoint) + (end-of-defun) + (setq end (point)) + (beginning-of-defun) + (setq beg (point))) + (goto-char end) + (re-search-backward "^\n" (- (point) 1) t) + (narrow-to-region beg end)))) + +(defvar insert-pair-alist + '((?\( ?\)) (?\[ ?\]) (?\{ ?\}) (?\< ?\>) (?\" ?\") (?\' ?\') (?\` ?\')) + "Alist of paired characters inserted by `insert-pair'. +Each element looks like (OPEN-CHAR CLOSE-CHAR) or (COMMAND-CHAR +OPEN-CHAR CLOSE-CHAR). The characters OPEN-CHAR and CLOSE-CHAR +of the pair whose key is equal to the last input character with +or without modifiers, are inserted by `insert-pair'.") + +(defun insert-pair (&optional arg open close) + "Enclose following ARG sexps in a pair of OPEN and CLOSE characters. +Leave point after the first character. +A negative ARG encloses the preceding ARG sexps instead. +No argument is equivalent to zero: just insert characters +and leave point between. +If `parens-require-spaces' is non-nil, this command also inserts a space +before and after, depending on the surrounding characters. +If region is active, insert enclosing characters at region boundaries. + +If arguments OPEN and CLOSE are nil, the character pair is found +from the variable `insert-pair-alist' according to the last input +character with or without modifiers. If no character pair is +found in the variable `insert-pair-alist', then the last input +character is inserted ARG times." + (interactive "P") + (if (not (and open close)) + (let ((pair (or (assq last-command-char insert-pair-alist) + (assq (event-basic-type last-command-event) + insert-pair-alist)))) + (if pair + (if (nth 2 pair) + (setq open (nth 1 pair) close (nth 2 pair)) + (setq open (nth 0 pair) close (nth 1 pair)))))) + (if (and open close) + (if (and transient-mark-mode mark-active) + (progn + (save-excursion (goto-char (region-end)) (insert close)) + (save-excursion (goto-char (region-beginning)) (insert open))) + (if arg (setq arg (prefix-numeric-value arg)) + (setq arg 0)) + (cond ((> arg 0) (skip-chars-forward " \t")) + ((< arg 0) (forward-sexp arg) (setq arg (- arg)))) + (and parens-require-spaces + (not (bobp)) + (memq (char-syntax (preceding-char)) (list ?w ?_ (char-syntax close))) + (insert " ")) + (insert open) + (save-excursion + (or (eq arg 0) (forward-sexp arg)) + (insert close) + (and parens-require-spaces + (not (eobp)) + (memq (char-syntax (following-char)) (list ?w ?_ (char-syntax open))) + (insert " ")))) + (insert-char (event-basic-type last-command-event) + (prefix-numeric-value arg)))) + +(defun insert-parentheses (&optional arg) "Enclose following ARG sexps in parentheses. Leave point after open-paren. A negative ARG encloses the preceding ARG sexps instead. No argument is equivalent to zero: just insert `()' and leave point between. If `parens-require-spaces' is non-nil, this command also inserts a space -before and after, depending on the surrounding characters." +before and after, depending on the surrounding characters. +If region is active, insert enclosing characters at region boundaries." (interactive "P") - (if arg (setq arg (prefix-numeric-value arg)) - (setq arg 0)) - (cond ((> arg 0) (skip-chars-forward " \t")) - ((< arg 0) (forward-sexp arg) (setq arg (- arg)))) - (and parens-require-spaces - (not (bobp)) - (memq (char-syntax (preceding-char)) '(?w ?_ ?\) )) - (insert " ")) - (insert ?\() - (save-excursion - (or (eq arg 0) (forward-sexp arg)) - (insert ?\)) - (and parens-require-spaces - (not (eobp)) - (memq (char-syntax (following-char)) '(?w ?_ ?\( )) - (insert " ")))) + (insert-pair arg ?\( ?\))) + +(defun delete-pair () + "Delete a pair of characters enclosing the sexp that follows point." + (interactive) + (save-excursion (forward-sexp 1) (delete-char -1)) + (delete-char 1)) + +(defun raise-sexp (&optional arg) + "Raise ARG sexps higher up the tree." + (interactive "p") + (let ((s (if (and transient-mark-mode mark-active) + (buffer-substring (region-beginning) (region-end)) + (buffer-substring + (point) + (save-excursion (forward-sexp arg) (point)))))) + (backward-up-list 1) + (delete-region (point) (save-excursion (forward-sexp 1) (point))) + (save-excursion (insert s)))) (defun move-past-close-and-reindent () "Move past next `)', delete indentation before it, then indent after it." diff --git a/lisp/emacs-lisp/pp.el b/lisp/emacs-lisp/pp.el index c93868859f0..61d31921e57 100644 --- a/lisp/emacs-lisp/pp.el +++ b/lisp/emacs-lisp/pp.el @@ -50,34 +50,40 @@ to make output that `read' can handle, whenever this is possible." (let ((print-escape-newlines pp-escape-newlines) (print-quoted t)) (prin1 object (current-buffer))) - (goto-char (point-min)) - (while (not (eobp)) - ;; (message "%06d" (- (point-max) (point))) - (cond - ((condition-case err-var - (prog1 t (down-list 1)) - (error nil)) - (save-excursion - (backward-char 1) - (skip-chars-backward "'`#^") - (when (and (not (bobp)) (= ?\ (char-before))) - (delete-char -1) - (insert "\n")))) - ((condition-case err-var - (prog1 t (up-list 1)) - (error nil)) - (while (looking-at "\\s)") - (forward-char 1)) - (delete-region - (point) - (progn (skip-chars-forward " \t") (point))) - (insert ?\n)) - (t (goto-char (point-max))))) - (goto-char (point-min)) - (indent-sexp) + (pp-buffer) (buffer-string)) (kill-buffer (current-buffer))))) +(defun pp-buffer () + "Prettify the current buffer with printed representation of a Lisp object." + (goto-char (point-min)) + (while (not (eobp)) + ;; (message "%06d" (- (point-max) (point))) + (cond + ((condition-case err-var + (prog1 t (down-list 1)) + (error nil)) + (save-excursion + (backward-char 1) + (skip-chars-backward "'`#^") + (when (and (not (bobp)) (memq (char-before) '(?\ ?\t ?\n))) + (delete-region + (point) + (progn (skip-chars-backward " \t\n") (point))) + (insert "\n")))) + ((condition-case err-var + (prog1 t (up-list 1)) + (error nil)) + (while (looking-at "\\s)") + (forward-char 1)) + (delete-region + (point) + (progn (skip-chars-forward " \t\n") (point))) + (insert ?\n)) + (t (goto-char (point-max))))) + (goto-char (point-min)) + (indent-sexp)) + ;;;###autoload (defun pp (object &optional stream) "Output the pretty-printed representation of OBJECT, any Lisp object. diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 9c904e6c0bc..83d3649006e 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -494,7 +494,7 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions." (defun reb-auto-update (beg end lenold &optional force) "Called from `after-update-functions' to update the display. -BEG END and LENOLD are passed in from the hook. +BEG, END and LENOLD are passed in from the hook. An actual update is only done if the regexp has changed or if the optional fourth argument FORCE is non-nil." (let ((prev-valid reb-valid-string) diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 6656cf5ed3c..d4a10104eea 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -1,6 +1,6 @@ ;;; rx.el --- sexp notation for regular expressions -;; Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2001, 03, 2004 Free Software Foundation, Inc. ;; Author: Gerd Moellmann <gerd@gnu.org> ;; Maintainer: FSF @@ -32,6 +32,22 @@ ;; from the bugs mentioned in the commentary section of Sregex, and ;; uses a nicer syntax (IMHO, of course :-). +;; This significantly extended version of the original, is almost +;; compatible with Sregex. The only incompatibility I (fx) know of is +;; that the `repeat' form can't have multiple regexp args. + +;; Now alternative forms are provided for a degree of compatibility +;; with Shivers' attempted definitive SRE notation +;; <URL:http://www.ai.mit.edu/~/shivers/sre.txt>. SRE forms not +;; catered for include: dsm, uncase, w/case, w/nocase, ,@<exp>, +;; ,<exp>, (word ...), word+, posix-string, and character class forms. +;; Some forms are inconsistent with SRE, either for historical reasons +;; or because of the implementation -- simple translation into Emacs +;; regexp strings. These include: any, word. Also, case-sensitivity +;; and greediness are controlled by variables external to the regexp, +;; and you need to feed the forms to the `posix-' functions to get +;; SRE's POSIX semantics. There are probably more difficulties. + ;; Rx translates a sexp notation for regular expressions into the ;; usual string notation. The translation can be done at compile-time ;; by using the `rx' macro. It can be done at run-time by calling @@ -94,62 +110,103 @@ ;;; Code: - (defconst rx-constituents '((and . (rx-and 1 nil)) + (seq . and) ; SRE + (: . and) ; SRE + (sequence . and) ; sregex (or . (rx-or 1 nil)) + (| . or) ; SRE (not-newline . ".") + (nonl . not-newline) ; SRE (anything . ".\\|\n") - (any . (rx-any 1 1 rx-check-any)) + (any . (rx-any 1 nil rx-check-any)) ; inconsistent with SRE (in . any) + (char . any) ; sregex + (not-char . (rx-not-char 1 nil rx-check-any)) ; sregex (not . (rx-not 1 1 rx-check-not)) + ;; Partially consistent with sregex, whose `repeat' is like our + ;; `**'. (`repeat' with optional max arg and multiple sexp forms + ;; is ambiguous.) (repeat . (rx-repeat 2 3)) - (submatch . (rx-submatch 1 nil)) + (= . (rx-= 2 nil)) ; SRE + (>= . (rx->= 2 nil)) ; SRE + (** . (rx-** 2 nil)) ; SRE + (submatch . (rx-submatch 1 nil)) ; SRE (group . submatch) - (zero-or-more . (rx-kleene 1 1)) - (one-or-more . (rx-kleene 1 1)) - (zero-or-one . (rx-kleene 1 1)) - (\? . zero-or-one) + (zero-or-more . (rx-kleene 1 nil)) + (one-or-more . (rx-kleene 1 nil)) + (zero-or-one . (rx-kleene 1 nil)) + (\? . zero-or-one) ; SRE (\?? . zero-or-one) - (* . zero-or-more) + (* . zero-or-more) ; SRE (*? . zero-or-more) (0+ . zero-or-more) - (+ . one-or-more) + (+ . one-or-more) ; SRE (+? . one-or-more) (1+ . one-or-more) (optional . zero-or-one) + (opt . zero-or-one) ; sregex (minimal-match . (rx-greedy 1 1)) (maximal-match . (rx-greedy 1 1)) (backref . (rx-backref 1 1 rx-check-backref)) (line-start . "^") + (bol . line-start) ; SRE (line-end . "$") + (eol . line-end) ; SRE (string-start . "\\`") + (bos . string-start) ; SRE + (bot . string-start) ; sregex (string-end . "\\'") + (eos . string-end) ; SRE + (eot . string-end) ; sregex (buffer-start . "\\`") (buffer-end . "\\'") (point . "\\=") (word-start . "\\<") + (bow . word-start) ; SRE (word-end . "\\>") + (eow . word-end) ; SRE (word-boundary . "\\b") + (not-word-boundary . "\\B") ; sregex (syntax . (rx-syntax 1 1)) + (not-syntax . (rx-not-syntax 1 1)) ; sregex (category . (rx-category 1 1 rx-check-category)) (eval . (rx-eval 1 1)) (regexp . (rx-regexp 1 1 stringp)) (digit . "[[:digit:]]") - (control . "[[:cntrl:]]") - (hex-digit . "[[:xdigit:]]") - (blank . "[[:blank:]]") - (graphic . "[[:graph:]]") - (printing . "[[:print:]]") - (alphanumeric . "[[:alnum:]]") + (numeric . digit) ; SRE + (num . digit) ; SRE + (control . "[[:cntrl:]]") ; SRE + (cntrl . control) ; SRE + (hex-digit . "[[:xdigit:]]") ; SRE + (hex . hex-digit) ; SRE + (xdigit . hex-digit) ; SRE + (blank . "[[:blank:]]") ; SRE + (graphic . "[[:graph:]]") ; SRE + (graph . graphic) ; SRE + (printing . "[[:print:]]") ; SRE + (print . printing) ; SRE + (alphanumeric . "[[:alnum:]]") ; SRE + (alnum . alphanumeric) ; SRE (letter . "[[:alpha:]]") - (ascii . "[[:ascii:]]") + (alphabetic . letter) ; SRE + (alpha . letter) ; SRE + (ascii . "[[:ascii:]]") ; SRE (nonascii . "[[:nonascii:]]") - (lower . "[[:lower:]]") - (punctuation . "[[:punct:]]") - (space . "[[:space:]]") - (upper . "[[:upper:]]") - (word . "[[:word:]]")) + (lower . "[[:lower:]]") ; SRE + (lower-case . lower) ; SRE + (punctuation . "[[:punct:]]") ; SRE + (punct . punctuation) ; SRE + (space . "[[:space:]]") ; SRE + (whitespace . space) ; SRE + (white . space) ; SRE + (upper . "[[:upper:]]") ; SRE + (upper-case . upper) ; SRE + (word . "[[:word:]]") ; inconsistent with SRE + (wordchar . word) ; sregex + (not-wordchar . "[^[:word:]]") ; sregex (use \\W?) + ) "Alist of sexp form regexp constituents. Each element of the alist has the form (SYMBOL . DEFN). SYMBOL is a valid constituent of sexp regular expressions. @@ -252,6 +309,8 @@ See also `rx-constituents'." (defun rx-check (form) "Check FORM according to its car's parsing info." + (unless (listp form) + (error "rx `%s' needs argument(s)" form)) (let* ((rx (rx-info (car form))) (nargs (1- (length form))) (min-args (nth 1 rx)) @@ -297,53 +356,61 @@ FORM is of the form `(and FORM1 ...)'." "\\)"))) -(defun rx-quote-for-set (string) - "Transform STRING for use in a character set. -If STRING contains a `]', move it to the front. -If STRING starts with a '^', move it to the end." - (when (string-match "\\`\\(\\(?:.\\|\n\\)+\\)\\]\\(\\(?:.\\|\n\\)\\)*\\'" - string) - (setq string (concat "]" (match-string 1 string) - (match-string 2 string)))) - (when (string-match "\\`^\\(\\(?:.\\|\n\\)+\\)\\'" string) - (setq string (concat (substring string 1) "^"))) - string) - +(defvar rx-bracket) ; dynamically bound in `rx-any' (defun rx-check-any (arg) "Check arg ARG for Rx `any'." - (cond ((integerp arg) t) - ((and (stringp arg) (zerop (length arg))) - (error "String arg for rx `any' must not be empty")) - ((stringp arg) t) - (t - (error "rx `any' requires string or character arg")))) - + (if (integerp arg) + (setq arg (string arg))) + (when (stringp arg) + (if (zerop (length arg)) + (error "String arg for Rx `any' must not be empty")) + ;; Quote ^ at start; don't bother to check whether this is first arg. + (if (eq ?^ (aref arg 0)) + (setq arg (concat "\\" arg))) + ;; Remove ] and set flag for adding it to start of overall result. + (when (string-match "]" arg) + (setq arg (replace-regexp-in-string "]" "" arg) + rx-bracket "]"))) + (when (symbolp arg) + (let ((translation (condition-case nil + (rx-to-string arg 'no-group) + (error nil)))) + (unless translation (error "Invalid char class `%s' in Rx `any'" arg)) + (setq arg (substring translation 1 -1)))) ; strip outer brackets + ;; sregex compatibility + (when (and (integerp (car-safe arg)) + (integerp (cdr-safe arg))) + (setq arg (string (car arg) ?- (cdr arg)))) + (unless (stringp arg) + (error "rx `any' requires string, character, char pair or char class args")) + arg) (defun rx-any (form) - "Parse and produce code from FORM, which is `(any STRING)'. -STRING is optional. If it is omitted, build a regexp that -matches anything." + "Parse and produce code from FORM, which is `(any ARG ...)'. +ARG is optional." (rx-check form) - (let ((arg (cadr form))) - (cond ((integerp arg) - (char-to-string arg)) - ((= (length arg) 1) - arg) - (t - (concat "[" (rx-quote-for-set (cadr form)) "]"))))) + (let* ((rx-bracket nil) + (args (mapcar #'rx-check-any (cdr form)))) ; side-effects `rx-bracket' + ;; If there was a ?- in the form, move it to the front to avoid + ;; accidental range. + (if (member "-" args) + (setq args (cons "-" (delete "-" args)))) + (apply #'concat "[" rx-bracket (append args '("]"))))) (defun rx-check-not (arg) "Check arg ARG for Rx `not'." - (unless (or (memq form - '(digit control hex-digit blank graphic printing - alphanumeric letter ascii nonascii lower - punctuation space upper word)) - (and (consp form) - (memq (car form) '(not any in syntax category:)))) - (error "rx `not' syntax error: %s" form)) - t) + (unless (or (and (symbolp arg) + (string-match "\\`\\[\\[:[-a-z]:]]\\'" + (condition-case nil + (rx-to-string arg 'no-group) + (error "")))) + (eq arg 'word-boundary) + (and (consp arg) + (memq (car arg) '(not any in syntax category)))) + (error "rx `not' syntax error: %s" arg)) + t) (defun rx-not (form) @@ -355,24 +422,67 @@ matches anything." (if (= (length result) 4) (substring result 2 3) (concat "[" (substring result 2)))) - ((string-match "\\`\\[" result) + ((eq ?\[ (aref result 0)) (concat "[^" (substring result 1))) - ((string-match "\\`\\\\s." result) - (concat "\\S" (substring result 2))) - ((string-match "\\`\\\\S." result) - (concat "\\s" (substring result 2))) - ((string-match "\\`\\\\c." result) - (concat "\\C" (substring result 2))) - ((string-match "\\`\\\\C." result) - (concat "\\c" (substring result 2))) - ((string-match "\\`\\\\B" result) - (concat "\\b" (substring result 2))) - ((string-match "\\`\\\\b" result) - (concat "\\B" (substring result 2))) + ((string-match "\\`\\\\[scb]" result) + (concat (capitalize (substring result 0 2)) (substring result 2))) (t (concat "[^" result "]"))))) +(defun rx-not-char (form) + "Parse and produce code from FORM. FORM is `(not-char ...)'." + (rx-check form) + (rx-not `(not (in ,@(cdr form))))) + + +(defun rx-not-syntax (form) + "Parse and produce code from FORM. FORM is `(not-syntax SYNTAX)'." + (rx-check form) + (rx-not `(not (syntax ,@(cdr form))))) + + +(defun rx-trans-forms (form &optional skip) + "If FORM's length is greater than two, transform it to length two. +A form (HEAD REST ...) becomes (HEAD (and REST ...)). +If SKIP is non-nil, allow that number of items after the head, i.e. +`(= N REST ...)' becomes `(= N (and REST ...))' if SKIP is 1." + (unless skip (setq skip 0)) + (let ((tail (nthcdr (1+ skip) form))) + (if (= (length tail) 1) + form + (let ((form (copy-sequence form))) + (setcdr (nthcdr skip form) (list (cons 'and tail))) + form)))) + + +(defun rx-= (form) + "Parse and produce code from FORM `(= N ...)'." + (rx-check form) + (setq form (rx-trans-forms form 1)) + (unless (and (integerp (nth 1 form)) + (> (nth 1 form) 0)) + (error "rx `=' requires positive integer first arg")) + (format "%s\\{%d\\}" (rx-to-string (nth 2 form)) (nth 1 form))) + + +(defun rx->= (form) + "Parse and produce code from FORM `(>= N ...)'." + (rx-check form) + (setq form (rx-trans-forms form 1)) + (unless (and (integerp (nth 1 form)) + (> (nth 1 form) 0)) + (error "rx `>=' requires positive integer first arg")) + (format "%s\\{%d,\\}" (rx-to-string (nth 2 form)) (nth 1 form))) + + +(defun rx-** (form) + "Parse and produce code from FORM `(** N M ...)'." + (rx-check form) + (setq form (cons 'repeat (cdr (rx-trans-forms form 2)))) + (rx-to-string form)) + + (defun rx-repeat (form) "Parse and produce code from FORM. FORM is either `(repeat N FORM1)' or `(repeat N M FORM1)'." @@ -419,6 +529,7 @@ If OP is one of `*?', `+?', `??', produce a non-greedy regexp. If OP is anything else, produce a greedy regexp if `rx-greedy-flag' is non-nil." (rx-check form) + (setq form (rx-trans-forms form)) (let ((suffix (cond ((memq (car form) '(* + ? )) "") ((memq (car form) '(*? +? ??)) "?") (rx-greedy-flag "") @@ -468,9 +579,15 @@ of all atomic regexps." (defun rx-syntax (form) "Parse and produce code from FORM, which is `(syntax SYMBOL)'." (rx-check form) - (let ((syntax (assq (cadr form) rx-syntax))) + (let* ((sym (cadr form)) + (syntax (assq sym rx-syntax))) (unless syntax - (error "Unknown rx syntax `%s'" (cadr form))) + ;; Try sregex compatibility. + (let ((name (symbol-name sym))) + (if (= 1 (length name)) + (setq syntax (rassq (aref name 0) rx-syntax)))) + (unless syntax + (error "Unknown rx syntax `%s'" (cadr form)))) (format "\\s%c" (cdr syntax)))) @@ -483,7 +600,7 @@ of all atomic regexps." (defun rx-category (form) - "Parse and produce code from FORM, which is `(category SYMBOL ...)'." + "Parse and produce code from FORM, which is `(category SYMBOL)'." (rx-check form) (let ((char (if (integerp (cadr form)) (cadr form) @@ -543,8 +660,9 @@ NO-GROUP non-nil means don't put shy groups around the result." ;;;###autoload -(defmacro rx (regexp) - "Translate a regular expression REGEXP in sexp form to a regexp string. +(defmacro rx (&rest regexps) + "Translate regular expressions REGEXPS in sexp form to a regexp string. +REGEXPS is a non-empty sequence of forms of the sort listed below. See also `rx-to-string' for how to do such a translation at run-time. The following are valid subforms of regular expressions in sexp @@ -556,53 +674,58 @@ STRING CHAR matches character CHAR literally. -`not-newline' +`not-newline', `nonl' matches any character except a newline. . `anything' matches any character -`(any SET)' - matches any character in SET. SET may be a character or string. +`(any SET ...)' +`(in SET ...)' +`(char SET ...)' + matches any character in SET .... SET may be a character or string. Ranges of characters can be specified as `A-Z' in strings. + Ranges may also be specified as conses like `(?A . ?Z)'. -'(in SET)' - like `any'. + SET may also be the name of a character class: `digit', + `control', `hex-digit', `blank', `graph', `print', `alnum', + `alpha', `ascii', `nonascii', `lower', `punct', `space', `upper', + `word', or one of their synonyms. -`(not (any SET))' - matches any character not in SET +`(not (any SET ...))' + matches any character not in SET ... -`line-start' +`line-start', `bol' matches the empty string, but only at the beginning of a line in the text being matched -`line-end' +`line-end', `eol' is similar to `line-start' but matches only at the end of a line -`string-start' +`string-start', `bos', `bot' matches the empty string, but only at the beginning of the string being matched against. -`string-end' +`string-end', `eos', `eot' matches the empty string, but only at the end of the string being matched against. `buffer-start' matches the empty string, but only at the beginning of the - buffer being matched against. + buffer being matched against. Actually equivalent to `string-start'. `buffer-end' matches the empty string, but only at the end of the - buffer being matched against. + buffer being matched against. Actually equivalent to `string-end'. `point' matches the empty string, but only at point. -`word-start' +`word-start', `bow' matches the empty string, but only at the beginning or end of a word. -`word-end' +`word-end', `eow' matches the empty string, but only at the end of a word. `word-boundary' @@ -610,34 +733,35 @@ CHAR word. `(not word-boundary)' +`not-word-boundary' matches the empty string, but not at the beginning or end of a word. -`digit' +`digit', `numeric', `num' matches 0 through 9. -`control' +`control', `cntrl' matches ASCII control characters. -`hex-digit' +`hex-digit', `hex', `xdigit' matches 0 through 9, a through f and A through F. `blank' matches space and tab only. -`graphic' +`graphic', `graph' matches graphic characters--everything except ASCII control chars, space, and DEL. -`printing' +`printing', `print' matches printing characters--everything except ASCII control chars and DEL. -`alphanumeric' +`alphanumeric', `alnum' matches letters and digits. (But at present, for multibyte characters, it matches anything that has word syntax.) -`letter' +`letter', `alphabetic', `alpha' matches letters. (But at present, for multibyte characters, it matches anything that has word syntax.) @@ -647,25 +771,29 @@ CHAR `nonascii' matches non-ASCII (multibyte) characters. -`lower' +`lower', `lower-case' matches anything lower-case. -`upper' +`upper', `upper-case' matches anything upper-case. -`punctuation' +`punctuation', `punct' matches punctuation. (But at present, for multibyte characters, it matches anything that has non-word syntax.) -`space' +`space', `whitespace', `white' matches anything that has whitespace syntax. -`word' +`word', `wordchar' matches anything that has word syntax. +`not-wordchar' + matches anything that has non-word syntax. + `(syntax SYNTAX)' matches a character with syntax SYNTAX. SYNTAX must be one - of the following symbols. + of the following symbols, or a symbol corresponding to the syntax + character, e.g. `\\.' for `\\s.'. `whitespace' (\\s- in string notation) `punctuation' (\\s.) @@ -684,7 +812,7 @@ CHAR `comment-delimiter' (\\s!) `(not (syntax SYNTAX))' - matches a character that has not syntax SYNTAX. + matches a character that doesn't have syntax SYNTAX. `(category CATEGORY)' matches a character with category CATEGORY. CATEGORY must be @@ -710,7 +838,7 @@ CHAR `japanese-katakana-two-byte' (\\cK) `korean-hangul-two-byte' (\\cN) `cyrillic-two-byte' (\\cY) - `combining-diacritic' (\\c^) + `combining-diacritic' (\\c^) `ascii' (\\ca) `arabic' (\\cb) `chinese' (\\cc) @@ -731,12 +859,16 @@ CHAR `can-break' (\\c|) `(not (category CATEGORY))' - matches a character that has not category CATEGORY. + matches a character that doesn't have category CATEGORY. `(and SEXP1 SEXP2 ...)' +`(: SEXP1 SEXP2 ...)' +`(seq SEXP1 SEXP2 ...)' +`(sequence SEXP1 SEXP2 ...)' matches what SEXP1 matches, followed by what SEXP2 matches, etc. `(submatch SEXP1 SEXP2 ...)' +`(group SEXP1 SEXP2 ...)' like `and', but makes the match accessible with `match-end', `match-beginning', and `match-string'. @@ -744,6 +876,7 @@ CHAR another name for `submatch'. `(or SEXP1 SEXP2 ...)' +`(| SEXP1 SEXP2 ...)' matches anything that matches SEXP1 or SEXP2, etc. If all args are strings, use `regexp-opt' to optimize the resulting regular expression. @@ -757,47 +890,55 @@ CHAR `(maximal-match SEXP)' produce a greedy regexp for SEXP. This is the default. -`(zero-or-more SEXP)' - matches zero or more occurrences of what SEXP matches. - -`(0+ SEXP)' - like `zero-or-more'. +Below, `SEXP ...' represents a sequence of regexp forms, treated as if +enclosed in `(and ...)'. -`(* SEXP)' - like `zero-or-more', but always produces a greedy regexp. +`(zero-or-more SEXP ...)' +`(0+ SEXP ...)' + matches zero or more occurrences of what SEXP ... matches. -`(*? SEXP)' - like `zero-or-more', but always produces a non-greedy regexp. +`(* SEXP ...)' + like `zero-or-more', but always produces a greedy regexp, independent + of `rx-greedy-flag'. -`(one-or-more SEXP)' - matches one or more occurrences of A. +`(*? SEXP ...)' + like `zero-or-more', but always produces a non-greedy regexp, + independent of `rx-greedy-flag'. -`(1+ SEXP)' - like `one-or-more'. +`(one-or-more SEXP ...)' +`(1+ SEXP ...)' + matches one or more occurrences of SEXP ... -`(+ SEXP)' +`(+ SEXP ...)' like `one-or-more', but always produces a greedy regexp. -`(+? SEXP)' +`(+? SEXP ...)' like `one-or-more', but always produces a non-greedy regexp. -`(zero-or-one SEXP)' +`(zero-or-one SEXP ...)' +`(optional SEXP ...)' +`(opt SEXP ...)' matches zero or one occurrences of A. -`(optional SEXP)' - like `zero-or-one'. - -`(? SEXP)' +`(? SEXP ...)' like `zero-or-one', but always produces a greedy regexp. -`(?? SEXP)' +`(?? SEXP ...)' like `zero-or-one', but always produces a non-greedy regexp. `(repeat N SEXP)' - matches N occurrences of what SEXP matches. +`(= N SEXP ...)' + matches N occurrences. + +`(>= N SEXP ...)' + matches N or more occurrences. `(repeat N M SEXP)' - matches N to M occurrences of what SEXP matches. +`(** N M SEXP ...)' + matches N to M occurrences. + +`(backref N)' + matches what was matched previously by submatch N. `(backref N)' matches what was matched previously by submatch N. @@ -811,9 +952,21 @@ CHAR `(regexp REGEXP)' include REGEXP in string notation in the result." - - (rx-to-string regexp)) - + (cond ((null regexps) + (error "No regexp")) + ((cdr regexps) + (rx-to-string `(and ,@regexps) t)) + (t + (rx-to-string (car regexps) t)))) + +;; ;; sregex.el replacement + +;; ;;;###autoload (provide 'sregex) +;; ;;;###autoload (autoload 'sregex "rx") +;; (defalias 'sregex 'rx-to-string) +;; ;;;###autoload (autoload 'sregexq "rx" nil nil 'macro) +;; (defalias 'sregexq 'rx) + (provide 'rx) ;;; arch-tag: 12d01a63-0008-42bb-ab8c-1c7d63be370b diff --git a/lisp/emacs-lisp/timer.el b/lisp/emacs-lisp/timer.el index 4ab2ac8e0d4..336a1ff82d0 100644 --- a/lisp/emacs-lisp/timer.el +++ b/lisp/emacs-lisp/timer.el @@ -161,7 +161,7 @@ fire repeatedly that many seconds apart." (aset timer 6 args) timer) -(defun timer-activate (timer) +(defun timer-activate (timer &optional triggered-p) "Put TIMER on the list of active timers." (if (and (timerp timer) (integerp (aref timer 1)) @@ -184,7 +184,7 @@ fire repeatedly that many seconds apart." (if last (setcdr last (cons timer timers)) (setq timer-list (cons timer timers))) - (aset timer 0 nil) + (aset timer 0 triggered-p) (aset timer 7 nil) nil) (error "Invalid or uninitialized timer"))) @@ -270,7 +270,7 @@ This function is called, by name, directly by the C code." (setq timer-event-last timer) (let ((inhibit-quit t)) (if (timerp timer) - (progn + (let (retrigger) ;; Delete from queue. (cancel-timer timer) ;; Re-schedule if requested. @@ -287,13 +287,16 @@ This function is called, by name, directly by the C code." (aref timer 4)))) (if (> repeats timer-max-repeats) (timer-inc-time timer (* (aref timer 4) repeats))))) - (timer-activate timer))) + (timer-activate timer t) + (setq retrigger t))) ;; Run handler. ;; We do this after rescheduling so that the handler function ;; can cancel its own timer successfully with cancel-timer. (condition-case nil (apply (aref timer 5) (aref timer 6)) - (error nil))) + (error nil)) + (if retrigger + (aset timer 0 nil))) (error "Bogus timer event")))) ;; This function is incompatible with the one in levents.el. diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 24f95ec21ea..51b47b104d0 100644 --- a/lisp/emulation/cua-base.el +++ b/lisp/emulation/cua-base.el @@ -1,6 +1,6 @@ ;;; cua-base.el --- emulate CUA key bindings -;; Copyright (C) 1997,98,99,200,01,02,03 Free Software Foundation, Inc. +;; Copyright (C) 1997,98,99,200,01,02,03,04 Free Software Foundation, Inc. ;; Author: Kim F. Storm <storm@cua.dk> ;; Keywords: keyboard emulation convenience cua @@ -413,29 +413,101 @@ Can be toggled by [M-p] while the rectangle is active," "red") "Normal (non-overwrite) cursor color. Also used to indicate that rectangle padding is not in effect. -Default is to load cursor color from initial or default frame parameters." +Default is to load cursor color from initial or default frame parameters. + +If the value is a COLOR name, then only the `cursor-color' attribute will be +affected. If the value is a cursor TYPE (one of: box, hollow, bar, or hbar), +then only the `cursor-type' property will be affected. If the value is +a cons (TYPE . COLOR), then both properties are affected." :initialize 'custom-initialize-default - :type 'color + :type '(choice + (color :tag "Color") + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (cons :tag "Color and Type" + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (color :tag "Color"))) :group 'cua) (defcustom cua-read-only-cursor-color "darkgreen" "*Cursor color used in read-only buffers, if non-nil. -Only used when `cua-enable-cursor-indications' is non-nil." - :type 'color +Only used when `cua-enable-cursor-indications' is non-nil. + +If the value is a COLOR name, then only the `cursor-color' attribute will be +affected. If the value is a cursor TYPE (one of: box, hollow, bar, or hbar), +then only the `cursor-type' property will be affected. If the value is +a cons (TYPE . COLOR), then both properties are affected." + :type '(choice + (color :tag "Color") + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (cons :tag "Color and Type" + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (color :tag "Color"))) :group 'cua) (defcustom cua-overwrite-cursor-color "yellow" "*Cursor color used when overwrite mode is set, if non-nil. Also used to indicate that rectangle padding is in effect. -Only used when `cua-enable-cursor-indications' is non-nil." - :type 'color +Only used when `cua-enable-cursor-indications' is non-nil. + +If the value is a COLOR name, then only the `cursor-color' attribute will be +affected. If the value is a cursor TYPE (one of: box, hollow, bar, or hbar), +then only the `cursor-type' property will be affected. If the value is +a cons (TYPE . COLOR), then both properties are affected." + :type '(choice + (color :tag "Color") + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (cons :tag "Color and Type" + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (color :tag "Color"))) :group 'cua) (defcustom cua-global-mark-cursor-color "cyan" "*Indication for active global mark. Will change cursor color to specified color if string. -Only used when `cua-enable-cursor-indications' is non-nil." - :type 'color +Only used when `cua-enable-cursor-indications' is non-nil. + +If the value is a COLOR name, then only the `cursor-color' attribute will be +affected. If the value is a cursor TYPE (one of: box, hollow, bar, or hbar), +then only the `cursor-type' property will be affected. If the value is +a cons (TYPE . COLOR), then both properties are affected." + :type '(choice + (color :tag "Color") + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (cons :tag "Color and Type" + (choice :tag "Type" + (const :tag "Filled box" box) + (const :tag "Vertical bar" bar) + (const :tag "Horisontal bar" hbar) + (const :tag "Hollow box" hollow)) + (color :tag "Color"))) :group 'cua) @@ -893,7 +965,7 @@ With a double \\[universal-argument] prefix argument, unconditionally set mark." forward-word backward-word end-of-line beginning-of-line end-of-buffer beginning-of-buffer - scroll-up scroll-down + scroll-up scroll-down cua-scroll-up cua-scroll-down forward-sentence backward-sentence forward-paragraph backward-paragraph) "List of standard movement commands. @@ -903,26 +975,72 @@ Extra commands should be added to `cua-movement-commands'") "User may add additional movement commands to this list.") +;;; Scrolling commands which does not signal errors at top/bottom +;;; of buffer at first key-press (instead moves to top/bottom +;;; of buffer). + +(defun cua-scroll-up (&optional arg) + "Scroll text of current window upward ARG lines; or near full screen if no ARG. +If window cannot be scrolled further, move cursor to bottom line instead. +A near full screen is `next-screen-context-lines' less than a full screen. +Negative ARG means scroll downward. +If ARG is the atom `-', scroll downward by nearly full screen." + (interactive "P") + (cond + ((eq arg '-) (cua-scroll-down nil)) + ((< (prefix-numeric-value arg) 0) + (cua-scroll-down (- (prefix-numeric-value arg)))) + ((eobp) + (scroll-up arg)) ; signal error + (t + (condition-case nil + (scroll-up arg) + (end-of-buffer (goto-char (point-max))))))) + +(defun cua-scroll-down (&optional arg) + "Scroll text of current window downward ARG lines; or near full screen if no ARG. +If window cannot be scrolled further, move cursor to top line instead. +A near full screen is `next-screen-context-lines' less than a full screen. +Negative ARG means scroll upward. +If ARG is the atom `-', scroll upward by nearly full screen." + (interactive "P") + (cond + ((eq arg '-) (cua-scroll-up nil)) + ((< (prefix-numeric-value arg) 0) + (cua-scroll-up (- (prefix-numeric-value arg)))) + ((bobp) + (scroll-down arg)) ; signal error + (t + (condition-case nil + (scroll-down arg) + (beginning-of-buffer (goto-char (point-min))))))) + ;;; Cursor indications (defun cua--update-indications () - (let ((cursor - (cond - ((and cua--global-mark-active - (stringp cua-global-mark-cursor-color)) - cua-global-mark-cursor-color) - ((and buffer-read-only - (stringp cua-read-only-cursor-color)) - cua-read-only-cursor-color) - ((and (stringp cua-overwrite-cursor-color) - (or overwrite-mode - (and cua--rectangle (cua--rectangle-padding)))) - cua-overwrite-cursor-color) - (t cua-normal-cursor-color)))) - (if (and cursor - (not (equal cursor (frame-parameter nil 'cursor-color)))) - (set-cursor-color cursor)) - cursor)) + (let* ((cursor + (cond + ((and cua--global-mark-active + cua-global-mark-cursor-color) + cua-global-mark-cursor-color) + ((and buffer-read-only + cua-read-only-cursor-color) + cua-read-only-cursor-color) + ((and cua-overwrite-cursor-color + (or overwrite-mode + (and cua--rectangle (cua--rectangle-padding)))) + cua-overwrite-cursor-color) + (t cua-normal-cursor-color))) + (color (if (consp cursor) (cdr cursor) cursor)) + (type (if (consp cursor) (car cursor) cursor))) + (if (and color + (stringp color) + (not (equal color (frame-parameter nil 'cursor-color)))) + (set-cursor-color color)) + (if (and type + (symbolp type) + (not (eq type default-cursor-type))) + (setq default-cursor-type type)))) ;;; Pre-command hook @@ -1108,6 +1226,10 @@ Extra commands should be added to `cua-movement-commands'") (define-key cua-global-keymap [remap undo] 'cua-undo) (define-key cua-global-keymap [remap advertised-undo] 'cua-undo) + ;; scrolling + (define-key cua-global-keymap [remap scroll-up] 'cua-scroll-up) + (define-key cua-global-keymap [remap scroll-down] 'cua-scroll-down) + (define-key cua--cua-keys-keymap [(control x) timeout] 'kill-region) (define-key cua--cua-keys-keymap [(control c) timeout] 'copy-region-as-kill) (define-key cua--cua-keys-keymap [(control z)] 'undo) @@ -1189,7 +1311,9 @@ paste (in addition to the normal emacs bindings)." (add-hook 'post-command-hook 'cua--post-command-handler) (if (and cua-enable-modeline-indications (not (assoc 'cua-mode minor-mode-alist))) (setq minor-mode-alist (cons '(cua-mode cua--status-string) minor-mode-alist))) - ) + (if cua-enable-cursor-indications + (cua--update-indications))) + (remove-hook 'pre-command-hook 'cua--pre-command-handler) (remove-hook 'post-command-hook 'cua--post-command-handler)) @@ -1212,6 +1336,7 @@ paste (in addition to the normal emacs bindings)." (delete-selection-mode -1)) (if (and (boundp 'pc-selection-mode) pc-selection-mode) (pc-selection-mode -1)) + (cua--deactivate) (setq transient-mark-mode (and cua-mode (if cua-highlight-region-shift-only (not cua--explicit-region-start) diff --git a/lisp/emulation/cua-rect.el b/lisp/emulation/cua-rect.el index fefd7001029..965fe63bced 100644 --- a/lisp/emulation/cua-rect.el +++ b/lisp/emulation/cua-rect.el @@ -1,6 +1,6 @@ ;;; cua-rect.el --- CUA unified rectangle support -;; Copyright (C) 1997-2002 Free Software Foundation, Inc. +;; Copyright (C) 1997-2002, 2004 Free Software Foundation, Inc. ;; Author: Kim F. Storm <storm@cua.dk> ;; Keywords: keyboard emulations convenience CUA @@ -1057,19 +1057,30 @@ The numbers are formatted according to the FORMAT string." (insert (format fmt first)) (setq first (+ first incr))))) +(defmacro cua--convert-rectangle-as (command) + `(cua--rectangle-operation 'clear nil nil nil + '(lambda (s e l r) + (,command s e)))) + (defun cua-upcase-rectangle () "Convert the rectangle to upper case." (interactive) - (cua--rectangle-operation 'clear nil nil nil - '(lambda (s e l r) - (upcase-region s e)))) + (cua--convert-rectangle-as upcase-region)) (defun cua-downcase-rectangle () "Convert the rectangle to lower case." (interactive) - (cua--rectangle-operation 'clear nil nil nil - '(lambda (s e l r) - (downcase-region s e)))) + (cua--convert-rectangle-as downcase-region)) + +(defun cua-upcase-initials-rectangle () + "Convert the rectangle initials to upper case." + (interactive) + (cua--convert-rectangle-as upcase-initials-region)) + +(defun cua-capitalize-rectangle () + "Convert the rectangle to proper case." + (interactive) + (cua--convert-rectangle-as capitalize-region)) ;;; Replace/rearrange text in current rectangle diff --git a/lisp/emulation/pc-select.el b/lisp/emulation/pc-select.el index c7ea973467f..188e335687c 100644 --- a/lisp/emulation/pc-select.el +++ b/lisp/emulation/pc-select.el @@ -61,7 +61,7 @@ ;; Eli Barzilay (eli@cs.bgu.ac.il) suggested the sexps functions and ;; keybindings. ;; -;; Ok, some details about the idea of pc-selection-mode: +;; Ok, some details about the idea of PC Selection mode: ;; ;; o The standard keys for moving around (right, left, up, down, home, end, ;; prior, next, called "move-keys" from now on) will always de-activate @@ -114,23 +114,23 @@ This gives mostly Emacs-like behaviour with only the selection keys enabled." :group 'pc-select) (defvar pc-select-saved-settings-alist nil - "The values of the variables before `pc-selection-mode' was toggled on. -When `pc-selection-mode' is toggled on, it sets quite a few variables + "The values of the variables before PC Selection mode was toggled on. +When PC Selection mode is toggled on, it sets quite a few variables for its own purposes. This alist holds the original values of the -variables `pc-selection-mode' had set, so that these variables can be -restored to their original values when `pc-selection-mode' is toggled off.") +variables PC Selection mode had set, so that these variables can be +restored to their original values when PC Selection mode is toggled off.") (defvar pc-select-map nil - "The keymap used as the global map when `pc-selection-mode' is on." ) + "The keymap used as the global map when PC Selection mode is on." ) (defvar pc-select-saved-global-map nil - "The global map that was in effect when `pc-selection-mode' was toggled on.") + "The global map that was in effect when PC Selection mode was toggled on.") (defvar pc-select-key-bindings-alist nil - "This alist holds all the key bindings `pc-selection-mode' sets.") + "This alist holds all the key bindings PC Selection mode sets.") (defvar pc-select-default-key-bindings nil - "These key bindings always get set by `pc-selection-mode'.") + "These key bindings always get set by PC Selection mode.") (unless pc-select-default-key-bindings (let ((lst @@ -250,7 +250,7 @@ These key bindings get installed when running in a tty, but only if (defvar pc-select-old-M-delete-binding nil "Holds the old mapping of [M-delete] in the `function-key-map'. This variable holds the value associated with [M-delete] in the -`function-key-map' before `pc-selection-mode' had changed that +`function-key-map' before PC Selection mode had changed that association.") ;;;; @@ -842,7 +842,7 @@ M-LEFT and M-RIGHT move back or forward one word or sexp, disabling the mark. S-M-LEFT and S-M-RIGHT move back or forward one word or sexp, leaving the mark behind. To control whether these keys move word-wise or sexp-wise set the variable `pc-select-meta-moves-sexps' after loading pc-select.el but before -turning `pc-selection-mode' on. +turning PC Selection mode on. C-DOWN and C-UP move back or forward a paragraph, disabling the mark. S-C-DOWN and S-C-UP move back or forward a paragraph, leaving the mark behind. @@ -864,7 +864,7 @@ C-INSERT copies the region into the kill ring (`copy-region-as-kill'). In addition, certain other PC bindings are imitated (to avoid this, set the variable `pc-select-selection-keys-only' to t after loading pc-select.el -but before calling `pc-selection-mode'): +but before calling PC Selection mode): F6 other-window DELETE delete-char @@ -974,7 +974,8 @@ but before calling `pc-selection-mode'): Change mark behaviour to emulate Motif, MAC or MS-Windows cut and paste style, and cursor movement commands. This mode enables Delete Selection mode and Transient Mark mode. -You must modify via \\[customize] for this variable to have an effect." +Setting this variable directly does not take effect; +you must modify it using \\[customize] or \\[pc-selection-mode]." :set (lambda (symbol value) (pc-selection-mode (if value 1 -1))) :initialize 'custom-initialize-default diff --git a/lisp/eshell/.arch-inventory b/lisp/eshell/.arch-inventory new file mode 100644 index 00000000000..b5d82cdd6fc --- /dev/null +++ b/lisp/eshell/.arch-inventory @@ -0,0 +1,4 @@ +# Generated files +precious ^(esh-groups)\.el$ + +# arch-tag: 8dc7bfaa-6ca6-4be0-915a-1e539c3dabfb diff --git a/lisp/eshell/.cvsignore b/lisp/eshell/.cvsignore index 16ccfcc8c0c..e1d7683a723 100644 --- a/lisp/eshell/.cvsignore +++ b/lisp/eshell/.cvsignore @@ -1 +1,14 @@ +COPYING +FEATURES +INSTALL +Makefile +NEWS +README +_darcs +_pkg.el +auto-autoloads.el esh-groups.el +esh-toggle.el +eshell-auto.el +eshell.info +eshell.texi diff --git a/lisp/eshell/em-alias.el b/lisp/eshell/em-alias.el index 0312f9d7ada..02af7531b3f 100644 --- a/lisp/eshell/em-alias.el +++ b/lisp/eshell/em-alias.el @@ -1,6 +1,6 @@ ;;; em-alias.el --- creation and management of command aliases -;; Copyright (C) 1999, 2000 Free Software Foundation +;; Copyright (C) 1999, 2000, 2004 Free Software Foundation ;; Author: John Wiegley <johnw@gnu.org> @@ -24,6 +24,7 @@ (provide 'em-alias) (eval-when-compile (require 'esh-maint)) +(require 'eshell) (defgroup eshell-alias nil "Command aliases allow for easy definition of alternate commands." diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el index 73837c324a5..7b74069454b 100644 --- a/lisp/eshell/em-dirs.el +++ b/lisp/eshell/em-dirs.el @@ -1,6 +1,6 @@ ;;; em-dirs.el --- directory navigation commands -;; Copyright (C) 1999, 2000 Free Software Foundation +;; Copyright (C) 1999, 2000, 2004 Free Software Foundation ;; Author: John Wiegley <johnw@gnu.org> @@ -24,6 +24,7 @@ (provide 'em-dirs) (eval-when-compile (require 'esh-maint)) +(require 'eshell) (defgroup eshell-dirs nil "Directory navigation involves changing directories, examining the diff --git a/lisp/eshell/em-glob.el b/lisp/eshell/em-glob.el index 24447c3e66d..c84962e66b0 100644 --- a/lisp/eshell/em-glob.el +++ b/lisp/eshell/em-glob.el @@ -122,10 +122,6 @@ This option slows down recursive glob processing by quite a bit." :type '(repeat (cons character (choice regexp function))) :group 'eshell-glob) -;;; Internal Variables: - -(defvar eshell-glob-chars-regexp nil) - ;;; Functions: (defun eshell-glob-initialize () @@ -134,8 +130,6 @@ This option slows down recursive glob processing by quite a bit." (when (boundp 'eshell-special-chars-outside-quoting) (set (make-local-variable 'eshell-special-chars-outside-quoting) (append eshell-glob-chars-list eshell-special-chars-outside-quoting))) - (set (make-local-variable 'eshell-glob-chars-regexp) - (format "[%s]+" (apply 'string eshell-glob-chars-list))) (add-hook 'eshell-parse-argument-hook 'eshell-parse-glob-chars t t) (add-hook 'eshell-pre-rewrite-command-hook 'eshell-no-command-globbing nil t)) @@ -184,6 +178,8 @@ interpretation." (buffer-substring-no-properties (1- (point)) (1+ end)) (goto-char (1+ end)))))))))) +(defvar eshell-glob-chars-regexp nil) + (defun eshell-glob-regexp (pattern) "Convert glob-pattern PATTERN to a regular expression. The basic syntax is: @@ -204,8 +200,11 @@ set to true, then these characters will match themselves in the resulting regular expression." (let ((matched-in-pattern 0) ; How much of PATTERN handled regexp) - (while (string-match eshell-glob-chars-regexp - pattern matched-in-pattern) + (while (string-match + (or eshell-glob-chars-regexp + (set (make-local-variable 'eshell-glob-chars-regexp) + (format "[%s]+" (apply 'string eshell-glob-chars-list)))) + pattern matched-in-pattern) (let* ((op-begin (match-beginning 0)) (op-char (aref pattern op-begin))) (setq regexp diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index b38c7a519ec..f4bfea798e0 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -24,6 +24,7 @@ (provide 'em-hist) (eval-when-compile (require 'esh-maint)) +(require 'eshell) (defgroup eshell-hist nil "This module provides command history management." diff --git a/lisp/eshell/em-unix.el b/lisp/eshell/em-unix.el index 8446eb1aa9d..43d3c9c4e5e 100644 --- a/lisp/eshell/em-unix.el +++ b/lisp/eshell/em-unix.el @@ -1,6 +1,6 @@ ;;; em-unix.el --- UNIX command aliases -;; Copyright (C) 1999, 2000, 2001 Free Software Foundation +;; Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation ;; Author: John Wiegley <johnw@gnu.org> @@ -24,6 +24,7 @@ (provide 'em-unix) (eval-when-compile (require 'esh-maint)) +(require 'eshell) (defgroup eshell-unix nil "This module defines many of the more common UNIX utilities as diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el index 9b4f54ce8bf..477d8b410ec 100644 --- a/lisp/eshell/esh-cmd.el +++ b/lisp/eshell/esh-cmd.el @@ -1246,9 +1246,8 @@ be finished later after the completion of an asynchronous subprocess." (setq program (eshell-search-path name)) (let* ((esym (eshell-find-alias-function name)) (sym (or esym (intern-soft name)))) - (if (and sym (fboundp sym) - (or esym eshell-prefer-lisp-functions - (not program))) + (if (and (or esym (and sym (fboundp sym))) + (or eshell-prefer-lisp-functions (not direct))) (let ((desc (let ((inhibit-redisplay t)) (save-window-excursion (prog1 diff --git a/lisp/eshell/esh-io.el b/lisp/eshell/esh-io.el index 8d1036b736e..d832fa9cd03 100644 --- a/lisp/eshell/esh-io.el +++ b/lisp/eshell/esh-io.el @@ -333,22 +333,23 @@ it defaults to `insert'." (cond ((stringp target) (let ((redir (assoc target eshell-virtual-targets))) - (if redir - (if (nth 2 redir) - (funcall (nth 1 redir) mode) - (nth 1 redir)) - (let* ((exists (get-file-buffer target)) - (buf (find-file-noselect target t))) - (with-current-buffer buf - (if buffer-read-only - (error "Cannot write to read-only file `%s'" target)) - (set (make-local-variable 'eshell-output-file-buffer) - (if (eq exists buf) 0 t)) - (cond ((eq mode 'overwrite) - (erase-buffer)) - ((eq mode 'append) - (goto-char (point-max)))) - (point-marker)))))) + (if redir + (if (nth 2 redir) + (funcall (nth 1 redir) mode) + (nth 1 redir)) + (let* ((exists (get-file-buffer target)) + (buf (find-file-noselect target t))) + (with-current-buffer buf + (if buffer-read-only + (error "Cannot write to read-only file `%s'" target)) + (set (make-local-variable 'eshell-output-file-buffer) + (if (eq exists buf) 0 t)) + (cond ((eq mode 'overwrite) + (erase-buffer)) + ((eq mode 'append) + (goto-char (point-max)))) + (point-marker)))))) + ((or (bufferp target) (and (boundp 'eshell-buffer-shorthand) (symbol-value 'eshell-buffer-shorthand) @@ -363,15 +364,18 @@ it defaults to `insert'." ((eq mode 'append) (goto-char (point-max)))) (point-marker)))) - ((functionp target) - nil) + + ((functionp target) nil) + ((symbolp target) (if (eq mode 'overwrite) (set target nil)) target) + ((or (eshell-processp target) (markerp target)) target) + (t (error "Illegal redirection target: %s" (eshell-stringify target))))) @@ -481,7 +485,8 @@ Returns what was actually sent, or nil if nothing was sent." (let ((moving (= (point) target))) (save-excursion (goto-char target) - (setq object (eshell-stringify object)) + (unless (stringp object) + (setq object (eshell-stringify object))) (insert-and-inherit object) (set-marker target (point-marker))) (if moving @@ -489,7 +494,8 @@ Returns what was actually sent, or nil if nothing was sent." ((eshell-processp target) (when (eq (process-status target) 'run) - (setq object (eshell-stringify object)) + (unless (stringp object) + (setq object (eshell-stringify object))) (process-send-string target object))) ((consp target) diff --git a/lisp/eshell/esh-module.el b/lisp/eshell/esh-module.el index 4c8ffceef78..dcbf77364f4 100644 --- a/lisp/eshell/esh-module.el +++ b/lisp/eshell/esh-module.el @@ -1,6 +1,6 @@ ;;; esh-module.el --- Eshell modules -;; Copyright (C) 1999, 2000 Free Software Foundation +;; Copyright (C) 1999, 2000, 2004 Free Software Foundation ;; Author: John Wiegley <johnw@gnu.org> ;; Keywords: processes @@ -41,32 +41,33 @@ customizing the variable `eshell-modules-list'." (defun eshell-load-defgroups (&optional directory) "Load `defgroup' statements from Eshell's module files." - (with-current-buffer - (find-file-noselect (expand-file-name "esh-groups.el" directory)) - (erase-buffer) - (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n") - (let ((files (directory-files (or directory - (car command-line-args-left)) - nil "\\`em-.*\\.el\\'"))) - (while files - (message "Loading defgroup from `%s'" (car files)) - (let (defgroup) - (catch 'handled - (with-current-buffer (find-file-noselect (car files)) - (goto-char (point-min)) - (while t - (forward-sexp) - (if (eobp) (throw 'handled t)) - (backward-sexp) - (let ((begin (point)) - (defg (looking-at "(defgroup"))) + (let ((vc-handled-backends nil)) ; avoid VC fucking things up + (with-current-buffer + (find-file-noselect (expand-file-name "esh-groups.el" directory)) + (erase-buffer) + (insert ";;; do not modify this file; it is auto-generated -*- no-byte-compile: t -*-\n\n") + (let ((files (directory-files (or directory + (car command-line-args-left)) + nil "\\`em-.*\\.el\\'"))) + (while files + (message "Loading defgroup from `%s'" (car files)) + (let (defgroup) + (catch 'handled + (with-current-buffer (find-file-noselect (car files)) + (goto-char (point-min)) + (while t (forward-sexp) - (if defg - (setq defgroup (buffer-substring begin (point)))))))) - (if defgroup - (insert defgroup "\n\n"))) - (setq files (cdr files)))) - (save-buffer))) + (if (eobp) (throw 'handled t)) + (backward-sexp) + (let ((begin (point)) + (defg (looking-at "(defgroup"))) + (forward-sexp) + (if defg + (setq defgroup (buffer-substring begin (point)))))))) + (if defgroup + (insert defgroup "\n\n"))) + (setq files (cdr files)))) + (save-buffer)))) ;; load the defgroup's for the standard extension modules, so that ;; documentation can be provided when the user customize's diff --git a/lisp/eshell/esh-test.el b/lisp/eshell/esh-test.el index 54edf5e35ab..076505da14e 100644 --- a/lisp/eshell/esh-test.el +++ b/lisp/eshell/esh-test.el @@ -167,13 +167,7 @@ (local-set-key [(control ?m)] 'eshell-test-goto-func) (local-set-key [return] 'eshell-test-goto-func) - (insert "Testing Eshell under " - (format "GNU Emacs %s (%s%s)" - emacs-version - system-configuration - (cond ((featurep 'motif) ", Motif") - ((featurep 'x-toolkit) ", X toolkit") - (t "")))) + (insert "Testing Eshell under " (emacs-version)) (switch-to-buffer test-buffer) (delete-other-windows)) (eshell-for funcname (sort (all-completions "eshell-test--" diff --git a/lisp/facemenu.el b/lisp/facemenu.el index 3893e320655..e9af58fc73d 100644 --- a/lisp/facemenu.el +++ b/lisp/facemenu.el @@ -480,9 +480,19 @@ of colors that the current display can handle." (when (and (null list) (> (display-color-cells) 0)) (setq list (defined-colors)) ;; Delete duplicate colors. + + ;; Identify duplicate colors by the name rather than the color + ;; value. For example, on MS-Windows, logical colors are added to + ;; the list that might have the same value but have different + ;; names and meanings. For example, `SystemMenuText' (the color + ;; w32 uses for the text in menu entries) and `SystemWindowText' + ;; (the default color w32 uses for the text in windows and + ;; dialogs) may be the same display color and be adjacent in the + ;; list. Detecting duplicates by name insures that both of these + ;; colors remain despite identical color values. (let ((l list)) (while (cdr l) - (if (facemenu-color-equal (car l) (car (cdr l))) + (if (facemenu-color-name-equal (car l) (car (cdr l))) (setcdr l (cdr (cdr l))) (setq l (cdr l))))) (when (memq (display-visual-class) '(gray-scale pseudo-color direct-color)) @@ -515,6 +525,22 @@ determine the correct answer." (cond ((equal a b) t) ((equal (color-values a) (color-values b))))) +(defun facemenu-color-name-equal (a b) + "Return t if colors A and B are the same color. +A and B should be strings naming colors. These names are +downcased, stripped of spaces and the string `grey' is turned +into `gray'. This accommodates alternative spellings of colors +found commonly in the list. It returns nil if the colors differ." + (progn + (setq a (replace-regexp-in-string "grey" "gray" + (replace-regexp-in-string " " "" + (downcase a))) + b (replace-regexp-in-string "grey" "gray" + (replace-regexp-in-string " " "" + (downcase b)))) + + (equal a b))) + (defun facemenu-add-face (face &optional start end) "Add FACE to text between START and END. If START is nil or START to END is empty, add FACE to next typed character diff --git a/lisp/faces.el b/lisp/faces.el index 882ef1cba58..5ab91b5f1ba 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -240,27 +240,24 @@ If FRAME is omitted or nil, use the selected frame." (defun face-differs-from-default-p (face &optional frame) - "Non-nil if FACE displays differently from the default face. + "Return non-nil if FACE displays differently from the default face. If the optional argument FRAME is given, report on face FACE in that frame. If FRAME is t, report on the defaults for face FACE (for new frames). -If FRAME is omitted or nil, use the selected frame. -A face is considered to be ``the same'' as the default face if it is -actually specified in the same way (equal attributes) or if it is -fully-unspecified, and thus inherits the attributes of any face it -is displayed on top of." - (cond ((eq frame t) (setq frame nil)) - ((null frame) (setq frame (selected-frame)))) - (let* ((v1 (internal-lisp-face-p face frame)) - (n (if v1 (length v1) 0)) - (v2 (internal-lisp-face-p 'default frame)) - (i 1)) - (unless v1 - (error "Not a face: %S" face)) - (while (and (< i n) - (or (eq 'unspecified (aref v1 i)) - (equal (aref v1 i) (aref v2 i)))) - (setq i (1+ i))) - (< i n))) +If FRAME is omitted or nil, use the selected frame." + (let ((attrs + '(:family :width :height :weight :slant :foreground + :foreground :background :underline :overline + :strike-through :box :inverse-video)) + (differs nil)) + (while (and attrs (not differs)) + (let* ((attr (pop attrs)) + (attr-val (face-attribute face attr frame t))) + (when (and + (not (eq attr-val 'unspecified)) + (display-supports-face-attributes-p (list attr attr-val) + frame)) + (setq differs attr)))) + differs)) (defun face-nontrivial-p (face &optional frame) @@ -1310,9 +1307,12 @@ If FRAME is nil, the current FRAME is used." (memq 'tty options)) (and (memq 'motif options) (featurep 'motif)) + (and (memq 'gtk options) + (featurep 'gtk)) (and (memq 'lucid options) (featurep 'x-toolkit) - (not (featurep 'motif))) + (not (featurep 'motif)) + (not (featurep 'gtk))) (and (memq 'x-toolkit options) (featurep 'x-toolkit)))) ((eq req 'min-colors) @@ -1487,33 +1487,6 @@ If omitted or nil, that stands for the selected frame's display." (t (> (tty-color-gray-shades display) 2))))) -(defun display-supports-face-attributes-p (attributes &optional display) - "Return non-nil if all the face attributes in ATTRIBUTES are supported. -The optional argument DISPLAY can be a display name, a frame, or -nil (meaning the selected frame's display) - -The definition of `supported' is somewhat heuristic, but basically means -that a face containing all the attributes in ATTRIBUTES, when merged -with the default face for display, can be represented in a way that's - - (1) different in appearance than the default face, and - (2) `close in spirit' to what the attributes specify, if not exact. - -Point (2) implies that a `:weight black' attribute will be satisfied by -any display that can display bold, and a `:foreground \"yellow\"' as long -as it can display a yellowish color, but `:slant italic' will _not_ be -satisfied by the tty display code's automatic substitution of a `dim' -face for italic." - (let ((frame - (if (framep display) - display - (car (frames-on-display-list display))))) - ;; For now, we assume that non-tty displays can support everything. - ;; Later, we should add the ability to query about specific fonts, - ;; colors, etc. - (or (memq (framep frame) '(x w32 mac)) - (tty-supports-face-attributes-p attributes frame)))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Background mode. @@ -1777,7 +1750,7 @@ created." ;; Update a frame's faces when we change its default font. -(defalias 'frame-update-faces 'ignore) +(defalias 'frame-update-faces 'ignore "") (make-obsolete 'frame-update-faces "no longer necessary." "21.1") ;; Update the colors of FACE, after FRAME's own colors have been diff --git a/lisp/ffap.el b/lisp/ffap.el index 38f7f92405e..dc78bd355be 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -941,7 +941,7 @@ If t, `ffap-tex-init' will initialize this when needed.") ;; * no commas (good for latex) (file "--:$+<>@-Z_a-z~" "<@" "@>;.,!?:") ;; An url, or maybe a email/news message-id: - (url "--:=&?$+@-Z_a-z~#,%" "^A-Za-z0-9" ":;.,!?") + (url "--:=&?$+@-Z_a-z~#,%;" "^A-Za-z0-9" ":;.,!?") ;; Find a string that does *not* contain a colon: (nocolon "--9$+<>@-Z_a-z~" "<@" "@>;.,!?") ;; A machine: diff --git a/lisp/files.el b/lisp/files.el index ca6719055b0..1804432ee45 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -293,7 +293,7 @@ Normally auto-save files are written under other names." :group 'auto-save) (defcustom auto-save-file-name-transforms - `(("\\`/[^/]*:\\(.+/\\)*\\(.*\\)" + `(("\\`/[^/]*:\\([^/]*/\\)*\\([^/]*\\)\\'" ;; Don't put "\\2" inside expand-file-name, since it will be ;; transformed to "/2" on DOS/Windows. ,(concat temporary-file-directory "\\2") t)) @@ -481,10 +481,15 @@ Runs the usual ange-ftp hook, but only for completion operations." (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the current OS. -This function's standard definition is trivial; it just returns the argument. -However, on some systems, the function is redefined with a definition -that really does change some file names to canonicalize certain -patterns and to guarantee valid names." +This means to guarantee valid names and perhaps to canonicalize +certain patterns. + +This function's standard definition is trivial; it just returns +the argument. However, on Windows and DOS, replace invalid +characters. On DOS, make sure to obey the 8.3 limitations. On +Windows, turn Cygwin names into native names, and also turn +slashes into backslashes if the shell requires it (see +`w32-shell-dos-semantics')." filename) (defun read-directory-name (prompt &optional dir default-dirname mustmatch initial) @@ -521,8 +526,9 @@ the value of `default-directory'." Not actually set up until the first time you use it.") (defun parse-colon-path (cd-path) - "Explode a colon-separated search path into a list of directory names. -\(For values of `colon' equal to `path-separator'.)" + "Explode a search path into a list of directory names. +Directories are separated by occurrences of `path-separator' +\(which is colon in GNU and GNU-like systems)." ;; We could use split-string here. (and cd-path (let (cd-list (cd-start 0) cd-colon) @@ -555,8 +561,10 @@ Not actually set up until the first time you use it.") (defun cd (dir) "Make DIR become the current buffer's default directory. -If your environment includes a `CDPATH' variable, try each one of that -colon-separated list of directories when resolving a relative directory name." +If your environment includes a `CDPATH' variable, try each one of +that list of directories (separated by occurrences of +`path-separator') when resolving a relative directory name. +The path separator is colon in GNU and GNU-like systems." (interactive (list (read-directory-name "Change default directory: " default-directory default-directory @@ -616,6 +624,8 @@ PATH-AND-SUFFIXES is a pair of lists (DIRECTORIES . SUFFIXES)." (suffix (concat (regexp-opt (cdr path-and-suffixes) t) "\\'")) (string-dir (file-name-directory string))) (dolist (dir (car path-and-suffixes)) + (unless dir + (setq dir default-directory)) (if string-dir (setq dir (expand-file-name string-dir dir))) (when (file-directory-p dir) (dolist (file (file-name-all-completions @@ -640,9 +650,10 @@ This is an interface to the function `load'." (defun file-remote-p (file) "Test whether FILE specifies a location on a remote system." - (let ((handler (find-file-name-handler file 'file-local-copy))) + (let ((handler (find-file-name-handler file 'file-remote-p))) (if handler - (get handler 'file-remote-p)))) + (funcall handler 'file-remote-p file) + nil))) (defun file-local-copy (file) "Copy the file FILE into a temporary file on this machine. @@ -661,21 +672,23 @@ The truename of a file name is found by chasing symbolic links both at the level of the file and at the level of the directories containing it, until no links are left at any level. -The arguments COUNTER and PREV-DIRS are used only in recursive calls. -Do not specify them in other calls." - ;; COUNTER can be a cons cell whose car is the count of how many more links - ;; to chase before getting an error. +\(fn FILENAME)" + ;; COUNTER and PREV-DIRS are only used in recursive calls. + ;; COUNTER can be a cons cell whose car is the count of how many + ;; more links to chase before getting an error. ;; PREV-DIRS can be a cons cell whose car is an alist ;; of truenames we've just recently computed. + (cond ((or (string= filename "") (string= filename "~")) + (setq filename (expand-file-name filename)) + (if (string= filename "") + (setq filename "/"))) + ((and (string= (substring filename 0 1) "~") + (string-match "~[^/]*/?" filename)) + (let ((first-part + (substring filename 0 (match-end 0))) + (rest (substring filename (match-end 0)))) + (setq filename (concat (expand-file-name first-part) rest))))) - ;; The last test looks dubious, maybe `+' is meant here? --simon. - (if (or (string= filename "") (string= filename "~") - (and (string= (substring filename 0 1) "~") - (string-match "~[^/]*" filename))) - (progn - (setq filename (expand-file-name filename)) - (if (string= filename "") - (setq filename "/")))) (or counter (setq counter (list 100))) (let (done ;; For speed, remove the ange-ftp completion handler from the list. @@ -901,8 +914,11 @@ but the visited file name is available through the minibuffer history: type M-n to pull it into the minibuffer. Interactively, or if WILDCARDS is non-nil in a call from Lisp, -expand wildcards (if any) and visit multiple files. Wildcard expansion -can be suppressed by setting `find-file-wildcards'." +expand wildcards (if any) and visit multiple files. You can +suppress wildcard expansion by setting `find-file-wildcards'. + +To visit a file without any kind of conversion and without +automatically choosing a major mode, use \\[find-file-literally]." (interactive (find-file-read-args "Find file: " nil)) (let ((value (find-file-noselect filename nil nil wildcards))) @@ -1353,21 +1369,22 @@ that are visiting the various files." rawfile truename number)))))) (defun find-file-noselect-1 (buf filename nowarn rawfile truename number) - (let ((inhibit-read-only t) - error) + (let (error) (with-current-buffer buf (kill-local-variable 'find-file-literally) ;; Needed in case we are re-visiting the file with a different ;; text representation. (kill-local-variable 'buffer-file-coding-system) (kill-local-variable 'cursor-type) - (erase-buffer) + (let ((inhibit-read-only t)) + (erase-buffer)) (and (default-value 'enable-multibyte-characters) (not rawfile) (set-buffer-multibyte t)) (if rawfile (condition-case () - (insert-file-contents-literally filename t) + (let ((inhibit-read-only t)) + (insert-file-contents-literally filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) @@ -1377,7 +1394,8 @@ that are visiting the various files." ;; Unconditionally set error (setq error t))) (condition-case () - (insert-file-contents filename t) + (let ((inhibit-read-only t)) + (insert-file-contents filename t)) (file-error (when (and (file-exists-p filename) (not (file-readable-p filename))) @@ -2325,7 +2343,7 @@ However, the mode will not be changed if (defun set-visited-file-name (filename &optional no-query along-with-file) "Change name of file visited in current buffer to FILENAME. The next time the buffer is saved it will go in the newly specified file. -nil or empty string as argument means make buffer not be visiting any file. +FILENAME nil or an empty string means make buffer not be visiting any file. Remember to delete the initial contents of the minibuffer if you wish to pass an empty string as the argument. @@ -2897,10 +2915,8 @@ on a DOS/Windows machine, it returns FILENAME on expanded form." (file-name-as-directory (expand-file-name (or directory default-directory)))) (setq filename (expand-file-name filename)) - (let ((hf (find-file-name-handler filename 'file-local-copy)) - (hd (find-file-name-handler directory 'file-local-copy))) - (when (and hf (not (get hf 'file-remote-p))) (setq hf nil)) - (when (and hd (not (get hd 'file-remote-p))) (setq hd nil)) + (let ((hf (find-file-name-handler filename 'file-remote-p)) + (hd (find-file-name-handler directory 'file-remote-p))) (if ;; Conditions for separate trees (or ;; Test for different drives on DOS/Windows @@ -3010,7 +3026,7 @@ the last real save, but optional arg FORCE non-nil means delete anyway." (defcustom before-save-hook nil "Normal hook that is run before a buffer is saved to its file." - :options '(copyright-update) + :options '(copyright-update time-stamp) :type 'hook :group 'files) @@ -3466,7 +3482,10 @@ this function is called. The idea behind the NOCONFIRM argument is that it should be non-nil if the buffer is going to be reverted without asking the user. In such situations, one has to be careful with potentially -time consuming operations.") +time consuming operations. + +For more information on how this variable is used by Auto Revert mode, +see Info node `(emacs-xtra)Supporting additional buffers'.") (defvar before-revert-hook nil "Normal hook for `revert-buffer' to run before reverting. @@ -4019,7 +4038,7 @@ by `sh' are supported." "Expand wildcard pattern PATTERN. This returns a list of file names which match the pattern. -If PATTERN is written as an absolute relative file name, +If PATTERN is written as an absolute file name, the values are absolute also. If PATTERN is written as a relative file name, it is interpreted @@ -4230,7 +4249,7 @@ This works by running a directory listing program whose name is in the variable `insert-directory-program'. If WILDCARD, it also runs the shell specified by `shell-file-name'. -When SWITCHES contains the long `--dired' option,this function +When SWITCHES contains the long `--dired' option, this function treats it specially, for the sake of dired. However, the normally equivalent short `-D' option is just passed on to `insert-directory-program', as any other option." @@ -4307,6 +4326,8 @@ normally equivalent short `-D' option is just passed on to ;; If `insert-directory-program' failed, signal an error. (unless (eq 0 result) + ;; Delete the error message it may have output. + (delete-region beg (point)) ;; On non-Posix systems, we cannot open a directory, so ;; don't even try, because that will always result in ;; the ubiquitous "Access denied". Instead, show the @@ -4329,21 +4350,26 @@ normally equivalent short `-D' option is just passed on to (when (looking-at "//SUBDIRED//") (delete-region (point) (progn (forward-line 1) (point))) (forward-line -1)) - (let ((end (line-end-position))) - (forward-word 1) - (forward-char 3) - (while (< (point) end) - (let ((start (+ beg (read (current-buffer)))) - (end (+ beg (read (current-buffer))))) - (if (= (char-after end) ?\n) - (put-text-property start end 'dired-filename t) - ;; It seems that we can't trust ls's output as to - ;; byte positions of filenames. - (put-text-property beg (point) 'dired-filename nil) - (end-of-line)))) - (goto-char end) - (beginning-of-line) - (delete-region (point) (progn (forward-line 2) (point))))) + (if (looking-at "//DIRED//") + (let ((end (line-end-position))) + (forward-word 1) + (forward-char 3) + (while (< (point) end) + (let ((start (+ beg (read (current-buffer)))) + (end (+ beg (read (current-buffer))))) + (if (= (char-after end) ?\n) + (put-text-property start end 'dired-filename t) + ;; It seems that we can't trust ls's output as to + ;; byte positions of filenames. + (put-text-property beg (point) 'dired-filename nil) + (end-of-line)))) + (goto-char end) + (beginning-of-line) + (delete-region (point) (progn (forward-line 2) (point)))) + (forward-line 1) + (if (looking-at "//DIRED-OPTIONS//") + (delete-region (point) (progn (forward-line 1) (point))) + (forward-line 1)))) ;; Now decode what read if necessary. (let ((coding (or coding-system-for-read @@ -4416,7 +4442,7 @@ be a predicate function such as `yes-or-no-p'." :type '(choice (const :tag "Ask with yes-or-no-p" yes-or-no-p) (const :tag "Ask with y-or-n-p" y-or-n-p) (const :tag "Don't confirm" nil)) - :group 'emacs + :group 'convenience :version "21.1") (defun save-buffers-kill-emacs (&optional arg) @@ -4470,7 +4496,7 @@ With prefix arg, silently save all file-visiting buffers, then kill." ;; Get a list of the indices of the args which are file names. (file-arg-indices (cdr (or (assq operation - ;; The first five are special because they + ;; The first six are special because they ;; return a file name. We want to include the /: ;; in the return value. ;; So just avoid stripping it in the first place. @@ -4479,11 +4505,21 @@ With prefix arg, silently save all file-visiting buffers, then kill." (file-name-as-directory . nil) (directory-file-name . nil) (file-name-sans-versions . nil) + (find-backup-file-name . nil) ;; `identity' means just return the first arg - ;; as stripped of its quoting. - (substitute-in-file-name . identity) + ;; not stripped of its quoting. + (substitute-in-file-name identity) + ;; `add' means add "/:" to the result. + (file-truename add 0) + ;; `quote' means add "/:" to buffer-file-name. + (insert-file-contents quote 0) + ;; `unquote-then-quote' means set buffer-file-name + ;; temporarily to unquoted filename. + (verify-visited-file-modtime unquote-then-quote) + ;; List the arguments which are filenames. (file-name-completion 1) (file-name-all-completions 1) + (write-region 2 5) (rename-file 0 1) (copy-file 0 1) (make-symbolic-link 0 1) @@ -4491,9 +4527,12 @@ With prefix arg, silently save all file-visiting buffers, then kill." ;; For all other operations, treat the first argument only ;; as the file name. '(nil 0)))) + method ;; Copy ARGUMENTS so we can replace elements in it. (arguments (copy-sequence arguments))) - ;; Strip off the /: from the file names that have this handler. + (if (symbolp (car file-arg-indices)) + (setq method (pop file-arg-indices))) + ;; Strip off the /: from the file names that have it. (save-match-data (while (consp file-arg-indices) (let ((pair (nthcdr (car file-arg-indices) arguments))) @@ -4504,9 +4543,21 @@ With prefix arg, silently save all file-visiting buffers, then kill." "/" (substring (car pair) 2))))) (setq file-arg-indices (cdr file-arg-indices)))) - (if (eq file-arg-indices 'identity) - (car arguments) - (apply operation arguments)))) + (cond ((eq method 'identity) + (car arguments)) + ((eq method 'add) + (concat "/:" (apply operation arguments))) + ((eq method 'quote) + (prog1 (apply operation arguments) + (setq buffer-file-name (concat "/:" buffer-file-name)))) + ((eq method 'unquote-then-quote) + (let (res) + (setq buffer-file-name (substring buffer-file-name 2)) + (setq res (apply operation arguments)) + (setq buffer-file-name (concat "/:" buffer-file-name)) + res)) + (t + (apply operation arguments))))) (define-key ctl-x-map "\C-f" 'find-file) (define-key ctl-x-map "\C-r" 'find-file-read-only) diff --git a/lisp/find-dired.el b/lisp/find-dired.el index 5bef4d6bf3a..2f499f243d7 100644 --- a/lisp/find-dired.el +++ b/lisp/find-dired.el @@ -55,6 +55,16 @@ LS-SWITCHES is a list of `ls' switches to tell dired how to parse the output." :group 'find-dired) ;;;###autoload +(defcustom find-ls-subdir-switches "-al" + "`ls' switches for inserting subdirectories in `*Find*' buffers. +This should contain the \"-l\" switch. +Use the \"-F\" or \"-b\" switches if and only if you also use +them for `find-ls-option'." + :type 'string + :group 'find-dired + :version "21.4") + +;;;###autoload (defcustom find-grep-options (if (or (eq system-type 'berkeley-unix) (string-match "solaris2" system-configuration) @@ -89,8 +99,7 @@ as the final argument." (let ((dired-buffers dired-buffers)) ;; Expand DIR ("" means default-directory), and make sure it has a ;; trailing slash. - (setq dir (abbreviate-file-name - (file-name-as-directory (expand-file-name dir)))) + (setq dir (file-name-as-directory (expand-file-name dir))) ;; Check that it's really a directory. (or (file-directory-p dir) (error "find-dired needs a directory: %s" dir)) @@ -115,7 +124,7 @@ as the final argument." (setq buffer-read-only nil) (erase-buffer) (setq default-directory dir - find-args args ; save for next interactive call + find-args args ; save for next interactive call args (concat find-dired-find-program " . " (if (string= args "") "" @@ -143,6 +152,7 @@ as the final argument." ;; this does no harm) (set (make-local-variable 'dired-subdir-alist) (list (cons default-directory (point-min-marker))))) + (set (make-local-variable 'dired-subdir-switches) find-ls-subdir-switches) (setq buffer-read-only nil) ;; Subdir headlerline must come first because the first marker in ;; subdir-alist points there. @@ -267,6 +277,7 @@ Thus ARG can also contain additional grep options." (delete-process proc) (force-mode-line-update))) (message "find-dired %s finished." (current-buffer)))))) + (provide 'find-dired) diff --git a/lisp/follow.el b/lisp/follow.el index 0ae6e175386..06857fc49e9 100644 --- a/lisp/follow.el +++ b/lisp/follow.el @@ -1561,7 +1561,7 @@ non-first windows in Follow Mode." (or follow-internal-force-redisplay (progn (if (eq dest (point-max)) - ;; We're at the end, we have be be careful since + ;; We're at the end, we have to be careful since ;; the display can be aligned while `dest' can ;; be visible in several windows. (cond diff --git a/lisp/font-lock.el b/lisp/font-lock.el index 27497057a91..1f6127f3ea5 100644 --- a/lisp/font-lock.el +++ b/lisp/font-lock.el @@ -1562,17 +1562,17 @@ Sets various variables using `font-lock-defaults' (or, if nil, using (:foreground "DimGray" :weight bold :slant italic)) (((class grayscale) (background dark)) (:foreground "LightGray" :weight bold :slant italic)) - (((class color) (min-colors 88) (background light)) + (((class color) (min-colors 88) (background light)) (:foreground "Firebrick")) - (((class color) (min-colors 88) (background dark)) + (((class color) (min-colors 88) (background dark)) (:foreground "chocolate1")) - (((class color) (min-colors 16) (background light)) + (((class color) (min-colors 16) (background light)) (:foreground "red")) - (((class color) (min-colors 16) (background dark)) + (((class color) (min-colors 16) (background dark)) (:foreground "red1")) - (((class color) (min-colors 8) (background light)) + (((class color) (min-colors 8) (background light)) (:foreground "red")) - (((class color) (min-colors 8) (background dark)) + (((class color) (min-colors 8) (background dark)) (:foreground "red1")) (t (:weight bold :slant italic))) "Font Lock mode face used to highlight comments." @@ -1673,13 +1673,14 @@ Sets various variables using `font-lock-defaults' (or, if nil, using '((((class color) (min-colors 88) (background light)) (:foreground "Red" :weight bold)) (((class color) (min-colors 88) (background dark)) (:foreground "Pink" :weight bold)) (((class color) (min-colors 16) (background light)) (:foreground "Red" :weight bold)) - (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold)) (((class color) (min-colors 8)) (:foreground "red")) + (((class color) (min-colors 16) (background dark)) (:foreground "Pink" :weight bold)) + (((class color) (min-colors 8)) (:foreground "red")) (t (:inverse-video t :weight bold))) "Font Lock mode face used to highlight warnings." :group 'font-lock-highlighting-faces) (defface font-lock-preprocessor-face - '((t :inherit 'font-lock-builtin-face)) + '((t :inherit font-lock-builtin-face)) "Font Lock mode face used to highlight preprocessor directives." :group 'font-lock-highlighting-faces) @@ -1910,6 +1911,7 @@ This function could be MATCHER in a MATCH-ANCHORED `font-lock-keywords' item." "proclaim" "declaim" "declare" "symbol-macrolet" "lexical-let" "lexical-let*" "flet" "labels" "compiler-let" "destructuring-bind" "macrolet" "tagbody" "block" + "multiple-value-bind" "return" "return-from" "with-accessors" "with-compilation-unit" "with-condition-restarts" "with-hash-table-iterator" diff --git a/lisp/format.el b/lisp/format.el index 3f1f9c62987..9fb541a6943 100644 --- a/lisp/format.el +++ b/lisp/format.el @@ -741,13 +741,15 @@ to write these unknown annotations back into the file." (message "Unknown annotations: %s" unknown-ans)))))) (defun format-subtract-regions (minu subtra) - "Remove from the regions in MINUend the regions in SUBTRAhend. + "Remove from the regions in MINUEND the regions in SUBTRAHEND. A region is a dotted pair (FROM . TO). Both parameters are lists of regions. Each list must contain nonoverlapping, noncontiguous regions, in descending order. The result is also nonoverlapping, noncontiguous, and in descending order. The first element of MINUEND can have a cdr of nil, indicating that the end of that region is not -yet known." +yet known. + +\(fn MINUEND SUBTRAHEND)" (let* ((minuend (copy-alist minu)) (subtrahend (copy-alist subtra)) (m (car minuend)) @@ -800,8 +802,8 @@ in the region, it is treated as though it were DEFAULT." Inserts each element of the given LIST of buffer annotations at its appropriate place. Use second arg OFFSET if the annotations' locations are not relative to the beginning of the buffer: annotations will be inserted -at their location-OFFSET+1 \(ie, the offset is treated as the character number -of the first character in the buffer)." +at their location-OFFSET+1 \(ie, the offset is treated as the position of +the first character in the buffer)." (if (not offset) (setq offset 0) (setq offset (1- offset))) @@ -911,7 +913,7 @@ The same TRANSLATIONS structure can be used in reverse for reading files." (defun format-annotate-location (loc all ignore translations) "Return annotation(s) needed at location LOC. -This includes any properties that change between LOC-1 and LOC. +This includes any properties that change between LOC - 1 and LOC. If ALL is true, don't look at previous location, but generate annotations for all non-nil properties. Third argument IGNORE is a list of text-properties not to consider. diff --git a/lisp/frame.el b/lisp/frame.el index a470fbc0f97..446bda55775 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -1,6 +1,6 @@ ;;; frame.el --- multi-frame management independent of window systems -;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003 +;; Copyright (C) 1993, 1994, 1996, 1997, 2000, 2001, 2003, 2004 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -113,7 +113,7 @@ use (car ARGS) as a function to do the work. Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." (if (and args (symbolp (car args))) (apply (car args) buffer (cdr args)) - (let ((window (get-buffer-window buffer t))) + (let ((window (get-buffer-window buffer 0))) (or ;; If we have a window already, make it visible. (when window @@ -131,6 +131,7 @@ Pass it BUFFER as first arg, and (cdr ARGS) gives the rest of the args." (let* ((pop-up-frames nil) (pop-up-windows t) special-display-regexps special-display-buffer-names (window (display-buffer buffer))) + ;; Only do it if this is a new window: ;; (set-window-dedicated-p window t) window)) ;; If no window yet, make one in a new frame. @@ -552,7 +553,7 @@ is not considered (see `next-frame')." (interactive) (select-window (next-window (selected-window) (> (minibuffer-depth) 0) - t)) + 0)) (select-frame-set-input-focus (selected-frame))) (defun previous-multiframe-window () @@ -560,7 +561,7 @@ is not considered (see `next-frame')." (interactive) (select-window (previous-window (selected-window) (> (minibuffer-depth) 0) - t)) + 0)) (select-frame-set-input-focus (selected-frame))) (defun make-frame-on-display (display &optional parameters) @@ -1190,9 +1191,8 @@ left untouched. FRAME nil or omitted means use the selected frame." (make-variable-buffer-local 'show-trailing-whitespace) (defcustom show-trailing-whitespace nil - "*Non-nil means highlight trailing whitespace in face `trailing-whitespace'. - -Setting this variable makes it local to the current buffer." + "*Non-nil means highlight trailing whitespace. +This is done in the face `trailing-whitespace'." :tag "Highlight trailing whitespace." :type 'boolean :group 'font-lock) @@ -1296,6 +1296,7 @@ if appropriate. It also arranges to cancel that timer when the next command starts, by installing a pre-command hook." (when (null blink-cursor-timer) (add-hook 'pre-command-hook 'blink-cursor-end) + (internal-show-cursor nil nil) (setq blink-cursor-timer (run-with-timer blink-cursor-interval blink-cursor-interval 'blink-cursor-timer-function)))) diff --git a/lisp/generic.el b/lisp/generic.el index d35a31a2b67..a951a0d53d8 100644 --- a/lisp/generic.el +++ b/lisp/generic.el @@ -1,6 +1,6 @@ ;;; generic.el --- defining simple major modes with comment and font-lock ;; -;; Copyright (C) 1997, 1999 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc. ;; ;; Author: Peter Breton <pbreton@cs.umb.edu> ;; Created: Fri Sep 27 1996 @@ -188,9 +188,6 @@ regexp in `generic-find-file-regexp'. If the value is nil, &optional description) "Create a new generic mode with NAME. -Args: (NAME COMMENT-LIST KEYWORD-LIST FONT-LOCK-LIST AUTO-MODE-LIST - FUNCTION-LIST &optional DESCRIPTION) - NAME should be a symbol; its string representation is used as the function name. If DESCRIPTION is provided, it is used as the docstring for the new function. diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index dc39720f79b..78c9f15f912 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,23 @@ +2004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * mm-view.el (mm-insert-inline): Make it work in read-only buffer. + + * gnus-win.el (gnus-all-windows-visible-p): Don't consider + non-visible windows. + +2004-05-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * rfc2047.el (rfc2047-encode-message-header): Don't encode non-address + headers as address headers (which breaks if subject has a single "). + +2004-05-06 Stefan Monnier <monnier@iro.umontreal.ca> + + * nnimap.el (nnimap-demule): Avoid string-as-multibyte. + +2004-04-21 Richard M. Stallman <rms@gnu.org> + + * mailcap.el (mailcap-mime-data): Mark as risky. + 2004-03-27 Juanma Barranquero <lektu@terra.es> * gnus-srvr.el (gnus-server-prepare): Remove spurious call to `cdr'. diff --git a/lisp/gnus/gnus-win.el b/lisp/gnus/gnus-win.el index fa082e7c1d0..4d0c18a8daf 100644 --- a/lisp/gnus/gnus-win.el +++ b/lisp/gnus/gnus-win.el @@ -1,5 +1,5 @@ ;;; gnus-win.el --- window configuration functions for Gnus -;; Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002 +;; Copyright (C) 1996, 97, 98, 1999, 2000, 02, 2004 ;; Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> @@ -516,7 +516,7 @@ should have point." (unless buffer (error "Invalid buffer type: %s" type)) (if (and (setq buf (get-buffer (gnus-window-to-buffer-helper buffer))) - (setq win (get-buffer-window buf t))) + (setq win (get-buffer-window buf 0))) (if (memq 'point split) (setq all-visible win)) (setq all-visible nil))) diff --git a/lisp/gnus/mailcap.el b/lisp/gnus/mailcap.el index 1663bd3f5f8..6d35e2196ae 100644 --- a/lisp/gnus/mailcap.el +++ b/lisp/gnus/mailcap.el @@ -271,6 +271,7 @@ validity. Otherwise, if it is a non-function Lisp symbol or list whose car is a symbol, it is `eval'led to yield the validity. If it is a string or list of strings, it represents a shell command to run to return a true or false shell value for the validity.") +(put 'mailcap-mime-data 'risky-local-variable t) (defcustom mailcap-download-directory nil "*Directory to which `mailcap-save-binary-file' downloads files by default. diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el index f7dfdb60f02..69cbd3d8a1d 100644 --- a/lisp/gnus/mm-view.el +++ b/lisp/gnus/mm-view.el @@ -1,5 +1,5 @@ ;;; mm-view.el --- functions for viewing MIME objects -;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1998, 1999, 2000, 01, 2004 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> ;; This file is part of GNU Emacs. @@ -197,7 +197,8 @@ (defun mm-insert-inline (handle text) "Insert TEXT inline from HANDLE." - (let ((b (point))) + (let ((b (point)) + (inhibit-read-only t)) (insert text) (mm-handle-set-undisplayer handle diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index 02cb87af28b..a7cf82317b5 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1,5 +1,6 @@ ;;; nnimap.el --- imap backend for Gnus -;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + +;; Copyright (C) 1998,1999,2000,01,02,2004 Free Software Foundation, Inc. ;; Author: Simon Josefsson <jas@pdc.kth.se> ;; Jim Radford <radford@robby.caltech.edu> @@ -671,9 +672,12 @@ function is generally only called when Gnus is shutting down." (nnoo-status-message 'nnimap server))) (defun nnimap-demule (string) - (funcall (if (and (fboundp 'string-as-multibyte) - (subrp (symbol-function 'string-as-multibyte))) - 'string-as-multibyte + ;; BEWARE: we used to use string-as-multibyte here which is braindead + ;; because it will turn accidental emacs-mule-valid byte sequences + ;; into multibyte chars. --Stef + (funcall (if (and (fboundp 'string-to-multibyte) + (subrp (symbol-function 'string-to-multibyte))) + 'string-to-multibyte 'identity) (or string ""))) @@ -1383,5 +1387,5 @@ sure of changing the value of `foo'." (provide 'nnimap) -;;; arch-tag: 2b001f20-3ff9-4094-a0ad-46807c1ba70b +;; arch-tag: 2b001f20-3ff9-4094-a0ad-46807c1ba70b ;;; nnimap.el ends here diff --git a/lisp/gnus/rfc2047.el b/lisp/gnus/rfc2047.el index 7c93160c455..f355ac8bbb4 100644 --- a/lisp/gnus/rfc2047.el +++ b/lisp/gnus/rfc2047.el @@ -1,5 +1,5 @@ ;;; rfc2047.el --- functions for encoding and decoding rfc2047 messages -;; Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1998,1999,2000,02,03,2004 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org> ;; MORIOKA Tomohiko <morioka@jaist.ac.jp> @@ -169,7 +169,7 @@ Should be called narrowed to the head of the message." ((eq method 'address-mime) (rfc2047-encode-region (point) (point-max))) ((eq method 'mime) - (let (rfc2047-encoding-type) + (let ((rfc2047-encoding-type method)) (rfc2047-encode-region (point) (point-max)))) ((eq method 'default) (if (and (featurep 'mule) diff --git a/lisp/gnus/starttls.el b/lisp/gnus/starttls.el index 0fd14cead55..c172e88c515 100644 --- a/lisp/gnus/starttls.el +++ b/lisp/gnus/starttls.el @@ -1,10 +1,11 @@ ;;; starttls.el --- STARTTLS functions -;; Copyright (C) 1999, 2000 Free Software Foundation, Inc. +;; Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. ;; Author: Daiki Ueno <ueno@unixuser.org> +;; Author: Simon Josefsson <simon@josefsson.org> ;; Created: 1999/11/20 -;; Keywords: TLS, SSL, OpenSSL, mail, news +;; Keywords: TLS, SSL, OpenSSL, GNUTLS, mail, news ;; This file is part of GNU Emacs. @@ -30,6 +31,90 @@ ;; [RFC 2595] "Using TLS with IMAP, POP3 and ACAP" ;; by Chris Newman <chris.newman@innosoft.com> (1999/06) +;; This file now contain a combination of the two previous +;; implementations both called "starttls.el". The first one is Daiki +;; Ueno's starttls.el which uses his own "starttls" command line tool, +;; and the second one is Simon Josefsson's starttls.el which uses +;; "gnutls-cli" from GNUTLS. +;; +;; If "starttls" is available, it is prefered by the code over +;; "gnutls-cli", for backwards compatibility. Use +;; `starttls-use-gnutls' to toggle between implementations if you have +;; both tools installed. It is recommended to use GNUTLS, though, as +;; it performs more verification of the certificates. + +;; The GNUTLS support require GNUTLS 0.9.90 (released 2003-10-08) or +;; later, from <http://www.gnu.org/software/gnutls/>, or "starttls" +;; from <ftp://ftp.opaopa.org/pub/elisp/>. + +;; Usage is similar to `open-network-stream'. For example: +;; +;; (when (setq tmp (starttls-open-stream +;; "test" (current-buffer) "yxa.extundo.com" 25)) +;; (accept-process-output tmp 15) +;; (process-send-string tmp "STARTTLS\n") +;; (accept-process-output tmp 15) +;; (message "STARTTLS output:\n%s" (starttls-negotiate tmp)) +;; (process-send-string tmp "EHLO foo\n")) + +;; An example run yield the following output: +;; +;; 220 yxa.extundo.com ESMTP Sendmail 8.12.11/8.12.11/Debian-3; Wed, 26 May 2004 19:12:29 +0200; (No UCE/UBE) logging access from: c494102a.s-bi.bostream.se(OK)-c494102a.s-bi.bostream.se [217.215.27.65] +;; 220 2.0.0 Ready to start TLS +;; 250-yxa.extundo.com Hello c494102a.s-bi.bostream.se [217.215.27.65], pleased to meet you +;; 250-ENHANCEDSTATUSCODES +;; 250-PIPELINING +;; 250-EXPN +;; 250-VERB +;; 250-8BITMIME +;; 250-SIZE +;; 250-DSN +;; 250-ETRN +;; 250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN +;; 250-DELIVERBY +;; 250 HELP +;; nil +;; +;; With the message buffer containing: +;; +;; STARTTLS output: +;; *** Starting TLS handshake +;; - Server's trusted authorities: +;; [0]: C=SE,ST=Stockholm,L=Stockholm,O=YXA,OU=CA,CN=yxa.extundo.com,EMAIL=staff@yxa.extundo.com +;; - Certificate type: X.509 +;; - Got a certificate list of 2 certificates. +;; +;; - Certificate[0] info: +;; # The hostname in the certificate matches 'yxa.extundo.com'. +;; # valid since: Wed May 26 12:16:00 CEST 2004 +;; # expires at: Wed Jul 26 12:16:00 CEST 2023 +;; # serial number: 04 +;; # fingerprint: 7c 04 4b c1 fa 26 9b 5d 90 22 52 3c 65 3d 85 3a +;; # version: #1 +;; # public key algorithm: RSA +;; # Modulus: 1024 bits +;; # Subject's DN: C=SE,ST=Stockholm,L=Stockholm,O=YXA,OU=Mail server,CN=yxa.extundo.com,EMAIL=staff@yxa.extundo.com +;; # Issuer's DN: C=SE,ST=Stockholm,L=Stockholm,O=YXA,OU=CA,CN=yxa.extundo.com,EMAIL=staff@yxa.extundo.com +;; +;; - Certificate[1] info: +;; # valid since: Sun May 23 11:35:00 CEST 2004 +;; # expires at: Sun Jul 23 11:35:00 CEST 2023 +;; # serial number: 00 +;; # fingerprint: fc 76 d8 63 1a c9 0b 3b fa 40 fe ed 47 7a 58 ae +;; # version: #3 +;; # public key algorithm: RSA +;; # Modulus: 1024 bits +;; # Subject's DN: C=SE,ST=Stockholm,L=Stockholm,O=YXA,OU=CA,CN=yxa.extundo.com,EMAIL=staff@yxa.extundo.com +;; # Issuer's DN: C=SE,ST=Stockholm,L=Stockholm,O=YXA,OU=CA,CN=yxa.extundo.com,EMAIL=staff@yxa.extundo.com +;; +;; - Peer's certificate issuer is unknown +;; - Peer's certificate is NOT trusted +;; - Version: TLS 1.0 +;; - Key Exchange: RSA +;; - Cipher: ARCFOUR 128 +;; - MAC: SHA +;; - Compression: NULL + ;;; Code: (defgroup starttls nil @@ -37,18 +122,141 @@ :version "21.1" :group 'mail) +(defcustom starttls-gnutls-program "gnutls-cli" + "Name of GNUTLS command line tool. +This program is used when GNUTLS is used, i.e. when +`starttls-use-gnutls' is non-nil." + :type 'string + :group 'starttls) + (defcustom starttls-program "starttls" - "The program to run in a subprocess to open an TLSv1 connection." + "The program to run in a subprocess to open an TLSv1 connection. +This program is used when the `starttls' command is used, +i.e. when `starttls-use-gnutls' is nil." :type 'string :group 'starttls) +(defcustom starttls-use-gnutls (not (executable-find starttls-program)) + "*Whether to use GNUTLS instead of the `starttls' command." + :type 'boolean + :group 'starttls) + (defcustom starttls-extra-args nil - "Extra arguments to `starttls-program'." + "Extra arguments to `starttls-program'. +This program is used when the `starttls' command is used, +i.e. when `starttls-use-gnutls' is nil." :type '(repeat string) :group 'starttls) +(defcustom starttls-extra-arguments nil + "Extra arguments to `starttls-program'. +This program is used when GNUTLS is used, i.e. when +`starttls-use-gnutls' is non-nil. + +For example, non-TLS compliant servers may require +'(\"--protocols\" \"ssl3\"). Invoke \"gnutls-cli --help\" to +find out which parameters are available." + :type '(repeat string) + :group 'starttls) + +(defcustom starttls-process-connection-type nil + "*Value for `process-connection-type' to use when starting STARTTLS process." + :type 'boolean + :group 'starttls) + +(defcustom starttls-connect "- Simple Client Mode:\n\n" + "*Regular expression indicating successful connection. +The default is what GNUTLS's \"gnutls-cli\" outputs." + ;; GNUTLS cli.c:main() print this string when it is starting to run + ;; in the application read/write phase. If the logic, or the string + ;; itself, is modified, this must be updated. + :type 'regexp + :group 'starttls) + +(defcustom starttls-failure "\\*\\*\\* Handshake has failed" + "*Regular expression indicating failed TLS handshake. +The default is what GNUTLS's \"gnutls-cli\" outputs." + ;; GNUTLS cli.c:do_handshake() print this string on failure. If the + ;; logic, or the string itself, is modified, this must be updated. + :type 'regexp + :group 'starttls) + +(defcustom starttls-success "- Compression: " + "*Regular expression indicating completed TLS handshakes. +The default is what GNUTLS's \"gnutls-cli\" outputs." + ;; GNUTLS cli.c:do_handshake() calls, on success, + ;; common.c:print_info(), that unconditionally print this string + ;; last. If that logic, or the string itself, is modified, this + ;; must be updated. + :type 'regexp + :group 'starttls) + +(defun starttls-negotiate-gnutls (process) + "Negotiate TLS on process opened by `open-starttls-stream'. +This should typically only be done once. It typically return a +multi-line informational message with information about the +handshake, or NIL on failure." + (let (buffer info old-max done-ok done-bad) + (if (null (setq buffer (process-buffer process))) + ;; XXX How to remove/extract the TLS negotiation junk? + (signal-process (process-id process) 'SIGALRM) + (with-current-buffer buffer + (save-excursion + (setq old-max (goto-char (point-max))) + (signal-process (process-id process) 'SIGALRM) + (while (and (processp process) + (eq (process-status process) 'run) + (save-excursion + (goto-char old-max) + (not (or (setq done-ok (re-search-forward + starttls-success nil t)) + (setq done-bad (re-search-forward + starttls-failure nil t)))))) + (accept-process-output process 1 100) + (sit-for 0.1)) + (setq info (buffer-substring-no-properties old-max (point-max))) + (delete-region old-max (point-max)) + (if (or (and done-ok (not done-bad)) + ;; Prevent mitm that fake success msg after failure msg. + (and done-ok done-bad (< done-ok done-bad))) + info + (message "STARTTLS negotiation failed: %s" info) + nil)))))) + (defun starttls-negotiate (process) - (signal-process (process-id process) 'SIGALRM)) + (if starttls-use-gnutls + (starttls-negotiate-gnutls process) + (signal-process (process-id process) 'SIGALRM))) + +(defun starttls-open-stream-gnutls (name buffer host service) + (message "Opening STARTTLS connection to `%s'..." host) + (let* (done + (old-max (with-current-buffer buffer (point-max))) + (process-connection-type starttls-process-connection-type) + (process (apply #'start-process name buffer + starttls-gnutls-program "-s" host + "-p" (if (integerp service) + (int-to-string service) + service) + starttls-extra-arguments))) + (process-kill-without-query process) + (while (and (processp process) + (eq (process-status process) 'run) + (save-excursion + (set-buffer buffer) + (goto-char old-max) + (not (setq done (re-search-forward + starttls-connect nil t))))) + (accept-process-output process 0 100) + (sit-for 0.1)) + (if done + (with-current-buffer buffer + (delete-region old-max done)) + (delete-process process) + (setq process nil)) + (message "Opening STARTTLS connection to `%s'...%s" + host (if done "done" "failed")) + process)) (defun starttls-open-stream (name buffer host service) "Open a TLS connection for a service to a host. @@ -64,13 +272,15 @@ BUFFER is the buffer (or `buffer-name') to associate with the process. Third arg is name of the host to connect to, or its IP address. Fourth arg SERVICE is name of the service desired, or an integer specifying a port number to connect to." - (let* ((process-connection-type nil) - (process (apply #'start-process - name buffer starttls-program - host (format "%s" service) - starttls-extra-args))) - (process-kill-without-query process) - process)) + (if starttls-use-gnutls + (starttls-open-stream-gnutls name buffer host service) + (let* ((process-connection-type starttls-process-connection-type) + (process (apply #'start-process + name buffer starttls-program + host (format "%s" service) + starttls-extra-args))) + (process-kill-without-query process) + process))) (provide 'starttls) diff --git a/lisp/gs.el b/lisp/gs.el index f160dca197a..2c38a55f6df 100644 --- a/lisp/gs.el +++ b/lisp/gs.el @@ -1,6 +1,6 @@ ;;; gs.el --- interface to Ghostscript -;; Copyright (C) 1998, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: internal @@ -39,12 +39,14 @@ (defvar gs-options '("-q" ;"-dNOPAUSE" + "-dSAFER" "-dBATCH" "-sDEVICE=<device>" "<file>") "List of command line arguments to pass to Ghostscript. Arguments may contain place-holders `<file>' for the name of the input file, and `<device>' for the device to use.") +(put 'gs-options 'risky-local-variable t) (defun gs-options (device file) "Return a list of command line options with place-holders replaced. @@ -55,7 +57,6 @@ FILE is the value to substitute for the place-holder `<file>'." option (replace-regexp-in-string "<file>" file option))) gs-options)) - ;; The GHOSTVIEW property (taken from gv 3.5.8). ;; ;; Type: @@ -196,7 +197,7 @@ the form \"WINDOW-ID PIXMAP-ID\". Value is non-nil if successful." (setenv "GHOSTVIEW" window-and-pixmap-id) (setq gs (apply 'start-process "gs" "*GS*" gs-program (gs-options gs-device file))) - (process-kill-without-query gs) + (set-process-query-on-exit-flag gs nil) gs) nil)) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index ab76b5eb232..e534c6998a7 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -45,10 +45,10 @@ If there's no tutorial in that language, `TUTORIAL' is selected. With ARG, you are asked to choose which language." (interactive "P") (let ((lang (if arg - (let ((minibuffer-setup-hook minibuffer-setup-hook)) - (add-hook 'minibuffer-setup-hook - 'minibuffer-completion-help) - (read-language-name 'tutorial "Language: " "English")) + (let ((minibuffer-setup-hook minibuffer-setup-hook)) + (add-hook 'minibuffer-setup-hook + 'minibuffer-completion-help) + (read-language-name 'tutorial "Language: " "English")) (if (get-language-info current-language-environment 'tutorial) current-language-environment "English"))) @@ -63,6 +63,7 @@ With ARG, you are asked to choose which language." (setq default-directory (expand-file-name "~/")) (setq buffer-auto-save-file-name nil) (insert-file-contents (expand-file-name filename data-directory)) + (hack-local-variables) (goto-char (point-min)) (search-forward "\n<<") (beginning-of-line) @@ -157,37 +158,37 @@ and the file name is displayed in the echo area." ;; Return the text we displayed. (buffer-string)))))) -(defun help-split-fundoc (doc def) - "Split a function docstring DOC into the actual doc and the usage info. +(defun help-split-fundoc (docstring def) + "Split a function DOCSTRING into the actual doc and the usage info. Return (USAGE . DOC) or nil if there's no usage info. -DEF is the function whose usage we're looking for in DOC." +DEF is the function whose usage we're looking for in DOCSTRING." ;; Functions can get the calling sequence at the end of the doc string. ;; In cases where `function' has been fset to a subr we can't search for ;; function's name in the doc string so we use `fn' as the anonymous ;; function name instead. - (when (and doc (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" doc)) + (when (and docstring (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring)) (cons (format "(%s%s" ;; Replace `fn' with the actual function name. (if (consp def) "anonymous" def) - (match-string 1 doc)) - (substring doc 0 (match-beginning 0))))) - -(defun help-add-fundoc-usage (doc arglist) - "Add the usage info to the docstring DOC. -If DOC already has a usage info, then just return DOC unchanged. -The usage info is built from ARGLIST. DOC can be nil. -ARGLIST can also be t or a string of the form \"(fun ARG1 ARG2 ...)\"." - (unless (stringp doc) (setq doc "Not documented")) - (if (or (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" doc) (eq arglist t)) - doc - (format "%s%s%s" doc - (if (string-match "\n?\n\\'" doc) + (match-string 1 docstring)) + (substring docstring 0 (match-beginning 0))))) + +(defun help-add-fundoc-usage (docstring arglist) + "Add the usage info to DOCSTRING. +If DOCSTRING already has a usage info, then just return it unchanged. +The usage info is built from ARGLIST. DOCSTRING can be nil. +ARGLIST can also be t or a string of the form \"(FUN ARG1 ARG2 ...)\"." + (unless (stringp docstring) (setq docstring "Not documented")) + (if (or (string-match "\n\n(fn\\(\\( .*\\)?)\\)\\'" docstring) (eq arglist t)) + docstring + (concat docstring + (if (string-match "\n?\n\\'" docstring) (if (< (- (match-end 0) (match-beginning 0)) 2) "\n" "") "\n\n") (if (and (stringp arglist) (string-match "\\`([^ ]+\\(.*\\))\\'" arglist)) (concat "(fn" (match-string 1 arglist) ")") - (help-make-usage 'fn arglist))))) + (format "%S" (help-make-usage 'fn arglist)))))) (defun help-function-arglist (def) ;; Handle symbols aliased to other symbols. @@ -215,27 +216,13 @@ ARGLIST can also be t or a string of the form \"(fun ARG1 ARG2 ...)\"." (intern (upcase name)))))) arglist))) -(defvar help-C-source-directory - (let ((dir (expand-file-name "src" source-directory))) - (when (and (file-directory-p dir) (file-readable-p dir)) - dir)) - "Directory where the C source files of Emacs can be found. -If nil, do not try to find the source code of functions and variables -defined in C.") - -(defun help-subr-name (subr) - (let ((name (prin1-to-string subr))) - (if (string-match "\\`#<subr \\(.*\\)>\\'" name) - (match-string 1 name) - (error "Unexpected subroutine print name: %s" name)))) - (defun help-C-file-name (subr-or-var kind) "Return the name of the C file where SUBR-OR-VAR is defined. KIND should be `var' for a variable or `subr' for a subroutine." (let ((docbuf (get-buffer-create " *DOC*")) (name (if (eq 'var kind) (concat "V" (symbol-name subr-or-var)) - (concat "F" (help-subr-name subr-or-var))))) + (concat "F" (subr-name subr-or-var))))) (with-current-buffer docbuf (goto-char (point-min)) (if (eobp) @@ -245,30 +232,72 @@ KIND should be `var' for a variable or `subr' for a subroutine." (re-search-backward "S\\(.*\\)") (let ((file (match-string 1))) (if (string-match "\\.\\(o\\|obj\\)\\'" file) - (replace-match ".c" t t file) + (setq file (replace-match ".c" t t file))) + (if (string-match "\\.c\\'" file) + (concat "src/" file) file))))) -(defun help-find-C-source (fun-or-var file kind) - "Find the source location where SUBR-OR-VAR is defined in FILE. -KIND should be `var' for a variable or `subr' for a subroutine." - (setq file (expand-file-name file help-C-source-directory)) - (unless (file-readable-p file) - (error "The C source file %s is not available" - (file-name-nondirectory file))) - (if (eq 'fun kind) - (setq fun-or-var (indirect-function fun-or-var))) - (with-current-buffer (find-file-noselect file) - (goto-char (point-min)) - (unless (re-search-forward - (if (eq 'fun kind) - (concat "DEFUN[ \t\n]*([ \t\n]*\"" - (regexp-quote (help-subr-name fun-or-var)) - "\"") - (concat "DEFVAR[A-Z_]*[ \t\n]*([ \t\n]*\"" - (regexp-quote (symbol-name fun-or-var)))) - nil t) - (error "Can't find source for %s" fun)) - (cons (current-buffer) (match-beginning 0)))) +;;;###autoload +(defface help-argument-name '((((supports :slant italic)) :inherit italic)) + "Face to highlight argument names in *Help* buffers." + :group 'help) + +(defun help-default-arg-highlight (arg) + "Default function to highlight arguments in *Help* buffers. +It returns ARG in face `help-argument-name'; ARG is also +downcased if it displays differently than the default +face (according to `face-differs-from-default-p')." + (propertize (if (face-differs-from-default-p 'help-argument-name) + (downcase arg) + arg) + 'face 'help-argument-name)) + +(defun help-do-arg-highlight (doc args) + (with-syntax-table (make-syntax-table emacs-lisp-mode-syntax-table) + (modify-syntax-entry ?\- "w") + (while args + (let ((arg (prog1 (car args) (setq args (cdr args))))) + (setq doc (replace-regexp-in-string + ;; This is heuristic, but covers all common cases + ;; except ARG1-ARG2 + (concat "\\<" ; beginning of word + "\\(?:[a-z-]+-\\)?" ; for xxx-ARG + "\\(" + arg + "\\)" + "\\(?:es\\|s\\|th\\)?" ; for ARGth, ARGs + "\\(?:-[a-z-]+\\)?" ; for ARG-xxx + "\\>") ; end of word + (help-default-arg-highlight arg) + doc t t 1)))) + doc)) + +(defun help-highlight-arguments (usage doc &rest args) + (when usage + (with-temp-buffer + (insert usage) + (goto-char (point-min)) + (let ((case-fold-search nil) + (next (not (or args (looking-at "\\[")))) + (opt nil)) + ;; Make a list of all arguments + (skip-chars-forward "^ ") + (while next + (or opt (not (looking-at " &")) (setq opt t)) + (if (not (re-search-forward " \\([\\[(]*\\)\\([^] &)\.]+\\)" nil t)) + (setq next nil) + (setq args (cons (match-string 2) args)) + (when (and opt (string= (match-string 1) "(")) + ;; A pesky CL-style optional argument with default value, + ;; so let's skip over it + (search-backward "(") + (goto-char (scan-sexps (point) 1))))) + ;; Highlight aguments in the USAGE string + (setq usage (help-do-arg-highlight (buffer-string) args)) + ;; Highlight arguments in the DOC string + (setq doc (and doc (help-do-arg-highlight doc args)))))) + ;; Return value is like the one from help-split-fundoc, but highlighted + (cons usage doc)) ;;;###autoload (defun describe-function-1 (function) @@ -335,14 +364,16 @@ KIND should be `var' for a variable or `subr' for a subroutine." (when (re-search-backward "^;;; Generated autoloads from \\(.*\\)" nil t) (setq file-name (match-string 1))))))) - (when (and (null file-name) (subrp def) help-C-source-directory) + (when (and (null file-name) (subrp def)) ;; Find the C source file name. - (setq file-name (concat "src/" (help-C-file-name def 'subr)))) + (setq file-name (if (get-buffer " *DOC*") + (help-C-file-name def 'subr) + 'C-source))) (when file-name (princ " in `") ;; We used to add .el to the file name, ;; but that's completely wrong when the user used load-file. - (princ file-name) + (princ (if (eq file-name 'C-source) "C source code" file-name)) (princ "'") ;; Make a hyperlink to the library. (with-current-buffer standard-output @@ -354,55 +385,74 @@ KIND should be `var' for a variable or `subr' for a subroutine." (when (commandp function) (let* ((remapped (command-remapping function)) (keys (where-is-internal - (or remapped function) overriding-local-map nil nil))) + (or remapped function) overriding-local-map nil nil)) + non-modified-keys) + ;; Which non-control non-meta keys run this command? + (dolist (key keys) + (if (member (event-modifiers (aref key 0)) '(nil (shift))) + (push key non-modified-keys))) (when remapped (princ "It is remapped to `") (princ (symbol-name remapped)) (princ "'")) + (when keys (princ (if remapped " which is bound to " "It is bound to ")) ;; FIXME: This list can be very long (f.ex. for self-insert-command). - (princ (mapconcat 'key-description keys ", "))) - (when (or remapped keys) + ;; If there are many, remove them from KEYS. + (if (< (length non-modified-keys) 10) + (princ (mapconcat 'key-description keys ", ")) + (dolist (key non-modified-keys) + (setq keys (delq key keys))) + (if keys + (progn + (princ (mapconcat 'key-description keys ", ")) + (princ ", and many ordinary text characters")) + (princ "many ordinary text characters")))) + (when (or remapped keys non-modified-keys) (princ ".") (terpri)))) (let* ((arglist (help-function-arglist def)) (doc (documentation function)) (usage (help-split-fundoc doc function))) - ;; If definition is a keymap, skip arglist note. - (unless (keymapp def) - (princ (cond - (usage (setq doc (cdr usage)) (car usage)) - ((listp arglist) (help-make-usage function arglist)) - ((stringp arglist) arglist) - ;; Maybe the arglist is in the docstring of the alias. - ((let ((fun function)) - (while (and (symbolp fun) - (setq fun (symbol-function fun)) - (not (setq usage (help-split-fundoc - (documentation fun) - function))))) - usage) - (car usage)) - ((or (stringp def) - (vectorp def)) - (format "\nMacro: %s" (format-kbd-macro def))) - (t "[Missing arglist. Please make a bug report.]"))) - (terpri)) - (let ((obsolete (and - ;; function might be a lambda construct. - (symbolp function) - (get function 'byte-obsolete-info)))) - (when obsolete - (terpri) - (princ "This function is obsolete") - (if (nth 2 obsolete) (princ (format " since %s" (nth 2 obsolete)))) - (princ ";") (terpri) - (princ (if (stringp (car obsolete)) (car obsolete) - (format "use `%s' instead." (car obsolete)))) - (terpri))) - (terpri) - (princ (or doc "Not documented."))))) + (with-current-buffer standard-output + ;; If definition is a keymap, skip arglist note. + (unless (keymapp def) + (let* ((use (cond + (usage (setq doc (cdr usage)) (car usage)) + ((listp arglist) + (format "%S" (help-make-usage function arglist))) + ((stringp arglist) arglist) + ;; Maybe the arglist is in the docstring of the alias. + ((let ((fun function)) + (while (and (symbolp fun) + (setq fun (symbol-function fun)) + (not (setq usage (help-split-fundoc + (documentation fun) + function))))) + usage) + (car usage)) + ((or (stringp def) + (vectorp def)) + (format "\nMacro: %s" (format-kbd-macro def))) + (t "[Missing arglist. Please make a bug report.]"))) + (high (help-highlight-arguments use doc))) + (insert (car high) "\n") + (setq doc (cdr high)))) + (let ((obsolete (and + ;; function might be a lambda construct. + (symbolp function) + (get function 'byte-obsolete-info)))) + (when obsolete + (princ "\nThis function is obsolete") + (when (nth 2 obsolete) + (insert (format " since %s" (nth 2 obsolete)))) + (insert ";\n" + (if (stringp (car obsolete)) (car obsolete) + (format "use `%s' instead." (car obsolete))) + "\n")) + (insert "\n" + (or doc "Not documented."))))))) ;; Variables @@ -560,13 +610,13 @@ it is displayed along with the global value." (when (and (null file-name) (integerp (get variable 'variable-documentation))) ;; It's a variable not defined in Elisp but in C. - (if help-C-source-directory - (setq file-name - (concat "src/" (help-C-file-name variable 'var))) - (princ "\n\nDefined in core C code."))) + (setq file-name + (if (get-buffer " *DOC*") + (help-C-file-name variable 'var) + 'C-source))) (when file-name (princ "\n\nDefined in `") - (princ file-name) + (princ (if (eq file-name 'C-source) "C source code" file-name)) (princ "'.") (with-current-buffer standard-output (save-excursion diff --git a/lisp/help-mode.el b/lisp/help-mode.el index 149eebb3d36..11656ec368c 100644 --- a/lisp/help-mode.el +++ b/lisp/help-mode.el @@ -147,14 +147,13 @@ The format is (FUNCTION ARGS...).") :supertype 'help-xref 'help-function (lambda (fun file) (require 'find-func) + (when (eq file 'C-source) + (setq file + (help-C-file-name (indirect-function fun) 'fun))) ;; Don't use find-function-noselect because it follows ;; aliases (which fails for built-in functions). (let ((location - (cond - ((bufferp file) (cons file fun)) - ((string-match "\\`src/\\(.*\\.c\\)" file) - (help-find-C-source fun (match-string 1 file) 'fun)) - (t (find-function-search-for-symbol fun nil file))))) + (find-function-search-for-symbol fun nil file))) (pop-to-buffer (car location)) (goto-char (cdr location)))) 'help-echo (purecopy "mouse-2, RET: find function's definition")) @@ -162,11 +161,9 @@ The format is (FUNCTION ARGS...).") (define-button-type 'help-variable-def :supertype 'help-xref 'help-function (lambda (var &optional file) - (let ((location - (cond - ((string-match "\\`src/\\(.*\\.c\\)" file) - (help-find-C-source var (match-string 1 file) 'var)) - (t (find-variable-noselect var file))))) + (when (eq file 'C-source) + (setq file (help-C-file-name var 'var))) + (let ((location (find-variable-noselect var file))) (pop-to-buffer (car location)) (goto-char (cdr location)))) 'help-echo (purecopy"mouse-2, RET: find variable's definition")) @@ -195,14 +192,17 @@ Commands: ;;;###autoload (defun help-mode-finish () + (let ((entry (assq (selected-window) view-return-to-alist))) + (if entry (setcdr entry (cons (selected-window) + help-return-method)) + (setq view-return-to-alist + (cons (cons (selected-window) help-return-method) + view-return-to-alist)))) (when (eq major-mode 'help-mode) ;; View mode's read-only status of existing *Help* buffer is lost ;; by with-output-to-temp-buffer. (toggle-read-only 1) - (help-make-xrefs (current-buffer))) - (setq view-return-to-alist - (list (cons (selected-window) help-return-method)))) - + (help-make-xrefs (current-buffer)))) ;; Grokking cross-reference information in doc strings and ;; hyperlinking it. @@ -577,12 +577,11 @@ help buffer." (goto-char position))))) (defun help-go-back () - "Invoke the [back] button (if any) in the Help mode buffer." + "Go back to previous topic in this help buffer." (interactive) - (let ((back-button (button-at (1- (point-max))))) - (if back-button - (button-activate back-button) - (error "No [back] button")))) + (if help-xref-stack + (help-xref-go-back (current-buffer)) + (error "No previous help buffer."))) (defun help-do-xref (pos function args) "Call the help cross-reference function FUNCTION with args ARGS. diff --git a/lisp/help.el b/lisp/help.el index b589de94474..fc43d8db03d 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -1,6 +1,6 @@ ;;; help.el --- help commands for Emacs -;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002 +;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2004 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -313,19 +313,61 @@ of the key sequence that ran this command." (defun view-emacs-news (&optional arg) "Display info on recent changes to Emacs. -With numeric argument, display information on correspondingly older changes." +With argument, display info only for the selected version." (interactive "P") - (let* ((arg (if arg (prefix-numeric-value arg) 0)) - (file (cond ((eq arg 0) "NEWS") - ((eq arg 1) "ONEWS") - (t - (nth (- arg 2) - (nreverse (directory-files data-directory - nil "^ONEWS\\.[0-9]+$" - nil))))))) - (if file - (view-file (expand-file-name file data-directory)) - (error "No such old news")))) + (if (not arg) + (view-file (expand-file-name "NEWS" data-directory)) + (let* ((map (sort + (delete-dups + (apply + 'nconc + (mapcar + (lambda (file) + (with-temp-buffer + (insert-file-contents + (expand-file-name file data-directory)) + (let (res) + (while (re-search-forward + (if (string-match "^ONEWS\\.[0-9]+$" file) + "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" + "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t) + (setq res (cons (list (match-string-no-properties 1) + file) res))) + res))) + (append '("NEWS" "ONEWS") + (directory-files data-directory nil + "^ONEWS\\.[0-9]+$" nil))))) + (lambda (a b) + (string< (car b) (car a))))) + (current (caar map)) + (version (completing-read + (format "Read NEWS for the version (default %s): " current) + (mapcar 'car map) nil nil nil nil current)) + (file (cadr (assoc version map))) + res) + (if (not file) + (error "No news is good news") + (view-file (expand-file-name file data-directory)) + (widen) + (goto-char (point-min)) + (when (re-search-forward + (concat (if (string-match "^ONEWS\\.[0-9]+$" file) + "Changes in \\(?:Emacs\\|version\\)?[ \t]*" + "^\* [^0-9\n]*") version) + nil t) + (beginning-of-line) + (narrow-to-region + (point) + (save-excursion + (while (and (setq res + (re-search-forward + (if (string-match "^ONEWS\\.[0-9]+$" file) + "Changes in \\(?:Emacs\\|version\\)?[ \t]*\\([0-9]+\\(?:\\.[0-9]+\\)?\\)" + "^\* [^0-9\n]*\\([0-9]+\\.[0-9]+\\)") nil t)) + (equal (match-string-no-properties 1) version))) + (or res (goto-char (point-max))) + (beginning-of-line) + (point)))))))) (defun view-todo (&optional arg) "Display the Emacs TODO list." diff --git a/lisp/hexl.el b/lisp/hexl.el index cc36c37602e..883700933a8 100644 --- a/lisp/hexl.el +++ b/lisp/hexl.el @@ -217,7 +217,9 @@ You can use \\[hexl-find-file] to visit a file in Hexl mode. (set-buffer-modified-p modified)) (make-local-variable 'hexl-max-address) (setq hexl-max-address max-address) - (hexl-goto-address original-point)) + (condition-case nil + (hexl-goto-address original-point) + (error nil))) ;; We do not turn off the old major mode; instead we just ;; override most of it. That way, we can restore it perfectly. @@ -405,7 +407,7 @@ This function is indented to be used as eldoc callback." Signal error if ADDRESS out of range." (interactive "nAddress: ") (if (or (< address 0) (> address hexl-max-address)) - (error "Out of hexl region")) + (error "Out of hexl region")) (goto-char (hexl-address-to-marker address))) (defun hexl-goto-hex-address (hex-address) diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 9492d5565f6..96678d2bc9a 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -1,6 +1,6 @@ ;;; ibuf-ext.el --- extensions for ibuffer -;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. ;; Author: Colin Walters <walters@verbum.org> ;; Maintainer: John Paul Wallington <jpw@gnu.org> @@ -1224,19 +1224,62 @@ to move by. The default is `ibuffer-marked-char'." ;;;###autoload (defun ibuffer-jump-to-buffer (name) - "Move point to the buffer whose name is NAME." + "Move point to the buffer whose name is NAME. + +If called interactively, prompt for a buffer name and go to the +corresponding line in the Ibuffer buffer. If said buffer is in a +hidden group filter, open it. + +If `ibuffer-jump-offer-only-visible-buffers' is non-nil, only offer +visible buffers in the completion list. Calling the command with +a prefix argument reverses the meaning of that variable." (interactive (list nil)) - (let ((table (mapcar #'(lambda (x) - (cons (buffer-name (car x)) - (caddr x))) - (ibuffer-current-state-list t)))) - (when (null table) - (error "No buffers!")) - (when (interactive-p) - (setq name (completing-read "Jump to buffer: " table nil t))) - (ibuffer-aif (assoc name table) - (goto-char (cdr it)) - (error "No buffer with name %s" name)))) + (let ((only-visible ibuffer-jump-offer-only-visible-buffers)) + (when current-prefix-arg + (setq only-visible (not only-visible))) + (if only-visible + (let ((table (mapcar #'(lambda (x) + (buffer-name (car x))) + (ibuffer-current-state-list)))) + (when (null table) + (error "No buffers!")) + (when (interactive-p) + (setq name (completing-read "Jump to buffer: " + table nil t)))) + (when (interactive-p) + (setq name (read-buffer "Jump to buffer: " nil t)))) + (when (not (string= "" name)) + (let (buf-point) + ;; Blindly search for our buffer: it is very likely that it is + ;; not in a hidden filter group. + (ibuffer-map-lines #'(lambda (buf marks) + (when (string= (buffer-name buf) name) + (setq buf-point (point)) + nil)) + t nil) + (when (and + (null buf-point) + (not (null ibuffer-hidden-filter-groups))) + ;; We did not find our buffer. It must be in a hidden filter + ;; group, so go through all hidden filter groups to find it. + (catch 'found + (dolist (group ibuffer-hidden-filter-groups) + (ibuffer-jump-to-filter-group group) + (ibuffer-toggle-filter-group) + (ibuffer-map-lines #'(lambda (buf marks) + (when (string= (buffer-name buf) name) + (setq buf-point (point)) + nil)) + t group) + (if buf-point + (throw 'found nil) + (ibuffer-toggle-filter-group))))) + (if (null buf-point) + ;; Still not found even though we expanded all hidden filter + ;; groups: that must be because it's hidden by predicate: + ;; we won't bother trying to display it. + (error "No buffer with name %s" name) + (goto-char buf-point)))))) ;;;###autoload (defun ibuffer-diff-with-file () diff --git a/lisp/ibuf-macs.el b/lisp/ibuf-macs.el index d6b4c2e1da8..effcafd9240 100644 --- a/lisp/ibuf-macs.el +++ b/lisp/ibuf-macs.el @@ -93,7 +93,9 @@ Note that this macro expands into a `defun' for a function named ibuffer-make-column-NAME. If INLINE is non-nil, then the form will be inlined into the compiled format versions. This means that if you change its definition, you should explicitly call -`ibuffer-recompile-formats'." +`ibuffer-recompile-formats'. + +\(fn SYMBOL (&key NAME INLINE PROPS SUMMARIZER) &rest BODY)" (let* ((sym (intern (concat "ibuffer-make-column-" (symbol-name symbol)))) (bod-1 `(with-current-buffer buffer @@ -135,7 +137,9 @@ DESCRIPTION is a short string describing the sorting method. For sorting, the forms in BODY will be evaluated with `a' bound to one buffer object, and `b' bound to another. BODY should return a non-nil -value if and only if `a' is \"less than\" `b'." +value if and only if `a' is \"less than\" `b'. + +\(fn NAME DOCUMENTATION (&key DESCRIPTION) &rest BODY)" `(progn (defun ,(intern (concat "ibuffer-do-sort-by-" (symbol-name name))) () ,(or documentation "No :documentation specified for this sorting method.") @@ -189,7 +193,9 @@ ACTIVE-OPSTRING is a string which will be displayed to the user in a confirmation message, in the form: \"Really ACTIVE-OPSTRING x buffers?\" COMPLEX means this function is special; see the source code of this -macro for exactly what it does." +macro for exactly what it does. + +\(fn OP ARGS DOCUMENTATION (&key INTERACTIVE MARK MODIFIER-P DANGEROUS OPSTRING ACTIVE-OPSTRING COMPLEX) &rest BODY)" `(progn (defun ,(intern (concat (if (string-match "^ibuffer-do" (symbol-name op)) "" "ibuffer-do-") (symbol-name op))) @@ -265,7 +271,9 @@ DESCRIPTION is a short string describing the filter. BODY should contain forms which will be evaluated to test whether or not a particular buffer should be displayed or not. The forms in BODY will be evaluated with BUF bound to the buffer object, and QUALIFIER -bound to the current value of the filter." +bound to the current value of the filter. + +\(fn NAME DOCUMENTATION (&key READER DESCRIPTION) &rest BODY)" (let ((fn-name (intern (concat "ibuffer-filter-by-" (symbol-name name))))) `(progn (defun ,fn-name (qualifier) diff --git a/lisp/ibuffer.el b/lisp/ibuffer.el index a1fd3195d46..fef9b7f811d 100644 --- a/lisp/ibuffer.el +++ b/lisp/ibuffer.el @@ -268,6 +268,12 @@ This variable takes precedence over filtering, and even (const :tag "Always except minibuffer" :value :nomini)) :group 'ibuffer) +(defcustom ibuffer-jump-offer-only-visible-buffers nil + "If non-nil, only offer buffers visible in the Ibuffer buffer +in completion lists of the `ibuffer-jump-to-buffer' command." + :type 'boolean + :group 'ibuffer) + (defcustom ibuffer-use-header-line (boundp 'header-line-format) "If non-nil, display a header line containing current filters." :type 'boolean @@ -357,6 +363,7 @@ directory, like `default-directory'." (define-key map (kbd "u") 'ibuffer-unmark-forward) (define-key map (kbd "=") 'ibuffer-diff-with-file) (define-key map (kbd "j") 'ibuffer-jump-to-buffer) + (define-key map (kbd "M-g") 'ibuffer-jump-to-buffer) (define-key map (kbd "DEL") 'ibuffer-unmark-backward) (define-key map (kbd "M-DEL") 'ibuffer-unmark-all) (define-key map (kbd "* *") 'ibuffer-unmark-all) @@ -2166,6 +2173,7 @@ If optional arg SILENT is non-nil, do not display progress messages." (member name ibuffer-hidden-filter-groups))) (bmarklist (cdr group))) (unless (and (null bmarklist) + (not disabled) ext-loaded (null ibuffer-show-empty-filter-groups)) (ibuffer-insert-filter-group diff --git a/lisp/ido.el b/lisp/ido.el index 6a66ce0388d..4cbc88cf037 100644 --- a/lisp/ido.el +++ b/lisp/ido.el @@ -1,6 +1,6 @@ ;;; ido.el --- interactively do things with buffers and files. -;; Copyright (C) 1996-2003 Free Software Foundation, Inc. +;; Copyright (C) 1996-2004 Free Software Foundation, Inc. ;; Author: Kim F. Storm <storm@cua.dk> ;; Based on: iswitchb by Stephen Eglen <stephen@cns.ed.ac.uk> @@ -30,8 +30,9 @@ ;; for ido-switch-buffer and found the inspiration for ido-find-file. ;; The ido package would never have existed without his work. -;; Also thanks to Klaus Berndl, Rohit Namjoshi, Robert Fenk, Alex Schroeder, -;; Bill Benedetto, and Stephen Eglen for bug fixes and improvements. +;; Also thanks to Klaus Berndl, Rohit Namjoshi, Robert Fenk, Alex +;; Schroeder, Bill Benedetto, Stephen Eglen, and many others for bug +;; fixes and improvements. ;;; History @@ -55,7 +56,7 @@ ;; so I invented a common "ido-" namespace for the merged packages. ;; ;; This version is based on ido.el version 1.57 released on -;; gnu.emacs.sources adapted for emacs 21.4 to use command remapping +;; gnu.emacs.sources adapted for emacs 21.5 to use command remapping ;; and optionally hooking the read-buffer and read-file-name functions. ;; ;; Prefix matching was added by Klaus Berndl <klaus.berndl@sdm.de> based on @@ -1667,8 +1668,7 @@ If INITIAL is non-nil, it specifies the initial input string." ((memq ido-exit '(edit chdir)) (cond ((memq ido-cur-item '(file dir)) - (let* ((process-environment (cons "HOME=/" process-environment)) ;; cheat read-file-name - (read-file-name-function nil) + (let* ((read-file-name-function nil) (edit (eq ido-exit 'edit)) (d ido-current-directory) (f ido-text-init) @@ -1676,7 +1676,9 @@ If INITIAL is non-nil, it specifies the initial input string." (setq ido-text-init "") (while new (setq new (if edit - (read-file-name (concat prompt "[EDIT] ") d (concat d f) nil f) + (read-file-name (concat prompt "[EDIT] ") + (expand-file-name d) + (concat d f) nil f) f) d (or (file-name-directory new) "/") f (file-name-nondirectory new) @@ -3807,15 +3809,19 @@ For details of keybindings, do `\\[describe-function] ido-find-file'." ;;; Helper functions for other programs +(put 'dired-do-rename 'ido 'ignore) + ;;;###autoload (defun ido-read-file-name (prompt &optional dir default-filename mustmatch initial predicate) "Read file name, prompting with PROMPT and completing in directory DIR. See `read-file-name' for additional parameters." (cond ((or (eq predicate 'file-directory-p) + (eq (get this-command 'ido) 'dir) (memq this-command ido-read-file-name-as-directory-commands)) (ido-read-directory-name prompt dir default-filename mustmatch initial)) - ((and (not (memq this-command ido-read-file-name-non-ido)) + ((and (not (eq (get this-command 'ido) 'ignore)) + (not (memq this-command ido-read-file-name-non-ido)) (or (null predicate) (eq predicate 'file-exists-p))) (let* (filename ido-saved-vc-hb diff --git a/lisp/ielm.el b/lisp/ielm.el index aa60d5de6c3..944e2453cb9 100644 --- a/lisp/ielm.el +++ b/lisp/ielm.el @@ -1,6 +1,6 @@ ;;; ielm.el --- interaction mode for Emacs Lisp -;; Copyright (C) 1994, 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1994, 2002, 2003, 2004 Free Software Foundation, Inc. ;; Author: David Smith <maa036@lancaster.ac.uk> ;; Maintainer: FSF @@ -49,12 +49,57 @@ :type 'boolean :group 'ielm) +(defcustom ielm-prompt-read-only t + "If non-nil, the IELM prompt is read only. +The read only region includes the newline before the prompt. +Setting this variable does not affect existing IELM runs. +This works by setting the buffer-local value of `comint-prompt-read-only'. +Setting that value directly affects new prompts in the current buffer. + +If this option is enabled, then the safe way to temporarily +override the read-only-ness of ielm prompts is to call +`comint-kill-whole-line' or `comint-kill-region' with no +narrowing in effect. This way you will be certain that none of +the remaining prompts will be accidentally messed up. You may +wish to put something like the following in your `.emacs' file: + +\(add-hook 'ielm-mode-hook + '(lambda () + (define-key ielm-map \"\C-w\" 'comint-kill-region) + (define-key ielm-map [C-S-backspace] + 'comint-kill-whole-line))) + +If you set `comint-prompt-read-only' to t, you might wish to use +`comint-mode-hook' and `comint-mode-map' instead of +`ielm-mode-hook' and `ielm-map'. That will affect all comint +buffers, including ielm buffers. If you sometimes use ielm on +text-only terminals or with `emacs -nw', you might wish to use +another binding for `comint-kill-whole-line'." + :type 'boolean + :group 'ielm + :version "21.4") + (defcustom ielm-prompt "ELISP> " - "Prompt used in IELM." + "Prompt used in IELM. +Setting this variable does not affect existing IELM runs. + +Interrupting the IELM process with \\<ielm-map>\\[comint-interrupt-subjob], +and then restarting it using \\[ielm], makes the then current +default value affect _new_ prompts. Unless the new prompt +differs only in text properties from the old one, IELM will no +longer recognize the old prompts. However, executing \\[ielm] +does not update the prompt of an *ielm* buffer with a running process. +For IELM buffers that are not called `*ielm*', you can execute +\\[inferior-emacs-lisp-mode] in that IELM buffer to update the value, +for new prompts. This works even if the buffer has a running process." :type 'string - :group 'ielm - :get #'(lambda (symbol) (substring-no-properties (symbol-value symbol))) - :set #'(lambda (symbol value) (set symbol (propertize value 'read-only t 'rear-nonsticky t)))) + :group 'ielm) + +(defvar ielm-prompt-internal "ELISP> " + "Stored value of `ielm-prompt' in the current IELM buffer. +This is an internal variable used by IELM. Its purpose is to +prevent a running IELM process from being messed up when the user +customizes `ielm-prompt'.") (defcustom ielm-dynamic-return t "*Controls whether \\<ielm-map>\\[ielm-return] has intelligent behaviour in IELM. @@ -145,9 +190,7 @@ This variable is buffer-local.") (define-key ielm-map "\C-c\C-v" 'ielm-print-working-buffer)) (defvar ielm-font-lock-keywords - (list - (cons (concat "^" (regexp-quote ielm-prompt)) 'font-lock-keyword-face) - '("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)" + '(("\\(^\\*\\*\\*[^*]+\\*\\*\\*\\)\\(.*$\\)" (1 font-lock-comment-face) (2 font-lock-constant-face))) "Additional expressions to highlight in ielm buffers.") @@ -250,8 +293,7 @@ simply inserts a newline." (defun ielm-send-input nil "Evaluate the Emacs Lisp expression after the prompt." (interactive) - (let ((buf (current-buffer)) - ielm-input) ; set by ielm-input-sender + (let (ielm-input) ; set by ielm-input-sender (comint-send-input) ; update history, markers etc. (ielm-eval-input ielm-input))) @@ -374,7 +416,7 @@ simply inserts a newline." (setq ** *) (setq * ielm-result)) (setq ielm-output (concat ielm-output "\n")))) - (setq ielm-output (concat ielm-output ielm-prompt)) + (setq ielm-output (concat ielm-output ielm-prompt-internal)) (comint-output-filter (ielm-process) ielm-output))) ;;; Process and marker utilities @@ -414,8 +456,8 @@ The current working buffer may be changed (with a call to `set-buffer', or with \\[ielm-change-working-buffer]), and its value is preserved between successive evaluations. In this way, expressions may be evaluated in a different buffer than the *ielm* buffer. -Display the name of the working buffer with \\[ielm-print-working-buffer], -or the buffer itself with \\[ielm-display-working-buffer]. +By default, its name is shown on the mode line; you can always display +it with \\[ielm-print-working-buffer], or the buffer itself with \\[ielm-display-working-buffer]. During evaluations, the values of the variables `*', `**', and `***' are the results of the previous, second previous and third previous @@ -426,14 +468,16 @@ buffer, then the values in the working buffer are used. The variables Expressions evaluated by IELM are not subject to `debug-on-quit' or `debug-on-error'. -The behaviour of IELM may be customised with the following variables: -* To stop beeping on error, set `ielm-noisy' to nil +The behaviour of IELM may be customized with the following variables: +* To stop beeping on error, set `ielm-noisy' to nil. * If you don't like the prompt, you can change it by setting `ielm-prompt'. -* Set `ielm-dynamic-return' to nil for bindings like `lisp-interaction-mode' +* If you do not like that the prompt is (by default) read-only, set + `ielm-prompt-read-only' to nil. +* Set `ielm-dynamic-return' to nil for bindings like `lisp-interaction-mode'. * Entry to this mode runs `comint-mode-hook' and `ielm-mode-hook' (in that order). -Customised bindings may be defined in `ielm-map', which currently contains: +Customized bindings may be defined in `ielm-map', which currently contains: \\{ielm-map}" (interactive) (comint-mode) @@ -443,15 +487,16 @@ Customised bindings may be defined in `ielm-map', which currently contains: (setq comint-input-sender 'ielm-input-sender) (setq comint-process-echoes nil) (make-local-variable 'comint-dynamic-complete-functions) + (set (make-local-variable 'ielm-prompt-internal) ielm-prompt) + (set (make-local-variable 'comint-prompt-read-only) ielm-prompt-read-only) (setq comint-dynamic-complete-functions '(ielm-tab comint-replace-by-expanded-history ielm-complete-filename ielm-complete-symbol)) (setq comint-get-old-input 'ielm-get-old-input) (make-local-variable 'comint-completion-addsuffix) - (setq comint-completion-addsuffix - (cons (char-to-string directory-sep-char) "")) - + (setq comint-completion-addsuffix '("/" . "")) (setq major-mode 'inferior-emacs-lisp-mode) (setq mode-name "IELM") + (setq mode-line-process '(":%s on " (:eval (buffer-name ielm-working-buffer)))) (use-local-map ielm-map) (set-syntax-table emacs-lisp-mode-syntax-table) @@ -494,10 +539,11 @@ Customised bindings may be defined in `ielm-map', which currently contains: (insert ielm-header) (ielm-set-pm (point-max)) (unless comint-use-prompt-regexp-instead-of-fields - (add-text-properties - (point-min) (point-max) - '(rear-nonsticky t field output inhibit-line-move-field-capture t))) - (comint-output-filter (ielm-process) ielm-prompt) + (let ((inhibit-read-only t)) + (add-text-properties + (point-min) (point-max) + '(rear-nonsticky t field output inhibit-line-move-field-capture t)))) + (comint-output-filter (ielm-process) ielm-prompt-internal) (set-marker comint-last-input-start (ielm-pm)) (set-process-filter (get-buffer-process (current-buffer)) 'comint-output-filter)) @@ -521,12 +567,13 @@ Customised bindings may be defined in `ielm-map', which currently contains: "Interactively evaluate Emacs Lisp expressions. Switches to the buffer `*ielm*', or creates it if it does not exist." (interactive) - (if (comint-check-proc "*ielm*") - nil - (save-excursion - (set-buffer (get-buffer-create "*ielm*")) - (inferior-emacs-lisp-mode))) - (pop-to-buffer "*ielm*")) + (let (old-point) + (unless (comint-check-proc "*ielm*") + (with-current-buffer (get-buffer-create "*ielm*") + (unless (zerop (buffer-size)) (setq old-point (point))) + (inferior-emacs-lisp-mode))) + (pop-to-buffer "*ielm*") + (when old-point (push-mark old-point)))) (provide 'ielm) diff --git a/lisp/iimage.el b/lisp/iimage.el new file mode 100644 index 00000000000..d138498ca3a --- /dev/null +++ b/lisp/iimage.el @@ -0,0 +1,134 @@ +;;; iimage.el --- Inline image minor mode. + +;; Copyright (C) 2004 Free Software Foundation + +;; Author: KOSEKI Yoshinori <kose@meadowy.org> +;; Maintainer: KOSEKI Yoshinori <kose@meadowy.org> +;; Keywords: multimedia + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; Iimage is a minor mode that display a images, when image-filename +;; exists in buffer. +;; http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html +;; +;; Add to your `~/.emacs': +;; (autoload 'iimage-mode "iimage" "SUpport Inline image minor mode." t) +;; +;; ** Display images in *Info* buffer. +;; +;; (add-hook 'info-mode-hook 'turn-on-iimage-mode) +;; +;; .texinfo: @file{file://foo.png} +;; .info: `file://foo.png' +;; +;; ** Display images in Wiki buffer. +;; +;; (add-hook 'wiki-mode-hook 'turn-on-iimage-mode) +;; +;; wiki-file: [[foo.png]] + +;;; Code: + +(eval-when-compile + (require 'image-file)) + +(defconst iimage-version "1.0") +(defvar iimage-mode nil) +(defvar iimage-mode-map nil) + +;; Set up key map. +(unless iimage-mode-map + (setq iimage-mode-map (make-sparse-keymap)) + (define-key iimage-mode-map "\C-l" 'iimage-recenter)) + +(defun iimage-recenter (&optional arg) +"Re-draw images and recenter." + (interactive "P") + (iimage-mode-buffer 0) + (iimage-mode-buffer 1) + (recenter arg)) + +(defvar iimage-mode-image-filename-regex + (concat "[-+./_0-9a-zA-Z]+\\." + (regexp-opt (nconc (mapcar #'upcase + image-file-name-extensions) + image-file-name-extensions) + t))) + +(defvar iimage-mode-image-regex-alist + `((,(concat "\\(`?file://\\|\\[\\[\\|<\\|`\\)?" + "\\(" iimage-mode-image-filename-regex "\\)" + "\\(\\]\\]\\|>\\|'\\)?") . 2)) +"*Alist of filename REGEXP vs NUM. +Each element looks like (REGEXP . NUM). +NUM specifies which parenthesized expression in the regexp. + +image filename regex exsamples: + file://foo.png + `file://foo.png' + \\[\\[foo.gif]] + <foo.png> + foo.JPG +") + +(defun turn-on-iimage-mode () +"Unconditionally turn on iimage mode." + (interactive) + (iimage-mode 1)) + +(defun turn-off-iimage-mode () +"Unconditionally turn off iimage mode." + (interactive) + (iimage-mode 0)) + +(defun iimage-mode-buffer (arg) +"Display/Undisplay Images. +With numeric ARG, display the images if and only if ARG is positive." + (interactive) + (let ((ing (if (numberp arg) + (> arg 0) + iimage-mode)) + (modp (buffer-modified-p (current-buffer))) + file buffer-read-only) + (save-excursion + (goto-char (point-min)) + (dolist (pair iimage-mode-image-regex-alist) + (while (re-search-forward (car pair) nil t) + (if (and (setq file (match-string (cdr pair))) + (setq file (expand-file-name file default-directory)) + (file-exists-p file)) + (if ing + (add-text-properties (match-beginning 0) (match-end 0) + (list 'display (create-image file))) + (remove-text-properties (match-beginning 0) (match-end 0) + '(display))))))) + (set-buffer-modified-p modp))) + +(define-minor-mode iimage-mode + "Toggle inline image minor mode." + nil " iImg" iimage-mode-map + (run-hooks 'iimage-mode-hook) + (iimage-mode-buffer iimage-mode)) + +(provide 'iimage) + +;;; arch-tag: f6f8e29a-08f6-4a12-9496-51e67441ce65 +;;; iimage.el ends here diff --git a/lisp/image.el b/lisp/image.el index 0e71bd4a349..88e38186d7b 100644 --- a/lisp/image.el +++ b/lisp/image.el @@ -1,6 +1,6 @@ ;;; image.el --- image API -;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1998, 99, 2000, 01, 04 Free Software Foundation, Inc. ;; Maintainer: FSF ;; Keywords: multimedia @@ -48,6 +48,17 @@ IMAGE-TYPE must be a pair (PREDICATE . TYPE). PREDICATE is called with one argument, a string containing the image data. If PREDICATE returns a non-nil value, TYPE is the image's type.") +;;;###autoload +(defvar image-library-alist nil + "Alist of image types vs external libraries needed to display them. + +Each element is a list (IMAGE-TYPE LIBRARY...), where the car is a symbol +representing a supported image type, and the rest are strings giving +alternate filenames for the corresponding external libraries to load. +They are tried in the order they appear on the list; if none of them can +be loaded, the running session of Emacs won't display the image type. +No entries are needed for pbm and xbm images; they're always supported.") +;;;###autoload (put 'image-library-alist 'risky-local-variable t) (defun image-jpeg-p (data) "Value is non-nil if DATA, a string, consists of JFIF image data. @@ -111,8 +122,8 @@ be determined." (defun image-type-available-p (type) "Value is non-nil if image type TYPE is available. Image types are symbols like `xbm' or `jpeg'." - (and (boundp 'image-types) (not (null (memq type image-types))))) - + (and (fboundp 'init-image-library) + (init-image-library type image-library-alist))) ;;;###autoload (defun create-image (file-or-data &optional type data-p &rest props) @@ -176,7 +187,7 @@ means display it in the right marginal area." ;;;###autoload -(defun insert-image (image &optional string area) +(defun insert-image (image &optional string area slice) "Insert IMAGE into current buffer at point. IMAGE is displayed by inserting STRING into the current buffer with a `display' property whose value is the image. STRING is @@ -184,7 +195,12 @@ defaulted if you omit it. AREA is where to display the image. AREA nil or omitted means display it in the text area, a value of `left-margin' means display it in the left marginal area, a value of `right-margin' -means display it in the right marginal area." +means display it in the right marginal area. +SLICE specifies slice of IMAGE to insert. SLICE nil or omitted +means insert whole image. SLICE is a list (X Y WIDTH HEIGHT) +specifying the X and Y positions and WIDTH and HEIGHT of image area +to insert. A float value 0.0 - 1.0 means relative to the width or +height of the image; integer values are taken as pixel values." ;; Use a space as least likely to cause trouble when it's a hidden ;; character in the buffer. (unless string (setq string " ")) @@ -204,7 +220,40 @@ means display it in the right marginal area." (let ((start (point))) (insert string) (add-text-properties start (point) - `(display ,image rear-nonsticky (display))))) + `(display ,(if slice + (list (cons 'slice slice) image) + image) rear-nonsticky (display))))) + + +(defun insert-sliced-image (image &optional string area rows cols) + (unless string (setq string " ")) + (unless (eq (car-safe image) 'image) + (error "Not an image: %s" image)) + (unless (or (null area) (memq area '(left-margin right-margin))) + (error "Invalid area %s" area)) + (if area + (setq image (list (list 'margin area) image)) + ;; Cons up a new spec equal but not eq to `image' so that + ;; inserting it twice in a row (adjacently) displays two copies of + ;; the image. Don't try to avoid this by looking at the display + ;; properties on either side so that we DTRT more often with + ;; cut-and-paste. (Yanking killed image text next to another copy + ;; of it loses anyway.) + (setq image (cons 'image (cdr image)))) + (let ((x 0.0) (dx (/ 1.0001 (or cols 1))) + (y 0.0) (dy (/ 1.0001 (or rows 1)))) + (while (< y 1.0) + (while (< x 1.0) + (let ((start (point))) + (insert string) + (add-text-properties start (point) + `(display ,(list (list 'slice x y dx dy) image) + rear-nonsticky (display))) + (setq x (+ x dx)))) + (setq x 0.0 + y (+ y dy)) + (insert (propertize "\n" 'line-height 0))))) + ;;;###autoload diff --git a/lisp/imenu.el b/lisp/imenu.el index 42f50fba3a4..e0b57440fd8 100644 --- a/lisp/imenu.el +++ b/lisp/imenu.el @@ -890,6 +890,7 @@ Returns t for rescan and otherwise a position number." (setq name (completing-read prompt prepared-index-alist nil t nil 'imenu--history-list name))) + (cond ((not (stringp name)) nil) ((string= name (car imenu--rescan-item)) t) (t @@ -1015,7 +1016,10 @@ This value becomes local in every buffer when it is set.") (if (equal item imenu--rescan-item) (progn (imenu--cleanup) + ;; Make sure imenu-update-menubar redoes everything. + (setq imenu-menubar-modified-tick -1) (setq imenu--index-alist nil) + (setq imenu--last-menubar-index-alist nil) (imenu-update-menubar) t) (imenu item) diff --git a/lisp/info-look.el b/lisp/info-look.el index 35138121838..644ee3d6c20 100644 --- a/lisp/info-look.el +++ b/lisp/info-look.el @@ -1,7 +1,7 @@ ;;; info-look.el --- major-mode-sensitive Info index lookup facility ;; An older version of this was known as libc.el. -;; Copyright (C) 1995,96,97,98,99,2001,2003,2004 Free Software Foundation, Inc. +;; Copyright (C) 1995,96,97,98,99,2001,03,04 Free Software Foundation, Inc. ;; Author: Ralph Schleicher <rs@nunatak.allgaeu.org> ;; (did not show signs of life (Nov 2001) -stef) @@ -408,12 +408,11 @@ If optional argument QUERY is non-nil, query for the help mode." (message "No %s help available for `%s'" topic mode) ;; Recursively setup cross references. ;; But refer only to non-void modes. - (mapcar (lambda (arg) - (or (info-lookup->initialized topic arg) - (info-lookup-setup-mode topic arg)) - (and (eq (info-lookup->initialized topic arg) t) - (setq refer-modes (cons arg refer-modes)))) - (info-lookup->other-modes topic mode)) + (dolist (arg (info-lookup->other-modes topic mode)) + (or (info-lookup->initialized topic arg) + (info-lookup-setup-mode topic arg)) + (and (eq (info-lookup->initialized topic arg) t) + (setq refer-modes (cons arg refer-modes)))) (setq refer-modes (nreverse refer-modes)) ;; Build the full completion alist. (setq completions @@ -887,6 +886,22 @@ Return nil if there is nothing appropriate in the buffer near point." "awk") ((string-equal item "gawk, versions of, information about, printing") "gawk")))))) + +;; This misses some things which occur as node names but not in the +;; index. Unfortunately it also picks up the wrong one of multiple +;; entries for the same term in some cases. --fx +(info-lookup-maybe-add-help + :mode 'cfengine-mode + :regexp "[[:alnum:]_]+\\(:?()\\)?" + :doc-spec '(("(cfengine-Reference)Variable Index" + (lambda (item) + ;; Index entries may be like `IsPlain()' + (if (string-match "\\([[:alnum:]_]+\\)()" item) + (match-string 1 item) + item)) + ;; This gets functions in evaluated classes. Other + ;; possible patterns don't seem to work too well. + "`" "("))) (provide 'info-look) diff --git a/lisp/info.el b/lisp/info.el index c67a1a5f0c7..43e1dafcc6f 100644 --- a/lisp/info.el +++ b/lisp/info.el @@ -66,29 +66,29 @@ The Lisp code is executed when the node is selected.") (put 'Info-enable-active-nodes 'risky-local-variable t) (defface info-node - '((((class color) (background light)) (:foreground "brown" :weight bold :slant italic)) - (((class color) (background dark)) (:foreground "white" :weight bold :slant italic)) - (t (:weight bold :slant italic))) + '((((class color) (background light)) :foreground "brown" :weight bold :slant italic) + (((class color) (background dark)) :foreground "white" :weight bold :slant italic) + (t :weight bold :slant italic)) "Face for Info node names." :group 'info) (defface info-menu-5 - '((((class color)) (:foreground "red1")) - (t (:underline t))) + '((((class color)) :foreground "red1") + (t :underline t)) "Face for every third `*' in an Info menu." :group 'info) (defface info-xref - '((((class color) (background light)) (:foreground "blue")) - (((class color) (background dark)) (:foreground "cyan")) - (t (:underline t))) + '((((class color) (background light)) :foreground "blue") + (((class color) (background dark)) :foreground "cyan") + (t :underline t)) "Face for Info cross-references." :group 'info) (defface info-xref-visited - '((((class color) (background light)) (:foreground "magenta4")) - (((class color) (background dark)) (:foreground "magenta4")) - (t (:underline t))) + '((t :inherit info-xref) + (((class color) (background light)) :foreground "magenta4") + (((class color) (background dark)) :foreground "magenta3")) ;"violet"? "Face for visited Info cross-references." :group 'info) @@ -110,12 +110,12 @@ A header-line does not scroll with the rest of the buffer." :group 'info) (defface info-header-xref - '((t (:inherit info-xref))) + '((t :inherit info-xref)) "Face for Info cross-references in a node header." :group 'info) (defface info-header-node - '((t (:inherit info-node))) + '((t :inherit info-node)) "Face for Info nodes in a node header." :group 'info) @@ -239,10 +239,11 @@ Marker points nowhere if file has no tag table.") (defvar Info-index-alternatives nil "List of possible matches for last `Info-index' command.") -(defvar Info-reference-name nil - "Name of the selected cross-reference. -Point is moved to the proper occurrence of this name within a node -after selecting it.") +(defvar Info-point-loc nil + "Point location within a selected node. +If string, the point is moved to the proper occurrence of the +name of the followed cross reference within a selected node. +If number, the point is moved to the corresponding line.") (defvar Info-standalone nil "Non-nil if Emacs was started solely as an Info browser.") @@ -449,28 +450,39 @@ Do the right thing if the file has been compressed or zipped." "Like `info' but show the Info buffer in another window." (interactive (if current-prefix-arg (list (read-file-name "Info file name: " nil nil t)))) - (let (same-window-buffer-names) + (let (same-window-buffer-names same-window-regexps) (info file))) -;;;###autoload (add-hook 'same-window-buffer-names "*info*") +;;;###autoload (add-hook 'same-window-regexps "\\*info\\*\\(\\|<[0-9]+>\\)") ;;;###autoload -(defun info (&optional file) +(defun info (&optional file buffer) "Enter Info, the documentation browser. Optional argument FILE specifies the file to examine; the default is the top-level directory of Info. Called from a program, FILE may specify an Info node of the form `(FILENAME)NODENAME'. +Optional argument BUFFER specifies the Info buffer name; +the default buffer name is *info*. If BUFFER exists, +just switch to BUFFER. Otherwise, create a new buffer +with the top-level Info directory. -In interactive use, a prefix argument directs this command -to read a file name from the minibuffer. +In interactive use, a non-numeric prefix argument directs +this command to read a file name from the minibuffer. +A numeric prefix argument selects an Info buffer with the prefix number +appended to the Info buffer name. The search path for Info files is in the variable `Info-directory-list'. The top-level Info directory is made by combining all the files named `dir' in all the directories in that path." - (interactive (if current-prefix-arg - (list (read-file-name "Info file name: " nil nil t)))) - (pop-to-buffer "*info*") + (interactive (list + (if (and current-prefix-arg (not (numberp current-prefix-arg))) + (read-file-name "Info file name: " nil nil t)) + (if (numberp current-prefix-arg) + (format "*info*<%s>" current-prefix-arg)))) + (pop-to-buffer (or buffer "*info*")) + (if (and buffer (not (eq major-mode 'Info-mode))) + (Info-mode)) (if file ;; If argument already contains parentheses, don't add another set ;; since the argument will then be parsed improperly. This also @@ -480,7 +492,7 @@ in all the directories in that path." (Info-goto-node file) (Info-goto-node (concat "(" file ")"))) (if (zerop (buffer-size)) - (Info-directory)))) + (Info-directory)))) ;;;###autoload (defun info-emacs-manual () @@ -535,11 +547,15 @@ just return nil (no error)." (if (stringp filename) (let (temp temp-downcase found) (setq filename (substitute-in-file-name filename)) - (cond + (cond ((string= (downcase filename) "dir") (setq found t)) ((string= filename "apropos") (setq found 'apropos)) + ((string= filename "history") + (setq found 'history)) + ((string= filename "toc") + (setq found 'toc)) (t (let ((dirs (if (string-match "^\\./" filename) ;; If specified name starts with `./' @@ -742,6 +758,10 @@ a case-insensitive match is tried." (Info-insert-dir)) ((eq filename 'apropos) (insert-buffer-substring " *info-apropos*")) + ((eq filename 'history) + (insert-buffer-substring " *info-history*")) + ((eq filename 'toc) + (insert-buffer-substring " *info-toc*")) (t (info-insert-file-contents filename nil) (setq default-directory (file-name-directory filename)))) @@ -782,6 +802,8 @@ a case-insensitive match is tried." (cond ((eq filename t) "dir") ((eq filename 'apropos) "apropos") + ((eq filename 'history) "history") + ((eq filename 'toc) "toc") (t filename))) )) ;; Use string-equal, not equal, to ignore text props. @@ -842,9 +864,17 @@ a case-insensitive match is tried." (let ((pos (Info-find-node-in-buffer regexp))) (when pos (goto-char pos) - (throw 'foo t)) - (error "No such anchor in tag table or node in tag table or file: %s" - nodename))) + (throw 'foo t))) + + (when (string-match "\\([^.]+\\)\\." nodename) + (let (Info-point-loc) + (Info-find-node-2 + filename (match-string 1 nodename) no-going-back)) + (widen) + (throw 'foo t)) + + ;; No such anchor in tag table or node in tag table or file + (error "No such node or anchor: %s" nodename)) (Info-select-node) (goto-char (point-min)) @@ -856,9 +886,12 @@ a case-insensitive match is tried." (cons new-history (delete new-history Info-history-list)))) (goto-char anchorpos)) - (Info-reference-name - (Info-find-index-name Info-reference-name) - (setq Info-reference-name nil)))))) + ((numberp Info-point-loc) + (forward-line (1- Info-point-loc)) + (setq Info-point-loc nil)) + ((stringp Info-point-loc) + (Info-find-index-name Info-point-loc) + (setq Info-point-loc nil)))))) ;; If we did not finish finding the specified node, ;; go back to the previous one. (or Info-current-node no-going-back (null Info-history) @@ -982,9 +1015,7 @@ a case-insensitive match is tried." nodename end) (re-search-backward "^\^_") (search-forward "Node: ") - (setq nodename - (and (looking-at (Info-following-node-name-re)) - (match-string 1))) + (setq nodename (Info-following-node-name)) (search-forward "\n\^_" nil 'move) (beginning-of-line) (setq end (point)) @@ -1053,7 +1084,7 @@ a case-insensitive match is tried." (goto-char (point-min)) ;; Remove duplicate headings in the same menu. (while (search-forward "\n* Menu:" nil t) - (setq limit (save-excursion (search-forward "\n" nil t))) + (setq limit (save-excursion (search-forward "\n\^_" nil t))) ;; Look for the next heading to unify. (while (re-search-forward "^\\(\\w.*\\)\n\\*" limit t) (let ((name (match-string 1)) @@ -1264,7 +1295,8 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." (let ((new-history (list Info-current-file Info-current-node))) (setq Info-history-list (cons new-history (delete new-history Info-history-list)))) - (Info-fontify-node) + (if (not (eq Info-fontify-maximum-menu-size nil)) + (Info-fontify-node)) (Info-display-images-node) (Info-hide-cookies-node) (run-hooks 'Info-selection-hook))))) @@ -1284,6 +1316,7 @@ any double quotes or backslashes must be escaped (\\\",\\\\)." ;; Go to an info node specified with a filename-and-nodename string ;; of the sort that is found in pointers in nodes. +;;;###autoload (defun Info-goto-node (nodename &optional fork) "Go to info node named NODENAME. Give just NODENAME or (FILENAME)NODENAME. If NODENAME is of the form (FILENAME)NODENAME, the node is in the Info file @@ -1298,8 +1331,6 @@ If FORK is a string, it is the name to use for the new buffer." (if fork (set-buffer (clone-buffer (concat "*info-" (if (stringp fork) fork nodename) "*") t))) - (if (member (buffer-name) '("*info-history*" "*info-toc*")) - (switch-to-buffer "*info*")) (let (filename) (string-match "\\s *\\((\\s *\\([^\t)]*\\)\\s *)\\s *\\|\\)\\(.*\\)" nodename) @@ -1307,9 +1338,9 @@ If FORK is a string, it is the name to use for the new buffer." "" (match-string 2 nodename)) nodename (match-string 3 nodename)) - (let ((trim (string-match "\\s *\\'" filename))) + (let ((trim (string-match "\\s +\\'" filename))) (if trim (setq filename (substring filename 0 trim)))) - (let ((trim (string-match "\\s *\\'" nodename))) + (let ((trim (string-match "\\s +\\'" nodename))) (if trim (setq nodename (substring nodename 0 trim)))) (if transient-mark-mode (deactivate-mark)) (Info-find-node (if (equal filename "") nil filename) @@ -1616,75 +1647,63 @@ If SAME-FILE is non-nil, do not move to a different Info file." (interactive) (Info-find-node "dir" "top")) -;;;###autoload (add-hook 'same-window-buffer-names "*info-history*") - (defun Info-history () - "Create the buffer *info-history* with a menu of visited nodes." + "Go to a node with a menu of visited nodes." (interactive) (let ((curr-file Info-current-file) (curr-node Info-current-node) p) - (pop-to-buffer - (with-current-buffer (get-buffer-create "*info-history*") - (let ((inhibit-read-only t)) - (erase-buffer) - (goto-char (point-min)) - (insert "Node: History\n\n") - (insert "Recently Visited Nodes\n**********************\n\n") - (insert "* Menu:\n\n") - (let ((hl Info-history-list)) - (while hl - (let ((file (nth 0 (car hl))) - (node (nth 1 (car hl)))) - (if (and (string-equal file curr-file) - (string-equal node curr-node)) - (setq p (point))) - (insert "* " node ": (" (file-name-nondirectory file) - ")" node ".\n")) - (setq hl (cdr hl)))) - (or (eq major-mode 'Info-mode) (Info-mode)) - (setq Info-current-file "info-history") - (setq Info-current-node "Info History") - (Info-set-mode-line) - (if (not (bobp)) (Info-fontify-node)) - (current-buffer)))) + (with-current-buffer (get-buffer-create " *info-history*") + (let ((inhibit-read-only t)) + (erase-buffer) + (goto-char (point-min)) + (insert "\n\^_\nFile: history Node: Top, Up: (dir)\n\n") + (insert "Recently Visited Nodes\n**********************\n\n") + (insert "* Menu:\n\n") + (let ((hl (delete '("history" "Top") Info-history-list))) + (while hl + (let ((file (nth 0 (car hl))) + (node (nth 1 (car hl)))) + (if (and (string-equal file curr-file) + (string-equal node curr-node)) + (setq p (point))) + (insert "* " node ": (" (file-name-nondirectory file) + ")" node ".\n")) + (setq hl (cdr hl)))))) + (Info-find-node "history" "Top") (goto-char (or p (point-min))))) -;;;###autoload (add-hook 'same-window-buffer-names "*info-toc*") - (defun Info-toc () - "Create the buffer *info-toc* with Info file's table of contents." + "Go to a node with table of contents of the current Info file. +Table of contents is created from the tree structure of menus." (interactive) (let ((curr-file Info-current-file) (curr-node Info-current-node) p) - (pop-to-buffer - (with-current-buffer (get-buffer-create "*info-toc*") - (if (not (equal Info-current-file curr-file)) - (let ((inhibit-read-only t) - (node-list (Info-build-toc curr-file))) - (erase-buffer) - (goto-char (point-min)) - (insert "Node: Contents\n\n") - (insert "Table of Contents\n*****************\n\n") - (insert "*Note Top::\n") - (Info-insert-toc - (nth 2 (assoc "Top" node-list)) ; get Top nodes - node-list 0) - (or (eq major-mode 'Info-mode) (Info-mode)) - (setq Info-current-file curr-file) - (setq Info-current-node "Contents") - (Info-set-mode-line))) - (if (not (bobp)) - (let ((Info-hide-note-references 'hide)) - (Info-fontify-node))) - (goto-char (point-min)) - (if (setq p (search-forward (concat "*Note " curr-node "::") nil t)) - (setq p (- p (length curr-node) 2))) - (current-buffer))) + (with-current-buffer (get-buffer-create " *info-toc*") + (let ((inhibit-read-only t) + (node-list (Info-build-toc curr-file))) + (erase-buffer) + (goto-char (point-min)) + (insert "\n\^_\nFile: toc Node: Top, Up: (dir)\n\n") + (insert "Table of Contents\n*****************\n\n") + (insert "*Note Top::\n") + (Info-insert-toc + (nth 2 (assoc "Top" node-list)) ; get Top nodes + node-list 0 (substring-no-properties curr-file))) + (if (not (bobp)) + (let ((Info-hide-note-references 'hide) + (Info-fontify-visited-nodes nil)) + (Info-mode) + (setq Info-current-file "toc" Info-current-node "Top") + (Info-fontify-node))) + (goto-char (point-min)) + (if (setq p (search-forward (concat "*Note " curr-node ":") nil t)) + (setq p (- p (length curr-node) 2)))) + (Info-find-node "toc" "Top") (goto-char (or p (point-min))))) -(defun Info-insert-toc (nodes node-list level) +(defun Info-insert-toc (nodes node-list level curr-file) "Insert table of contents with references to nodes." (let ((section "Top")) (while nodes @@ -1692,8 +1711,8 @@ If SAME-FILE is non-nil, do not move to a different Info file." (unless (member (nth 1 node) (list nil section)) (insert (setq section (nth 1 node)) "\n")) (insert (make-string level ?\t)) - (insert "*Note " (car nodes) "::\n") - (Info-insert-toc (nth 2 node) node-list (1+ level)) + (insert "*Note " (car nodes) ": (" curr-file ")" (car nodes) ".\n") + (Info-insert-toc (nth 2 node) node-list (1+ level) curr-file) (setq nodes (cdr nodes)))))) (defun Info-build-toc (file) @@ -1701,16 +1720,18 @@ If SAME-FILE is non-nil, do not move to a different Info file." (if (equal file "dir") (error "Table of contents for Info directory is not supported yet")) (with-temp-buffer - (let ((default-directory (or (and (stringp file) - (file-name-directory - (setq file (Info-find-file file)))) - default-directory)) - (sections '(("Top" "Top"))) - nodes subfiles) - (while (or file subfiles) - (or file (message "Searching subfile %s..." (car subfiles))) + (let* ((default-directory (or (and (stringp file) + (file-name-directory + (setq file (Info-find-file file)))) + default-directory)) + (main-file file) + (sections '(("Top" "Top"))) + nodes subfiles) + (while (or main-file subfiles) + (or main-file (message "Searching subfile %s..." (car subfiles))) (erase-buffer) - (info-insert-file-contents (or file (car subfiles))) + (info-insert-file-contents (or main-file (car subfiles))) + (goto-char (point-min)) (while (and (search-forward "\n\^_\nFile:" nil 'move) (search-forward "Node: " nil 'move)) (let ((nodename (substring-no-properties (Info-following-node-name))) @@ -1718,7 +1739,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (point-max)) 2)) (section "Top") menu-items) - (when (and (not (string-match "\\<index\\>" nodename)) + (when (and (not (Info-index-node nodename file)) (re-search-forward "^\\* Menu:" bound t)) (forward-line 1) (beginning-of-line) @@ -1750,7 +1771,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (nreverse menu-items)) nodes)) (goto-char bound))) - (if file + (if main-file (save-excursion (goto-char (point-min)) (if (search-forward "\n\^_\nIndirect:" nil t) @@ -1759,7 +1780,7 @@ If SAME-FILE is non-nil, do not move to a different Info file." (setq subfiles (cons (match-string-no-properties 1) subfiles))))) (setq subfiles (nreverse subfiles) - file nil)) + main-file nil)) (setq subfiles (cdr subfiles)))) (message "") (nreverse nodes)))) @@ -1838,8 +1859,7 @@ new buffer." (if (and (save-excursion (goto-char (+ (point) 5)) ; skip a possible *note (re-search-backward "\\*note[ \n\t]+" nil t) - (looking-at (concat "\\*note[ \n\t]+" - (Info-following-node-name-re "^.,\t")))) + (looking-at str)) (<= (point) (match-end 0))) (goto-char (match-beginning 0)))) ;; Go to the reference closest to point @@ -1867,11 +1887,27 @@ new buffer." Because of ambiguities, this should be concatenated with something like `:' and `Info-following-node-name-re'.") -(defun Info-extract-menu-node-name (&optional multi-line) +(defun Info-extract-menu-node-name (&optional multi-line index-node) (skip-chars-forward " \t\n") (when (looking-at (concat Info-menu-entry-name-re ":\\(:\\|" (Info-following-node-name-re - (if multi-line "^.,\t" "^.,\t\n")) "\\)")) + (cond + (index-node "^,\t\n") + (multi-line "^.,\t") + (t "^.,\t\n"))) + "\\)" + (if index-node + "\\.\\(?:[ \t\n]+(line +\\([0-9]+\\))\\)?" + ""))) + (if index-node + (setq Info-point-loc + (if (match-beginning 5) + (string-to-number (match-string 5)) + (buffer-substring (match-beginning 0) (1- (match-beginning 1))))) +;;; Comment out the next line to use names of cross-references: +;;; (setq Info-point-loc +;;; (buffer-substring (match-beginning 0) (1- (match-beginning 1)))) + ) (replace-regexp-in-string "[ \n]+" " " (or (match-string 2) @@ -1886,6 +1922,7 @@ Because of ambiguities, this should be concatenated with something like (defvar Info-complete-menu-buffer) (defvar Info-complete-next-re nil) +(defvar Info-complete-nodes nil) (defvar Info-complete-cache nil) (defconst Info-node-spec-re @@ -1899,6 +1936,9 @@ Because of ambiguities, this should be concatenated with something like ;; - `Info-complete-next-re' which, if non-nil, indicates that we should ;; also look for menu items in subsequent nodes as long as those ;; nodes' names match `Info-complete-next-re'. This feature is currently + ;; not used. + ;; - `Info-complete-nodes' which, if non-nil, indicates that we should + ;; also look for menu items in these nodes. This feature is currently ;; only used for completion in Info-index. ;; Note that `Info-complete-menu-buffer' could be current already, @@ -1922,6 +1962,7 @@ Because of ambiguities, this should be concatenated with something like (if (and (equal (nth 0 Info-complete-cache) Info-current-file) (equal (nth 1 Info-complete-cache) Info-current-node) (equal (nth 2 Info-complete-cache) Info-complete-next-re) + (equal (nth 5 Info-complete-cache) Info-complete-nodes) (let ((prev (nth 3 Info-complete-cache))) (eq t (compare-strings string 0 (length prev) prev 0 nil t)))) @@ -1934,9 +1975,12 @@ Because of ambiguities, this should be concatenated with something like (push (match-string-no-properties 1) completions)) ;; Check subsequent nodes if applicable. - (and Info-complete-next-re - (setq nextnode (Info-extract-pointer "next" t)) - (string-match Info-complete-next-re nextnode))) + (or (and Info-complete-next-re + (setq nextnode (Info-extract-pointer "next" t)) + (string-match Info-complete-next-re nextnode)) + (and Info-complete-nodes + (setq Info-complete-nodes (cdr Info-complete-nodes) + nextnode (car Info-complete-nodes))))) (Info-goto-node nextnode)) ;; Go back to the start node (for the next completion). (unless (equal Info-current-node orignode) @@ -1944,7 +1988,8 @@ Because of ambiguities, this should be concatenated with something like ;; Update the cache. (set (make-local-variable 'Info-complete-cache) (list Info-current-file Info-current-node - Info-complete-next-re string completions))) + Info-complete-next-re string completions + Info-complete-nodes))) (if action (all-completions string completions predicate) (try-completion string completions predicate))))))) @@ -2013,7 +2058,7 @@ new buffer." (error "No such item in menu")) (beginning-of-line) (forward-char 2) - (Info-extract-menu-node-name))))) + (Info-extract-menu-node-name nil (Info-index-node)))))) ;; If COUNT is nil, use the last item in the menu. (defun Info-extract-menu-counting (count) @@ -2028,7 +2073,7 @@ new buffer." (error "Too few items in menu")) (while (search-forward "\n* " nil t) nil)) - (Info-extract-menu-node-name))))) + (Info-extract-menu-node-name nil (Info-index-node)))))) (defun Info-nth-menu-item () "Go to the node of the Nth menu item. @@ -2055,7 +2100,7 @@ N is the digit argument used to invoke this command." ;; move forward until we can't go any farther. (while (Info-forward-node t t) nil) ;; Then keep moving down to last subnode, unless we reach an index. - (while (and (not (string-match "\\<index\\>" Info-current-node)) + (while (and (not (Info-index-node)) (save-excursion (search-forward "\n* Menu:" nil t))) (Info-goto-node (Info-extract-menu-counting nil))))) @@ -2071,7 +2116,7 @@ N is the digit argument used to invoke this command." ;; 3. next node is up and next (cond ((and (not not-down) (save-excursion (search-forward "\n* menu:" nil t)) - (not (string-match "\\<index\\>" Info-current-node))) + (not (Info-index-node))) (Info-goto-node (Info-extract-menu-counting 1)) t) ((save-excursion (search-backward "next:" nil t)) @@ -2109,7 +2154,7 @@ N is the digit argument used to invoke this command." ;; go down to find the last subnode*. (Info-prev) (let (Info-history) - (while (and (not (string-match "\\<index\\>" Info-current-node)) + (while (and (not (Info-index-node)) (save-excursion (search-forward "\n* Menu:" nil t))) (Info-goto-node (Info-extract-menu-counting nil))))) (t @@ -2300,32 +2345,124 @@ parent node." (if recur (error "No cross references in this node") (Info-prev-reference t))))) + +(defvar Info-index-nodes nil + "Alist of cached index node names of visited Info files. +Each element has the form (INFO-FILE INDEX-NODE-NAMES-LIST).") + +(defun Info-index-nodes (&optional file) + "Return a list of names of all index nodes in Info FILE. +If FILE is omitted, it defaults to the current Info file. +First look in a list of cached index node names. Then scan Info +file and its subfiles for nodes with the index cookie. Then try +to find index nodes starting from the first node in the top level +menu whose name contains the word \"Index\", plus any immediately +following nodes whose names also contain the word \"Index\"." + (or file (setq file Info-current-file)) + (or (assoc file Info-index-nodes) + ;; Skip virtual Info files + (and (member file '("dir" "history" "toc" "apropos")) + (setq Info-index-nodes (cons (cons file nil) Info-index-nodes))) + (not (stringp file)) + ;; Find nodes with index cookie + (let* ((default-directory (or (and (stringp file) + (file-name-directory + (setq file (Info-find-file file)))) + default-directory)) + Info-history Info-history-list Info-fontify-maximum-menu-size + (main-file file) subfiles nodes node) + (condition-case nil + (with-temp-buffer + (while (or main-file subfiles) + (erase-buffer) + (info-insert-file-contents (or main-file (car subfiles))) + (goto-char (point-min)) + (while (search-forward "\0\b[index\0\b]" nil 'move) + (save-excursion + (re-search-backward "^\^_") + (search-forward "Node: ") + (setq nodes (cons (Info-following-node-name) nodes)))) + (if main-file + (save-excursion + (goto-char (point-min)) + (if (search-forward "\n\^_\nIndirect:" nil t) + (let ((bound (save-excursion (search-forward "\n\^_" nil t)))) + (while (re-search-forward "^\\(.*\\): [0-9]+$" bound t) + (setq subfiles (cons (match-string-no-properties 1) + subfiles))))) + (setq subfiles (nreverse subfiles) + main-file nil)) + (setq subfiles (cdr subfiles))))) + (error nil)) + (if nodes + (setq nodes (nreverse nodes) + Info-index-nodes (cons (cons file nodes) Info-index-nodes))) + nodes) + ;; Find nodes with the word "Index" in the node name + (let ((case-fold-search t) + Info-history Info-history-list Info-fontify-maximum-menu-size + nodes node) + (condition-case nil + (with-temp-buffer + (Info-mode) + (Info-find-node file "Top") + (when (and (search-forward "\n* menu:" nil t) + (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t)) + (goto-char (match-beginning 1)) + (setq nodes (list (Info-extract-menu-node-name))) + (Info-goto-node (car nodes)) + (while (and (setq node (Info-extract-pointer "next" t)) + (string-match "\\<Index\\>" node)) + (setq nodes (cons node nodes)) + (Info-goto-node node)))) + (error nil)) + (if nodes + (setq nodes (nreverse nodes) + Info-index-nodes (cons (cons file nodes) Info-index-nodes))) + nodes) + ;; If file has no index nodes, still add it to the cache + (setq Info-index-nodes (cons (cons file nil) Info-index-nodes))) + (cdr (assoc file Info-index-nodes))) + +(defun Info-index-node (&optional node file) + "Return non-nil value if NODE is an index node. +If NODE is nil, check the current Info node. +If FILE is nil, check the current Info file." + (if (or (and node (not (equal node Info-current-node))) + (assoc (or file Info-current-file) Info-index-nodes)) + (member (or node Info-current-node) (Info-index-nodes file)) + ;; Don't search all index nodes if request is only for the current node + ;; and file is not in the cache of index nodes + (or + (save-match-data + (string-match "\\<Index\\>" (or node Info-current-node ""))) + (save-excursion + (goto-char (+ (or (save-excursion + (search-backward "\n\^_" nil t)) + (point-min)) 2)) + (search-forward "\0\b[index\0\b]" + (or (save-excursion + (search-forward "\n\^_" nil t)) + (point-max)) t))))) (defun Info-goto-index () - (Info-goto-node "Top") - (or (search-forward "\n* menu:" nil t) - (error "No index")) - (or (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t) - (error "No index")) - (goto-char (match-beginning 1)) - ;; Protect Info-history so that the current node (Top) is not added to it. - (let ((Info-history nil)) - (Info-goto-node (Info-extract-menu-node-name)))) + "Go to the first index node." + (let ((node (car (Info-index-nodes)))) + (or node (error "No index")) + (Info-goto-node node))) ;;;###autoload (defun Info-index (topic) "Look up a string TOPIC in the index for this file. -The index is defined as the first node in the top level menu whose -name contains the word \"Index\", plus any immediately following -nodes whose names also contain the word \"Index\". If there are no exact matches to the specified topic, this chooses the first match which is a case-insensitive substring of a topic. -Use the `,' command to see the other matches. +Use the \\<Info-mode-map>\\[Info-index-next] command to see the other matches. Give a blank topic name to go to the Index node itself." (interactive (list (let ((Info-complete-menu-buffer (clone-buffer)) - (Info-complete-next-re "\\<Index\\>")) + (Info-complete-nodes (Info-index-nodes)) + (Info-history-list nil)) (if (equal Info-current-file "dir") (error "The Info directory node has no index; use m to select a manual")) (unwind-protect @@ -2336,9 +2473,10 @@ Give a blank topic name to go to the Index node itself." (if (equal Info-current-file "dir") (error "The Info directory node has no index; use m to select a manual")) (let ((orignode Info-current-node) - (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^.\n]*\\)\\.[ \t]*\\([0-9]*\\)" + (pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]*\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" (regexp-quote topic))) - node + node (nodes (Info-index-nodes)) + (ohist-list Info-history-list) (case-fold-search t)) (Info-goto-index) (or (equal topic "") @@ -2360,8 +2498,7 @@ Give a blank topic name to go to the Index node itself." (string-to-number (concat "0" (match-string 3)))) matches)) - (and (setq node (Info-extract-pointer "next" t)) - (string-match "\\<Index\\>" node))) + (setq nodes (cdr nodes) node (car nodes))) (Info-goto-node node)) (or matches (progn @@ -2371,11 +2508,12 @@ Give a blank topic name to go to the Index node itself." (while (setq found (assoc topic matches)) (setq exact (cons found exact) matches (delq found matches))) + (setq Info-history-list ohist-list) (setq Info-index-alternatives (nconc exact (nreverse matches))) (Info-index-next 0))))) (defun Info-index-next (num) - "Go to the next matching index item from the last `i' command." + "Go to the next matching index item from the last \\<Info-mode-map>\\[Info-index] command." (interactive "p") (or Info-index-alternatives (error "No previous `i' command")) @@ -2388,7 +2526,7 @@ Give a blank topic name to go to the Index node itself." num (1- num))) (Info-goto-node (nth 1 (car Info-index-alternatives))) (if (> (nth 3 (car Info-index-alternatives)) 0) - (forward-line (nth 3 (car Info-index-alternatives))) + (forward-line (1- (nth 3 (car Info-index-alternatives)))) (forward-line 3) ; don't search in headers (let ((name (car (car Info-index-alternatives)))) (Info-find-index-name name))) @@ -2427,16 +2565,14 @@ Give a blank topic name to go to the Index node itself." Build a menu of the possible matches." (interactive "sIndex apropos: ") (unless (string= string "") - (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^.]+\\)." + (let ((pattern (format "\n\\* +\\([^\n]*%s[^\n]*\\):[ \t]+\\([^\n]+\\)\\.\\(?:[ \t\n]*(line +\\([0-9]+\\))\\)?" (regexp-quote string))) (ohist Info-history) (ohist-list Info-history-list) (current-node Info-current-node) (current-file Info-current-file) - manuals matches temp-file node) - (let ((Info-fontify-maximum-menu-size 0) - Info-use-header-lines - Info-hide-note-references) + manuals matches node nodes) + (let ((Info-fontify-maximum-menu-size nil)) (Info-directory) (message "Searching indices...") (goto-char (point-min)) @@ -2445,24 +2581,22 @@ Build a menu of the possible matches." (add-to-list 'manuals (match-string 1))) (dolist (manual manuals) (message "Searching %s" manual) - (condition-case nil - (save-excursion - (Info-find-node manual "Top") - (when (re-search-forward "\n\\* \\(.*\\<Index\\>\\)" nil t) - (goto-char (match-beginning 1)) - (Info-goto-node (Info-extract-menu-node-name)) - (while - (progn - (goto-char (point-min)) - (while (re-search-forward pattern nil t) - (add-to-list 'matches - (list (match-string 1) - (match-string 2) - manual))) - (and (setq node (Info-extract-pointer "next" t)) - (string-match "\\<Index\\>" node))) - (Info-goto-node node)))) - (error nil)))) + (if (setq nodes (Info-index-nodes (Info-find-file manual))) + (condition-case nil + (save-excursion + (Info-find-node manual (car nodes)) + (while + (progn + (goto-char (point-min)) + (while (re-search-forward pattern nil t) + (add-to-list 'matches + (list manual + (match-string-no-properties 1) + (match-string-no-properties 2) + (match-string-no-properties 3)))) + (setq nodes (cdr nodes) node (car nodes))) + (Info-goto-node node))) + (error nil))))) (Info-goto-node (concat "(" current-file ")" current-node)) (setq Info-history ohist Info-history-list ohist-list) @@ -2471,12 +2605,19 @@ Build a menu of the possible matches." (message "No matches found") (with-current-buffer (get-buffer-create " *info-apropos*") (erase-buffer) - (insert "\n\nFile: apropos, Node: Top, Up: (dir)\n") + (insert "\n\^_\nFile: apropos, Node: Index, Up: (dir)\n") (insert "* Menu: \nNodes whose indices contain \"" string "\"\n\n") (dolist (entry matches) - (insert "* " (car entry) " [" (nth 2 entry) - "]: (" (nth 2 entry) ")" (nth 1 entry) ".\n"))) - (Info-find-node "apropos" "top"))))) + (insert + (format "* %-38s (%s)%s.%s\n" + (concat (nth 1 entry) " [" (nth 0 entry) "]:") + (nth 0 entry) + (nth 2 entry) + (if (nth 3 entry) + (concat " (line " (nth 3 entry) ")") + ""))))) + (Info-find-node "apropos" "Index") + (setq Info-complete-cache nil))))) (defun Info-undefined () "Make command be undefined in Info." @@ -2592,21 +2733,15 @@ if point is in a menu item description, follow that menu item." (browse-url (browse-url-url-at-point))) ((setq node (Info-get-token (point) "\\*note[ \n\t]+" "\\*note[ \n\t]+\\([^:]*\\):\\(:\\|[ \n\t]*(\\)?")) -;;; (or (match-string 2) -;;; (setq Info-reference-name -;;; (replace-regexp-in-string -;;; "[ \n\t]+" " " (match-string-no-properties 1)))) (Info-follow-reference node fork)) ;; menu item: node name ((setq node (Info-get-token (point) "\\* +" "\\* +\\([^:]*\\)::")) (Info-goto-node node fork)) - ;; menu item: index entry + ;; menu item: node name or index entry ((Info-get-token (point) "\\* +" "\\* +\\(.*\\): ") - (if (save-match-data (string-match "\\<index\\>" Info-current-node)) - (setq Info-reference-name (match-string-no-properties 1))) (beginning-of-line) (forward-char 2) - (setq node (Info-extract-menu-node-name)) + (setq node (Info-extract-menu-node-name nil (Info-index-node))) (Info-goto-node node fork)) ((setq node (Info-get-token (point) "Up: " "Up: \\([^,\n\t]*\\)")) (Info-goto-node node fork)) @@ -2654,16 +2789,21 @@ if point is in a menu item description, follow that menu item." (define-key Info-mode-map "h" 'Info-help) (define-key Info-mode-map "i" 'Info-index) (define-key Info-mode-map "l" 'Info-last) + (define-key Info-mode-map "L" 'Info-history) (define-key Info-mode-map "m" 'Info-menu) (define-key Info-mode-map "n" 'Info-next) (define-key Info-mode-map "p" 'Info-prev) (define-key Info-mode-map "q" 'Info-exit) (define-key Info-mode-map "s" 'Info-search) + (define-key Info-mode-map "S" 'Info-search-case-sensitively) ;; For consistency with Rmail. (define-key Info-mode-map "\M-s" 'Info-search) (define-key Info-mode-map "\M-n" 'clone-buffer) (define-key Info-mode-map "t" 'Info-top-node) + (define-key Info-mode-map "T" 'Info-toc) (define-key Info-mode-map "u" 'Info-up) + ;; For consistency with dired-copy-filename-as-kill. + (define-key Info-mode-map "w" 'Info-copy-current-node-name) (define-key Info-mode-map "," 'Info-index-next) (define-key Info-mode-map "\177" 'Info-scroll-down) (define-key Info-mode-map [mouse-2] 'Info-mouse-follow-nearest-node) @@ -2708,9 +2848,9 @@ if point is in a menu item description, follow that menu item." ["Last" Info-last :active Info-history :help "Go to the last node you were at"] ["History" Info-history :active Info-history-list - :help "Go to the history buffer"] + :help "Go to menu of visited nodes"] ["Table of Contents" Info-toc - :help "Go to the buffer with a table of contents"] + :help "Go to table of contents"] ("Index..." ["Lookup a String" Info-index :help "Look for a string in the index items"] @@ -2808,20 +2948,23 @@ if point is in a menu item description, follow that menu item." (error (ding)))) -(defun Info-copy-current-node-name () +(defun Info-copy-current-node-name (&optional arg) "Put the name of the current info node into the kill ring. -The name of the info file is prepended to the node name in parentheses." - (interactive) +The name of the info file is prepended to the node name in parentheses. +With a zero prefix arg, put the name inside a function call to `info'." + (interactive "P") (unless Info-current-node (error "No current info node")) - (kill-new - (concat "(" - (file-name-nondirectory - (if (stringp Info-current-file) - Info-current-file - (or buffer-file-name ""))) - ")" - Info-current-node))) + (let ((node (concat "(" (file-name-nondirectory + (or (and (stringp Info-current-file) + Info-current-file) + buffer-file-name + "")) + ")" Info-current-node))) + (if (zerop (prefix-numeric-value arg)) + (setq node (concat "(info \"" node "\")"))) + (kill-new node) + (message "%s" node))) ;; Info mode is suitable only for specially formatted data. @@ -2852,14 +2995,15 @@ Selecting other nodes: \\[Info-directory] Go to the Info directory node. \\[Info-follow-reference] Follow a cross reference. Reads name of reference. \\[Info-last] Move to the last node you were at. -\\[Info-history] Go to the history buffer. -\\[Info-toc] Go to the buffer with a table of contents. -\\[Info-index] Look up a topic in this file's Index and move to that node. -\\[Info-index-next] (comma) Move to the next match from a previous `i' command. +\\[Info-history] Go to menu of visited nodes. +\\[Info-toc] Go to table of contents of the current Info file. \\[Info-top-node] Go to the Top node of this file. \\[Info-final-node] Go to the final node in this file. \\[Info-backward-node] Go backward one node, considering all nodes as forming one sequence. \\[Info-forward-node] Go forward one node, considering all nodes as forming one sequence. +\\[Info-index] Look up a topic in this file's Index and move to that node. +\\[Info-index-next] (comma) Move to the next match from a previous \\<Info-mode-map>\\[Info-index] command. +\\[info-apropos] Look for a string in the indices of all manuals. Moving within a node: \\[Info-scroll-up] Normally, scroll forward a full screen. @@ -2876,17 +3020,17 @@ Advanced commands: \\[Info-copy-current-node-name] Put name of current info node in the kill ring. \\[clone-buffer] Select a new cloned Info buffer in another window. \\[Info-edit] Edit contents of selected node. -1 Pick first item in node's menu. -2, 3, 4, 5 Pick second ... fifth item in node's menu. +1 .. 9 Pick first ... ninth item in node's menu. + Every third `*' is highlighted to help pick the right number. \\[Info-goto-node] Move to node specified by name. You may include a filename as well, as (FILENAME)NODENAME. \\[universal-argument] \\[info] Move to new Info file with completion. +\\[universal-argument] N \\[info] Select Info buffer with prefix number in the name *info*<N>. \\[Info-search] Search through this Info file for specified regexp, and select the node in which the next occurrence is found. -\\[Info-search-case-sensitively] Search through this Info file - for specified regexp case-sensitively. +\\[Info-search-case-sensitively] Search through this Info file for specified regexp case-sensitively. \\[Info-search-next] Search for another occurrence of regexp - from a previous `Info-search' command. + from a previous \\<Info-mode-map>\\[Info-search] command. \\[Info-next-reference] Move cursor to next cross-reference or menu item. \\[Info-prev-reference] Move cursor to previous cross-reference or menu item." (kill-all-local-variables) @@ -2916,6 +3060,8 @@ Advanced commands: ;; This is for the sake of the invisible text we use handling titles. (make-local-variable 'line-move-ignore-invisible) (setq line-move-ignore-invisible t) + (make-local-variable 'desktop-save-buffer) + (setq desktop-save-buffer 'Info-desktop-buffer-misc-data) (add-hook 'clone-buffer-hook 'Info-clone-buffer-hook nil t) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) (Info-set-mode-line) @@ -3045,8 +3191,9 @@ The locations are of the format used in `Info-history', i.e. ;; Bind Info-history to nil, to prevent the index nodes from ;; getting into the node history. (let ((Info-history nil) - node) - (Info-goto-node (Info-extract-menu-node-name)) + (Info-history-list nil) + node (nodes (Info-index-nodes))) + (Info-goto-node (car nodes)) (while (progn (goto-char (point-min)) @@ -3056,8 +3203,7 @@ The locations are of the format used in `Info-history', i.e. (match-string-no-properties 2) 0) where))) - (and (setq node (Info-extract-pointer "next" t)) - (string-match "\\<Index\\>" node))) + (and (setq nodes (cdr nodes) node (car nodes)))) (Info-goto-node node))) where)) @@ -3080,13 +3226,11 @@ COMMAND must be a symbol or string." ;; Get Info running, and pop to it in another window. (save-window-excursion (info)) - ;; FIXME It would be cool if this could use a buffer other - ;; than *info*. - (pop-to-buffer "*info*") + (or (eq major-mode 'Info-mode) (pop-to-buffer "*info*")) ;; Bind Info-history to nil, to prevent the last Index node ;; visited by Info-find-emacs-command-nodes from being ;; pushed onto the history. - (let ((Info-history nil)) + (let ((Info-history nil) (Info-history-list nil)) (Info-find-node (car (car where)) (car (cdr (car where))))) (if (> num-matches 1) @@ -3122,26 +3266,26 @@ the variable `Info-file-list-for-emacs'." (Info-goto-emacs-command-node command))))) (defface Info-title-1-face - '((((type tty pc) (class color)) (:foreground "yellow" :weight bold)) - (t (:height 1.2 :inherit Info-title-2-face))) + '((((type tty pc) (class color)) :foreground "yellow" :weight bold) + (t :height 1.2 :inherit Info-title-2-face)) "Face for Info titles at level 1." :group 'info) (defface Info-title-2-face - '((((type tty pc) (class color)) (:foreground "lightblue" :weight bold)) - (t (:height 1.2 :inherit Info-title-3-face))) + '((((type tty pc) (class color)) :foreground "lightblue" :weight bold) + (t :height 1.2 :inherit Info-title-3-face)) "Face for Info titles at level 2." :group 'info) (defface Info-title-3-face - '((((type tty pc) (class color)) (:weight bold)) - (t (:height 1.2 :inherit Info-title-4-face))) + '((((type tty pc) (class color)) :weight bold) + (t :height 1.2 :inherit Info-title-4-face)) "Face for Info titles at level 3." :group 'info) (defface Info-title-4-face - '((((type tty pc) (class color)) (:weight bold)) - (t (:weight bold :inherit variable-pitch))) + '((((type tty pc) (class color)) :weight bold) + (t :weight bold :inherit variable-pitch)) "Face for Info titles at level 4." :group 'info) @@ -3360,7 +3504,8 @@ Preserve text properties." (hl Info-history-list) res) (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) - (setq file (match-string 1 node) + (setq file (file-name-nondirectory + (match-string 1 node)) node (if (equal (match-string 2 node) "") "Top" (match-string 2 node)))) @@ -3377,14 +3522,20 @@ Preserve text properties." (add-text-properties (match-beginning 3) (match-end 3) '(invisible t front-sticky nil rear-nonsticky t)) ;; Unhide the file name of the external reference in parens - (if (match-string 6) + (if (and (match-string 6) (not (eq Info-hide-note-references 'hide))) (remove-text-properties (match-beginning 6) (match-end 6) '(invisible t front-sticky nil rear-nonsticky t))) ;; Unhide newline because hidden newlines cause too long lines (save-match-data - (let ((start3 (match-beginning 3))) - (if (string-match "\n[ \t]*" (match-string 3)) - (remove-text-properties (+ start3 (match-beginning 0)) (+ start3 (match-end 0)) + (let ((beg3 (match-beginning 3)) + (end3 (match-end 3))) + (if (and (string-match "\n[ \t]*" (match-string 3)) + (not (save-match-data + (save-excursion + (goto-char (1+ end3)) + (looking-at "[.)]*$"))))) + (remove-text-properties (+ beg3 (match-beginning 0)) + (+ beg3 (match-end 0)) '(invisible t front-sticky nil rear-nonsticky t)))))) (when (and Info-refill-paragraphs Info-hide-note-references) (push (set-marker (make-marker) start) @@ -3416,7 +3567,7 @@ Preserve text properties." (goto-char (point-min)) (when (and (or not-fontified-p fontify-visited-p) (search-forward "\n* Menu:" nil t) - (not (string-match "\\<Index\\>" Info-current-node)) + (not (Info-index-node)) ;; Don't take time to annotate huge menus (< (- (point-max) (point)) Info-fontify-maximum-menu-size)) (let ((n 0) @@ -3454,7 +3605,8 @@ Preserve text properties." (hl Info-history-list) res) (if (string-match "(\\([^)]+\\))\\([^)]*\\)" node) - (setq file (match-string 1 node) + (setq file (file-name-nondirectory + (match-string 1 node)) node (if (equal (match-string 2 node) "") "Top" (match-string 2 node)))) @@ -3502,6 +3654,13 @@ Preserve text properties." (put-text-property (match-beginning 1) (match-end 1) 'font-lock-face 'info-menu-header))) + ;; Hide index line numbers + (goto-char (point-min)) + (when (and not-fontified-p (Info-index-node)) + (while (re-search-forward "[ \t\n]*(line +[0-9]+)" nil t) + (put-text-property (match-beginning 0) (match-end 0) + 'invisible t))) + ;; Fontify http and ftp references (goto-char (point-min)) (when not-fontified-p @@ -3713,6 +3872,27 @@ BUFFER is the buffer speedbar is requesting buttons for." "^No \".*\" in index$")) (add-to-list 'debug-ignored-errors mess)) +;;;; Desktop support + +(defun Info-desktop-buffer-misc-data (desktop-dirname) + "Auxiliary information to be saved in desktop file." + (if (not (member Info-current-file '("apropos" "history" "toc"))) + (list Info-current-file Info-current-node))) + +;;;###autoload +(defun Info-restore-desktop-buffer (desktop-buffer-file-name + desktop-buffer-name + desktop-buffer-misc) + "Restore an info buffer specified in a desktop file." + (let ((first (nth 0 desktop-buffer-misc)) + (second (nth 1 desktop-buffer-misc))) + (when (and first second) + (when desktop-buffer-name + (set-buffer (get-buffer-create desktop-buffer-name)) + (Info-mode)) + (Info-find-node first second) + (current-buffer)))) + (provide 'info) ;;; arch-tag: f2480fe2-2139-40c1-a49b-6314991164ac diff --git a/lisp/international/ccl.el b/lisp/international/ccl.el index 883b53d83e3..6dd0258e6c5 100644 --- a/lisp/international/ccl.el +++ b/lisp/international/ccl.el @@ -1120,7 +1120,8 @@ (insert (format "write r%d (%d remaining)\n" rrr cc))) (defun ccl-dump-call (ignore cc) - (insert (format "call subroutine #%d\n" cc))) + (let ((subroutine (car (ccl-get-next-code)))) + (insert (format "call subroutine `%s'\n" subroutine)))) (defun ccl-dump-write-const-string (rrr cc) (if (= rrr 0) diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el index cd60e266b45..4c93ee62554 100644 --- a/lisp/international/mule-cmds.el +++ b/lisp/international/mule-cmds.el @@ -1030,7 +1030,7 @@ For a list of useful values for KEY and their meanings, see `language-info-alist'." (if (symbolp lang-env) (setq lang-env (symbol-name lang-env))) - (let ((lang-slot (assoc-ignore-case lang-env language-info-alist))) + (let ((lang-slot (assoc-string lang-env language-info-alist t))) (if lang-slot (cdr (assq key (cdr lang-slot)))))) @@ -1587,11 +1587,11 @@ to using the function `set-language-environment'." :link '(custom-manual "(emacs)Language Environments") :set (lambda (symbol value) (set-language-environment value)) :get (lambda (x) - (or (car-safe (assoc-ignore-case + (or (car-safe (assoc-string (if (symbolp current-language-environment) (symbol-name current-language-environment) current-language-environment) - language-info-alist)) + language-info-alist t)) "English")) ;; custom type will be updated with `set-language-info'. :type (if language-info-alist @@ -1696,7 +1696,7 @@ specifies the character set for the major languages of Western Europe." (if (symbolp language-name) (setq language-name (symbol-name language-name))) (setq language-name "English")) - (let ((slot (assoc-ignore-case language-name language-info-alist))) + (let ((slot (assoc-string language-name language-info-alist t))) (unless slot (error "Language environment not defined: %S" language-name)) (setq language-name (car slot))) @@ -1860,8 +1860,8 @@ Setting this variable directly does not take effect. See ?3)) ;; We suppress these setting for the moment because the ;; above assumption is wrong. - ;; (aset standard-display-table ?' [?,F"(B]) - ;; (aset standard-display-table ?` [?,F!(B]) + ;; (aset standard-display-table ?' [?$B!G(B]) + ;; (aset standard-display-table ?` [?$B!F(B]) ;; The fonts don't have the relevant bug. (aset standard-display-table 160 nil) (aset standard-display-table (make-char 'latin-iso8859-1 160) @@ -2268,7 +2268,7 @@ matches are looked for in the coding system list, treating case and the characters `-' and `_' as insignificant. The coding system base is returned. Thus, for instance, if charset \"ISO8859-2\", `iso-latin-2' is returned." - (or (car (assoc-ignore-case charset locale-charset-alist)) + (or (car (assoc-string charset locale-charset-alist t)) (let ((cs coding-system-alist) c) (while (and (not c) cs) @@ -2413,6 +2413,16 @@ See also `locale-charset-language-names', `locale-language-names', (message "Warning: Default coding system `%s' disagrees with system codeset `%s' for this locale." coding-system codeset)))))))) + ;; On Windows, override locale-coding-system, keyboard-coding-system, + ;; selection-coding-system with system codepage. + (when (boundp 'w32-ansi-code-page) + (let ((code-page-coding (intern (format "cp%d" w32-ansi-code-page)))) + (when (coding-system-p code-page-coding) + (setq locale-coding-system code-page-coding) + (set-selection-coding-system code-page-coding) + (set-keyboard-coding-system code-page-coding) + (set-terminal-coding-system code-page-coding)))) + ;; Default to A4 paper if we're not in a C, POSIX or US locale. ;; (See comments in Flocale_info.) (let ((locale locale) @@ -2435,7 +2445,11 @@ system codeset `%s' for this locale." coding-system codeset)))))))) ("posix$" . letter) (".._us" . letter) (".._pr" . letter) - (".._ca" . letter))) + (".._ca" . letter) + ("enu$" . letter) ; Windows + ("esu$" . letter) + ("enc$" . letter) + ("frc$" . letter))) 'a4)))))) nil) diff --git a/lisp/international/mule-diag.el b/lisp/international/mule-diag.el index 18d477c1cb8..2ce49981cf2 100644 --- a/lisp/international/mule-diag.el +++ b/lisp/international/mule-diag.el @@ -965,9 +965,7 @@ see the function `describe-fontset' for the format of the list." (goto-char (point-min)) (while (re-search-forward "^ \\([^ ]+\\) (`.*' in mode line)$" nil t) - (help-xref-button 1 #'help-input-method - (match-string 1) - "mouse-2: describe this method")))))) + (help-xref-button 1 'help-input-method (match-string 1))))))) (defun list-input-methods-1 () (if (not input-method-alist) diff --git a/lisp/international/mule-util.el b/lisp/international/mule-util.el index c3ea76c8716..9751812f348 100644 --- a/lisp/international/mule-util.el +++ b/lisp/international/mule-util.el @@ -379,27 +379,7 @@ basis, this may not be accurate." ;; On a window system, a character is displayable if we have ;; a font for that character in the default face of the ;; currently selected frame. - (let ((fontset (frame-parameter (selected-frame) 'font)) - font-pattern) - (if (query-fontset fontset) - (setq font-pattern (fontset-font fontset char))) - (or font-pattern - (setq font-pattern (fontset-font "fontset-default" char))) - (if font-pattern - (progn - ;; Now FONT-PATTERN is a string or a cons of family - ;; field pattern and registry field pattern. - (or (stringp font-pattern) - (let ((family (or (car font-pattern) "*")) - (registry (or (cdr font-pattern) "*"))) - (or (string-match "-" family) - (setq family (concat "*-" family))) - (or (string-match "-" registry) - (setq registry (concat registry "-*"))) - (setq font-pattern - (format "-%s-*-*-*-*-*-*-*-*-*-*-%s" - family registry)))) - (x-list-fonts font-pattern 'default (selected-frame) 1))))) + (car (internal-char-font nil char))) (t (let ((coding (terminal-coding-system))) (if coding diff --git a/lisp/international/mule.el b/lisp/international/mule.el index 8b2702bc30a..32f6a199268 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1374,9 +1374,9 @@ Each element must be one of the names listed in the variable (let* ((M (char-after (+ pos 4))) (L (char-after (+ pos 5))) (encoding (match-string 2)) - (encoding-info (assoc-ignore-case + (encoding-info (assoc-string encoding - ctext-non-standard-encodings-alist)) + ctext-non-standard-encodings-alist t)) (coding (if encoding-info (nth 1 encoding-info) (setq encoding (intern (downcase encoding))) @@ -1418,7 +1418,7 @@ Each element must be one of the names listed in the variable (dolist (elt charset) (aset table (make-char elt) slot))) ((char-table-p charset) - (map-char-table #'(lambda (k v) + (map-char-table #'(lambda (k v) (if (and v (> k 128)) (aset table k slot))) charset)))))) table)) @@ -1467,7 +1467,7 @@ text, and convert it in the temporary buffer. Otherwise, convert in-place." (- (point) last-pos))) (save-excursion (goto-char last-pos) - (insert (string-to-multibyte + (insert (string-to-multibyte (format "\e%%/%d%c%c%s" noctets (+ (/ len 128) 128) @@ -1636,7 +1636,7 @@ function by default." (goto-char tail-start) (re-search-forward "[\r\n]\^L" nil t) (if (re-search-forward - "[\r\n]\\([^[\r\n]*\\)[ \t]*Local Variables:[ \t]*\\([^\r\n]*\\)[\r\n]" + "[\r\n]\\([^[\r\n]*\\)[ \t]*Local Variables:[ \t]*\\([^\r\n]*\\)[\r\n]" tail-end t) ;; The prefix is what comes before "local variables:" in its ;; line. The suffix is what comes after "local variables:" @@ -1656,7 +1656,7 @@ function by default." "[ \t]*unibyte[ \t]*:[ \t]*\\([^ \t\r\n]+\\)[ \t]*" suffix "[\r\n]")) (re-end - (concat "[\r\n]" prefix "[ \t]*End *:[ \t]*" suffix + (concat "[\r\n]" prefix "[ \t]*End *:[ \t]*" suffix "[\r\n]?")) (pos (1- (point)))) (forward-char -1) ; skip back \r or \n. diff --git a/lisp/international/quail.el b/lisp/international/quail.el index 1415648be3b..2feaaeabf20 100644 --- a/lisp/international/quail.el +++ b/lisp/international/quail.el @@ -1043,9 +1043,13 @@ which to install MAP. The installed decode map can be referred by the function `quail-decode-map'." (if (null quail-current-package) (error "No current Quail package")) - (if (not (and (consp decode-map) (eq (car decode-map) 'decode-map))) - (error "Invalid Quail decode map `%s'" decode-map)) - (setcar (nthcdr 10 quail-current-package) decode-map)) + (if (if (consp decode-map) + (eq (car decode-map) 'decode-map) + (if (char-table-p decode-map) + (eq (char-table-subtype decode-map) 'quail-decode-map))) + (setcar (nthcdr 10 quail-current-package) decode-map) + (error "Invalid Quail decode map `%s'" decode-map))) + ;;;###autoload (defun quail-defrule (key translation &optional name append) @@ -1218,7 +1222,7 @@ selected translation." (t (error "Invalid object in Quail map: %s" def)))) -(defun quail-lookup-key (key &optional len) +(defun quail-lookup-key (key &optional len not-reset-indices) "Lookup KEY of length LEN in the current Quail map and return the definition. The returned value is a Quail map specific to KEY." (or len @@ -1256,7 +1260,7 @@ The returned value is a Quail map specific to KEY." (if (and (consp translation) (vectorp (cdr translation))) (progn (setq quail-current-translations translation) - (if (quail-forget-last-selection) + (if (and (not not-reset-indices) (quail-forget-last-selection)) (setcar (car quail-current-translations) 0)))))) ;; We may have to reform cdr part of MAP. (if (and (cdr map) (functionp (cdr map))) @@ -1512,6 +1516,28 @@ with more keys." (let (pos) (quail-delete-region) (setq pos (point)) + (or enable-multibyte-characters + (let (char) + (if (stringp quail-current-str) + (catch 'tag + (mapc #'(lambda (ch) + (when (/= (unibyte-char-to-multibyte + (multibyte-char-to-unibyte ch)) + ch) + (setq char ch) + (throw 'tag nil))) + quail-current-str)) + (if (/= (unibyte-char-to-multibyte + (multibyte-char-to-unibyte quail-current-str)) + quail-current-str) + (setq char quail-current-str))) + (when char + (message "Can't input %c in the current unibyte buffer" char) + (ding) + (sit-for 2) + (message nil) + (setq quail-current-str nil) + (throw 'quail-tag nil)))) (insert quail-current-str) (move-overlay quail-overlay pos (point)) (if (overlayp quail-conv-overlay) @@ -2009,7 +2035,7 @@ minibuffer and the selected frame has no other windows)." (defun quail-get-translations () "Return a string containing the current possible translations." - (let ((map (quail-lookup-key quail-current-key)) + (let ((map (quail-lookup-key quail-current-key nil t)) (str (copy-sequence quail-current-key))) (if quail-current-translations (quail-update-current-translations)) @@ -2080,7 +2106,7 @@ are shown (at most to the depth specified `quail-completion-max-depth')." (quail-setup-completion-buf) (let ((win (get-buffer-window quail-completion-buf 'visible)) (key quail-current-key) - (map (quail-lookup-key quail-current-key)) + (map (quail-lookup-key quail-current-key nil t)) (require-update nil)) (with-current-buffer quail-completion-buf (if (and win @@ -2556,6 +2582,143 @@ KEY BINDINGS FOR CONVERSION (quail-update-guidance) )))) +;; Add KEY (string) to the element of TABLE (char-table) for CHAR if +;; it is not yet stored. As a result, the element is a string or a +;; list of strings. + +(defsubst quail-store-decode-map-key (table char key) + (let ((elt (aref table char))) + (if elt + (if (consp elt) + (or (member key elt) + (aset table char (cons key elt))) + (or (string= key elt) + (aset table char (list key elt)))) + (aset table char key)))) + +;; Helper function for quail-gen-decode-map. Store key strings to +;; type each character under MAP in TABLE (char-table). MAP is an +;; element of the current Quail map reached by typing keys in KEY +;; (string). + +(defun quail-gen-decode-map1 (map key table) + (when (and (consp map) (listp (cdr map))) + (let ((trans (car map))) + (cond ((integerp trans) + (quail-store-decode-map-key table trans key)) + ((stringp trans) + (dotimes (i (length trans)) + (quail-store-decode-map-key table (aref trans i) key))) + ((or (vectorp trans) + (and (consp trans) + (setq trans (cdr trans)))) + (dotimes (i (length trans)) + (let ((elt (aref trans i))) + (if (stringp elt) + (if (= (length elt) 1) + (quail-store-decode-map-key table (aref elt 0) key)) + (quail-store-decode-map-key table elt key))))))) + (if (> (length key) 1) + (dolist (elt (cdr map)) + (quail-gen-decode-map1 (cdr elt) key table)) + (dolist (elt (cdr map)) + (quail-gen-decode-map1 (cdr elt) (format "%s%c" key (car elt)) + table))))) + +(put 'quail-decode-map 'char-table-extra-slots 0) + +;; Generate a halfly-cooked decode map (char-table) for the current +;; Quail map. An element for a character C is a key string or a list +;; of a key strings to type to input C. The lenth of key string is at +;; most 2. If it is 2, more keys may be required to input C. + +(defun quail-gen-decode-map () + (let ((table (make-char-table 'quail-decode-map nil))) + (dolist (elt (cdr (quail-map))) + (quail-gen-decode-map1 (cdr elt) (string (car elt)) table)) + table)) + +;; Helper function for quail-find-key. Prepend key strings to type +;; for inputting CHAR by the current input method to KEY-LIST and +;; return the result. MAP is an element of the current Quail map +;; reached by typing keys in KEY. + +(defun quail-find-key1 (map key char key-list) + (let ((trans (car map)) + (found-here nil)) + (cond ((stringp trans) + (setq found-here + (and (= (length trans) 1) (= (aref trans 0) char)))) + ((or (vectorp trans) (consp trans)) + (if (consp trans) + (setq trans (cdr trans))) + (setq found-here + (catch 'tag + (dotimes (i (length trans)) + (let ((target (aref trans i))) + (if (integerp target) + (if (= target char) + (throw 'tag t)) + (if (and (= (length target) 1) + (= (aref target 0) char)) + (throw 'tag t)))))))) + ((integerp trans) + (if (= trans char) + (setq found-here t)))) + (if found-here + (setq key-list (cons key key-list))) + (if (> (length key) 1) + (dolist (elt (cdr map)) + (setq key-list + (quail-find-key1 (cdr elt) (format "%s%c" key (car elt)) + char key-list)))) + key-list)) + +(defun quail-find-key (char) + "Return a list of keys to type to input CHAR in the current input method. +If CHAR is an ASCII character and can be input by typing itself, return t." + (let ((decode-map (or (quail-decode-map) + (setcar (nthcdr 10 quail-current-package) + (quail-gen-decode-map)))) + (key-list nil)) + (if (consp decode-map) + (let ((str (string char))) + (mapc #'(lambda (elt) + (if (string= str (car elt)) + (setq key-list (cons (cdr elt) key-list)))) + (cdr decode-map))) + (let ((key-head (aref decode-map char))) + (if (stringp key-head) + (setq key-list (quail-find-key1 + (quail-lookup-key key-head nil t) + key-head char nil)) + (mapc #'(lambda (elt) + (setq key-list + (quail-find-key1 + (quail-lookup-key elt nil t) elt char key-list))) + key-head)))) + (or key-list + (and (< char 128) + (not (quail-lookup-key (string char) 1)))))) + +(defun quail-show-key () + "Show a list of key strings to type for inputting a character at point." + (interactive) + (or current-input-method + (error "No input method is activated")) + (let* ((char (following-char)) + (key-list (quail-find-key char))) + (cond ((consp key-list) + (message "To input `%c', type \"%s\"" + char + (mapconcat 'identity key-list "\", \""))) + ((eq key-list t) + (message "To input `%s', just type it" + (single-key-description char))) + (t + (message "%c can't be input by the current input method" char))))) + + ;; Quail map generator from state transition table. (defun quail-map-from-table (table) @@ -2661,7 +2824,7 @@ function `quail-install-map' (which see)." (translation-list nil) map) (while (> len 0) - (setq map (quail-lookup-key key len) + (setq map (quail-lookup-key key len t) len (1- len)) (if map (let* ((def (quail-map-definition map)) diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el index d92e28981e3..2891dcca52d 100644 --- a/lisp/international/titdic-cnv.el +++ b/lisp/international/titdic-cnv.el @@ -1112,21 +1112,25 @@ the generated Quail package is saved." name title dicfile coding quailfile converter copyright dicbuf) (while tail - (when (or (string-match (nth 2 (car tail)) filename) - ;; MS-DOS filesystem truncates file names to 8+3 - ;; limits, so "cangjie-table.cns" becomes - ;; "cangjie-.cns", and the above string-match fails. - ;; Give DOS users a chance... - (and (fboundp 'msdos-long-file-names) - (not (msdos-long-file-names)) - (string-match (dos-8+3-filename (nth 2 (car tail))) - filename))) - (setq slot (car tail) - name (car slot) + (setq slot (car tail) + dicfile (nth 2 slot) + quailfile (nth 4 slot)) + (when (and (or (string-match dicfile filename) + ;; MS-DOS filesystem truncates file names to 8+3 + ;; limits, so "cangjie-table.cns" becomes + ;; "cangjie-.cns", and the above string-match + ;; fails. Give DOS users a chance... + (and (fboundp 'msdos-long-file-names) + (not (msdos-long-file-names)) + (string-match (dos-8+3-filename dicfile) filename))) + (if (file-newer-than-file-p + filename (expand-file-name quailfile dirname)) + t + (message "%s is up to date" quailfile) + nil)) + (setq name (car slot) title (nth 1 slot) - dicfile (nth 2 slot) coding (nth 3 slot) - quailfile (nth 4 slot) converter (nth 5 slot) copyright (nth 6 slot)) (message "Converting %s to %s..." dicfile quailfile) diff --git a/lisp/isearch.el b/lisp/isearch.el index f9729567169..4d86b37cb8d 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el @@ -444,12 +444,15 @@ With a prefix argument, do an incremental regular expression search instead. As you type characters, they add to the search string and are found. The following non-printing keys are bound in `isearch-mode-map'. -Type \\[isearch-delete-char] to cancel characters from end of search string. +Type \\[isearch-delete-char] to cancel last input item from end of search string. +Type \\[isearch-del-char] to cancel last character from end of search string. Type \\[isearch-exit] to exit, leaving point at location found. Type LFD (C-j) to match end of line. Type \\[isearch-repeat-forward] to search again forward,\ \\[isearch-repeat-backward] to search again backward. -Type \\[isearch-yank-word-or-char] to yank word from buffer onto end of search\ +Type \\[isearch-yank-char] to yank character from buffer onto end of search\ + string and search for it. +Type \\[isearch-yank-word] to yank word from buffer onto end of search\ string and search for it. Type \\[isearch-yank-line] to yank rest of line onto end of search string\ and search for it. @@ -482,7 +485,7 @@ To use a different input method for searching, type you want to use. The above keys, bound in `isearch-mode-map', are often controlled by - options; do M-x apropos on search-.* to find them. + options; do \\[apropos] on search-.* to find them. Other control and meta characters terminate the search and are then executed normally (depending on `search-exit-option'). Likewise for function keys and mouse button events. @@ -785,7 +788,7 @@ The following additional command keys are active while editing. \\[isearch-ring-retreat-edit] to replace the search string with the previous item in the search ring. \\[isearch-complete-edit] to complete the search string using the search ring. \\<isearch-mode-map> -If first char entered is \\[isearch-yank-word-or-char], then do word search instead." +If first char entered is \\[isearch-yank-word], then do word search instead." ;; This code is very hairy for several reasons, explained in the code. ;; Mainly, isearch-mode must be terminated while editing and then restarted. @@ -992,7 +995,8 @@ Use `isearch-exit' to quit without signaling." (if (equal isearch-string "") (setq isearch-success t) - (if (and isearch-success (equal (match-end 0) (match-beginning 0)) + (if (and isearch-success + (equal (point) isearch-other-end) (not isearch-just-started)) ;; If repeating a search that found ;; an empty string, ensure we advance. @@ -1049,6 +1053,16 @@ If no previous match was done, just beep." (isearch-pop-state)) (isearch-update)) +(defun isearch-del-char () + "Discard last character and move point back. +If there is no previous character, just beep." + (interactive) + (if (equal isearch-string "") + (ding) + (setq isearch-string (substring isearch-string 0 -1) + isearch-message (mapconcat 'isearch-text-char-description + isearch-string ""))) + (isearch-search-and-update)) (defun isearch-yank-string (string) "Pull STRING into search string." @@ -1110,7 +1124,7 @@ might return the position of the end of the line." (buffer-substring-no-properties (point) (funcall jumpform))))) (defun isearch-yank-char () - "Pull next letter from buffer into search string." + "Pull next character from buffer into search string." (interactive) (isearch-yank-internal (lambda () (forward-char 1) (point)))) @@ -1138,9 +1152,8 @@ might return the position of the end of the line." (defun isearch-search-and-update () ;; Do the search and update the display. (when (or isearch-success - ;; unsuccessful regexp search may become - ;; successful by addition of characters which - ;; make isearch-string valid + ;; Unsuccessful regexp search may become successful by + ;; addition of characters which make isearch-string valid isearch-regexp ;; If the string was found but was completely invisible, ;; it might now be partly visible, so try again. @@ -1467,7 +1480,9 @@ Isearch mode." (command-execute scroll-command) (let ((ab-bel (isearch-string-out-of-window isearch-point))) (if ab-bel - (isearch-back-into-window (eq ab-bel 'above) isearch-point))) + (isearch-back-into-window (eq ab-bel 'above) isearch-point) + (or (eq (point) isearch-point) + (goto-char isearch-point)))) (isearch-update)) (search-exit-option (let (window) @@ -1746,7 +1761,13 @@ If there is no completion possible, say so and continue searching." (let ((cursor-in-echo-area ellipsis) (m (concat (isearch-message-prefix c-q-hack ellipsis isearch-nonincremental) - isearch-message + (if (and (not isearch-success) + (string-match " +$" isearch-message)) + (concat + (substring isearch-message 0 (match-beginning 0)) + (propertize (substring isearch-message (match-beginning 0)) + 'face 'trailing-whitespace)) + isearch-message) (isearch-message-suffix c-q-hack ellipsis) ))) (if c-q-hack @@ -1793,7 +1814,11 @@ If there is no completion possible, say so and continue searching." ;; Searching -(defvar isearch-search-fun-function nil "Override `isearch-function-fun'.") +(defvar isearch-search-fun-function nil + "Override `isearch-search-fun'. +This function should return the search function for isearch to use. +It will call this function with three arguments +as if it were `search-forward'.") (defun isearch-search-fun () "Return the function to use for the search. diff --git a/lisp/isearchb.el b/lisp/isearchb.el new file mode 100644 index 00000000000..9714701944f --- /dev/null +++ b/lisp/isearchb.el @@ -0,0 +1,227 @@ +;;; isearchb --- a marriage between iswitchb and isearch + +;; Copyright (C) 2004 John Wiegley + +;; Author: John Wiegley <johnw@gnu.org> +;; Created: 16 Apr 2004 +;; Version: 1.5 +;; Keywords: lisp +;; X-URL: http://www.newartisans.com/johnw/emacs.html + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; This module allows you to switch to buffers even faster than with +;; iswitchb! It is not intended to replace it, however, as it works +;; well only with buffers whose names don't typically overlap. You'll +;; have to try it first, and see how your mileage varies. +;; +;; The first way to use isearchb is by holding down a modifier key, in +;; which case every letter you type while holding it searches for any +;; buffer matching what you're typing (using the same ordering scheme +;; employed by iswitchb). To use it this way, add to your .emacs: +;; +;; (isearchb-set-keybindings 'super) ; s-x s-y s-z now finds "xyz" +;; +;; The other way is by using a command that puts you into "search" +;; mode, just like with isearch. I use C-z for this. The binding in +;; my .emacs looks like: +;; +;; (define-key global-map [(control ?z)] 'isearchb-activate) +;; +;; Now, after pressing C-z (for example), each self-inserting +;; character thereafter will search for a buffer containing those +;; characters. For instance, typing "C-z xyz" will switch to the +;; first buffer containing "xyz". Once you press a non-self-inserting +;; character (such as any control key sequence), the search will end. +;; +;; C-z after C-z toggles between the previously selected buffer and +;; the current one. +;; +;; C-g aborts the search and returns you to your original buffer. +;; +;; TAB, after typing in a few characters (after C-z), will jump into +;; iswitchb, using the prefix you've typed so far. This is handy when +;; you realize that isearchb is not powerful enough to find the buffer +;; you're looking for. +;; +;; C-s and C-r move forward and backward in the buffer list. If +;; `isearchb-show-completions' is non-nil (the default), the list of +;; possible completions is shown in the minibuffer. +;; +;; If `isearchb-idle-timeout' is set to a number, isearchb will quit +;; after that many seconds of idle time. I recommend trying it set to +;; one or two seconds. Then, if you switch to a buffer and wait for +;; that amount of time, you can start typing without manually exiting +;; isearchb. + +;; TODO: +;; C-z C-z is broken +;; killing iswitchb.el and then trying to switch back is broken +;; make sure TAB isn't broken + +(require 'iswitchb) + +(defgroup isearchb nil + "Switch between buffers using a mechanism like isearch." + :group 'iswitchb) + +(defcustom isearchb-idle-timeout nil + "*Number of idle seconds before isearchb turns itself off. +If nil, don't use a timeout." + :type '(choice (integer :tag "Seconds") + (const :tag "Disable" nil)) + :group 'isearchb) + +(defcustom isearchb-show-completions t + "*If non-nil, show possible completions in the minibuffer." + :type 'boolean + :group 'isearchb) + +(defvar isearchb-start-buffer nil) +(defvar isearchb-last-buffer nil) +(defvar isearchb-idle-timer nil) + +(defun isearchb-stop (&optional return-to-buffer ignore-command) + "Called by isearchb to terminate a search in progress." + (remove-hook 'pre-command-hook 'isearchb-follow-char) + (if return-to-buffer + (switch-to-buffer isearchb-start-buffer) + (setq isearchb-last-buffer isearchb-start-buffer)) + (when isearchb-idle-timer + (cancel-timer isearchb-idle-timer) + (setq isearchb-idle-timer nil)) + (if ignore-command + (setq this-command 'ignore + last-command 'ignore)) + (message nil)) + +(defun isearchb-iswitchb () + "isearchb's custom version of the `iswitchb' command. +It's purpose is to pass different call arguments to +`iswitchb-read-buffer'." + (interactive) + (let* ((prompt "iswitch ") + (iswitchb-method 'samewindow) + (buf (iswitchb-read-buffer prompt nil nil iswitchb-text t))) + (if (eq iswitchb-exit 'findfile) + (call-interactively 'find-file) + (when buf + (if (get-buffer buf) + ;; buffer exists, so view it and then exit + (iswitchb-visit-buffer buf) + ;; else buffer doesn't exist + (iswitchb-possible-new-buffer buf)))))) + +(defun isearchb () + "Switch to buffer matching a substring, based on chars typed." + (interactive) + (unless (eq last-command 'isearchb) + (setq iswitchb-text nil)) + (unless iswitchb-text + (setq iswitchb-text "") + (iswitchb-make-buflist nil)) + (if last-command-char + (setq iswitchb-rescan t + iswitchb-text (concat iswitchb-text + (char-to-string last-command-char)))) + (iswitchb-set-matches) + (let* ((match (car iswitchb-matches)) + (buf (and match (get-buffer match)))) + (if (null buf) + (progn + (isearchb-stop t) + (isearchb-iswitchb)) + (switch-to-buffer buf) + (if isearchb-show-completions + (message "isearchb: %s%s" iswitchb-text + (iswitchb-completions iswitchb-text nil)) + (if (= 1 (length iswitchb-matches)) + (message "isearchb: %s (only match)" iswitchb-text) + (message "isearchb: %s" iswitchb-text)))))) + +(defun isearchb-set-keybindings (modifier) + "Setup isearchb on the given MODIFIER." + (dotimes (i 128) + (if (eq 'self-insert-command + (lookup-key global-map (vector i))) + (define-key global-map (vector (list modifier i)) 'isearchb)))) + +(defun isearchb-follow-char () + "Function added to post-command-hook to handle the isearchb \"mode\"." + (let (keys) + (if (not (and (memq last-command '(isearchb isearchb-activate)) + (setq keys (this-command-keys)) + (= 1 (length keys)))) + (isearchb-stop) + (cond + ((or (equal keys "\C-h") (equal keys "\C-?") + (equal keys [backspace]) (equal keys [delete])) + (setq iswitchb-text + (substring iswitchb-text 0 (1- (length iswitchb-text)))) + (if (= 0 (length iswitchb-text)) + (isearchb-stop t t) + (setq last-command-char nil) + (setq this-command 'isearchb))) + ((or (equal keys "\C-i") (equal keys [tab])) + (setq this-command 'isearchb-iswitchb)) + ((equal keys "\C-s") + (iswitchb-next-match) + (setq last-command-char nil) + (setq this-command 'isearchb)) + ((equal keys "\C-r") + (iswitchb-prev-match) + (setq last-command-char nil) + (setq this-command 'isearchb)) + ((equal keys "\C-g") + (ding) + (isearchb-stop t t)) + ((eq (lookup-key global-map keys) 'self-insert-command) + (setq this-command 'isearchb))) + (if (and isearchb-idle-timeout + (null isearchb-idle-timer)) + (setq isearchb-idle-timer + (run-with-idle-timer isearchb-idle-timeout nil + 'isearchb-stop)))))) + +;;;###autoload +(defun isearchb-activate () + "Active isearchb mode for subsequent alphanumeric keystrokes. +Executing this command again will terminate the search; or, if +the search has not yet begun, will toggle to the last buffer +accessed via isearchb." + (interactive) + (cond + ((eq last-command 'isearchb) + (isearchb-stop nil t)) + ((eq last-command 'isearchb-activate) + (if isearchb-last-buffer + (switch-to-buffer isearchb-last-buffer) + (error "isearchb: There is no previous buffer to toggle to.")) + (isearchb-stop nil t)) + (t + (message "isearchb: ") + (setq iswitchb-text nil + isearchb-start-buffer (current-buffer)) + (add-hook 'pre-command-hook 'isearchb-follow-char)))) + +(provide 'isearchb) + +;;; arch-tag: 9277523f-a624-4aa0-ba10-b89eeb7b6e99 +;;; isearchb.el ends here diff --git a/lisp/iswitchb.el b/lisp/iswitchb.el index aab768387d0..bda0ce4fddc 100644 --- a/lisp/iswitchb.el +++ b/lisp/iswitchb.el @@ -298,6 +298,29 @@ example functions that filter buffernames." :type '(repeat (choice regexp function)) :group 'iswitchb) +(defcustom iswitchb-max-to-show nil + "*If non-nil, limit the number of names shown in the minibuffer. +If this value is N, and N is greater than the number of matching +buffers, the first N/2 and the last N/2 matching buffers are +shown. This can greatly speed up iswitchb if you have a +multitude of buffers open." + :type '(choice (const :tag "Show all" nil) integer) + :group 'iswitchb) + +(defcustom iswitchb-use-virtual-buffers nil + "*If non-nil, refer to past buffers when none match. +This feature relies upon the `recentf' package, which will be +enabled if this variable is configured to a non-nil value." + :type 'boolean + :require 'recentf + :set (function + (lambda (sym value) + (if value (recentf-mode 1)) + (set sym value))) + :group 'iswitchb) + +(defvar iswitchb-virtual-buffers nil) + (defcustom iswitchb-cannot-complete-hook 'iswitchb-completion-help "*Hook run when `iswitchb-complete' can't complete any more. The most useful values are `iswitchb-completion-help', which pops up a @@ -455,7 +478,7 @@ interfere with other minibuffer usage.") (substitute-key-definition 'display-buffer ; C-x 4 C-o 'iswitchb-display-buffer map global-map) map) - "Global keymap for `iswtichb-mode'.") + "Global keymap for `iswitchb-mode'.") (defvar iswitchb-history nil "History of buffers selected using `iswitchb-buffer'.") @@ -562,13 +585,18 @@ in a separate window. (iswitchb-possible-new-buffer buf))) )))) -;;;###autoload -(defun iswitchb-read-buffer (prompt &optional default require-match) +(defun iswitchb-read-buffer (prompt &optional default require-match + start matches-set) "Replacement for the built-in `read-buffer'. Return the name of a buffer selected. -PROMPT is the prompt to give to the user. DEFAULT if given is the default -buffer to be selected, which will go to the front of the list. -If REQUIRE-MATCH is non-nil, an existing-buffer must be selected." +PROMPT is the prompt to give to the user. +DEFAULT if given is the default buffer to be selected, which will +go to the front of the list. +If REQUIRE-MATCH is non-nil, an existing-buffer must be selected. +If START is a string, the selection process is started with that +string. +If MATCHES-SET is non-nil, the buflist is not updated before +the selection process begins. Used by isearchb.el." (let ( buf-sel @@ -581,14 +609,15 @@ If REQUIRE-MATCH is non-nil, an existing-buffer must be selected." (iswitchb-define-mode-map) (setq iswitchb-exit nil) - (setq iswitchb-rescan t) - (setq iswitchb-text "") (setq iswitchb-default (if (bufferp default) (buffer-name default) default)) - (iswitchb-make-buflist iswitchb-default) - (iswitchb-set-matches) + (setq iswitchb-text (or start "")) + (unless matches-set + (setq iswitchb-rescan t) + (iswitchb-make-buflist iswitchb-default) + (iswitchb-set-matches)) (let ((minibuffer-local-completion-map iswitchb-mode-map) ;; Record the minibuffer depth that we expect to find once @@ -597,32 +626,41 @@ If REQUIRE-MATCH is non-nil, an existing-buffer must be selected." (iswitchb-require-match require-match)) ;; prompt the user for the buffer name (setq iswitchb-final-text (completing-read - prompt ;the prompt + prompt ;the prompt '(("dummy" . 1)) ;table - nil ;predicate - nil ;require-match [handled elsewhere] - nil ;initial-contents + nil ;predicate + nil ;require-match [handled elsewhere] + start ;initial-contents 'iswitchb-history))) (if (and (not (eq iswitchb-exit 'usefirst)) (get-buffer iswitchb-final-text)) ;; This happens for example if the buffer was chosen with the mouse. - (setq iswitchb-matches (list iswitchb-final-text))) + (setq iswitchb-matches (list iswitchb-final-text) + iswitchb-virtual-buffers nil)) + + ;; If no buffer matched, but a virtual buffer was selected, visit + ;; that file now and act as though that buffer had been selected. + (if (and iswitchb-virtual-buffers + (not (iswitchb-existing-buffer-p))) + (let ((virt (car iswitchb-virtual-buffers))) + (find-file-noselect (cdr virt)) + (setq iswitchb-matches (list (car virt)) + iswitchb-virtual-buffers nil))) ;; Handling the require-match must be done in a better way. - (if (and require-match (not (iswitchb-existing-buffer-p))) + (if (and require-match + (not (iswitchb-existing-buffer-p))) (error "Must specify valid buffer")) - (if (or - (eq iswitchb-exit 'takeprompt) - (null iswitchb-matches)) + (if (or (eq iswitchb-exit 'takeprompt) + (null iswitchb-matches)) (setq buf-sel iswitchb-final-text) ;; else take head of list (setq buf-sel (car iswitchb-matches))) ;; Or possibly choose the default buffer (if (equal iswitchb-final-text "") - (setq buf-sel - (car iswitchb-matches))) + (setq buf-sel (car iswitchb-matches))) buf-sel)) @@ -723,18 +761,29 @@ If no buffer exactly matching the prompt exists, maybe create a new one." (setq iswitchb-exit 'findfile) (exit-minibuffer)) +(eval-when-compile + (defvar recentf-list)) + (defun iswitchb-next-match () "Put first element of `iswitchb-matches' at the end of the list." (interactive) (let ((next (cadr iswitchb-matches))) - (setq iswitchb-buflist (iswitchb-chop iswitchb-buflist next)) + (if (and (null next) iswitchb-virtual-buffers) + (setq recentf-list + (iswitchb-chop recentf-list + (cdr (cadr iswitchb-virtual-buffers)))) + (setq iswitchb-buflist (iswitchb-chop iswitchb-buflist next))) (setq iswitchb-rescan t))) (defun iswitchb-prev-match () "Put last element of `iswitchb-matches' at the front of the list." (interactive) (let ((prev (car (last iswitchb-matches)))) - (setq iswitchb-buflist (iswitchb-chop iswitchb-buflist prev)) + (if (and (null prev) iswitchb-virtual-buffers) + (setq recentf-list + (iswitchb-chop recentf-list + (cdr (car (last iswitchb-virtual-buffers))))) + (setq iswitchb-buflist (iswitchb-chop iswitchb-buflist prev))) (setq iswitchb-rescan t))) (defun iswitchb-chop (list elem) @@ -826,7 +875,8 @@ current frame, rather than all frames, regardless of value of (setq iswitchb-matches (let* ((buflist iswitchb-buflist)) (iswitchb-get-matched-buffers iswitchb-text iswitchb-regexp - buflist))))) + buflist)) + iswitchb-virtual-buffers nil))) (defun iswitchb-get-matched-buffers (regexp &optional string-format buffer-list) @@ -1064,7 +1114,6 @@ If BUFFER is visible in the current frame, return nil." (get-buffer-window buffer 0) ; better than 'visible ))) -;;;###autoload (defun iswitchb-default-keybindings () "Set up default keybindings for `iswitchb-buffer'. Call this function to override the normal bindings. This function also @@ -1078,7 +1127,6 @@ Obsolescent. Use `iswitchb-mode'." (global-set-key "\C-x4\C-o" 'iswitchb-display-buffer) (global-set-key "\C-x5b" 'iswitchb-buffer-other-frame)) -;;;###autoload (defun iswitchb-buffer () "Switch to another buffer. @@ -1091,7 +1139,6 @@ For details of keybindings, do `\\[describe-function] iswitchb'." (setq iswitchb-method iswitchb-default-method) (iswitchb)) -;;;###autoload (defun iswitchb-buffer-other-window () "Switch to another buffer and show it in another window. The buffer name is selected interactively by typing a substring. @@ -1100,7 +1147,6 @@ For details of keybindings, do `\\[describe-function] iswitchb'." (setq iswitchb-method 'otherwindow) (iswitchb)) -;;;###autoload (defun iswitchb-display-buffer () "Display a buffer in another window but don't select it. The buffer name is selected interactively by typing a substring. @@ -1109,7 +1155,6 @@ For details of keybindings, do `\\[describe-function] iswitchb'." (setq iswitchb-method 'display) (iswitchb)) -;;;###autoload (defun iswitchb-buffer-other-frame () "Switch to another buffer and show it in another frame. The buffer name is selected interactively by typing a substring. @@ -1185,6 +1230,19 @@ Copied from `icomplete-exhibit' with two changes: contents (not minibuffer-completion-confirm))))))) +(eval-when-compile + (defvar most-len) + (defvar most-is-exact)) + +(defun iswitchb-output-completion (com) + (if (= (length com) most-len) + ;; Most is one exact match, + ;; note that and leave out + ;; for later indication: + (ignore + (setq most-is-exact t)) + (substring com most-len))) + (defun iswitchb-completions (name require-match) "Return the string that is displayed after the user's text. Modified from `icomplete-completions'." @@ -1209,6 +1267,35 @@ Modified from `icomplete-completions'." first) (setq comps (cons first (cdr comps))))) + ;; If no buffers matched, and virtual buffers are being used, then + ;; consult the list of past visited files, to see if we can find + ;; the file which the user might thought was still open. + (when (and iswitchb-use-virtual-buffers (null comps) + recentf-list) + (setq iswitchb-virtual-buffers nil) + (let ((head recentf-list) name) + (while head + (if (and (setq name (file-name-nondirectory (car head))) + (string-match (if iswitchb-regexp + iswitchb-text + (regexp-quote iswitchb-text)) name) + (null (get-file-buffer (car head))) + (not (assoc name iswitchb-virtual-buffers)) + (not (iswitchb-ignore-buffername-p name)) + (file-exists-p (car head))) + (setq iswitchb-virtual-buffers + (cons (cons name (car head)) + iswitchb-virtual-buffers))) + (setq head (cdr head))) + (setq iswitchb-virtual-buffers (nreverse iswitchb-virtual-buffers) + comps (mapcar 'car iswitchb-virtual-buffers)) + (let ((comp comps)) + (while comp + (put-text-property 0 (length (car comp)) + 'face 'font-lock-builtin-face + (car comp)) + (setq comp (cdr comp)))))) + (cond ((null comps) (format " %sNo match%s" open-bracket-determined close-bracket-determined)) @@ -1224,28 +1311,28 @@ Modified from `icomplete-completions'." "") (if (not iswitchb-use-fonts) " [Matched]"))) (t ;multiple matches + (if (and iswitchb-max-to-show + (> (length comps) iswitchb-max-to-show)) + (setq comps + (append + (let ((res nil) + (comp comps) + (end (/ iswitchb-max-to-show 2))) + (while (>= (setq end (1- end)) 0) + (setq res (cons (car comp) res) + comp (cdr comp))) + (nreverse res)) + (list "...") + (nthcdr (- (length comps) + (/ iswitchb-max-to-show 2)) comps)))) (let* ( ;;(most (try-completion name candidates predicate)) (most nil) (most-len (length most)) most-is-exact (alternatives - (apply - (function concat) - (cdr (apply - (function nconc) - (mapcar '(lambda (com) - (if (= (length com) most-len) - ;; Most is one exact match, - ;; note that and leave out - ;; for later indication: - (progn - (setq most-is-exact t) - ()) - (list "," - (substring com - most-len)))) - comps)))))) + (mapconcat (if most 'iswitchb-output-completion + 'identity) comps ","))) (concat diff --git a/lisp/language/chinese.el b/lisp/language/chinese.el index 7e03ed40dda..1806d79f2de 100644 --- a/lisp/language/chinese.el +++ b/lisp/language/chinese.el @@ -87,6 +87,7 @@ (define-coding-system-alias 'euc-cn 'chinese-iso-8bit) (define-coding-system-alias 'cn-gb 'chinese-iso-8bit) (define-coding-system-alias 'gb2312 'chinese-iso-8bit) +(define-coding-system-alias 'cp936 'chinese-iso-8bit) (define-coding-system 'chinese-hz "Hz/ZW 7-bit encoding for Chinese GB2312 (MIME:HZ-GB-2312)." @@ -124,6 +125,7 @@ (define-coding-system-alias 'big5 'chinese-big5) (define-coding-system-alias 'cn-big5 'chinese-big5) +(define-coding-system-alias 'cp950 'chinese-big5) (set-language-info-alist "Chinese-BIG5" '((charset chinese-big5-1 chinese-big5-2) diff --git a/lisp/language/european.el b/lisp/language/european.el index 4c12f1bf591..164d51c9aad 100644 --- a/lisp/language/european.el +++ b/lisp/language/european.el @@ -43,7 +43,7 @@ (unibyte-display . iso-latin-1) (input-method . "latin-1-prefix") (sample-text - . "Hello, Hej, Tere, Hei, Bonjour, Gr,A|_(B Gott, Ciao, ,A!(BHola!") + . "Hello, Hej, Tere, Hei, Bonjour, Gr$(D+d)N(B Gott, Ciao, $(D"B(BHola!") (documentation . "\ This language environment is a generic one for the Latin-1 (ISO-8859-1) character set which supports the following European languages: @@ -241,7 +241,7 @@ See also the Turkish environment.")) (unibyte-display . iso-latin-8) (input-method . "latin-8-prefix") ;; Fixme: Welsh/Ga{e}lic greetings - (sample-text . ",_"(B ,_p(B ,_^(B") + (sample-text . ",_"(B $(D+q(B $(D*t(B") (documentation . "\ This language environment is a generic one for the Latin-8 (ISO-8859-14) character set which supports the Celtic languages, including those not @@ -271,7 +271,7 @@ covered by other ISO-8859 character sets: (unibyte-display . iso-latin-9) (input-method . "latin-9-prefix") (sample-text - . "AVE. ,B)9.>,b<=,_/(B ,b$(B") + . "AVE. $(D*^+^*v+v)-)M*s(B $(Q)!(B") (documentation . "\ This language environment is a generic one for the Latin-9 (ISO-8859-15) character set which supports the same languages as Latin-1 with the @@ -406,7 +406,7 @@ but it selects the Dutch tutorial and input method.")) (unibyte-display . iso-latin-1) (sample-text . "\ German (Deutsch Nord) Guten Tag -German (Deutsch S,A|(Bd) Gr,A|_(B Gott") +German (Deutsch S$(D+d(Bd) Gr$(D+d)N(B Gott") (documentation . "\ This language environment is almost the same as Latin-1, but sets the default input method to \"german-postfix\". @@ -421,7 +421,7 @@ Additionally, it selects the German tutorial.")) (nonascii-translation . iso-8859-1) (unibyte-display . iso-latin-1) (input-method . "latin-1-prefix") - (sample-text . "French (Fran,Ag(Bais) Bonjour, Salut") + (sample-text . "French (Fran$(D+.(Bais) Bonjour, Salut") (documentation . "\ This language environment is almost the same as Latin-1, but it selects the French tutorial and input method.")) @@ -450,7 +450,7 @@ Additionally, it selects the Italian tutorial.")) (input-method . "slovenian") (unibyte-display . iso-8859-2) (tutorial . "TUTORIAL.sl") - (sample-text . ",B.(Belimo vam uspe,B9(Ben dan!") + (sample-text . "$(D*v(Belimo vam uspe$(D+^(Ben dan!") (documentation . "\ This language environment is almost the same as Latin-2, but it selects the Slovenian tutorial and input method.")) @@ -464,7 +464,7 @@ but it selects the Slovenian tutorial and input method.")) (input-method . "spanish-postfix") (nonascii-translation . iso-8859-1) (unibyte-display . iso-latin-1) - (sample-text . "Spanish (Espa,Aq(Bol) ,A!(BHola!") + (sample-text . "Spanish (Espa$(D+P(Bol) $(D"B(BHola!") (documentation . "\ This language environment is almost the same as Latin-1, but it sets the default input method to \"spanish-postfix\", @@ -483,19 +483,19 @@ and it selects the Spanish tutorial.")) (nonascii-translation . iso-8859-9) (unibyte-display . iso-latin-5) (input-method . "turkish-postfix") - (sample-text . "Turkish (T,A|(Brk,Ag(Be) Merhaba") + (sample-text . "Turkish (T$(D+d(Brk$(D+.(Be) Merhaba") (setup-function . (lambda () - (set-case-syntax-pair ?I ?,C9(B (standard-case-table)) - (set-case-syntax-pair ?,C)(B ?i (standard-case-table)))) + (set-case-syntax-pair ?I ?$(D)E(B (standard-case-table)) + (set-case-syntax-pair ?$(D*D(B ?i (standard-case-table)))) (exit-function . (lambda () (set-case-syntax-pair ?I ?i (standard-case-table)) - (set-case-syntax ?,C9(B "w" (standard-case-table)) - (set-case-syntax ?,C)(B "w" (standard-case-table)))) + (set-case-syntax ?$(D)E(B "w" (standard-case-table)) + (set-case-syntax ?$(D*D(B "w" (standard-case-table)))) (documentation . "Support for Turkish. Differs from the Latin-5 environment in using the `turkish-postfix' input -method and applying Turkish case rules for the characters i, I, ,C9(B, ,C)(B."))) +method and applying Turkish case rules for the characters i, I, $(D)E(B, $(D*D(B."))) ;; Polish ISO 8859-2 environment. ;; Maintainer: Wlodek Bzyl <matwb@univ.gda.pl> @@ -509,7 +509,7 @@ method and applying Turkish case rules for the characters i, I, ,C9(B, ,C)(B (nonascii-translation . iso-8859-2) (unibyte-display . iso-8859-2) (tutorial . "TUTORIAL.pl") - (sample-text . "P,As(Bjd,B<(B, ki,Bq(B-,B?(Be t,Bj(B chmurno,B6f(B w g,B31(Bb flaszy") + (sample-text . "P$(D+Q(Bjd$(D+u(B, ki$(D+M(B-$(D+w(Be t$(D+8(B chmurno$(D+\++(B w g$(D)H+((Bb flaszy") (documentation . t)) '("European")) @@ -575,6 +575,18 @@ method and applying Turkish case rules for the characters i, I, ,C9(B, ,C)(B (documentation . "Support for Croatian with Latin-2 encoding.")) '("European")) +(set-language-info-alist + "Brazilian Portuguese" '((tutorial . "TUTORIAL.pt_BR") + (charset iso-8859-1) + (coding-system iso-latin-1 iso-latin-9) + (coding-priority iso-latin-1) + (nonascii-translation . iso-8859-1) + (unibyte-display . iso-8859-1) + (input-method . "latin-1-prefix") + (sample-text . "Oi") + (documentation . "Support for Brazilian Portuguese.")) + '("European")) + (define-coding-system 'mac-roman "Mac Roman Encoding (MIME:MACINTOSH)." diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index b4ec979d425..2f005c45708 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el @@ -97,6 +97,7 @@ (define-coding-system-alias 'shift_jis 'japanese-shift-jis) (define-coding-system-alias 'sjis 'japanese-shift-jis) +(define-coding-system-alias 'cp932 'japanese-shift-jis) (define-coding-system 'japanese-cp932 "CP932 (Microsoft shift-jis)" diff --git a/lisp/language/korean.el b/lisp/language/korean.el index 9595ab4ed02..8624264185d 100644 --- a/lisp/language/korean.el +++ b/lisp/language/korean.el @@ -41,6 +41,7 @@ (define-coding-system-alias 'euc-kr 'korean-iso-8bit) (define-coding-system-alias 'euc-korea 'korean-iso-8bit) +(define-coding-system-alias 'cp949 'korean-iso-8bit) (define-coding-system 'iso-2022-kr "ISO 2022 based 7-bit encoding for Korean KSC5601 (MIME:ISO-2022-KR)." diff --git a/lisp/ldefs-boot.el b/lisp/ldefs-boot.el index 15d3eb0eb95..1e6a824d541 100644 --- a/lisp/ldefs-boot.el +++ b/lisp/ldefs-boot.el @@ -3864,24 +3864,6 @@ of `scheme-program-name'). Runs the hooks `inferior-scheme-mode-hook' ;;;*** -;;;### (autoloads (cp-make-coding-system) "code-pages" "international/code-pages.el" -;;;;;; (16271 3438)) -;;; Generated autoloads from international/code-pages.el - -(autoload (quote cp-make-coding-system) "code-pages" "\ -Make coding system NAME for and 8-bit, extended-ASCII character set. -V is a 128-long vector of characters to translate the upper half of -the character set. DOC-STRING and MNEMONIC are used as the -corresponding args of `make-coding-system'. If MNEMONIC isn't given, -?* is used. -Return an updated `non-iso-charset-alist'. - -\(fn NAME V &optional DOC-STRING MNEMONIC)" nil (quote macro)) -(autoload-coding-system 'pt154 '(require 'code-pages)) -(autoload-coding-system 'iso-8859-11 '(require 'code-pages)) - -;;;*** - ;;;### (autoloads (codepage-setup cp-supported-codepages cp-offset-for-codepage ;;;;;; cp-language-for-codepage cp-charset-for-codepage cp-make-coding-systems-for-codepage) ;;;;;; "codepage" "international/codepage.el" (16215 28546)) diff --git a/lisp/locate.el b/lisp/locate.el index eb8074c9f6c..3a18d77f089 100644 --- a/lisp/locate.el +++ b/lisp/locate.el @@ -24,42 +24,7 @@ ;;; Commentary: -;; Search a database of files and use dired commands on -;; the result. -;; - -;;;;; Building a database of files ;;;;;;;;; -;; -;; You can create a simple files database with a port of the Unix find command -;; and one of the various Windows NT various scheduling utilities, -;; for example the AT command from the NT Resource Kit, WinCron which is -;; included with Microsoft FrontPage, or the shareware NTCron program. -;; -;; To set up a function which searches the files database, do something -;; like this: -;; -;; (defvar locate-fcodes-file "c:/users/peter/fcodes") -;; (defvar locate-make-command-line 'nt-locate-make-command-line) -;; -;; (defun nt-locate-make-command-line (arg) -;; (list "grep" "-i" arg locate-fcodes-file)) -;; -;;;;;;;; ADVICE For dired-make-relative: ;;;;;;;;; -;; -;; For certain dired commands to work right, you should also include the -;; following in your _emacs/.emacs: -;; -;; (defadvice dired-make-relative (before set-no-error activate) -;; "For locate mode and Windows, don't return errors" -;; (if (and (eq major-mode 'locate-mode) -;; (memq system-type (list 'windows-nt 'ms-dos))) -;; (ad-set-arg 2 t) -;; )) -;; -;; Otherwise, `dired-make-relative' will give error messages like -;; "FILENAME: not in directory tree growing at /" - -;;; Commentary: +;; Search a database of files and use dired commands on the result. ;; ;; Locate.el provides an interface to a program which searches a ;; database of file names. By default, this program is the GNU locate @@ -109,6 +74,38 @@ ;; regular expression; this is often useful to constrain a big search. ;; +;;;;; Building a database of files ;;;;;;;;; +;; +;; You can create a simple files database with a port of the Unix find command +;; and one of the various Windows NT various scheduling utilities, +;; for example the AT command from the NT Resource Kit, WinCron which is +;; included with Microsoft FrontPage, or the shareware NTCron program. +;; +;; To set up a function which searches the files database, do something +;; like this: +;; +;; (defvar locate-fcodes-file "c:/users/peter/fcodes") +;; (defvar locate-make-command-line 'nt-locate-make-command-line) +;; +;; (defun nt-locate-make-command-line (arg) +;; (list "grep" "-i" arg locate-fcodes-file)) +;; +;;;;;;;; ADVICE For dired-make-relative: ;;;;;;;;; +;; +;; For certain dired commands to work right, you should also include the +;; following in your _emacs/.emacs: +;; +;; (defadvice dired-make-relative (before set-no-error activate) +;; "For locate mode and Windows, don't return errors" +;; (if (and (eq major-mode 'locate-mode) +;; (memq system-type (list 'windows-nt 'ms-dos))) +;; (ad-set-arg 2 t) +;; )) +;; +;; Otherwise, `dired-make-relative' will give error messages like +;; "FILENAME: not in directory tree growing at /" + + ;;; Code: (eval-when-compile @@ -154,13 +151,21 @@ :type 'face :group 'locate) +;;;###autoload +(defcustom locate-ls-subdir-switches "-al" + "`ls' switches for inserting subdirectories in `*Locate*' buffers. +This should contain the \"-l\" switch, but not the \"-F\" or \"-b\" switches." + :type 'string + :group 'locate + :version "21.4") + (defcustom locate-update-command "updatedb" "The command used to update the locate database." :type 'string :group 'locate) (defcustom locate-prompt-for-command nil - "If non-nil, the default behavior of the locate command is to prompt for a command to run. + "If non-nil, the locate command prompts for a command to run. Otherwise, that behavior is invoked via a prefix argument." :group 'locate :type 'boolean @@ -223,24 +228,25 @@ With prefix arg, prompt for the locate command to run." (save-window-excursion (set-buffer (get-buffer-create locate-buffer-name)) (locate-mode) - (erase-buffer) + (let ((inhibit-read-only t)) + (erase-buffer) - (setq locate-current-filter filter) + (setq locate-current-filter filter) - (if run-locate-command - (shell-command search-string locate-buffer-name) - (apply 'call-process locate-cmd nil t nil locate-cmd-args)) + (if run-locate-command + (shell-command search-string locate-buffer-name) + (apply 'call-process locate-cmd nil t nil locate-cmd-args)) - (and filter - (locate-filter-output filter)) + (and filter + (locate-filter-output filter)) - (locate-do-setup search-string) - ) + (locate-do-setup search-string) + )) (and (not (string-equal (buffer-name) locate-buffer-name)) (switch-to-buffer-other-window locate-buffer-name)) (run-hooks 'dired-mode-hook) - (dired-next-line 2) ;move to first matching file. + (dired-next-line 3) ;move to first matching file. (run-hooks 'locate-post-command-hook) ) ) @@ -281,9 +287,10 @@ shown; this is often useful to constrain a big search." (define-key locate-mode-map [menu-bar mark directories] 'undefined) (define-key locate-mode-map [menu-bar mark symlinks] 'undefined) - (define-key locate-mode-map [mouse-2] 'locate-mouse-view-file) + (define-key locate-mode-map [M-mouse-2] 'locate-mouse-view-file) (define-key locate-mode-map "\C-c\C-t" 'locate-tags) + (define-key locate-mode-map "l" 'locate-do-redisplay) (define-key locate-mode-map "U" 'dired-unmark-all-files) (define-key locate-mode-map "V" 'locate-find-directory) ) @@ -318,41 +325,74 @@ shown; this is often useful to constrain a big search." (not (eq lineno 2)) (buffer-substring (elt pos 0) (elt pos 1))))) +(defun locate-main-listing-line-p () + "Return t if current line contains a file name listed by locate. +This function returns nil if the current line either contains no +file name or is inside a subdirectory." + (save-excursion + (forward-line 0) + (looking-at (concat "." + (make-string (1- locate-filename-indentation) ?\ ) + "\\(/\\|[A-Za-z]:\\)")))) + (defun locate-mouse-view-file (event) "In Locate mode, view a file, using the mouse." (interactive "@e") (save-excursion (goto-char (posn-point (event-start event))) - (view-file (locate-get-filename)))) + (if (locate-main-listing-line-p) + (view-file (locate-get-filename)) + (message "This command only works inside main listing.")))) ;; Define a mode for locate ;; Default directory is set to "/" so that dired commands, which ;; expect to be in a tree, will work properly (defun locate-mode () - "Major mode for the `*Locate*' buffer made by \\[locate]." + "Major mode for the `*Locate*' buffer made by \\[locate]. +\\<locate-mode-map>\ +In that buffer, you can use almost all the usual dired bindings. +\\[locate-find-directory] visits the directory of the file on the current line. + +Operating on listed files works, but does not always +automatically update the buffer as in ordinary Dired. +This is true both for the main listing and for subdirectories. +Reverting the buffer using \\[revert-buffer] deletes all subdirectories. +Specific `locate-mode' commands, such as \\[locate-find-directory], +do not work in subdirectories. + +\\{locate-mode-map}" + ;; Not to be called interactively. (kill-all-local-variables) - ;; Avoid clobbering this variables + ;; Avoid clobbering this variable (make-local-variable 'dired-subdir-alist) (use-local-map locate-mode-map) (setq major-mode 'locate-mode mode-name "Locate" - default-directory "/") + default-directory "/" + buffer-read-only t + selective-display t) (dired-alist-add-1 default-directory (point-min-marker)) + (set (make-local-variable 'dired-directory) "/") + (set (make-local-variable 'dired-subdir-switches) locate-ls-subdir-switches) + (setq dired-switches-alist nil) (make-local-variable 'dired-move-to-filename-regexp) ;; This should support both Unix and Windoze style names (setq dired-move-to-filename-regexp - (concat "." + (concat "^." (make-string (1- locate-filename-indentation) ?\ ) - "\\(/\\|[A-Za-z]:\\)")) + "\\(/\\|[A-Za-z]:\\)\\|" + (default-value 'dired-move-to-filename-regexp))) (make-local-variable 'dired-actual-switches) (setq dired-actual-switches "") (make-local-variable 'dired-permission-flags-regexp) (setq dired-permission-flags-regexp (concat "^.\\(" (make-string (1- locate-filename-indentation) ?\ ) - "\\)")) + "\\)\\|" + (default-value 'dired-permission-flags-regexp))) (make-local-variable 'revert-buffer-function) (setq revert-buffer-function 'locate-update) + (set (make-local-variable 'page-delimiter) "\n\n") (run-hooks 'locate-mode-hook)) (defun locate-do-setup (search-string) @@ -382,7 +422,10 @@ shown; this is often useful to constrain a big search." (dired-insert-set-properties (elt pos 0) (elt pos 1))))) (defun locate-insert-header (search-string) - (let ((locate-format-string "Matches for %s") + ;; There needs to be a space before `Matches, because otherwise, + ;; `*!" would erase the `M'. We can not use two spaces, or the line + ;; would mistakenly fit `dired-subdir-regexp'. + (let ((locate-format-string " /:\n Matches for %s") (locate-regexp-match (concat " *Matches for \\(" (regexp-quote search-string) "\\)")) (locate-format-args (list search-string)) @@ -420,6 +463,7 @@ shown; this is often useful to constrain a big search." (save-excursion (goto-char (point-min)) + (forward-line 1) (if (not (looking-at locate-regexp-match)) nil (add-text-properties (match-beginning 1) (match-end 1) @@ -435,9 +479,11 @@ shown; this is often useful to constrain a big search." (defun locate-tags () "Visit a tags table in `*Locate*' mode." (interactive) - (let ((tags-table (locate-get-filename))) - (and (y-or-n-p (format "Visit tags table %s? " tags-table)) - (visit-tags-table tags-table)))) + (if (locate-main-listing-line-p) + (let ((tags-table (locate-get-filename))) + (and (y-or-n-p (format "Visit tags table %s? " tags-table)) + (visit-tags-table tags-table))) + (message "This command only works inside main listing."))) ;; From Stephen Eglen <stephen@cns.ed.ac.uk> (defun locate-update (ignore1 ignore2) @@ -456,12 +502,14 @@ Database is updated using the shell command in `locate-update-command'." (defun locate-find-directory () "Visit the directory of the file mentioned on this line." (interactive) - (let ((directory-name (locate-get-dirname))) - (if (file-directory-p directory-name) - (find-file directory-name) - (if (file-symlink-p directory-name) - (error "Directory is a symlink to a nonexistent target") - (error "Directory no longer exists; run `updatedb' to update database"))))) + (if (locate-main-listing-line-p) + (let ((directory-name (locate-get-dirname))) + (if (file-directory-p directory-name) + (find-file directory-name) + (if (file-symlink-p directory-name) + (error "Directory is a symlink to a nonexistent target") + (error "Directory no longer exists; run `updatedb' to update database")))) + (message "This command only works inside main listing."))) (defun locate-find-directory-other-window () "Visit the directory of the file named on this line in other window." @@ -514,6 +562,14 @@ Database is updated using the shell command in `locate-update-command'." string)))))) (locate search-string))) +(defun locate-do-redisplay (&optional arg test-for-subdir) + "Like `dired-do-redisplay', but adapted for `*Locate*' buffers." + (interactive "P\np") + (if (string= (dired-current-directory) "/") + (message "This command only works in subdirectories.") + (let ((dired-actual-switches locate-ls-subdir-switches)) + (dired-do-redisplay arg test-for-subdir)))) + (provide 'locate) ;;; arch-tag: 60c4d098-b5d5-4b3c-a3e0-51a2e9f43898 diff --git a/lisp/log-view.el b/lisp/log-view.el index a6f736d16f7..51ca8907db8 100644 --- a/lisp/log-view.el +++ b/lisp/log-view.el @@ -191,8 +191,10 @@ "Get the diff for several revisions. If the point is the same as the mark, get the diff for this revision. Otherwise, get the diff between the revisions - were the region starts and ends." - (interactive "r") +were the region starts and ends." + (interactive + (list (if mark-active (region-beginning) (point)) + (if mark-active (region-end) (point)))) (let ((fr (log-view-current-tag beg)) (to (log-view-current-tag end))) (when (string-equal fr to) diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el index 07ea44cef04..5d603d7be26 100644 --- a/lisp/mail/rfc2368.el +++ b/lisp/mail/rfc2368.el @@ -120,12 +120,13 @@ calling this function." ;; deal w/ multiple 'To' recipients (if prequery (progn + (setq prequery (rfc2368-unhexify-string prequery)) (if (assoc "To" headers-alist) (let* ((our-cons-cell (assoc "To" headers-alist)) (our-cdr (cdr our-cons-cell))) - (setcdr our-cons-cell (concat our-cdr ", " prequery))) + (setcdr our-cons-cell (concat prequery ", " our-cdr))) (setq headers-alist (cons (cons "To" prequery) headers-alist))))) diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el index 5ab38370e57..5fa4f34bbb8 100644 --- a/lisp/mail/rmail.el +++ b/lisp/mail/rmail.el @@ -227,7 +227,9 @@ and the value of the environment variable MAIL overrides it)." ;;;###autoload (defcustom rmail-mail-new-frame nil - "*Non-nil means Rmail makes a new frame for composing outgoing mail." + "*Non-nil means Rmail makes a new frame for composing outgoing mail. +This is handy if you want to preserve the window configuration of +the frame where you have the RMAIL buffer displayed." :type 'boolean :group 'rmail-reply) @@ -1137,7 +1139,9 @@ Instead, these commands are available: (make-local-variable 'kill-buffer-hook) (add-hook 'kill-buffer-hook 'rmail-mode-kill-summary) (make-local-variable 'file-precious-flag) - (setq file-precious-flag t)) + (setq file-precious-flag t) + (make-local-variable 'desktop-save-buffer) + (setq desktop-save-buffer t)) ;; Handle M-x revert-buffer done in an rmail-mode buffer. (defun rmail-revert (arg noconfirm) @@ -1666,7 +1670,15 @@ It returns t if it got any new messages." (defun rmail-decode-region (from to coding) (if (or (not coding) (not (coding-system-p coding))) (setq coding 'undecided)) - (decode-coding-region from to coding)) + ;; Use -dos decoding, to remove ^M characters left from base64 or + ;; rogue qp-encoded text. + (decode-coding-region from to + (coding-system-change-eol-conversion coding 1)) + ;; Don't reveal the fact we used -dos decoding, as users generally + ;; will not expect the RMAIL buffer to use DOS EOL format. + (setq buffer-file-coding-system + (setq last-coding-system-used + (coding-system-change-eol-conversion coding 0)))) ;; the rmail-break-forwarded-messages feature is not implemented (defun rmail-convert-to-babyl-format () @@ -1751,9 +1763,6 @@ It returns t if it got any new messages." (error nil)) ;; Change "base64" to "8bit", to reflect the ;; decoding we just did. - (goto-char (1+ header-end)) - (while (search-forward "\r\n" (point-max) t) - (replace-match "\n")) (goto-char base64-header-field-end) (delete-region (point) (search-backward ":")) (insert ": 8bit")))) @@ -1901,9 +1910,6 @@ It returns t if it got any new messages." (point))) t) (error nil)) - (goto-char header-end) - (while (search-forward "\r\n" (point-max) t) - (replace-match "\n")) ;; Change "base64" to "8bit", to reflect the ;; decoding we just did. (goto-char base64-header-field-end) @@ -3167,7 +3173,7 @@ See also user-option `rmail-confirm-expunge'." (compose-mail to subject others noerase nil yank-action sendactions) - (if (and (display-multi-frame-p) rmail-mail-new-frame) + (if rmail-mail-new-frame (prog1 (compose-mail to subject others noerase 'switch-to-buffer-other-frame @@ -3867,6 +3873,23 @@ encoded string (and the same mask) will decode the string." (setq i (1+ i))) (concat string-vector))) +;;;; Desktop support + +;;;###autoload +(defun rmail-restore-desktop-buffer (desktop-buffer-file-name + desktop-buffer-name + desktop-buffer-misc) + "Restore an rmail buffer specified in a desktop file." + (condition-case error + (progn + (rmail-input desktop-buffer-file-name) + (if (eq major-mode 'rmail-mode) + (current-buffer) + rmail-buffer)) + (file-locked + (kill-buffer (current-buffer)) + nil))) + (provide 'rmail) ;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el index 9ef7e575bed..9009b5a3c87 100644 --- a/lisp/mail/sendmail.el +++ b/lisp/mail/sendmail.el @@ -714,7 +714,12 @@ Prefix arg means don't delete this window." (if (and (or (window-dedicated-p (frame-selected-window)) (cdr (assq 'mail-dedicated-frame (frame-parameters)))) (not (null (delq (selected-frame) (visible-frame-list))))) - (delete-frame (selected-frame)) + (progn + (if (display-multi-frame-p) + (delete-frame (selected-frame)) + ;; The previous frame is where normally they have the + ;; RMAIL buffer displayed. + (other-frame -1))) (let (rmail-flag summary-buffer) (and (not arg) (not (one-window-p)) diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 60831b259d8..84a61350145 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -483,7 +483,14 @@ This is relative to `smtpmail-queue-dir'.") (setq cred-key (expand-file-name cred-key))) (file-regular-p (setq cred-cert (expand-file-name cred-cert)))) - (list "--key-file" cred-key "--cert-file" cred-cert)))) + (list "--key-file" cred-key "--cert-file" cred-cert))) + (starttls-extra-arguments + (when (and (stringp cred-key) (stringp cred-cert) + (file-regular-p + (setq cred-key (expand-file-name cred-key))) + (file-regular-p + (setq cred-cert (expand-file-name cred-cert)))) + (list "--x509keyfile" cred-key "--x509certfile" cred-cert)))) (starttls-open-stream "SMTP" process-buffer host port))))) (defun smtpmail-try-auth-methods (process supported-extensions host port) diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el index 55f611b53ad..db6990d625b 100644 --- a/lisp/mail/unrmail.el +++ b/lisp/mail/unrmail.el @@ -51,43 +51,71 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (defun unrmail (file to-file) "Convert Rmail file FILE to system inbox format file TO-FILE." (interactive "fUnrmail (rmail file): \nFUnrmail into (new mailbox file): ") - (let ((message-count 1) - ;; Prevent rmail from making, or switching to, a summary buffer. - (rmail-display-summary nil) - (rmail-delete-after-output nil) - (temp-buffer (get-buffer-create " unrmail"))) - (rmail file) + (with-temp-buffer + ;; Read in the old Rmail file with no decoding. + (let ((coding-system-for-read 'raw-text)) + (insert-file-contents file)) + ;; But make it multibyte. + (set-buffer-multibyte t) + + (if (not (looking-at "BABYL OPTIONS")) + (error "This file is not in Babyl format")) + + ;; Decode the file contents just as Rmail did. + (let ((modifiedp (buffer-modified-p)) + (coding-system rmail-file-coding-system) + from to) + (goto-char (point-min)) + (search-forward "\n\^_" nil t) ; Skip BABYL header. + (setq from (point)) + (goto-char (point-max)) + (search-backward "\n\^_" from 'mv) + (setq to (point)) + (unless (and coding-system + (coding-system-p coding-system)) + (setq coding-system + ;; Emacs 21.1 and later writes RMAIL files in emacs-mule, but + ;; earlier versions did that with the current buffer's encoding. + ;; So we want to favor detection of emacs-mule (whose normal + ;; priority is quite low), but still allow detection of other + ;; encodings if emacs-mule won't fit. The call to + ;; detect-coding-with-priority below achieves that. + (car (detect-coding-with-priority + from to + '((coding-category-emacs-mule . emacs-mule)))))) + (unless (memq coding-system + '(undecided undecided-unix)) + (set-buffer-modified-p t) ; avoid locking when decoding + (let ((buffer-undo-list t)) + (decode-coding-region from to coding-system)) + (setq coding-system last-coding-system-used)) + + (setq buffer-file-coding-system nil) + + ;; We currently don't use this value, but maybe we should. + (setq save-buffer-coding-system + (or coding-system 'undecided))) + ;; Default the directory of TO-FILE based on where FILE is. (setq to-file (expand-file-name to-file default-directory)) (condition-case () (delete-file to-file) (file-error nil)) (message "Writing messages to %s..." to-file) - (save-restriction - (widen) - (while (<= message-count rmail-total-messages) - (let ((beg (rmail-msgbeg message-count)) - (end (rmail-msgbeg (1+ message-count))) - (from-buffer (current-buffer)) - (coding (or rmail-file-coding-system 'raw-text)) + (goto-char (point-min)) + + (let ((temp-buffer (get-buffer-create " unrmail")) + (from-buffer (current-buffer))) + + ;; Process the messages one by one. + (while (search-forward "\^_\^l" nil t) + (let ((beg (point)) + (end (save-excursion + (if (search-forward "\^_" nil t) + (1- (point)) (point-max)))) + (coding 'raw-text) label-line attrs keywords - header-beginning mail-from) - (save-excursion - (goto-char (rmail-msgbeg message-count)) - (setq header-beginning (point)) - (search-forward "\n*** EOOH ***\n") - (forward-line -1) - (search-forward "\n\n") - (save-restriction - (narrow-to-region header-beginning (point)) - (setq mail-from - (or (mail-fetch-field "Mail-From") - (concat "From " - (mail-strip-quoted-names (or (mail-fetch-field "from") - (mail-fetch-field "really-from") - (mail-fetch-field "sender") - "unknown")) - " " (current-time-string)))))) + mail-from reformatted) (with-current-buffer temp-buffer (setq buffer-undo-list t) (erase-buffer) @@ -95,11 +123,15 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (insert-buffer-substring from-buffer beg end) (goto-char (point-min)) (forward-line 1) + ;; Record whether the header is reformatted. + (setq reformatted (= (following-char) ?1)) + + ;; Collect the label line, then get the attributes + ;; and the keywords from it. (setq label-line (buffer-substring (point) - (progn (forward-line 1) - (point)))) - (forward-line -1) + (save-excursion (forward-line 1) + (point)))) (search-forward ",,") (unless (eolp) (setq keywords @@ -118,9 +150,61 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (if (string-match ", resent," label-line) ?R ?-) (if (string-match ", unseen," label-line) ?\ ?-) (if (string-match ", stored," label-line) ?S ?-))) - (unrmail-unprune) + + ;; Delete the special Babyl lines at the start, + ;; and the ***EOOH*** line, and the reformatted header if any. + (goto-char (point-min)) + (if reformatted + (progn + (forward-line 2) + ;; Delete Summary-Line headers. + (let ((case-fold-search t)) + (while (looking-at "Summary-Line:") + (forward-line 1))) + (delete-region (point-min) (point)) + ;; Delete the old reformatted header. + (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") + (forward-line -1) + (let ((start (point))) + (search-forward "\n\n") + (delete-region start (point)))) + ;; Not reformatted. Delete the special + ;; lines before the real header. + (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") + (delete-region (point-min) (point))) + + ;; Some operations on the message header itself. (goto-char (point-min)) + (save-restriction + (narrow-to-region + (point-min) + (save-excursion (search-forward "\n\n" nil 'move) (point))) + + ;; Fetch or construct what we should use in the `From ' line. + (setq mail-from + (or (mail-fetch-field "Mail-From") + (concat "From " + (mail-strip-quoted-names (or (mail-fetch-field "from") + (mail-fetch-field "really-from") + (mail-fetch-field "sender") + "unknown")) + " " (current-time-string)))) + + ;; If the message specifies a coding system, use it. + (let ((maybe-coding (mail-fetch-field "X-Coding-System"))) + (if maybe-coding + (setq coding (intern maybe-coding)))) + + ;; Delete the Mail-From: header field if any. + (when (re-search-forward "^Mail-from:" nil t) + (beginning-of-line) + (delete-region (point) + (progn (forward-line 1) (point))))) + + (goto-char (point-min)) + ;; Insert the `From ' line. (insert mail-from "\n") + ;; Record the keywords and attributes in our special way. (insert "X-BABYL-V6-ATTRIBUTES: " (apply 'string attrs) "\n") (when keywords (insert "X-BABYL-V6-KEYWORDS: " keywords "\n")) @@ -132,43 +216,12 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'." (while (search-forward "\nFrom " nil t) (forward-char -5) (insert ?>))) + ;; Write it to the output file. (write-region (point-min) (point-max) to-file t - 'nomsg))) - (setq message-count (1+ message-count)))) + 'nomsg)))) + (kill-buffer temp-buffer)) (message "Writing messages to %s...done" to-file))) -(defun unrmail-unprune () - (let* ((pruned - (save-excursion - (goto-char (point-min)) - (forward-line 1) - (= (following-char) ?1)))) - (if pruned - (progn - (goto-char (point-min)) - (forward-line 2) - ;; Delete Summary-Line headers. - (let ((case-fold-search t)) - (while (looking-at "Summary-Line:") - (forward-line 1))) - (delete-region (point-min) (point)) - ;; Delete the old reformatted header. - (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") - (forward-line -1) - (let ((start (point))) - (search-forward "\n\n") - (delete-region start (point)))) - ;; Delete everything up to the real header. - (goto-char (point-min)) - (re-search-forward "^[*][*][*] EOOH [*][*][*]\n") - (delete-region (point-min) (point))) - (goto-char (point-min)) - (when (re-search-forward "^Mail-from:") - (beginning-of-line) - (delete-region (point) - (progn (forward-line 1) (point)))))) - - (provide 'unrmail) ;;; unrmail.el ends here diff --git a/lisp/makefile.nt b/lisp/makefile.nt deleted file mode 100644 index 069ef96ac98..00000000000 --- a/lisp/makefile.nt +++ /dev/null @@ -1,284 +0,0 @@ -# Hacked up Nmake makefile for GNU Emacs -# Geoff Voelker (voelker@cs.washington.edu) -# Copyright (c) 1994 Free Software Foundation, Inc. -# -# This file is part of GNU Emacs. -# -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -!include ..\nt\makefile.def - -all: - -#lisp=$(MAKEDIR:\=/) -lisp=. - -# You can specify a different executable on the make command line, -# e.g. "make EMACS=../src/emacs ...". - -EMACS = ..\bin\emacs.exe - -# Command line flags for Emacs. This must include --multibyte, -# otherwise some files will not compile. - -EMACSOPT = -batch --no-init-file --no-site-file --multibyte - -lisptagsfiles1 = $(lisp)/*.el -lisptagsfiles2 = $(lisp)/*/*.el -ETAGS = ..\lib-src\$(BLD)\etags - -# Files which should not be compiled. -# - emacs-lisp/cl-specs.el: only contains `def-edebug-spec's so there's -# no point compiling it, although it doesn't hurt. - -DONTCOMPILE = \ - $(lisp)/cus-load.el \ - $(lisp)/cus-start.el \ - $(lisp)/emacs-lisp/cl-specs.el \ - $(lisp)/eshell/esh-maint.el \ - $(lisp)/eshell/esh-groups.el \ - $(lisp)/finder-inf.el \ - $(lisp)/forms-d2.el \ - $(lisp)/forms-pass.el \ - $(lisp)/generic-x.el \ - $(lisp)/international/latin-1.el \ - $(lisp)/international/latin-2.el \ - $(lisp)/international/latin-3.el \ - $(lisp)/international/latin-4.el \ - $(lisp)/international/latin-5.el \ - $(lisp)/international/latin-8.el \ - $(lisp)/international/latin-9.el \ - $(lisp)/international/mule-conf.el \ - $(lisp)/loaddefs.el \ - $(lisp)/loadup.el \ - $(lisp)/mail/blessmail.el \ - $(lisp)/patcomp.el \ - $(lisp)/paths.el \ - $(lisp)/play/bruce.el \ - $(lisp)/subdirs.el \ - $(lisp)/term/internal.el \ - $(lisp)/term/AT386.el \ - $(lisp)/term/apollo.el \ - $(lisp)/term/bobcat.el \ - $(lisp)/term/iris-ansi.el \ - $(lisp)/term/keyswap.el \ - $(lisp)/term/linux.el \ - $(lisp)/term/lk201.el \ - $(lisp)/term/news.el \ - $(lisp)/term/vt102.el \ - $(lisp)/term/vt125.el \ - $(lisp)/term/vt200.el \ - $(lisp)/term/vt201.el \ - $(lisp)/term/vt220.el \ - $(lisp)/term/vt240.el \ - $(lisp)/term/vt300.el \ - $(lisp)/term/vt320.el \ - $(lisp)/term/vt400.el \ - $(lisp)/term/vt420.el \ - $(lisp)/term/wyse50.el \ - $(lisp)/term/xterm.el \ - $(lisp)/version.el - -# Files to compile before others during a bootstrap. This is done -# to speed up the bootstrap process. - -COMPILE_FIRST = \ - $(lisp)/emacs-lisp/byte-opt.el \ - $(lisp)/emacs-lisp/bytecomp.el \ - $(lisp)/subr.el - -# The actual Emacs command run in the targets below. - -emacs = $(EMACS) $(EMACSOPT) - -# Common command to find subdirectories - -# setwins=subdirs=`find $$wd -type d -print`; \ -# for file in $$subdirs; do \ -# case $$file in */Old | */RCS | */CVS | */CVS/* | */=* ) ;; \ -# *) wins="$$wins $$file" ;; \ -# esac; \ -# done - -# Have to define the list of subdirs manually -WINS=\ - calendar \ - emacs-lisp \ - emulation \ - eshell \ - gnus \ - international \ - language \ - mail \ - mh-e \ - net \ - play \ - progmodes \ - term \ - textmodes - -doit: - -cus-load.el: - touch $@ -custom-deps: cus-load.el doit - @echo Directories: $(WINS) - $(emacs) -l cus-dep --eval "(setq find-file-hooks nil)" -f custom-make-dependencies $(lisp) $(WINS) - -finder-inf.el: - echo (provide 'finder-inf)>> $@ - -finder-data: finder-inf.el doit - @echo Directories: $(WINS) - $(emacs) -l finder -f finder-compile-keywords-make-dist $(lisp) $(WINS) - -loaddefs.el: - echo ;;; loaddefs.el --- automatically extracted autoloads> $@ - echo ;;; Code:>> $@ - echo >> $@ - echo ;;; Local Variables:>> $@ - echo ;;; version-control: never>> $@ - echo ;;; no-byte-compile: t>> $@ - echo ;;; no-update-autoloads: t>> $@ - echo ;;; End:>> $@ - echo ;;; loaddefs.el ends here>> $@ - -autoloads: loaddefs.el doit - @echo Directories: $(WINS) - $(emacs) -l autoload --eval "(setq find-file-hooks nil generated-autoload-file \"$(lisp)/loaddefs.el\")" -f batch-update-autoloads $(lisp) $(WINS) - -subdirs.el: - $(MAKE) $(MFLAGS) -f makefile.nt update-subdirs -update-subdirs: doit - @set QWINS= - @for %d in ($(WINS)) do if not (%d)==(term) set QWINS=%QWINS% "%d" - echo ;; In load-path, after this directory should come> subdirs.el - echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el - echo (normal-top-level-add-to-load-path '(%QWINS%))>> subdirs.el - -updates: update-subdirs autoloads finder-data custom-deps - -TAGS: $(lisptagsfiles1) $(lisptagsfiles2) - $(ETAGS) $(lisptagsfiles1) $(lisptagsfiles2) - -TAGS-LISP: $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) - $(ETAGS) -o TAGS-LISP $(lispsource)$(lisptagsfiles1) $(lispsource)$(lisptagsfiles2) - -.SUFFIXES: .elc .el - -.el.elc: - -$(emacs) -f batch-byte-compile $< - -$(DONTCOMPILE:.el=.elc): - -$(DEL) $@ - -# Compile all Lisp files, except those from DONTCOMPILE. This -# compiles files unconditionally. All .elc files are made writable -# before compilation in case we checked out read-only (CVS option -r). -# Files MUST be compiled one by one. If we compile several files in a -# row we can't make sure that the compilation environment is clean. -# We also set the load-path of the Emacs used for compilation to the -# current directory and its subdirectories, to make sure require's and -# load's in the files being compiled find the right files. - -compile-files: subdirs.el doit -# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g - for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f - for %f in ($(lisp) $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g - -# Backup compiled Lisp files in elc.tar.gz. If that file already -# exists, make a backup of it. - -backup-compiled-files: - -mv $(lisp)/elc.tar.gz $(lisp)/elc.tar.gz~ - -tar czf $(lisp)/elc.tar.gz $(lisp)/*.elc $(lisp)/*/*.elc - -# Compile Lisp files, but save old compiled files first. - -compile: backup-compiled-files compile-files - -# Recompile all Lisp files which are newer than their .elc files. -# Note that this doesn't create .elc files. It only recompiles if an -# .elc is present. - -recompile: doit - $(emacs) -f batch-byte-recompile-directory . - -# Prepare a bootstrap in the lisp subdirectory. Build loaddefs.el, -# because it's not sure it's up-to-date, and if it's not, that might -# lead to errors during the bootstrap because something fails to -# autoload as expected. Remove compiled Lisp files so that -# bootstrap-emacs will be built from sources only. - -bootstrap-clean: - if exist $(EMACS) $(MAKE) $(MFLAGS) -f makefile.nt autoloads - -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g - -# Generate/update files for the bootstrap process. - -bootstrap: autoloads compile-files custom-deps - -# -# Assuming INSTALL_DIR is defined, copy the elisp files to it -# Windows 95 makes this harder than it should be. -# -install: - - mkdir $(INSTALL_DIR)\lisp - - $(DEL) .\same-dir.tst - - $(DEL) $(INSTALL_DIR)\lisp\same-dir.tst - echo SameDirTest > $(INSTALL_DIR)\lisp\same-dir.tst -!ifdef COPY_LISP_SOURCE - if not exist .\same-dir.tst $(CP_DIR) . $(INSTALL_DIR)\lisp -!else - if not exist .\same-dir.tst $(CP_DIR) *.elc $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) cus-load.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) cus-start.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) emacs-lisp\cl-specs.el $(INSTALL_DIR)\lisp\emacs-lisp - if not exist .\same-dir.tst $(CP) eshell\esh-maint.el $(INSTALL_DIR)\lisp\eshell - if not exist .\same-dir.tst $(CP) eshell\esh-groups.el $(INSTALL_DIR)\lisp\eshell - if not exist .\same-dir.tst $(CP) finder-inf.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) forms*.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) generic-x.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) patcomp.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) subdirs.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) version.el $(INSTALL_DIR)\lisp - if not exist .\same-dir.tst $(CP) mail\blessmail.el $(INSTALL_DIR)\lisp\mail - if not exist .\same-dir.tst $(CP) play\bruce.el $(INSTALL_DIR)\lisp\play - if not exist .\same-dir.tst $(CP) international\latin-*.el $(INSTALL_DIR)\lisp\international - if not exist .\same-dir.tst $(CP) international\mule-conf.el $(INSTALL_DIR)\lisp\international - - $(DEL) $(INSTALL_DIR)\lisp\same-dir.tst -!endif - -# -# Maintenance -# -clean: - - $(DEL) *~ term\*~ - - $(DEL) *.orig *.rej *.crlf - - $(DEL) emacs-lisp\*.orig emacs-lisp\*.rej emacs-lisp\*.crlf - - $(DEL) emulation\*.orig emulation\*.rej emulation\*.crlf - - $(DEL) gnus\*.orig gnus\*.rej gnus\*.crlf - - $(DEL) international\*.orig international\*.rej international\*.crlf - - $(DEL) language\*.orig language\*.rej language\*.crlf - - $(DEL) mail\*.orig mail\*.rej mail\*.crlf - - $(DEL) play\*.orig play\*.rej play\*.crlf - - $(DEL) progmodes\*.orig progmodes\*.rej progmodes\*.crlf - - $(DEL) term\*.orig term\*.rej term\*.crlf - - $(DEL) textmodes\*.orig textmodes\*.rej textmodes\*.crlf - - $(DEL_TREE) deleted - -# arch-tag: 01ddeb44-fb4c-4366-8478-4a6c21a68fb3 diff --git a/lisp/makefile.w32-in b/lisp/makefile.w32-in index 6791cb0aea4..826cf89bfec 100644 --- a/lisp/makefile.w32-in +++ b/lisp/makefile.w32-in @@ -1,5 +1,5 @@ -# Makefile for GNU Emacs on the Microsoft W32 API. -# Copyright (c) 2000-2001 Free Software Foundation, Inc. +# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# Copyright (c) 2000,2001,2004 Free Software Foundation, Inc. # # This file is part of GNU Emacs. # @@ -42,9 +42,6 @@ EMACSOPT = -batch --no-init-file --no-site-file --multibyte # Set EMACSLOADPATH correctly (already defined in environment). EMACSLOADPATH=$(lisp) -# Use C locale -LC_ALL = C - lisptagsfiles1 = $(lisp)/*.el lisptagsfiles2 = $(lisp)/*/*.el ETAGS = "../lib-src/$(BLD)/etags" @@ -65,7 +62,13 @@ DONTCOMPILE = \ $(lisp)/forms-d2.el \ $(lisp)/forms-pass.el \ $(lisp)/generic-x.el \ - $(lisp)/international/latin1-disp.el \ + $(lisp)/international/latin-1.el \ + $(lisp)/international/latin-2.el \ + $(lisp)/international/latin-3.el \ + $(lisp)/international/latin-4.el \ + $(lisp)/international/latin-5.el \ + $(lisp)/international/latin-8.el \ + $(lisp)/international/latin-9.el \ $(lisp)/international/mule-conf.el \ $(lisp)/language/czech.el \ $(lisp)/language/devanagari.el \ @@ -84,10 +87,6 @@ DONTCOMPILE = \ $(lisp)/language/thai.el \ $(lisp)/language/utf-8-lang.el \ $(lisp)/language/georgian.el \ - $(lisp)/language/vietnamese.el \ - $(lisp)/language/cyrillic.el \ - $(lisp)/language/chinese.el \ - $(lisp)/language/indian.el \ $(lisp)/loaddefs.el \ $(lisp)/ldefs-boot.el \ $(lisp)/loadup.el \ @@ -162,7 +161,8 @@ WINS=\ progmodes \ term \ textmodes \ - toolbar + toolbar \ + url doit: @@ -237,7 +237,7 @@ update-subdirs-CMD: doit echo ;; In load-path, after this directory should come>> subdirs.el echo ;; certain of its subdirectories. Here we specify them.>> subdirs.el echo (normal-top-level-add-to-load-path $(SQUOTE)(>> subdirs.el - @for %d in ($(WINS)) do if not (%d)==(term) echo "%d">> subdirs.el + @for %%d in ($(WINS)) do if not (%%d)==(term) echo "%%d">> subdirs.el echo ))>> subdirs.el update-subdirs-SH: doit @@ -282,11 +282,11 @@ $(DONTCOMPILE:.el=.elc): compile: subdirs.el compile-$(SHELLTYPE) doit compile-CMD: -# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g - for %f in ($(COMPILE_FIRST)) do \ - $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f - for %f in (. $(WINS)) do for %g in (%f/*.el) do \ - $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %f/%g +# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g + for %%f in ($(COMPILE_FIRST)) do \ + $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f + for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do \ + $(emacs) -l loaddefs -f batch-byte-compile-if-not-done %%f/%%g compile-SH: # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done @@ -309,9 +309,9 @@ compile-SH: compile-always: subdirs.el compile-always-$(SHELLTYPE) doit compile-always-CMD: -# -for %f in ($(lisp) $(WINS)) do for %g in (%f\*.elc) do @attrib -r %g - for %f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %f - for %f in (. $(WINS)) do for %g in (%f/*.el) do $(emacs) -f batch-byte-compile %f/%g +# -for %%f in ($(lisp) $(WINS)) do for %%g in (%%f\*.elc) do @attrib -r %%g + for %%f in ($(COMPILE_FIRST)) do $(emacs) -f batch-byte-compile %%f + for %%f in (. $(WINS)) do for %%g in (%%f/*.el) do $(emacs) -f batch-byte-compile %%f/%%g compile-always-SH: # for elc in $(lisp)/*.elc $(lisp)/*/*.elc; do attrib -r $$elc; done @@ -329,7 +329,7 @@ compile-always-SH: compile-calc: compile-calc-$(SHELLTYPE) compile-calc-CMD: - for %f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %f + for %%f in ($(lisp)/calc/*.el) do $(emacs) -f batch-byte-compile %%f compile-calc-SH: for el in $(lisp)/calc/*.el; do \ @@ -374,7 +374,7 @@ bootstrap-clean: bootstrap-clean-$(SHELLTYPE) loaddefs.el bootstrap-clean-CMD: # if exist $(EMACS) $(MAKE) $(MFLAGS) autoloads if not exist $(lisp)\loaddefs.el cp $(lisp)/ldefs-boot.el $(lisp)/loaddefs.el - -for %f in (. $(WINS)) do for %g in (%f\*.elc) do @$(DEL) %g + -for %%f in (. $(WINS)) do for %%g in (%%f\*.elc) do @$(DEL) %%g bootstrap-clean-SH: # if test -f $(EMACS); then $(MAKE) $(MFLAGS) autoloads; fi @@ -420,5 +420,3 @@ install: # clean: - $(DEL) *~ - -# arch-tag: bd03b562-c58d-4403-99db-c7bccd8c49a0 diff --git a/lisp/man.el b/lisp/man.el index 7222c1bad15..5a07045dda9 100644 --- a/lisp/man.el +++ b/lisp/man.el @@ -732,11 +732,14 @@ all sections related to a subject, put something appropriate into the (setenv "GROFF_NO_SGR" "1") (if (fboundp 'start-process) (set-process-sentinel - (start-process manual-program buffer "sh" "-c" + (start-process manual-program buffer + (if (eq system-type 'cygwin) shell-file-name "sh") + shell-command-switch (format (Man-build-man-command) man-args)) 'Man-bgproc-sentinel) (let ((exit-status - (call-process shell-file-name nil (list buffer nil) nil "-c" + (call-process shell-file-name nil (list buffer nil) nil + shell-command-switch (format (Man-build-man-command) man-args))) (msg "")) (or (and (numberp exit-status) diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 7db5f96e6d7..17deeff4619 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -893,7 +893,7 @@ PROPS are additional properties." '("--")) (define-key menu-bar-options-menu [cua-mode] (menu-bar-make-mm-toggle cua-mode - "CUA-style cut and paste" + "C-x/C-c/C-v cut and paste (CUA)" "Use C-z/C-x/C-c/C-v keys for undo/cut/copy/paste")) (define-key menu-bar-options-menu [case-fold-search] @@ -1557,7 +1557,8 @@ Buffers menu is regenerated." (setq buffers-menu (cons 'keymap (cons "Select Buffer" buffers-menu))) (define-key (current-global-map) [menu-bar buffer] - (cons "Buffers" buffers-menu))))) + ;; Call copy-sequence so the string is not pure. + (cons (copy-sequence "Buffers") buffers-menu))))) (add-hook 'menu-bar-update-hook 'menu-bar-update-buffers) diff --git a/lisp/mh-e/ChangeLog b/lisp/mh-e/ChangeLog index 92c2600560f..6eb2c1bc2ec 100644 --- a/lisp/mh-e/ChangeLog +++ b/lisp/mh-e/ChangeLog @@ -1,3 +1,6 @@ +2004-04-26 Lars Hansen <larsh@math.ku.dk> + * mh-e.el (mh-folder-mode): Bind desktop-save-buffer to t. + 2003-04-24 Bill Wohler <wohler@newt.com> * Released MH-E version 7.3. @@ -47,6 +50,10 @@ runs checkdoc and lm-verify which is useful before releasing the software. It can and should be expanded to do real unit tests. +2004-04-22 Lars Hansen <larsh@math.ku.dk> + + * mh-e.el (mh-restore-desktop-buffer): Delete with-no-warnings. + 2003-04-22 Mark D Baushke <mdb@gnu.org> * mh-alias.el: Update Copyright. @@ -71,6 +78,11 @@ Emacs. (mh-exec-cmd-error): Add a comment, so that we change it later on. +2004-04-21 Lars Hansen <larsh@math.ku.dk> + + * mh-e.el (mh-restore-desktop-buffer): Move from + desktop.el. Add Parameters. + 2003-04-18 Steve Youngs <youngs@xemacs.org> * mh-xemacs-icons.el (mh-xemacs-icons): Provide 'mh-xemacs-icons' diff --git a/lisp/mh-e/mh-e.el b/lisp/mh-e/mh-e.el index c4b027f382f..344a67f5725 100644 --- a/lisp/mh-e/mh-e.el +++ b/lisp/mh-e/mh-e.el @@ -1548,6 +1548,8 @@ When a folder is visited, the hook `mh-folder-mode-hook' is run. (make-local-variable 'font-lock-defaults) (setq font-lock-defaults '(mh-folder-font-lock-keywords t)) + (make-local-variable 'desktop-save-buffer) + (setq desktop-save-buffer t) (mh-make-local-vars 'mh-current-folder (buffer-name) ; Name of folder, a string 'mh-show-buffer (format "show-%s" (buffer-name)) ; Buffer that displays msgs @@ -2441,6 +2443,17 @@ well.") "^There is no other window$")) (add-to-list 'debug-ignored-errors mess)) +;;;; Desktop support + +;;;###autoload +(defun mh-restore-desktop-buffer (desktop-buffer-file-name + desktop-buffer-name + desktop-buffer-misc) + "Restore an mh folder buffer specified in a desktop file." + (mh-find-path) + (mh-visit-folder desktop-buffer-name) + (current-buffer)) + (provide 'mh-e) ;;; Local Variables: diff --git a/lisp/minibuf-eldef.el b/lisp/minibuf-eldef.el index 10bf38f945f..908b77aab33 100644 --- a/lisp/minibuf-eldef.el +++ b/lisp/minibuf-eldef.el @@ -1,6 +1,6 @@ ;;; minibuf-eldef.el --- Only show defaults in prompts when applicable ;; -;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. ;; ;; Author: Miles Bader <miles@gnu.org> ;; Keywords: convenience @@ -36,7 +36,7 @@ ;;; Code: (defvar minibuffer-default-in-prompt-regexps - '(("\\( (default\\>.*)\\):? \\'" . 1)) + '(("\\( (default\\>.*)\\):? \\'" . 1) ("\\( \\[.*\\]\\):? *\\'" . 1)) "*A list of regexps matching the parts of minibuffer prompts showing defaults. When `minibuffer-electric-default-mode' is active, these regexps are used to identify the portions of prompts to elide. @@ -157,5 +157,5 @@ Returns non-nil if the new state is enabled." (provide 'minibuf-eldef) -;;; arch-tag: 7e421fae-c275-4729-b0da-7836af377d3d +;; arch-tag: 7e421fae-c275-4729-b0da-7836af377d3d ;;; minibuf-eldef.el ends here diff --git a/lisp/mouse.el b/lisp/mouse.el index faa10e842d3..7f9d080478a 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -42,6 +42,12 @@ "*If non-nil, mouse yank commands yank at point instead of at click." :type 'boolean :group 'mouse) + +(defcustom mouse-drag-copy-region t + "*If non-nil, mouse drag copies region to kill-ring." + :type 'boolean + :group 'mouse) + ;; Provide a mode-specific menu on a mouse button. @@ -612,11 +618,14 @@ This should be bound to a mouse drag event." ;; Don't set this-command to kill-region, so that a following ;; C-w will not double the text in the kill ring. ;; Ignore last-command so we don't append to a preceding kill. - (let (this-command last-command deactivate-mark) - (copy-region-as-kill (mark) (point))) + (when mouse-drag-copy-region + (let (this-command last-command deactivate-mark) + (copy-region-as-kill (mark) (point)))) (mouse-set-region-1))) (defun mouse-set-region-1 () + ;; Set transient-mark-mode for a little while. + (setq transient-mark-mode (or transient-mark-mode 'only)) (setq mouse-last-region-beg (region-beginning)) (setq mouse-last-region-end (region-end)) (setq mouse-last-region-tick (buffer-modified-tick))) @@ -827,8 +836,9 @@ If the click is in the echo area, display the `*Messages*' buffer." (push-mark region-commencement t t) (goto-char region-termination) ;; Don't let copy-region-as-kill set deactivate-mark. - (let (deactivate-mark) - (copy-region-as-kill (point) (mark t))) + (when mouse-drag-copy-region + (let (deactivate-mark) + (copy-region-as-kill (point) (mark t)))) (let ((buffer (current-buffer))) (mouse-show-mark) ;; mouse-show-mark can call read-event, diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el index 8e1068a5bed..09448e87329 100644 --- a/lisp/net/ange-ftp.el +++ b/lisp/net/ange-ftp.el @@ -4116,6 +4116,9 @@ directory, so that Emacs will know its current contents." (format "Getting %s" fn1)) tmp1)))) +(defun ange-ftp-file-remote-p (file) + (when (ange-ftp-ftp-name file) t)) + (defun ange-ftp-load (file &optional noerror nomessage nosuffix) (if (ange-ftp-ftp-name file) (let ((tryfiles (if nosuffix @@ -4257,9 +4260,6 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (let ((fn (get operation 'ange-ftp))) (if fn (save-match-data (apply fn args)) (ange-ftp-run-real-handler operation args)))) -;;;###autoload -;;; These file names are remote file names. -(put 'ange-ftp-hook-function 'file-remote-p t) ;; The following code is commented out because Tramp now deals with ;; Ange-FTP filenames, too. @@ -4327,6 +4327,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.") (put 'file-name-completion 'ange-ftp 'ange-ftp-file-name-completion) (put 'insert-directory 'ange-ftp 'ange-ftp-insert-directory) (put 'file-local-copy 'ange-ftp 'ange-ftp-file-local-copy) +(put 'file-remote-p 'ange-ftp 'ange-ftp-file-remote-p) (put 'unhandled-file-name-directory 'ange-ftp 'ange-ftp-unhandled-file-name-directory) (put 'file-name-sans-versions 'ange-ftp 'ange-ftp-file-name-sans-versions) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index a70e08028d2..1dbd97f0073 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -577,13 +577,22 @@ down (this *won't* always work)." (defun browse-url-interactive-arg (prompt) "Read a URL from the minibuffer, prompting with PROMPT. -Default to the URL at or before point. If invoked with a mouse button, -set point to the position clicked first. Return a list for use in -`interactive' containing the URL and `browse-url-new-window-flag' or its -negation if a prefix argument was given." +If `transient-mark-mode' is non-nil and the mark is active, +it defaults to the current region, else to the URL at or before +point. If invoked with a mouse button, it moves point to the +position clicked before acting. + +This function returns a list (URL NEW-WINDOW-FLAG) +for use in `interactive'." (let ((event (elt (this-command-keys) 0))) (and (listp event) (mouse-set-point event))) - (list (read-string prompt (browse-url-url-at-point)) + (list (read-string prompt (or (and transient-mark-mode mark-active + ;; rfc2396 Appendix E. + (replace-regexp-in-string + "[\t\r\f\n ]+" "" + (buffer-substring-no-properties + (region-beginning) (region-end)))) + (browse-url-url-at-point))) (not (eq (null browse-url-new-window-flag) (null current-prefix-arg))))) @@ -847,7 +856,7 @@ used instead of `browse-url-new-window-flag'." (or (eq (process-exit-status process) 0) (let* ((process-environment (browse-url-process-environment))) ;; Netscape not running - start it - (message "Starting Netscape...") + (message "Starting %s..." browse-url-netscape-program) (apply 'start-process (concat "netscape" url) nil browse-url-netscape-program (append browse-url-netscape-startup-arguments (list url)))))) @@ -918,7 +927,7 @@ used instead of `browse-url-new-window-flag'." (or (eq (process-exit-status process) 0) (let* ((process-environment (browse-url-process-environment))) ;; Mozilla is not running - start it - (message "Starting Mozilla...") + (message "Starting %s..." browse-url-mozilla-program) (apply 'start-process (concat "mozilla " url) nil browse-url-mozilla-program (append browse-url-mozilla-startup-arguments (list url)))))) @@ -968,7 +977,7 @@ used instead of `browse-url-new-window-flag'." (or (eq (process-exit-status process) 0) (let* ((process-environment (browse-url-process-environment))) ;; Galeon is not running - start it - (message "Starting Galeon...") + (message "Starting %s..." browse-url-galeon-program) (apply 'start-process (concat "galeon " url) nil browse-url-galeon-program (append browse-url-galeon-startup-arguments (list url)))))) @@ -1017,7 +1026,7 @@ used instead of `browse-url-new-window-flag'." (or (eq (process-exit-status process) 0) (let* ((process-environment (browse-url-process-environment))) ;; Epiphany is not running - start it - (message "Starting Epiphany...") + (message "Starting %s..." browse-url-epiphany-program) (apply 'start-process (concat "epiphany " url) nil browse-url-epiphany-program (append browse-url-epiphany-startup-arguments (list url)))))) @@ -1098,10 +1107,10 @@ used instead of `browse-url-new-window-flag'." (message "Signalling Mosaic...done") ) ;; Mosaic not running - start it - (message "Starting Mosaic...") + (message "Starting %s..." browse-url-mosaic-program) (apply 'start-process "xmosaic" nil browse-url-mosaic-program (append browse-url-mosaic-arguments (list url))) - (message "Starting Mosaic...done")))) + (message "Starting %s...done" browse-url-mosaic-program)))) ;; --- Grail --- diff --git a/lisp/net/ldap.el b/lisp/net/ldap.el index 55af47e6a87..f093fb1cbcc 100644 --- a/lisp/net/ldap.el +++ b/lisp/net/ldap.el @@ -554,7 +554,7 @@ an alist of attribute/value pairs." (setq arglist (nconc arglist (list (format "-z%s" sizelimit))))) (eval `(call-process ldap-ldapsearch-prog nil - buf + `(,buf nil) nil ,@arglist ,@ldap-ldapsearch-args diff --git a/lisp/net/quickurl.el b/lisp/net/quickurl.el index fd13b3a0f51..40a1e4bfad3 100644 --- a/lisp/net/quickurl.el +++ b/lisp/net/quickurl.el @@ -256,14 +256,16 @@ returned." ;; Main code: -(defun* quickurl-read (&optional (buffer (current-buffer))) +(defun* quickurl-read (&optional buffer) "`read' the URL list from BUFFER into `quickurl-urls'. +BUFFER, if nil, defaults to current buffer. Note that this function moves point to `point-min' before doing the `read' It also restores point after the `read'." (save-excursion (setf (point) (point-min)) - (setq quickurl-urls (funcall quickurl-sort-function (read buffer))))) + (setq quickurl-urls (funcall quickurl-sort-function + (read (or buffer (current-buffer))))))) (defun quickurl-load-urls () "Load the contents of `quickurl-url-file' into `quickurl-urls'." @@ -298,14 +300,15 @@ Also display a `message' saying what the URL was unless SILENT is non-nil." (message "Found %s" (quickurl-url-url url)))) ;;;###autoload -(defun* quickurl (&optional (lookup (funcall quickurl-grab-lookup-function))) +(defun* quickurl (&optional lookup) "Insert an URL based on LOOKUP. If not supplied LOOKUP is taken to be the word at point in the current buffer, this default action can be modifed via `quickurl-grab-lookup-function'." (interactive) - (when lookup + (when (or lookup + (setq lookup (funcall quickurl-grab-lookup-function))) (quickurl-load-urls) (let ((url (quickurl-find-url lookup))) (if (null url) @@ -392,14 +395,15 @@ is decided." (message "Added %s" url)))))) ;;;###autoload -(defun* quickurl-browse-url (&optional (lookup (funcall quickurl-grab-lookup-function))) +(defun quickurl-browse-url (&optional lookup) "Browse the URL associated with LOOKUP. If not supplied LOOKUP is taken to be the word at point in the current buffer, this default action can be modifed via `quickurl-grab-lookup-function'." (interactive) - (when lookup + (when (or lookup + (setq lookup (funcall quickurl-grab-lookup-function))) (quickurl-load-urls) (let ((url (quickurl-find-url lookup))) (if url diff --git a/lisp/net/telnet.el b/lisp/net/telnet.el index dac6f228cd6..40a28494774 100644 --- a/lisp/net/telnet.el +++ b/lisp/net/telnet.el @@ -1,6 +1,6 @@ ;;; telnet.el --- run a telnet session from within an Emacs buffer -;; Copyright (C) 1985, 1988, 1992, 1994 Free Software Foundation, Inc. +;; Copyright (C) 1985, 88, 1992, 94, 2004 Free Software Foundation, Inc. ;; Author: William F. Schelter ;; Maintainer: FSF @@ -197,18 +197,28 @@ rejecting one login and prompting again for a username and password.") ;;;###autoload (add-hook 'same-window-regexps "\\*telnet-.*\\*\\(\\|<[0-9]+>\\)") ;;;###autoload -(defun telnet (host) +(defun telnet (host &optional port) "Open a network login connection to host named HOST (a string). +Optional arg PORT specifies alternative port to connect to. +Interactively, use \\[universal-argument] prefix to be prompted for port number. + Communication with HOST is recorded in a buffer `*PROGRAM-HOST*' where PROGRAM is the telnet program being used. This program is controlled by the contents of the global variable `telnet-host-properties', falling back on the value of the global variable `telnet-program'. Normally input is edited in Emacs and sent a line at a time." - (interactive "sOpen connection to host: ") + (interactive (list (read-string "Open connection to host: ") + (cond + ((null current-prefix-arg) nil) + ((consp current-prefix-arg) (read-string "Port: ")) + (t (prefix-numeric-value current-prefix-arg))))) + (if (and port (numberp port)) + (setq port (int-to-string port))) (let* ((comint-delimiter-argument-list '(?\ ?\t)) (properties (cdr (assoc host telnet-host-properties))) (telnet-program (if properties (car properties) telnet-program)) - (name (concat telnet-program "-" (comint-arguments host 0 nil) )) + (hname (if port (concat host ":" port) host)) + (name (concat telnet-program "-" (comint-arguments hname 0 nil) )) (buffer (get-buffer (concat "*" name "*"))) (telnet-options (if (cdr properties) (cons "-l" (cdr properties)))) process) @@ -221,29 +231,22 @@ Normally input is edited in Emacs and sent a line at a time." ;; Don't send the `open' cmd till telnet is ready for it. (accept-process-output process) (erase-buffer) - (send-string process (concat "open " host "\n")) + (send-string process (concat "open " host + (if port " " "") (or port "") + "\n")) (telnet-mode) (setq comint-input-sender 'telnet-simple-send) (setq telnet-count telnet-initial-count)))) (put 'telnet-mode 'mode-class 'special) -(defun telnet-mode () +(define-derived-mode telnet-mode comint-mode "Telnet" "This mode is for using telnet (or rsh) from a buffer to another host. It has most of the same commands as comint-mode. There is a variable ``telnet-interrupt-string'' which is the character sent to try to stop execution of a job on the remote host. -Data is sent to the remote host when RET is typed. - -\\{telnet-mode-map} -" - (interactive) - (comint-mode) - (setq major-mode 'telnet-mode - mode-name "Telnet" - comint-prompt-regexp telnet-prompt-pattern) - (use-local-map telnet-mode-map) - (run-hooks 'telnet-mode-hook)) +Data is sent to the remote host when RET is typed." + (set (make-local-variable 'comint-prompt-regexp) telnet-prompt-pattern)) ;;;###autoload (add-hook 'same-window-regexps "\\*rsh-[^-]*\\*\\(\\|<[0-9]*>\\)") diff --git a/lisp/net/tramp-smb.el b/lisp/net/tramp-smb.el index ab6ad3310c1..cca01d169b6 100644 --- a/lisp/net/tramp-smb.el +++ b/lisp/net/tramp-smb.el @@ -38,6 +38,19 @@ (or (>= emacs-major-version 20) (load "cl-seq"))) +;; Avoid byte-compiler warnings if the byte-compiler supports this. +;; Currently, XEmacs supports this. +(eval-when-compile + (when (fboundp 'byte-compiler-options) + (let (unused-vars) ; Pacify Emacs byte-compiler + (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler + (byte-compiler-options (warnings (- unused-vars)))))) + +;; XEmacs byte-compiler raises warning abouts `last-coding-system-used'. +(eval-when-compile + (unless (boundp 'last-coding-system-used) + (defvar last-coding-system-used nil))) + ;; Define SMB method ... (defcustom tramp-smb-method "smb" "*Method to connect SAMBA and M$ SMB servers." @@ -131,6 +144,7 @@ This variable is local to each buffer.") (file-executable-p . tramp-smb-handle-file-exists-p) (file-exists-p . tramp-smb-handle-file-exists-p) (file-local-copy . tramp-smb-handle-file-local-copy) + (file-remote-p . tramp-handle-file-remote-p) (file-modes . tramp-handle-file-modes) (file-name-all-completions . tramp-smb-handle-file-name-all-completions) ;; `file-name-as-directory' performed by default handler @@ -145,7 +159,7 @@ This variable is local to each buffer.") (file-symlink-p . tramp-smb-not-handled) ;; `file-truename' performed by default handler (file-writable-p . tramp-smb-handle-file-writable-p) - ;; `find-backup-file-name' performed by default handler + (find-backup-file-name . tramp-handle-find-backup-file-name) ;; `find-file-noselect' performed by default handler ;; `get-file-buffer' performed by default handler (insert-directory . tramp-smb-handle-insert-directory) @@ -990,7 +1004,7 @@ Domain names in USER and port numbers in HOST are acknowledged." tramp-smb-program args))) (tramp-message 9 "Started process %s" (process-command p)) - (process-kill-without-query p) + (tramp-set-process-query-on-exit-flag p nil) (set-buffer buffer) (setq tramp-smb-share share) diff --git a/lisp/net/tramp-uu.el b/lisp/net/tramp-uu.el index 1047e62a3cb..d18af101c48 100644 --- a/lisp/net/tramp-uu.el +++ b/lisp/net/tramp-uu.el @@ -1,7 +1,7 @@ ;;; -*- coding: iso-2022-7bit; -*- ;;; tramp-uu.el --- uuencode in Lisp -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2004 Free Software Foundation, Inc. ;; Author: Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> ;; Keywords: comm, terminals @@ -63,10 +63,10 @@ (setq c (char-after (point))) (delete-char 1) (if (equal c ?=) - ;; "=" means padding. Insert "`" instead. - (insert "`") - (insert (tramp-uu-byte-to-uu-char (tramp-uu-b64-char-to-byte c)))) - (setq i (1+ i)) + ;; "=" means padding. Insert "`" instead. Not counted for length. + (progn (insert "`") (setq len (1- len))) + (insert (tramp-uu-byte-to-uu-char (tramp-uu-b64-char-to-byte c))) + (setq i (1+ i))) ;; Every 60 characters, add "M" at beginning of line (as ;; length byte) and insert a newline. (when (zerop (% i 60)) diff --git a/lisp/net/tramp-vc.el b/lisp/net/tramp-vc.el index ded30f4b09c..839a8702dd9 100644 --- a/lisp/net/tramp-vc.el +++ b/lisp/net/tramp-vc.el @@ -1,6 +1,6 @@ ;;; tramp-vc.el --- Version control integration for TRAMP.el -;; Copyright (C) 2000 by Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2002, 2003, 2004 by Free Software Foundation, Inc. ;; Author: Daniel Pittman <daniel@danann.net> ;; Keywords: comm, processes @@ -38,6 +38,14 @@ (require 'vc-rcs)) (require 'tramp) +;; Avoid byte-compiler warnings if the byte-compiler supports this. +;; Currently, XEmacs supports this. +(eval-when-compile + (when (fboundp 'byte-compiler-options) + (let (unused-vars) ; Pacify Emacs byte-compiler + (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler + (byte-compiler-options (warnings (- unused-vars)))))) + ;; -- vc -- ;; This used to blow away the file-name-handler-alist and reinstall @@ -163,7 +171,9 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." (if vc-command-messages (message "Running %s on %s..." command file)) (save-current-buffer - (unless (eq buffer t) (vc-setup-buffer buffer)) + (unless (eq buffer t) + ; Pacify byte-compiler + (funcall (symbol-function 'vc-setup-buffer) buffer)) (let ((squeezed nil) (inhibit-read-only t) (status 0)) @@ -192,9 +202,10 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." (if (integerp status) (format "status %d" status) status)))) (if vc-command-messages (message "Running %s...OK" command)) - (vc-exec-after - `(run-hook-with-args - 'vc-post-command-functions ',command ',localname ',flags)) + ; Pacify byte-compiler + (funcall (symbol-function 'vc-exec-after) + `(run-hook-with-args + 'vc-post-command-functions ',command ',localname ',flags)) status)))) @@ -325,7 +336,8 @@ Since TRAMP doesn't do async commands yet, this function doesn't, either." (not want-differences-if-changed)))) (zerop status)) ;; New VC. Call `vc-default-workfile-unchanged-p'. - (vc-default-workfile-unchanged-p (vc-backend file) filename))) + (funcall (symbol-function 'vc-default-workfile-unchanged-p) + (vc-backend filename) filename))) (defadvice vc-workfile-unchanged-p (around tramp-advice-vc-workfile-unchanged-p @@ -391,14 +403,15 @@ filename we are thinking about..." ;; Pacify byte-compiler; this symbol is bound in the calling ;; function. CCC: Maybe it would be better to move the ;; boundness-checking into this function? - (let ((file (symbol-value 'file)) - (remote-uid - ;; With Emacs 21.4, `file-attributes' has got an optional parameter - ;; ID-FORMAT. Handle this case backwards compatible. - (if (and (functionp 'subr-arity) - (= 2 (cdr (subr-arity (symbol-function 'file-attributes))))) - (nth 2 (file-attributes file 'integer)) - (nth 2 (file-attributes file))))) + (let* ((file (symbol-value 'file)) + (remote-uid + ;; With Emacs 21.4, `file-attributes' has got an optional parameter + ;; ID-FORMAT. Handle this case backwards compatible. + (if (and (functionp 'subr-arity) + (= 2 (cdr (funcall (symbol-function 'subr-arity) + (symbol-function 'file-attributes))))) + (nth 2 (file-attributes file 'integer)) + (nth 2 (file-attributes file))))) (if (and uid (/= uid remote-uid)) (error "tramp-handle-vc-user-login-name cannot map a uid to a name") (let* ((v (tramp-dissect-file-name (tramp-handle-expand-file-name file))) diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index cd6ed337927..769ad3f51f6 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -135,11 +135,25 @@ Nil means to use a separate filename syntax for Tramp.") (unless (boundp 'custom-print-functions) (defvar custom-print-functions nil)) ; not autoloaded before Emacs 20.4 -;; Avoid bytecompiler warnings if the byte-compiler supports this. +;; Avoid byte-compiler warnings if the byte-compiler supports this. ;; Currently, XEmacs supports this. (eval-when-compile (when (fboundp 'byte-compiler-options) - (byte-compiler-options (warnings (- unused-vars))))) + (let (unused-vars) ; Pacify Emacs byte-compiler + (defalias 'warnings 'identity) ; Pacify Emacs byte-compiler + (byte-compiler-options (warnings (- unused-vars)))))) + +;; `directory-sep-char' is an obsolete variable in Emacs. But it is +;; used in XEmacs, so we set it here and there. The following is needed +;; to pacify Emacs byte-compiler. +(eval-when-compile + (when (boundp 'byte-compile-not-obsolete-var) + (setq byte-compile-not-obsolete-var 'directory-sep-char))) + +;; XEmacs byte-compiler raises warning abouts `last-coding-system-used'. +(eval-when-compile + (unless (boundp 'last-coding-system-used) + (defvar last-coding-system-used nil))) ;;; User Customizable Internal Variables: @@ -157,6 +171,49 @@ Nil means to use a separate filename syntax for Tramp.") :group 'tramp :type 'boolean) +;; Emacs case +(eval-and-compile + (when (boundp 'backup-directory-alist) + (defcustom tramp-backup-directory-alist nil + "Alist of filename patterns and backup directory names. +Each element looks like (REGEXP . DIRECTORY), with the same meaning like +in `backup-directory-alist'. If a Tramp file is backed up, and DIRECTORY +is a local file name, the backup directory is prepended with Tramp file +name prefix \(multi-method, method, user, host\) of file. + +\(setq tramp-backup-directory-alist backup-directory-alist\) + +gives the same backup policy for Tramp files on their hosts like the +policy for local files." + :group 'tramp + :type '(repeat (cons (regexp :tag "Regexp matching filename") + (directory :tag "Backup directory name")))))) + +;; XEmacs case. We cannot check for `bkup-backup-directory-info', because +;; the package "backup-dir" might not be loaded yet. +(eval-and-compile + (when (featurep 'xemacs) + (defcustom tramp-bkup-backup-directory-info nil + "*Alist of (FILE-REGEXP BACKUP-DIR OPTIONS ...)) +It has the same meaning like `bkup-backup-directory-info' from package +`backup-dir'. If a Tramp file is backed up, and BACKUP-DIR is a local +file name, the backup directory is prepended with Tramp file name prefix +\(multi-method, method, user, host\) of file. + +\(setq tramp-bkup-backup-directory-info bkup-backup-directory-info\) + +gives the same backup policy for Tramp files on their hosts like the +policy for local files." + :type '(repeat + (list (regexp :tag "File regexp") + (string :tag "Backup Dir") + (set :inline t + (const ok-create) + (const full-path) + (const prepend-name) + (const search-upward)))) + :group 'tramp))) + (defcustom tramp-auto-save-directory nil "*Put auto-save files in this directory, if set. The idea is to use a local directory so that auto-saving is faster." @@ -854,6 +911,16 @@ The answer will be provided by `tramp-action-terminal', which see." :group 'tramp :type 'regexp) +(defcustom tramp-process-alive-regexp + "" + "Regular expression indicating a process has finished. +In fact this expression is empty by intention, it will be used only to +check regularly the status of the associated process. +The answer will be provided by `tramp-action-process-alive' and +`tramp-action-out-of-band', which see." + :group 'tramp + :type 'regexp) + (defcustom tramp-temp-name-prefix "tramp." "*Prefix to use for temporary files. If this is a relative file name (such as \"tramp.\"), it is considered @@ -1080,7 +1147,7 @@ Also see `tramp-file-name-structure'." ;;;###autoload (defconst tramp-completion-file-name-regexp-unified - "^/[^/]*$" + "^/$\\|^/[^/:][^/]*$" "Value for `tramp-completion-file-name-regexp' for unified remoting. Emacs (not XEmacs) uses a unified filename syntax for Ange-FTP and Tramp. See `tramp-file-name-structure-unified' for more explanations.") @@ -1222,7 +1289,8 @@ but it might be slow on large directories." (tramp-wrong-passwd-regexp tramp-action-permission-denied) (tramp-yesno-prompt-regexp tramp-action-yesno) (tramp-yn-prompt-regexp tramp-action-yn) - (tramp-terminal-prompt-regexp tramp-action-terminal)) + (tramp-terminal-prompt-regexp tramp-action-terminal) + (tramp-process-alive-regexp tramp-action-process-alive)) "List of pattern/action pairs. Whenever a pattern matches, the corresponding action is performed. Each item looks like (PATTERN ACTION). @@ -1237,12 +1305,23 @@ corresponding PATTERN matches, the ACTION function is called." :group 'tramp :type '(repeat (list variable function))) +(defcustom tramp-actions-copy-out-of-band + '((tramp-password-prompt-regexp tramp-action-password) + (tramp-wrong-passwd-regexp tramp-action-permission-denied) + (tramp-process-alive-regexp tramp-action-out-of-band)) + "List of pattern/action pairs. +This list is used for copying/renaming with out-of-band methods. +See `tramp-actions-before-shell' for more info." + :group 'tramp + :type '(repeat (list variable function))) + (defcustom tramp-multi-actions '((tramp-password-prompt-regexp tramp-multi-action-password) (tramp-login-prompt-regexp tramp-multi-action-login) (shell-prompt-pattern tramp-multi-action-succeed) (tramp-shell-prompt-pattern tramp-multi-action-succeed) - (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied)) + (tramp-wrong-passwd-regexp tramp-multi-action-permission-denied) + (tramp-process-alive-regexp tramp-action-process-alive)) "List of pattern/action pairs. This list is used for each hop in multi-hop connections. See `tramp-actions-before-shell' for more info." @@ -1250,7 +1329,8 @@ See `tramp-actions-before-shell' for more info." :type '(repeat (list variable function))) (defcustom tramp-initial-commands - '("unset correct" + '("unset HISTORY" + "unset correct" "unset autocorrect") "List of commands to send to the first remote shell that we see. These commands will be sent to any shell, and thus they should be @@ -1326,7 +1406,8 @@ the visited file modtime.") (defvar tramp-md5-function (cond ((and (require 'md5) (fboundp 'md5)) 'md5) ((fboundp 'md5-encode) - (lambda (x) (base64-encode-string (md5-encode x)))) + (lambda (x) (base64-encode-string + (funcall (symbol-function 'md5-encode) x)))) (t (error "Coulnd't find an `md5' function"))) "Function to call for running the MD5 algorithm.") @@ -1464,7 +1545,7 @@ some systems don't, and for them we have this shell function.") ;; The device number is returned as "-1", because there will be a virtual ;; device number set in `tramp-handle-file-attributes' (defconst tramp-perl-file-attributes "\ -($f, $n) = @ARGV; +\($f, $n) = @ARGV; @s = lstat($f); if (($s[2] & 0170000) == 0120000) { $l = readlink($f); $l = \"\\\"$l\\\"\"; } elsif (($s[2] & 0170000) == 040000) { $l = \"t\"; } @@ -1628,6 +1709,14 @@ This is used to map a mode number to a permission string.") 'undecided-dos) "Some Emacsen know the `dos' coding system, others need `undecided-dos'.") +(defvar tramp-last-cmd nil + "Internal Tramp variable recording the last command sent. +This variable is buffer-local in every buffer.") +(make-variable-buffer-local 'tramp-last-cmd) + +(defvar tramp-process-echoes nil + "Whether to process echoes from the remote shell.") + (defvar tramp-last-cmd-time nil "Internal Tramp variable recording the time when the last cmd was sent. This variable is buffer-local in every buffer.") @@ -1638,7 +1727,8 @@ This variable is buffer-local in every buffer.") (defvar tramp-feature-write-region-fix (when (fboundp 'find-operation-coding-system) (let ((file-coding-system-alist '(("test" emacs-mule)))) - (find-operation-coding-system 'write-region 0 0 "" nil "test"))) + (funcall (symbol-function 'find-operation-coding-system) + 'write-region 0 0 "" nil "test"))) "Internal variable to say if `write-region' chooses the right coding. Older versions of Emacs chose the coding system for `write-region' based on the FILENAME argument, even if VISIT was a string.") @@ -1682,8 +1772,10 @@ on the FILENAME argument, even if VISIT was a string.") (insert-directory . tramp-handle-insert-directory) (expand-file-name . tramp-handle-expand-file-name) (file-local-copy . tramp-handle-file-local-copy) + (file-remote-p . tramp-handle-file-remote-p) (insert-file-contents . tramp-handle-insert-file-contents) (write-region . tramp-handle-write-region) + (find-backup-file-name . tramp-handle-find-backup-file-name) (unhandled-file-name-directory . tramp-handle-unhandled-file-name-directory) (dired-compress-file . tramp-handle-dired-compress-file) (dired-call-process . tramp-handle-dired-call-process) @@ -1756,8 +1848,8 @@ remaining args passed to `tramp-message'." Calls `line-end-position' or `point-at-eol' if defined, else own implementation." (cond - ((fboundp 'line-end-position) (funcall 'line-end-position)) - ((fboundp 'point-at-eol) (funcall 'point-at-eol)) + ((fboundp 'line-end-position) (funcall (symbol-function 'line-end-position))) + ((fboundp 'point-at-eol) (funcall (symbol-function 'point-at-eol))) (t (save-excursion (end-of-line) (point))))) (defmacro with-parsed-tramp-file-name (filename var &rest body) @@ -1790,6 +1882,18 @@ If VAR is nil, then we bind `v' to the structure and `multi-method', ,@body)) (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) +;; To be activated for debugging containing this macro +(def-edebug-spec with-parsed-tramp-file-name t) + +(defmacro tramp-let-maybe (variable value &rest body) + "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. +BODY is executed whether or not the variable is obsolete. +The intent is to protect against `obsolete variable' warnings." + `(if (get ',variable 'byte-obsolete-variable) + (progn ,@body) + (let ((,variable ,value)) + ,@body))) +(put 'tramp-let-maybe 'lisp-indent-function 2) ;;; Config Manipulation Functions: @@ -1953,8 +2057,8 @@ target of the symlink differ." "Like `file-truename' for tramp files." (with-parsed-tramp-file-name filename nil (let* ((steps (tramp-split-string localname "/")) - (localnamedir (let ((directory-sep-char ?/)) - (file-name-as-directory localname))) + (localnamedir (tramp-let-maybe directory-sep-char ?/ ;for XEmacs + (file-name-as-directory localname))) (is-dir (string= localname localnamedir)) (thisstep nil) (numchase 0) @@ -2711,7 +2815,7 @@ and `rename'. FILENAME and NEWNAME must be absolute file names." ;; matter which filename handlers are used for the ;; source and target file. (t - (tramp-do-copy-or-rename-via-buffer + (tramp-do-copy-or-rename-file-via-buffer op filename newname keep-date)))) ;; One file is a Tramp file, the other one is local. @@ -2727,14 +2831,14 @@ and `rename'. FILENAME and NEWNAME must be absolute file names." (tramp-do-copy-or-rename-file-out-of-band op filename newname keep-date) ;; Use the generic method via a Tramp buffer. - (tramp-do-copy-or-rename-via-buffer op filename newname keep-date))) + (tramp-do-copy-or-rename-file-via-buffer + op filename newname keep-date))) (t ;; One of them must be a Tramp file. (error "Tramp implementation says this cannot happen"))))) -;; CCC: implement keep-date if possible -- via touch? -(defun tramp-do-copy-or-rename-via-buffer (op filename newname keep-date) +(defun tramp-do-copy-or-rename-file-via-buffer (op filename newname keep-date) "Use an Emacs buffer to copy or rename a file. First arg OP is either `copy' or `rename' and indicates the operation. FILENAME is the source file, NEWNAME the target file. @@ -2754,10 +2858,11 @@ KEEP-DATE is non-nil if NEWNAME should have the same timestamp as FILENAME." (jka-compr-inhibit t)) (write-region (point-min) (point-max) newname)) ;; KEEP-DATE handling. - (when (and keep-date - (not (null modtime)) - (not (equal modtime '(0 0)))) - (tramp-touch newname modtime))) + (when keep-date + (when (and (not (null modtime)) + (not (equal modtime '(0 0)))) + (tramp-touch newname modtime)) + (set-file-modes newname (file-modes filename)))) ;; If the operation was `rename', delete the original file. (unless (eq op 'copy) (delete-file filename)))) @@ -2791,12 +2896,12 @@ If KEEP-DATE is non-nil, preserve the time stamp when copying." "Invoke rcp program to copy. One of FILENAME and NEWNAME must be a Tramp name, the other must be a local filename. The method used must be an out-of-band method." - (let ((trampbuf (get-buffer-create "*tramp output*")) - (t1 (tramp-tramp-file-p filename)) + (let ((t1 (tramp-tramp-file-p filename)) (t2 (tramp-tramp-file-p newname)) v1-multi-method v1-method v1-user v1-host v1-localname v2-multi-method v2-method v2-user v2-host v2-localname - method copy-program copy-args source target) + multi-method method user host copy-program copy-args + source target trampbuf) ;; Check which ones of source and target are Tramp files. ;; We cannot invoke `with-parsed-tramp-file-name'; @@ -2808,8 +2913,11 @@ be a local filename. The method used must be an out-of-band method." v1-user l-user v1-host l-host v1-localname l-localname + multi-method l-multi-method method (tramp-find-method v1-multi-method v1-method v1-user v1-host) + user l-user + host l-host copy-program (tramp-get-method-parameter v1-multi-method method v1-user v1-host 'tramp-copy-program) @@ -2825,8 +2933,11 @@ be a local filename. The method used must be an out-of-band method." v2-user l-user v2-host l-host v2-localname l-localname + multi-method l-multi-method method (tramp-find-method v2-multi-method v2-method v2-user v2-host) + user l-user + host l-host copy-program (tramp-get-method-parameter v2-multi-method method v2-user v2-host 'tramp-copy-program) @@ -2871,24 +2982,29 @@ be a local filename. The method used must be an out-of-band method." v2-user v2-host 'tramp-copy-keep-date-arg) copy-args)))) - (setq copy-args (append copy-args (list source target))) + (setq copy-args (append copy-args (list source target)) + trampbuf (generate-new-buffer + (tramp-buffer-name multi-method method user host))) - ;; Use rcp-like program for file transfer. - (tramp-message - 5 "Transferring %s to file %s..." filename newname) - (save-excursion (set-buffer trampbuf) (erase-buffer)) - (unless (equal - 0 - (apply #'call-process copy-program - nil trampbuf nil copy-args)) - (pop-to-buffer trampbuf) - (error - (concat - "tramp-do-copy-or-rename-file-out-of-band: `%s' didn't work, " - "see buffer `%s' for details") - copy-program trampbuf)) - (tramp-message - 5 "Transferring %s to file %s...done" filename newname) + ;; Use an asynchronous process. By this, password can be handled. + (save-excursion + (set-buffer trampbuf) + (setq tramp-current-multi-method multi-method + tramp-current-method method + tramp-current-user user + tramp-current-host host) + (tramp-message + 5 "Transferring %s to file %s..." filename newname) + + ;; Use rcp-like program for file transfer. + (let ((p (apply 'start-process (buffer-name trampbuf) trampbuf + copy-program copy-args))) + (tramp-set-process-query-on-exit-flag p nil) + (tramp-process-actions p multi-method method user host + tramp-actions-copy-out-of-band)) + (kill-buffer trampbuf) + (tramp-message + 5 "Transferring %s to file %s...done" filename newname)) ;; If the operation was `rename', delete the original file. (unless (eq op 'copy) @@ -3012,7 +3128,8 @@ This is like `dired-recursive-delete-directory' for tramp files." multi-method method user host (concat (nth 2 suffix) " " localname))) (message "Uncompressing %s...done" file) - (dired-remove-file file) + ;; `dired-remove-file' is not defined in XEmacs + (funcall (symbol-function 'dired-remove-file) file) (string-match (car suffix) file) (concat (substring file 0 (match-beginning 0))))) (t @@ -3023,7 +3140,8 @@ This is like `dired-recursive-delete-directory' for tramp files." multi-method method user host (concat "gzip -f " localname))) (message "Compressing %s...done" file) - (dired-remove-file file) + ;; `dired-remove-file' is not defined in XEmacs + (funcall (symbol-function 'dired-remove-file) file) (cond ((file-exists-p (concat file ".gz")) (concat file ".gz")) ((file-exists-p (concat file ".z")) @@ -3091,12 +3209,10 @@ This is like `dired-recursive-delete-directory' for tramp files." (format "%s %s %s" (tramp-get-ls-command multi-method method user host) switches - (if full-directory-p - ;; Add "/." to make sure we got complete dir - ;; listing for symlinks, too. - (concat (file-name-as-directory - (file-name-nondirectory localname)) ".") - (file-name-nondirectory localname))))) + (if wildcard + localname + (tramp-shell-quote-argument + (file-name-nondirectory localname)))))) (sit-for 1) ;needed for rsh but not ssh? (tramp-wait-for-output)) ;; The following let-binding is used by code that's commented @@ -3196,7 +3312,7 @@ the result will be a local, non-Tramp, filename." ;; expand-file-name (this does "/./" and "/../"). We bind ;; directory-sep-char here for XEmacs on Windows, which ;; would otherwise use backslash. - (let ((directory-sep-char ?/)) + (tramp-let-maybe directory-sep-char ?/ (tramp-make-tramp-file-name multi-method (or method (tramp-find-default-method user host)) user host @@ -3361,7 +3477,6 @@ This will break if COMMAND prints a newline, followed by the value of filename)) (setq tmpfil (tramp-make-temp-file)) - (cond ((tramp-method-out-of-band-p multi-method method user host) ;; `copy-file' handles out-of-band methods (copy-file filename tmpfil t t)) @@ -3418,11 +3533,16 @@ This will break if COMMAND prints a newline, followed by the value of (delete-file tmpfil2))) (tramp-message-for-buffer multi-method method user host - 5 "Decoding remote file %s...done" filename))) + 5 "Decoding remote file %s...done" filename) + ;; Set proper permissions. + (set-file-modes tmpfil (file-modes filename)))) (t (error "Wrong method specification for `%s'" method))) tmpfil))) +(defun tramp-handle-file-remote-p (filename) + "Like `file-remote-p' for tramp files." + (when (tramp-tramp-file-p filename) t)) (defun tramp-handle-insert-file-contents (filename &optional visit beg end replace) @@ -3470,6 +3590,49 @@ This will break if COMMAND prints a newline, followed by the value of (list (expand-file-name filename) (second result)))))) + +(defun tramp-handle-find-backup-file-name (filename) + "Like `find-backup-file-name' for tramp files." + + (if (or (and (not (featurep 'xemacs)) + (not (boundp 'tramp-backup-directory-alist))) + (and (featurep 'xemacs) + (not (boundp 'tramp-bkup-backup-directory-info)))) + + ;; No tramp backup directory alist defined, or nil + (tramp-run-real-handler 'find-backup-file-name (list filename)) + + (with-parsed-tramp-file-name filename nil + (let* ((backup-var + (copy-tree + (if (featurep 'xemacs) + ;; XEmacs case + (symbol-value 'tramp-bkup-backup-directory-info) + ;; Emacs case + (symbol-value 'tramp-backup-directory-alist)))) + + ;; We set both variables. It doesn't matter whether it is + ;; Emacs or XEmacs + (backup-directory-alist backup-var) + (bkup-backup-directory-info backup-var)) + + (mapcar + '(lambda (x) + (let ((dir (if (consp (cdr x)) (car (cdr x)) (cdr x)))) + (when (and (stringp dir) + (file-name-absolute-p dir) + (not (tramp-file-name-p dir))) + ;; Prepend absolute directory names with tramp prefix + (if (consp (cdr x)) + (setcar (cdr x) + (tramp-make-tramp-file-name + multi-method method user host dir)) + (setcdr x (tramp-make-tramp-file-name + multi-method method user host dir)))))) + backup-var) + + (tramp-run-real-handler 'find-backup-file-name (list filename)))))) + ;; CCC grok APPEND, LOCKNAME, CONFIRM (defun tramp-handle-write-region (start end filename &optional append visit lockname confirm) @@ -3499,6 +3662,7 @@ This will break if COMMAND prints a newline, followed by the value of (loc-enc (tramp-get-local-encoding multi-method method user host)) (loc-dec (tramp-get-local-decoding multi-method method user host)) (trampbuf (get-buffer-create "*tramp output*")) + (modes (file-modes filename)) ;; We use this to save the value of `last-coding-system-used' ;; after writing the tmp file. At the end of the function, ;; we set `last-coding-system-used' to this saved value. @@ -3519,6 +3683,11 @@ This will break if COMMAND prints a newline, followed by the value of (if confirm ; don't pass this arg unless defined for backward compat. (list start end tmpfil append 'no-message lockname confirm) (list start end tmpfil append 'no-message lockname))) + ;; The permissions of the temporary file should be set. If + ;; filename does not exist (eq modes nil) it has been renamed to + ;; the backup file. This case `save-buffer' handles + ;; permissions. + (when modes (set-file-modes tmpfil modes)) ;; Now, `last-coding-system-used' has the right value. Remember it. (when (boundp 'last-coding-system-used) (setq coding-system-used last-coding-system-used)) @@ -3694,10 +3863,10 @@ pass to the OPERATION." ;; We handle here all file primitives. Most of them have the file ;; name as first parameter; nevertheless we check for them explicitly -;; in order to be be signalled if a new primitive appears. This +;; in order to be signalled if a new primitive appears. This ;; scenario is needed because there isn't a way to decide by ;; syntactical means whether a foreign method must be called. It would -;; ease the live if `file-name-handler-alist' would support a decision +;; ease the life if `file-name-handler-alist' would support a decision ;; function as well but regexp only. (defun tramp-file-name-for-operation (operation &rest args) "Return file name related to OPERATION file primitive. @@ -3711,16 +3880,16 @@ ARGS are the arguments OPERATION has been called with." 'dired-compress-file 'dired-uncache 'file-accessible-directory-p 'file-attributes 'file-directory-p 'file-executable-p 'file-exists-p - 'file-local-copy 'file-modes 'file-name-as-directory - 'file-name-directory 'file-name-nondirectory - 'file-name-sans-versions 'file-ownership-preserved-p - 'file-readable-p 'file-regular-p 'file-symlink-p - 'file-truename 'file-writable-p 'find-backup-file-name - 'find-file-noselect 'get-file-buffer 'insert-directory - 'insert-file-contents 'load 'make-directory - 'make-directory-internal 'set-file-modes - 'substitute-in-file-name 'unhandled-file-name-directory - 'vc-registered + 'file-local-copy 'file-remote-p 'file-modes + 'file-name-as-directory 'file-name-directory + 'file-name-nondirectory 'file-name-sans-versions + 'file-ownership-preserved-p 'file-readable-p + 'file-regular-p 'file-symlink-p 'file-truename + 'file-writable-p 'find-backup-file-name 'find-file-noselect + 'get-file-buffer 'insert-directory 'insert-file-contents + 'load 'make-directory 'make-directory-internal + 'set-file-modes 'substitute-in-file-name + 'unhandled-file-name-directory 'vc-registered ; XEmacs only 'abbreviate-file-name 'create-file-buffer 'dired-file-modtime 'dired-make-compressed-filename @@ -3789,9 +3958,6 @@ Falls back to normal file name handler if no tramp file name handler exists." (foreign (apply foreign operation args)) (t (tramp-run-real-handler operation args)))))) -;;;###autoload -(put 'tramp-file-name-handler 'file-remote-p t) ;for file-remote-p - (defun tramp-sh-file-name-handler (operation &rest args) "Invoke remote-shell Tramp file name handler. Fall back to normal file name handler if no Tramp handler exists." @@ -3885,7 +4051,7 @@ necessary anymore." (list (tramp-handle-expand-file-name name)))))) ;; Check for complete.el and override PC-expand-many-files if appropriate. -(eval-when-compile +(eval-and-compile (defun tramp-save-PC-expand-many-files (name))); avoid compiler warning (defun tramp-setup-complete () @@ -3936,11 +4102,14 @@ necessary anymore." (and (featurep 'xemacs) (not (event-modifiers last-input-event)) (or (char-equal - (funcall 'event-to-character last-input-event) ?\?) + (funcall (symbol-function 'event-to-character) + last-input-event) ?\?) (char-equal - (funcall 'event-to-character last-input-event) ?\t) + (funcall (symbol-function 'event-to-character) + last-input-event) ?\t) (char-equal - (funcall 'event-to-character last-input-event) ?\ )))) + (funcall (symbol-function 'event-to-character) + last-input-event) ?\ )))) t))) (defun tramp-completion-handle-file-exists-p (filename) @@ -4478,17 +4647,24 @@ hosts, or files, disagree." "Set the last-modified timestamp of the given file. TIME is an Emacs internal time value as returned by `current-time'." (let ((touch-time (format-time-string "%Y%m%d%H%M.%S" time))) - (with-parsed-tramp-file-name file nil - (let ((buf (tramp-get-buffer multi-method method user host))) - (unless (zerop (tramp-send-command-and-check - multi-method method user host - (format "touch -t %s %s" - touch-time - localname))) - (pop-to-buffer buf) - (error "tramp-touch: touch failed, see buffer `%s' for details" - buf)))))) - + (if (tramp-tramp-file-p file) + (with-parsed-tramp-file-name file nil + (let ((buf (tramp-get-buffer multi-method method user host))) + (unless (zerop (tramp-send-command-and-check + multi-method method user host + (format "touch -t %s %s" + touch-time + localname))) + (pop-to-buffer buf) + (error "tramp-touch: touch failed, see buffer `%s' for details" + buf)))) + ;; It's a local file + (with-temp-buffer + (unless (zerop (call-process + "touch" nil (current-buffer) nil "-t" touch-time file)) + (pop-to-buffer (current-buffer)) + (error "tramp-touch: touch failed")))))) + (defun tramp-buffer-name (multi-method method user host) "A name for the connection buffer for USER at HOST using METHOD." (if multi-method @@ -4726,16 +4902,16 @@ otherwise." "Checks whether the given `ls' executable in one of the dirs groks `-n'. Returns nil if none was found, else the command is returned." (let ((dl dirlist) - (result nil) - (directory-sep-char ?/)) ;for XEmacs - ;; It would be better to use the CL function `find', but - ;; we don't want run-time dependencies on CL. - (while (and dl (not result)) - (let ((x (concat (file-name-as-directory (car dl)) cmd))) - (when (tramp-check-ls-command multi-method method user host x) - (setq result x))) - (setq dl (cdr dl))) - result)) + (result nil)) + (tramp-let-maybe directory-sep-char ?/ ;for XEmacs + ;; It would be better to use the CL function `find', but + ;; we don't want run-time dependencies on CL. + (while (and dl (not result)) + (let ((x (concat (file-name-as-directory (car dl)) cmd))) + (when (tramp-check-ls-command multi-method method user host x) + (setq result x))) + (setq dl (cdr dl))) + result))) (defun tramp-find-ls-command (multi-method method user host) "Finds an `ls' command which groks the `-n' option, returning nil if failed. @@ -4815,6 +4991,24 @@ The terminal type can be configured with `tramp-terminal-type'." (process-send-string nil (concat tramp-terminal-type tramp-rsh-end-of-line))) +(defun tramp-action-process-alive (p multi-method method user host) + "Check whether a process has finished." + (unless (memq (process-status p) '(run open)) + (throw 'tramp-action 'process-died))) + +(defun tramp-action-out-of-band (p multi-method method user host) + "Check whether an out-of-band copy has finished." + (cond ((and (memq (process-status p) '(stop exit)) + (zerop (process-exit-status p))) + (tramp-message 9 "Process has finished.") + (throw 'tramp-action 'ok)) + ((or (and (memq (process-status p) '(stop exit)) + (not (zerop (process-exit-status p)))) + (memq (process-status p) '(signal))) + (tramp-message 9 "Process has died.") + (throw 'tramp-action 'process-died)) + (t nil))) + ;; The following functions are specifically for multi connections. (defun tramp-multi-action-login (p method user host) @@ -4931,7 +5125,7 @@ The terminal type can be configured with `tramp-terminal-type'." (erase-buffer) (tramp-message 10 "Sending command to remote shell: %s" cmd) - (tramp-send-command multi-method method user host cmd) + (tramp-send-command multi-method method user host cmd nil t) (tramp-barf-if-no-shell-prompt p 60 "Remote shell command failed: %s" cmd)) (erase-buffer))) @@ -4991,7 +5185,7 @@ Maybe the different regular expressions need to be tuned. user host 'tramp-login-args))) (found nil) (pw nil)) - (process-kill-without-query p) + (tramp-set-process-query-on-exit-flag p nil) (set-buffer (tramp-get-buffer multi-method method user host)) (erase-buffer) (tramp-process-actions p multi-method method user host @@ -5014,12 +5208,6 @@ Recognition of the remote shell prompt is based on the variables `shell-prompt-pattern' and `tramp-shell-prompt-pattern' which must be set up correctly. -Please note that it is NOT possible to use this connection method with -an out-of-band transfer method if this function asks the user for a -password! You must use an inline transfer method in this case. -Sadly, the transfer method cannot be switched on the fly, instead you -must specify the right method in the file name. - Kludgy feature: if HOST has the form \"xx#yy\", then yy is assumed to be a port number for ssh, and \"-p yy\" will be added to the list of arguments, and xx will be used as the host name to connect to. @@ -5064,7 +5252,7 @@ arguments, and xx will be used as the host name to connect to. (apply #'start-process bufnam buf login-program host login-args))) (found nil)) - (process-kill-without-query p) + (tramp-set-process-query-on-exit-flag p nil) (set-buffer buf) (tramp-process-actions p multi-method method user host @@ -5125,7 +5313,7 @@ prompt than you do, so it is not at all unlikely that the variable user host 'tramp-login-args)))) (found nil) (pw nil)) - (process-kill-without-query p) + (tramp-set-process-query-on-exit-flag p nil) (set-buffer (tramp-get-buffer multi-method method user host)) (tramp-process-actions p multi-method method user host tramp-actions-before-shell) @@ -5178,7 +5366,7 @@ log in as u2 to h2." tramp-multi-sh-program)) (num-hops (length method)) (i 0)) - (process-kill-without-query p) + (tramp-set-process-query-on-exit-flag p nil) (tramp-message 9 "Waiting 60s for local shell to come up...") (unless (tramp-wait-for-regexp p 60 (format "\\(%s\\)\\'\\|\\(%s\\)\\'" @@ -5298,12 +5486,16 @@ nil." (with-timeout (timeout) (while (not found) (accept-process-output proc 1) + (unless (memq (process-status proc) '(run open)) + (error "Process has died")) (goto-char (point-min)) (setq found (when (re-search-forward regexp nil t) (tramp-match-string-list))))))) (t (while (not found) (accept-process-output proc 1) + (unless (memq (process-status proc) '(run open)) + (error "Process has died")) (goto-char (point-min)) (setq found (when (re-search-forward regexp nil t) (tramp-match-string-list)))))) @@ -5358,7 +5550,7 @@ Uses PROMPT as a prompt and sends the password to process P." ;; HHH: Not Changed. This might handle the case where USER is not ;; given in the "File name" very poorly. Then, the local -;; variable tramp-current user will be set to nil. +;; variable tramp-current-user will be set to nil. (defun tramp-pre-connection (multi-method method user host) "Do some setup before actually logging in. METHOD, USER and HOST specify the connection." @@ -5412,6 +5604,10 @@ to set up. METHOD, USER and HOST specify the connection." (tramp-send-command-internal multi-method method user host "stty -inlcr -echo kill '^U'") (erase-buffer) + ;; Ignore garbage after stty command. + (tramp-send-command-internal multi-method method user host + "echo foo") + (erase-buffer) (tramp-send-command-internal multi-method method user host "TERM=dumb; export TERM") ;; Try to set up the coding system correctly. @@ -5449,9 +5645,10 @@ to set up. METHOD, USER and HOST specify the connection." "stty -onlcr")))) (erase-buffer) (tramp-message - 9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1'") - (tramp-send-command-internal multi-method method user host - "HISTFILE=$HOME/.tramp_history; HISTSIZE=1") + 9 "Waiting 30s for `HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE'") + (tramp-send-command-internal + multi-method method user host + "HISTFILE=$HOME/.tramp_history; HISTSIZE=1; export HISTFILE; export HISTSIZE") (erase-buffer) (tramp-message 9 "Waiting 30s for `set +o vi +o emacs'") (tramp-send-command-internal multi-method method user host @@ -5858,6 +6055,7 @@ connection. This is meant to be used from (or neveropen (tramp-maybe-open-connection multi-method method user host)) (setq tramp-last-cmd-time (current-time)) + (setq tramp-last-cmd command) (when tramp-debug-buffer (save-excursion (set-buffer (tramp-get-debug-buffer multi-method method user host)) @@ -5886,6 +6084,7 @@ Sends COMMAND, then waits 30 seconds for shell prompt." (let ((proc (get-buffer-process (current-buffer))) (found nil) (start-time (current-time)) + (start-point (point)) (end-of-output (concat "^" (regexp-quote tramp-end-of-output) "\r?$"))) @@ -5905,12 +6104,16 @@ Sends COMMAND, then waits 30 seconds for shell prompt." (with-timeout (timeout) (while (not found) (accept-process-output proc 1) + (unless (memq (process-status proc) '(run open)) + (error "Process has died")) (goto-char (point-max)) (forward-line -1) (setq found (looking-at end-of-output)))))) (t (while (not found) (accept-process-output proc 1) + (unless (memq (process-status proc) '(run open)) + (error "Process has died")) (goto-char (point-max)) (forward-line -1) (setq found (looking-at end-of-output)))))) @@ -5920,6 +6123,12 @@ Sends COMMAND, then waits 30 seconds for shell prompt." (goto-char (point-max)) (forward-line -2) (delete-region (point) (point-max))) + ;; If processing echoes, look for it in the first line and delete. + (when tramp-process-echoes + (save-excursion + (goto-char start-point) + (when (looking-at (regexp-quote tramp-last-cmd)) + (delete-region (point) (forward-line 1))))) ;; Add output to debug buffer if appropriate. (when tramp-debug-buffer (append-to-buffer @@ -6325,9 +6534,7 @@ If both MULTI-METHOD and METHOD are nil, do a lookup in (format "%s:%s" host localname))) (defun tramp-method-out-of-band-p (multi-method method user host) - "Return t if this is an out-of-band method, nil otherwise. -It is important to check for this condition, since it is not possible -to enter a password for the `tramp-copy-program'." + "Return t if this is an out-of-band method, nil otherwise." (tramp-get-method-parameter multi-method (tramp-find-method multi-method method user host) @@ -6502,7 +6709,10 @@ Invokes `password-read' if available, `read-passwd' else." (if (functionp 'password-read) (let* ((user (or tramp-current-user (user-login-name))) (host (or tramp-current-host (system-name))) - (key (concat user "@" host)) + (key (if (and (stringp user) (stringp host)) + (concat user "@" host) + (concat "[" (mapconcat 'identity user "/") "]@[" + (mapconcat 'identity host "/") "]"))) (password (apply #'password-read (list prompt key)))) (apply #'password-cache-add (list key password)) password) @@ -6581,6 +6791,16 @@ If you want to use it for something else, you'll have to check whether it does the right thing." (delete "" (split-string string pattern))) +(defun tramp-set-process-query-on-exit-flag (process flag) + "Specify if query is needed for process when Emacs is exited. +If the second argument flag is non-nil, Emacs will query the user before +exiting if process is running." + (if (fboundp 'set-process-query-on-exit-flag) + (set-process-query-on-exit-flag process flag) + (funcall (symbol-function 'process-kill-without-query) + process flag))) + + ;; ------------------------------------------------------------ ;; -- Kludges section -- ;; ------------------------------------------------------------ @@ -6714,6 +6934,8 @@ Only works for Bourne-like shells." tramp-wrong-passwd-regexp tramp-yesno-prompt-regexp tramp-yn-prompt-regexp + tramp-terminal-prompt-regexp + tramp-out-of-band-prompt-regexp tramp-temp-name-prefix tramp-file-name-structure tramp-file-name-regexp @@ -6725,10 +6947,15 @@ Only works for Bourne-like shells." tramp-end-of-output tramp-coding-commands tramp-actions-before-shell + tramp-actions-copy-out-of-band tramp-multi-actions tramp-terminal-type tramp-shell-prompt-pattern tramp-chunksize + ,(when (boundp 'tramp-backup-directory-alist) + 'tramp-backup-directory-alist) + ,(when (boundp 'tramp-bkup-backup-directory-info) + 'tramp-bkup-backup-directory-info) ;; Non-tramp variables of interest shell-prompt-pattern @@ -6737,6 +6964,14 @@ Only works for Bourne-like shells." backup-by-copying-when-mismatch ,(when (boundp 'backup-by-copying-when-privileged-mismatch) 'backup-by-copying-when-privileged-mismatch) + ,(when (boundp 'password-cache) + 'password-cache) + ,(when (boundp 'password-cache-expiry) + 'password-cache-expiry) + ,(when (boundp 'backup-directory-alist) + 'backup-directory-alist) + ,(when (boundp 'bkup-backup-directory-info) + 'bkup-backup-directory-info) file-name-handler-alist) nil ; pre-hook nil ; post-hook @@ -6799,7 +7034,6 @@ report. ;; * Rewrite `tramp-shell-quote-argument' to abstain from using ;; `shell-quote-argument'. ;; * Completion gets confused when you leave out the method name. -;; * Support `dired-compress-file' filename handler. ;; * In Emacs 21, `insert-directory' shows total number of bytes used ;; by the files in that directory. Add this here. ;; * Avoid screen blanking when hitting `g' in dired. (Eli Tziperman) @@ -6820,19 +7054,12 @@ report. ;; if it does show files when run locally. ;; * Allow correction of passwords, if the remote end allows this. ;; (Mark Hershberger) -;; * Make sure permissions of tmp file are good. -;; (Nelson Minar <nelson@media.mit.edu>) -;; * Grok passwd prompts with scp? (David Winter -;; <winter@nevis1.nevis.columbia.edu>). Maybe just do `ssh -l user -;; host', then wait a while for the passwd or passphrase prompt. If -;; there is one, remember the passwd/phrase. ;; * How to deal with MULE in `insert-file-contents' and `write-region'? ;; * Do asynchronous `shell-command's. ;; * Grok `append' parameter for `write-region'. ;; * Test remote ksh or bash for tilde expansion in `tramp-find-shell'? ;; * abbreviate-file-name ;; * grok ~ in tramp-remote-path (Henrik Holm <henrikh@tele.ntnu.no>) -;; * `C' in dired gives error `not tramp file name'. ;; * Also allow to omit user names when doing multi-hop. Not sure yet ;; what the user names should default to, though. ;; * better error checking. At least whenever we see something @@ -6848,9 +7075,7 @@ report. ;; (Francesco Potort,Al(B) ;; * Should we set PATH ourselves or should we rely on the remote end ;; to do it? -;; * Do the autoconf thing. ;; * Make it work for XEmacs 20, which is missing `with-timeout'. -;; * Allow non-Unix remote systems. (More a long-term thing.) ;; * Make it work for different encodings, and for different file name ;; encodings, too. (Daniel Pittman) ;; * Change applicable functions to pass a struct tramp-file-name rather @@ -6865,13 +7090,6 @@ report. ;; * When editing a remote CVS controlled file as a different user, VC ;; gets confused about the file locking status. Try to find out why ;; the workaround doesn't work. -;; * When user is running ssh-agent, it would be useful to add the -;; passwords typed by the user to that agent. This way, the next time -;; round, the users don't have to type all this in again. -;; This would be especially useful for start-process, I think. -;; An easy way to implement start-process is to open a second shell -;; connection which is inconvenient if the user has to reenter -;; passwords. ;; * Change `copy-file' to grok the case where the filename handler ;; for the source and the target file are different. Right now, ;; it looks at the source file and then calls that handler, if @@ -6895,17 +7113,10 @@ report. ;; Functions for file-name-handler-alist: ;; diff-latest-backup-file -- in diff.el -;; dired-compress-file ;; dired-uncache -- this will be needed when we do insert-directory caching ;; file-name-as-directory -- use primitive? -;; file-name-directory -- use primitive? -;; file-name-nondirectory -- use primitive? ;; file-name-sans-versions -- use primitive? -;; file-newer-than-file-p -;; find-backup-file-name ;; get-file-buffer -- use primitive -;; load -;; unhandled-file-name-directory ;; vc-registered ;;; arch-tag: 3a21a994-182b-48fa-b0cd-c1d9fede424a diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 924cf0ed8c4..22713f87a96 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el @@ -356,7 +356,7 @@ in strings will not confuse Emacs.") "Find a comment start between point and LIMIT. Moves point to inside the comment and returns the position of the comment-starter. If no comment is found, moves point to LIMIT -and raises an error or returns nil of NOERROR is non-nil." +and raises an error or returns nil if NOERROR is non-nil." (if (not comment-use-syntax) (if (re-search-forward comment-start-skip limit noerror) (or (match-end 1) (match-beginning 0)) @@ -392,7 +392,7 @@ and raises an error or returns nil of NOERROR is non-nil." "Find a comment start between LIMIT and point. Moves point to inside the comment and returns the position of the comment-starter. If no comment is found, moves point to LIMIT -and raises an error or returns nil of NOERROR is non-nil." +and raises an error or returns nil if NOERROR is non-nil." ;; FIXME: If a comment-start appears inside a comment, we may erroneously ;; stop there. This can be rather bad in general, but since ;; comment-search-backward is only used to find the comment-column (in @@ -873,17 +873,17 @@ indentation to be kept as it was before narrowing." (setq ,bindent (- ,bindent n))))))))))) (defun comment-region-internal (beg end cs ce - &optional ccs cce block lines indent) + &optional ccs cce block lines indent) "Comment region BEG .. END. -CS and CE are the comment start resp end string. -CCS and CCE are the comment continuation strings for the start resp end -of lines (default to CS and CE). -BLOCK indicates that end of lines should be marked with either CCE, CE or CS -\(if CE is empty) and that those markers should be aligned. -LINES indicates that an extra lines will be used at the beginning and end -of the region for CE and CS. -INDENT indicates to put CS and CCS at the current indentation of the region -rather than at left margin." +CS and CE are the comment start string and comment end string, +respectively. CCS and CCE are the comment continuation strings +for the start and end of lines, respectively (default to CS and CE). +BLOCK indicates that end of lines should be marked with either CCE, +CE or CS \(if CE is empty) and that those markers should be aligned. +LINES indicates that an extra lines will be used at the beginning +and end of the region for CE and CS. +INDENT indicates to put CS and CCS at the current indentation of +the region rather than at left margin." ;;(assert (< beg end)) (let ((no-empty (not (or (eq comment-empty-lines t) (and comment-empty-lines (zerop (length ce))))))) @@ -955,7 +955,7 @@ rather than at left margin." (defun comment-region (beg end &optional arg) "Comment or uncomment each line in the region. With just \\[universal-argument] prefix arg, uncomment each line in region BEG .. END. -Numeric prefix arg ARG means use ARG comment characters. +Numeric prefix ARG means use ARG comment characters. If ARG is negative, delete that many comment characters instead. By default, comments start at the left margin, are terminated on each line, even for syntax in which newline does not end the comment and blank lines diff --git a/lisp/outline.el b/lisp/outline.el index 59aeb233fdd..0f7d3b627b0 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -216,6 +216,9 @@ in the file it applies to." (defvar outline-mode-hook nil "*This hook is run when outline mode starts.") +(defvar outline-blank-line nil + "*Non-nil means to leave unhidden blank line before heading.") + ;;;###autoload (define-derived-mode outline-mode text-mode "Outline" "Set major mode for editing outlines with selective display. @@ -349,7 +352,7 @@ at the end of the buffer." (if (re-search-forward (concat "\n\\(?:" outline-regexp "\\)") nil 'move) (goto-char (match-beginning 0))) - (if (and (bolp) (not (bobp))) + (if (and (bolp) (or outline-blank-line (eobp)) (not (bobp))) (forward-char -1))) (defun outline-next-heading () @@ -706,8 +709,8 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." "Hide the body directly following this heading." (interactive) (outline-back-to-heading) - (outline-end-of-heading) (save-excursion + (outline-end-of-heading) (outline-flag-region (point) (progn (outline-next-preface) (point)) t))) (defun show-entry () @@ -770,9 +773,10 @@ Show the heading too, if it is currently invisible." (defun outline-show-heading () "Show the current heading and move to its end." (outline-flag-region (- (point) - (if (bobp) 0 - (if (eq (char-before (1- (point))) ?\n) - 2 1))) + (if (bobp) 0 + (if (and outline-blank-line + (eq (char-before (1- (point))) ?\n)) + 2 1))) (progn (outline-end-of-heading) (point)) nil)) @@ -841,9 +845,9 @@ Show the heading too, if it is currently invisible." (progn ;; Go to end of line before heading (forward-char -1) - (if (bolp) - ;; leave blank line before heading - (forward-char -1)))))) + (if (and outline-blank-line (bolp)) + ;; leave blank line before heading + (forward-char -1)))))) (defun show-branches () "Show all subheadings of this heading, but not their bodies." @@ -884,6 +888,8 @@ Default is enough to cause the following heading to appear." With argument, move up ARG levels. If INVISIBLE-OK is non-nil, also consider invisible lines." (interactive "p") + (and (eq this-command 'outline-up-heading) + (or (eq last-command 'outline-up-heading) (push-mark))) (outline-back-to-heading invisible-ok) (let ((start-level (funcall outline-level))) (if (eq start-level 1) diff --git a/lisp/paren.el b/lisp/paren.el index ab3efe10ba5..6c5f9dece99 100644 --- a/lisp/paren.el +++ b/lisp/paren.el @@ -91,6 +91,9 @@ otherwise)." :group 'faces :group 'paren-showing) +(defvar show-paren-highlight-openparen t + "*Non-nil turns on openparen highlighting when matching forward.") + (defvar show-paren-idle-timer nil) ;;;###autoload @@ -195,7 +198,7 @@ in `show-paren-style' after `show-paren-delay' seconds of Emacs idle time." ;; If matching forward, and the openparen is unbalanced, ;; highlight the paren at point to indicate misbalance. ;; Otherwise, turn off any such highlighting. - (if (and (= dir 1) (integerp pos)) + (if (and (not show-paren-highlight-openparen) (= dir 1) (integerp pos)) (when (and show-paren-overlay-1 (overlay-buffer show-paren-overlay-1)) (delete-overlay show-paren-overlay-1)) diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el index 213b68a4000..1260867f7c6 100644 --- a/lisp/pcomplete.el +++ b/lisp/pcomplete.el @@ -1,6 +1,6 @@ ;;; pcomplete.el --- programmable completion -;; Copyright (C) 1999, 2000, 2001, 2002 Free Sofware Foundation +;; Copyright (C) 1999, 2000,01,02,03,04 Free Sofware Foundation ;; Author: John Wiegley <johnw@gnu.org> ;; Keywords: processes abbrev @@ -505,7 +505,7 @@ See the documentation for `pcomplete-arg'." (defsubst pcomplete-actual-arg (&optional index offset) "Return the actual text representation of the last argument. -This different from `pcomplete-arg', which returns the textual value +This is different from `pcomplete-arg', which returns the textual value that the last argument evaluated to. This function returns what the user actually typed in." (buffer-substring (pcomplete-begin index offset) (point))) @@ -531,7 +531,7 @@ user actually typed in." (throw 'pcompleted nil)))) (defun pcomplete-match-string (which &optional index offset) - "Like `string-match', but on the current completion argument." + "Like `match-string', but on the current completion argument." (let ((arg (pcomplete-arg (or index 1) offset))) (if arg (match-string which arg) @@ -583,8 +583,8 @@ user actually typed in." (defun pcomplete-comint-setup (completef-sym) "Setup a comint buffer to use pcomplete. COMPLETEF-SYM should be the symbol where the -dynamic-complete-functions are kept. For comint mode itself, this is -`comint-dynamic-complete-functions'." +dynamic-complete-functions are kept. For comint mode itself, +this is `comint-dynamic-complete-functions'." (set (make-local-variable 'pcomplete-parse-arguments-function) 'pcomplete-parse-comint-arguments) (make-local-variable completef-sym) @@ -709,7 +709,7 @@ match (files not matching the REGEXP will be excluded). If PREDICATE is non-nil, it will also be used to refine the match \(files for which the PREDICATE returns nil will be excluded). If no directory information can be extracted from the completed -component, DEFAULT-DIRECTORY is used as the basis for completion." +component, `default-directory' is used as the basis for completion." (let* ((name (substitute-env-vars pcomplete-stub)) (default-directory (expand-file-name (or (file-name-directory name) @@ -809,11 +809,10 @@ component, DEFAULT-DIRECTORY is used as the basis for completion." (defun pcomplete-opt (options &optional prefix no-ganging args-follow) "Complete a set of OPTIONS, each beginning with PREFIX (?- by default). PREFIX may be t, in which case no PREFIX character is necessary. -If REQUIRED is non-nil, the options must be present. -If NO-GANGING is non-nil, each option is separate. -xy is not allowed. -If ARGS-FOLLOW is non-nil, then options which arguments which take may -have the argument appear after a ganged set of options. This is how -tar behaves, for example." +If NO-GANGING is non-nil, each option is separate (-xy is not allowed). +If ARGS-FOLLOW is non-nil, then options which take arguments may have +the argument appear after a ganged set of options. This is how tar +behaves, for example." (if (and (= pcomplete-index pcomplete-last) (string= (pcomplete-arg) "-")) (let ((len (length options)) @@ -864,7 +863,7 @@ tar behaves, for example." (setq index (1+ index)))))))) (defun pcomplete--here (&optional form stub paring form-only) - "Complete aganst the current argument, if at the end. + "Complete against the current argument, if at the end. See the documentation for `pcomplete-here'." (if (< pcomplete-index pcomplete-last) (progn @@ -893,7 +892,7 @@ See the documentation for `pcomplete-here'." (throw 'pcomplete-completions (eval form)))) (defmacro pcomplete-here (&optional form stub paring form-only) - "Complete aganst the current argument, if at the end. + "Complete against the current argument, if at the end. If completion is to be done here, evaluate FORM to generate the list of strings which will be used for completion purposes. If STUB is a string, use it as the completion stub instead of the default (which is @@ -913,10 +912,11 @@ always for the sake of efficiency. If PARING is nil, this argument will be pared against previous arguments using the function `file-truename' to normalize them. -PARING may be a function, in which case that function is for -normalization. If PARING is the value t, the argument dealt with by -this call will not participate in argument paring. If it the integer -0, all previous arguments that have been seen will be cleared. +PARING may be a function, in which case that function is used for +normalization. If PARING is t, the argument dealt with by this +call will not participate in argument paring. If it is the +integer 0, all previous arguments that have been seen will be +cleared. If FORM-ONLY is non-nil, only the result of FORM will be used to generate the completions list. This means that the hook @@ -1129,10 +1129,7 @@ See also `pcomplete-filename'." (defun pcomplete--help () "Produce context-sensitive help for the current argument. -If specific documentation can't be given, be generic. -INFODOC specifies the Info node to goto. DOCUMENTATION is a sexp -which will produce documentation for the argument (it is responsible -for displaying in its own buffer)." +If specific documentation can't be given, be generic." (if (and pcomplete-help (or (and (stringp pcomplete-help) (fboundp 'Info-goto-node)) @@ -1150,12 +1147,6 @@ for displaying in its own buffer)." ;; general utilities -(defsubst pcomplete-time-less-p (t1 t2) - "Say whether time T1 is less than time T2." - (or (< (car t1) (car t2)) - (and (= (car t1) (car t2)) - (< (nth 1 t1) (nth 1 t2))))) - (defun pcomplete-pare-list (l r &optional pred) "Destructively remove from list L all elements matching any in list R. Test is done using `equal'. diff --git a/lisp/pcvs-defs.el b/lisp/pcvs-defs.el index dadb194abb9..6fea0052a7d 100644 --- a/lisp/pcvs-defs.el +++ b/lisp/pcvs-defs.el @@ -305,6 +305,7 @@ This variable is buffer local and only used in the *cvs* buffer.") ("d" "diff" . cvs-mode-diff) ("b" "backup" . cvs-mode-diff-backup) ("h" "head" . cvs-mode-diff-head) + ("y" "yesterday" . cvs-mode-diff-yesterday) ("v" "vendor" . cvs-mode-diff-vendor)) "Keymap for diff-related operations in `cvs-mode'." :name "Diff") diff --git a/lisp/pcvs-util.el b/lisp/pcvs-util.el index 86fafea37ea..3380077c74a 100644 --- a/lisp/pcvs-util.el +++ b/lisp/pcvs-util.el @@ -1,6 +1,6 @@ ;;; pcvs-util.el --- utility functions for PCL-CVS -*- byte-compile-dynamic: t -*- -;; Copyright (C) 1991,92,93,94,95,96,97,98,99,2000, 2001 +;; Copyright (C) 1991,92,93,94,95,96,97,98,99, 2000,01,04 ;; Free Software Foundation, Inc. ;; Author: Stefan Monnier <monnier@cs.yale.edu> @@ -50,7 +50,6 @@ (dolist (x xs zs) (unless (member x ys) (push x zs))))) - (defun cvs-map (-cvs-map-f &rest -cvs-map-ls) (unless (cvs-every 'null -cvs-map-ls) (cons (apply -cvs-map-f (mapcar 'car -cvs-map-ls)) @@ -77,22 +76,6 @@ the other elements. The ordering among elements is maintained." (if (funcall p x) (push x car) (push x cdr))) (cons (nreverse car) (nreverse cdr)))) -;; Copied from CL ;-( - -(defun cvs-butlast (x &optional n) - "Returns a copy of LIST with the last N elements removed." - (if (and n (<= n 0)) x - (cvs-nbutlast (copy-sequence x) n))) - -(defun cvs-nbutlast (x &optional n) - "Modifies LIST to remove the last N elements." - (let ((m (length x))) - (or n (setq n 1)) - (and (< n m) - (progn - (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) - x)))) - ;;; ;;; frame, window, buffer handling ;;; diff --git a/lisp/pcvs.el b/lisp/pcvs.el index 21e34fbc7ed..73f7106d0e8 100644 --- a/lisp/pcvs.el +++ b/lisp/pcvs.el @@ -764,7 +764,7 @@ before calling the real function `" (symbol-name fun-1) "'.\n") (interactive) (cvs-mode! ',fun-1))))) - (t (error "unknown style %s in `defun-cvs-mode'" style))))) + (t (error "Unknown style %s in `defun-cvs-mode'" style))))) (defun-cvs-mode cvs-mode-kill-process () "Kill the temporary buffer and associated process." @@ -1312,10 +1312,7 @@ If there are any marked tins, and IGNORE-MARKS is nil, return them. Otherwise, if the cursor selects a directory, and IGNORE-CONTENTS is nil, return all files in it, else return just the directory. Otherwise return (a list containing) the file the cursor points to, or -an empty list if it doesn't point to a file at all. - -Args: &optional IGNORE-MARKS IGNORE-CONTENTS." - +an empty list if it doesn't point to a file at all." (let ((fis nil)) (dolist (fi (if (and (boundp 'cvs-minor-current-files) (consp cvs-minor-current-files)) @@ -1568,6 +1565,12 @@ See ``cvs-mode-diff'' for more info." (interactive (list (cvs-flags-query 'cvs-diff-flags "cvs diff flags"))) (cvs-mode-diff-1 (cons "-rHEAD" flags))) +(defun-cvs-mode (cvs-mode-diff-yesterday . SIMPLE) (flags) + "Diff the selected files against yesterday's head of the current branch. +See ``cvs-mode-diff'' for more info." + (interactive (list (cvs-flags-query 'cvs-diff-flags "cvs diff flags"))) + (cvs-mode-diff-1 (cons "-Dyesterday" flags))) + (defun-cvs-mode (cvs-mode-diff-vendor . SIMPLE) (flags) "Diff the selected files against the head of the vendor branch. See ``cvs-mode-diff'' for more info." @@ -1754,7 +1757,7 @@ Signal an error if there is no backup file." (defun cvs-is-within-p (fis dir) - "Non-nil is buffer is inside one of FIS (in DIR)." + "Non-nil if buffer is inside one of FIS (in DIR)." (when (stringp buffer-file-name) (setq buffer-file-name (expand-file-name buffer-file-name)) (let (ret) @@ -1774,7 +1777,7 @@ BUF is the buffer to be used for cvs' output. DONT-CHANGE-DISC non-nil indicates that the command will not change the contents of files. This is only used by the parser. POSTPROC is a list of expressions to be evaluated at the very end (after - parsing if applicable). It will be prepended with `progn' is necessary." + parsing if applicable). It will be prepended with `progn' if necessary." (let ((def-dir default-directory)) ;; Save the relevant buffers (save-some-buffers nil (lambda () (cvs-is-within-p fis def-dir)))) diff --git a/lisp/progmodes/ada-mode.el b/lisp/progmodes/ada-mode.el index abc8db6d2c3..f7688e24069 100644 --- a/lisp/progmodes/ada-mode.el +++ b/lisp/progmodes/ada-mode.el @@ -1466,8 +1466,8 @@ The standard casing rules will no longer apply to this word." ;; If the word is already in the list, even with a different casing ;; we simply want to replace it. (if (and (not (equal ada-case-exception '())) - (assoc-ignore-case word ada-case-exception)) - (setcar (assoc-ignore-case word ada-case-exception) word) + (assoc-string word ada-case-exception t)) + (setcar (assoc-string word ada-case-exception t) word) (add-to-list 'ada-case-exception (cons word t)) ) @@ -1519,8 +1519,8 @@ word itself has a special casing." ;; If the word is already in the list, even with a different casing ;; we simply want to replace it. (if (and (not (equal ada-case-exception-substring '())) - (assoc-ignore-case word ada-case-exception-substring)) - (setcar (assoc-ignore-case word ada-case-exception-substring) word) + (assoc-string word ada-case-exception-substring t)) + (setcar (assoc-string word ada-case-exception-substring t) word) (add-to-list 'ada-case-exception-substring (cons word t)) ) @@ -1548,9 +1548,9 @@ word itself has a special casing." (if (char-equal (string-to-char word) ?*) (progn (setq word (substring word 1)) - (unless (assoc-ignore-case word ada-case-exception-substring) + (unless (assoc-string word ada-case-exception-substring t) (add-to-list 'ada-case-exception-substring (cons word t)))) - (unless (assoc-ignore-case word ada-case-exception) + (unless (assoc-string word ada-case-exception t) (add-to-list 'ada-case-exception (cons word t))))) (forward-line 1)) @@ -1618,8 +1618,8 @@ the exceptions defined in `ada-case-exception-file'." (point))) match) ;; If we have an exception, replace the word by the correct casing - (if (setq match (assoc-ignore-case (buffer-substring start end) - ada-case-exception)) + (if (setq match (assoc-string (buffer-substring start end) + ada-case-exception t)) (progn (delete-region start end) diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el index c6f60d3dcc0..a61369004e8 100644 --- a/lisp/progmodes/cc-cmds.el +++ b/lisp/progmodes/cc-cmds.el @@ -1488,7 +1488,7 @@ more \"DWIM:ey\"." (save-excursion (beginning-of-line) (or (not (re-search-backward - sentence-end + (sentence-end) (c-point 'bopl) t)) (< (match-end 0) diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 62633fe2940..16064586ee9 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el @@ -1,6 +1,6 @@ ;;; cfengine.el --- mode for editing Cfengine files -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. ;; Author: Dave Love <fx@gnu.org> ;; Keywords: languages @@ -102,7 +102,8 @@ This includes those for cfservd as well as cfagent.")) (defun cfengine-beginning-of-defun () "`beginning-of-defun' function for Cfengine mode. Treats actions as defuns." - (end-of-line) + (unless (<= (current-column) (current-indentation)) + (end-of-line)) (if (re-search-backward "^[[:alpha:]]+: *$" nil t) (beginning-of-line) (goto-char (point-min))) @@ -113,7 +114,7 @@ Treats actions as defuns." Treats actions as defuns." (end-of-line) (if (re-search-forward "^[[:alpha:]]+: *$" nil t) - (progn (forward-line -1) (end-of-line)) + (beginning-of-line) (goto-char (point-max))) t) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index ff4256192c4..033ce883e5f 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -100,7 +100,7 @@ in the compilation output, and should return a transformed file name.") ;;;###autoload (defvar compilation-process-setup-function nil "*Function to call to customize the compilation process. -This functions is called immediately before the compilation process is +This function is called immediately before the compilation process is started. It can be used to set any variables or functions that are used while processing the output of the compilation process. The function is called with variables `compilation-buffer' and `compilation-window' @@ -125,11 +125,6 @@ describing how the process finished.") Each function is called with two arguments: the compilation buffer, and a string describing how the process finished.") -(defvar compilation-last-buffer nil - "The most recent compilation buffer. -A buffer becomes most recent when its compilation is started -or when it is used with \\[next-error] or \\[compile-goto-error].") - (defvar compilation-in-progress nil "List of compilation processes now running.") (or (assq 'compilation-in-progress minor-mode-alist) @@ -176,8 +171,15 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) "^\"\\([^,\" \n\t]+\\)\", line \\([0-9]+\\)\ \\(?:[(. pos]+\\([0-9]+\\))?\\)?[:.,; (-]\\( warning:\\|[-0-9 ]*(W)\\)?" 1 2 3 (4)) + (edg-1 + "^\\([^ \n]+\\)(\\([0-9]+\\)): \\(?:error\\|warnin\\(g\\)\\|remar\\(k\\)\\)" + 1 2 nil (3 . 4)) + (edg-2 + "at line \\([0-9]+\\) of \"\\([^ \n]+\\)\"$" + 2 1 nil 0) + (epc - "^Error [0-9]+ at (\\([0-9]*\\):\\([^)\n]+\\))" 2 1) + "^Error [0-9]+ at (\\([0-9]+\\):\\([^)\n]+\\))" 2 1) (iar "^\"\\(.*\\)\",\\([0-9]+\\)\\s-+\\(?:Error\\|Warnin\\(g\\)\\)\\[[0-9]+\\]:" @@ -187,8 +189,9 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) "^\\([^( \n\t]+\\)(\\([0-9]+\\):\\([0-9]+\\)) :\ \\(?:warnin\\(g\\)\\|informationa\\(l\\)\\)?" 1 2 3 (4 . 5)) + ;; fixme: should be `mips' (irix - "^[a-z0-9/]+: \\(?:[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*:\ + "^[-[:alnum:]_/]+: \\(?:[sS]evere\\|[eE]rror\\|[wW]arnin\\(g\\)\\|[iI]nf\\(o\\)\\)[0-9 ]*:\ \\([^,\" \n\t]+\\)\\(?:, line\\|:\\) \\([0-9]+\\):" 3 4 nil (1 . 2)) (java @@ -206,8 +209,8 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) \\(.+\\):\\([0-9]+\\)\\(?:\\(:\\)\\|\\(,\\)\\)?" 1 2 nil (3 . 4)) (gnu - "^\\(?:[a-zA-Z][-a-zA-Z0-9.]+: ?\\)?\ -\\([/.]*[a-zA-Z]:?[^ \t\n:]*\\): ?\ + "^\\(?:[[:alpha:]][-[:alnum:].]+: ?\\)?\ +\\([/.]*[a-zA-Z]:?[^ \t\n:]*\\|{standard input}\\): ?\ \\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?:\ \\(?: *\\(\\(?:Future\\|Runtime\\)?[Ww]arning\\|W:\\)\\|\ @@ -228,6 +231,7 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) (1 (compilation-error-properties 2 3 nil nil nil 0 nil) append))) + ;; Should be lint-1, lint-2 (SysV lint) (mips-1 " (\\([0-9]+\\)) in \\([^ \n]+\\)" 2 1) (mips-2 @@ -238,7 +242,9 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) : \\(?:error\\|warnin\\(g\\)\\) C[0-9]+:" 1 2 nil (3)) (oracle - "^Semantic error at line \\([0-9]+\\), column \\([0-9]+\\), file \\(.*\\):$" + "^\\(?:Semantic error\\|Error\\|PCC-[0-9]+:\\).* line \\([0-9]+\\)\ +\\(?:\\(?:,\\| at\\)? column \\([0-9]+\\)\\)?\ +\\(?:,\\| in\\| of\\)? file \\(.*?\\):?$" 3 1 2) (perl @@ -261,16 +267,13 @@ of[ \t]+\"?\\([a-zA-Z]?:?[^\":\n]+\\)\"?:" 3 2 nil (1)) nil 1 nil (3) nil (2 (compilation-face '(3)))) (sun - ": \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[a-zA-Z0-9 ]+, \\)?\ + ": \\(?:ERROR\\|WARNIN\\(G\\)\\|REMAR\\(K\\)\\) \\(?:[[:alnum:] ]+, \\)?\ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?" 3 4 5 (1 . 2)) (sun-ada "^\\([^, \n\t]+\\), line \\([0-9]+\\), char \\([0-9]+\\)[:., \(-]" 1 2 3) - (ultrix - "^\\(?:cfe\\|fort\\): \\(Warning\\)?[^:\n]*: \\([^ \n]*\\), line \\([0-9]+\\):" 2 3 nil (1)) - (4bsd "\\(?:^\\|:: \\|\\S ( \\)\\(/[^ \n\t()]+\\)(\\([0-9]+\\))\ \\(?:: \\(warning:\\)?\\|$\\| ),\\)" 1 2 nil (3))) @@ -279,14 +282,14 @@ File = \\(.+\\), Line = \\([0-9]+\\)\\(?:, Column = \\([0-9]+\\)\\)?" (defcustom compilation-error-regexp-alist (mapcar 'car compilation-error-regexp-alist-alist) "Alist that specifies how to match errors in compiler output. -Note that on Unix exerything is a valid filename, so these +Note that on Unix everything is a valid filename, so these matchers must make some common sense assumptions, which catch normal cases. A shorter list will be lighter on resource usage. Instead of an alist element, you can use a symbol, which is looked up in `compilation-error-regexp-alist-alist'. You can see the predefined symbols and their effects in the file -`etc/compilation.txt' (linked below if your are customizing this). +`etc/compilation.txt' (linked below if you are customizing this). Each elt has the form (REGEXP FILE [LINE COLUMN TYPE HYPERLINK HIGHLIGHT...]). If REGEXP matches, the FILE'th subexpression @@ -328,7 +331,7 @@ be added." (list 'const (car elt))) compilation-error-regexp-alist-alist)) :link `(file-link :tag "example file" - ,(concat doc-directory "compilation.txt")) + ,(expand-file-name "compilation.txt" data-directory)) :group 'compilation) (defvar compilation-directory nil @@ -357,7 +360,7 @@ you may also want to change `compilation-page-delimiter'.") (1 font-lock-variable-name-face) (2 (compilation-face '(4 . 3)))) ;; Command output lines. Recognize `make[n]:' lines too. - ("^\\([A-Za-z_0-9/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" + ("^\\([[:alnum:]_/.+-]+\\)\\(\\[\\([0-9]+\\)\\]\\)?[ \t]*:" (1 font-lock-function-name-face) (3 compilation-line-face nil t)) (" --?o\\(?:utfile\\|utput\\)?[= ]?\\(\\S +\\)" . 1) ("^Compilation finished" . compilation-info-face) @@ -427,7 +430,7 @@ You might also use mode hooks to specify it in certain modes, like this: (defvar compilation-locs ()) (defvar compilation-debug nil - "*Set this to `t' before creating a *compilation* buffer. + "*Set this to t before creating a *compilation* buffer. Then every error line will have a debug text property with the matcher that fit this line and the match data. Use `describe-text-properties'.") @@ -447,17 +450,19 @@ starting the compilation process.") (defvar compile-history nil) (defface compilation-warning-face - '((((type tty) (class color)) (:foreground "cyan" :weight bold)) - (((class color)) (:foreground "Orange" :weight bold)) + '((((class color) (min-colors 16)) (:foreground "Orange" :weight bold)) + (((class color)) (:foreground "cyan" :weight bold)) (t (:weight bold))) "Face used to highlight compiler warnings." :group 'font-lock-highlighting-faces :version "21.4") (defface compilation-info-face - '((((type tty) (class color)) (:foreground "green" :weight bold)) - (((class color) (background light)) (:foreground "Green3" :weight bold)) - (((class color) (background dark)) (:foreground "Green" :weight bold)) + '((((class color) (min-colors 16) (background light)) + (:foreground "Green3" :weight bold)) + (((class color) (min-colors 16) (background dark)) + (:foreground "Green" :weight bold)) + (((class color)) (:foreground "green" :weight bold)) (t (:weight bold))) "Face used to highlight compiler warnings." :group 'font-lock-highlighting-faces @@ -494,7 +499,8 @@ Faces `compilation-error-face', `compilation-warning-face', ;; Used for compatibility with the old compile.el. -(defvar compilation-parsing-end nil) +(defvaralias 'compilation-last-buffer 'next-error-last-buffer) +(defvar compilation-parsing-end (make-marker)) (defvar compilation-parse-errors-function nil) (defvar compilation-error-list nil) (defvar compilation-old-error-list nil) @@ -518,6 +524,7 @@ Faces `compilation-error-face', `compilation-warning-face', '(nil)) ; nil only isn't a property-change (cons (match-string-no-properties idx) dir)) mouse-face highlight + keymap compilation-button-map help-echo "mouse-2: visit current directory"))) ;; Data type `reverse-ordered-alist' retriever. This function retrieves the @@ -528,6 +535,7 @@ Faces `compilation-error-face', `compilation-warning-face', ;; may be nil. The other KEYs are ordered backwards so that growing line ;; numbers can be inserted in front and searching can abort after half the ;; list on average. +(eval-when-compile ;Don't keep it at runtime if not needed. (defmacro compilation-assq (key alist) `(let* ((l1 ,alist) (l2 (cdr l1))) @@ -538,7 +546,7 @@ Faces `compilation-error-face', `compilation-warning-face', l2 (cdr l1))) (if l2 (eq ,key (caar l2)))) l2 - (setcdr l1 (cons (list ,key) l2)))))) + (setcdr l1 (cons (list ,key) l2))))))) ;; This function is the central driver, called when font-locking to gather @@ -556,17 +564,13 @@ Faces `compilation-error-face', `compilation-warning-face', (setq dir (previous-single-property-change (point) 'directory) dir (if dir (or (get-text-property (1- dir) 'directory) (get-text-property dir 'directory))))) - (setq file (cons file (car dir)) ; top of dir stack is current - file (or (gethash file compilation-locs) - (puthash file (list file fmt) compilation-locs))))) + (setq file (cons file (car dir))))) ;; This message didn't mention one, get it from previous (setq file (previous-single-property-change (point) 'message) file (or (if file - (nth 2 (car (or (get-text-property (1- file) 'message) - (get-text-property file 'message))))) - ;; no previous either -- let font-lock continue - (gethash (setq file '("*unknown*")) compilation-locs) - (puthash file (list file fmt) compilation-locs)))) + (car (nth 2 (car (or (get-text-property (1- file) 'message) + (get-text-property file 'message)))))) + '("*unknown*")))) ;; All of these fields are optional, get them only if we have an index, and ;; it matched some part of the message. (and line @@ -579,75 +583,87 @@ Faces `compilation-error-face', `compilation-warning-face', (setq col (match-string-no-properties col)) (setq col (- (string-to-number col) compilation-first-column))) (if (and end-col (setq end-col (match-string-no-properties end-col))) - (setq end-col (- (string-to-number end-col) compilation-first-column)) + (setq end-col (- (string-to-number end-col) compilation-first-column -1)) (if end-line (setq end-col -1))) - (if (consp type) ; not a preset type, check what it is. + (if (consp type) ; not a static type, check what it is. (setq type (or (and (car type) (match-end (car type)) 1) (and (cdr type) (match-end (cdr type)) 0) 2))) - ;; Get any (first) already existing marker (if any has one, all have one). - ;; Do this first, as the next assq`s may create new nodes. - (let ((marker (nth 3 (car (cdar (cddr file))))) - (loc (compilation-assq line (cdr file))) - end-loc) - (if end-line - (setq end-loc (compilation-assq end-line (cdr file)) - end-loc (compilation-assq end-col end-loc)) - (if end-col ; use same line element - (setq end-loc (compilation-assq end-col loc)))) - (setq loc (compilation-assq col loc)) - ;; If they are new, make the loc(s) reference the file they point to. - (or (cdr loc) (setcdr loc (list line file))) - (if end-loc - (or (cdr end-loc) (setcdr end-loc (list (or end-line line) file)))) - ;; If we'd found a marker, ensure that the new locs also get markers - (when (and marker - (not (or (cddr loc) (cddr end-loc))) ; maybe new node w/o marker - (marker-buffer marker)) ; other marker still valid - (or line (setq line 1)) ; normalize no linenumber to line 1 - (catch 'marker ; find nearest loc, at least one exists - (dolist (x (cddr file)) - (if (> (or (car x) 1) line) - (setq marker x) - (if (eq (or (car x) 1) line) - (if (cdr (cddr x)) ; at least one other column - (throw 'marker (setq marker x)) - (if marker (throw 'marker t))) - (throw 'marker (or marker (setq marker x))))))) - (setq marker (if (eq (car (cddr marker)) col) - (nthcdr 3 marker) - (cddr marker)) - file compilation-error-screen-columns) - (with-current-buffer (marker-buffer (cddr marker)) - (save-restriction - (widen) - (goto-char (marker-position (cddr marker))) - (beginning-of-line (- line (car (cadr marker)) -1)) - (if file ; original c.-error-screen-columns - (move-to-column (car loc)) - (forward-char (car loc))) - (setcdr (cdr loc) (point-marker)) - (when end-loc - (beginning-of-line (- end-line line -1)) - (if (< end-col 0) - (end-of-line) - (if file ; original c.-error-screen-columns - (move-to-column (car end-loc)) - (forward-char (car end-loc)))) - (setcdr (cdr end-loc) (point-marker)))))) - ;; Must start with face - `(face ,compilation-message-face - message (,loc ,type ,end-loc) - ,@(if compilation-debug - `(debug (,(assoc (with-no-warnings matcher) font-lock-keywords) - ,@(match-data)))) - help-echo ,(if col - "mouse-2: visit this file, line and column" - (if line - "mouse-2: visit this file and line" - "mouse-2: visit this file")) - keymap compilation-button-map - mouse-face highlight)))) + (compilation-internal-error-properties file line end-line col end-col type fmt))) + +(defun compilation-internal-error-properties (file line end-line col end-col type fmt) + "Get the meta-info that will be added as text-properties. +LINE, END-LINE, COL, END-COL are integers or nil. +TYPE can be 0, 1, or 2. +FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME) or nil." + (unless file (setq file '("*unknown*"))) + (setq file (compilation-get-file-structure file fmt)) + ;; Get first already existing marker (if any has one, all have one). + ;; Do this first, as the compilation-assq`s may create new nodes. + (let* ((marker-line (car (cddr file))) ; a line structure + (marker (nth 3 (cadr marker-line))) ; its marker + (compilation-error-screen-columns compilation-error-screen-columns) + end-marker loc end-loc) + (if (not (and marker (marker-buffer marker))) + (setq marker) ; no valid marker for this file + (setq loc (or line 1)) ; normalize no linenumber to line 1 + (catch 'marker ; find nearest loc, at least one exists + (dolist (x (nthcdr 3 file)) ; loop over remaining lines + (if (> (car x) loc) ; still bigger + (setq marker-line x) + (if (> (- (or (car marker-line) 1) loc) + (- loc (car x))) ; current line is nearer + (setq marker-line x)) + (throw 'marker t)))) + (setq marker (nth 3 (cadr marker-line)) + marker-line (or (car marker-line) 1)) + (with-current-buffer (marker-buffer marker) + (save-restriction + (widen) + (goto-char (marker-position marker)) + (when (or end-col end-line) + (beginning-of-line (- (or end-line line) marker-line -1)) + (if (< end-col 0) + (end-of-line) + (if compilation-error-screen-columns + (move-to-column end-col) + (forward-char end-col))) + (setq end-marker (list (point-marker)))) + (beginning-of-line (if end-line + (- end-line line -1) + (- loc marker-line -1))) + (if col + (if compilation-error-screen-columns + (move-to-column col) + (forward-char col)) + (forward-to-indentation 0)) + (setq marker (list (point-marker)))))) + + (setq loc (compilation-assq line (cdr file))) + (if end-line + (setq end-loc (compilation-assq end-line (cdr file)) + end-loc (compilation-assq end-col end-loc)) + (if end-col ; use same line element + (setq end-loc (compilation-assq end-col loc)))) + (setq loc (compilation-assq col loc)) + ;; If they are new, make the loc(s) reference the file they point to. + (or (cdr loc) (setcdr loc `(,line ,file ,@marker))) + (if end-loc + (or (cdr end-loc) (setcdr end-loc `(,(or end-line line) ,file ,@end-marker)))) + + ;; Must start with face + `(face ,compilation-message-face + message (,loc ,type ,end-loc) + ,@(if compilation-debug + `(debug (,(assoc (with-no-warnings matcher) font-lock-keywords) + ,@(match-data)))) + help-echo ,(if col + "mouse-2: visit this file, line and column" + (if line + "mouse-2: visit this file and line" + "mouse-2: visit this file")) + keymap compilation-button-map + mouse-face highlight))) (defun compilation-mode-font-lock-keywords () "Return expressions to highlight in Compilation mode." @@ -686,12 +702,15 @@ Faces `compilation-error-face', `compilation-warning-face', ;; error location. Let's do our best. `(,(car item) (0 (compilation-compat-error-properties - (funcall ',line (list* (match-string ,file) - default-directory - ',(nthcdr 4 item)) + (funcall ',line (cons (match-string ,file) + (cons default-directory + ',(nthcdr 4 item))) ,(if col `(match-string ,col))))) (,file compilation-error-face t)) + (unless (or (null (nth 5 item)) (integerp (nth 5 item))) + (error "HYPERLINK should be an integer: %s" (nth 5 item))) + `(,(nth 0 item) ,@(when (integerp file) @@ -729,7 +748,7 @@ Faces `compilation-error-face', `compilation-warning-face', Runs COMMAND, a shell command, in a separate process asynchronously with output going to the buffer `*compilation*'. -If optional second arg COMINT is t the buffer will be in comint mode with +If optional second arg COMINT is t the buffer will be in Comint mode with `compilation-shell-minor-mode'. You can then use the command \\[next-error] to find the next error message @@ -737,6 +756,8 @@ and move to the source code that caused it. Interactively, prompts for the command if `compilation-read-command' is non-nil; otherwise uses `compile-command'. With prefix arg, always prompts. +Additionally, with universal prefix arg, compilation buffer will be in +comint mode, i.e. interactive. To run more than one compilation at once, start one and rename the \`*compilation*' buffer to some other name with @@ -748,11 +769,13 @@ The name used for the buffer is actually whatever is returned by the function in `compilation-buffer-name-function', so you can set that to a function that generates a unique name." (interactive - (if (or compilation-read-command current-prefix-arg) - (list (read-from-minibuffer "Compile command: " - (eval compile-command) nil nil - '(compile-history . 1))) - (list (eval compile-command)))) + (list + (if (or compilation-read-command current-prefix-arg) + (read-from-minibuffer "Compile command: " + (eval compile-command) nil nil + '(compile-history . 1)) + (eval compile-command)) + (consp current-prefix-arg))) (unless (equal command (eval compile-command)) (setq compile-command command)) (save-some-buffers (not compilation-ask-about-save) nil) @@ -762,8 +785,8 @@ to a function that generates a unique name." ;; run compile with the default command line (defun recompile () "Re-compile the program including the current buffer. -If this is run in a compilation-mode buffer, re-use the arguments from the -original use. Otherwise, it recompiles using `compile-command'." +If this is run in a Compilation mode buffer, re-use the arguments from the +original use. Otherwise, recompile using `compile-command'." (interactive) (save-some-buffers (not compilation-ask-about-save) nil) (let ((default-directory (or compilation-directory default-directory))) @@ -773,9 +796,9 @@ original use. Otherwise, it recompiles using `compile-command'." (defcustom compilation-scroll-output nil "*Non-nil to scroll the *compilation* buffer window as output appears. -Setting it causes the compilation-mode commands to put point at the +Setting it causes the Compilation mode commands to put point at the end of their output window so that the end of the output is always -visible rather than the begining." +visible rather than the beginning." :type 'boolean :version "20.3" :group 'compilation) @@ -822,11 +845,11 @@ Otherwise, construct a buffer name from MODE-NAME." The rest of the arguments are optional; for them, nil means use the default. MODE is the major mode to set in the compilation buffer. Mode -may also be `t' meaning `compilation-shell-minor-mode' under `comint-mode'. +may also be t meaning use `compilation-shell-minor-mode' under `comint-mode'. NAME-FUNCTION is a function called to name the buffer. If HIGHLIGHT-REGEXP is non-nil, `next-error' will temporarily highlight -matching section of the visited source line; the default is to use the +the matching section of the visited source line; the default is to use the global value of `compilation-highlight-regexp'. Returns the compilation buffer created." @@ -838,8 +861,8 @@ Returns the compilation buffer created." (process-environment (append compilation-environment - (if (and (boundp 'system-uses-terminfo) - system-uses-terminfo) + (if (if (boundp 'system-uses-terminfo) ; `if' for compiler warning + system-uses-terminfo) (list "TERM=dumb" "TERMCAP=" (format "COLUMNS=%d" (window-width))) (list "TERM=emacs" @@ -903,7 +926,9 @@ Returns the compilation buffer created." 'compilation-revert-buffer) (set-window-start outwin (point-min)) (or (eq outwin (selected-window)) - (set-window-point outwin (point))) + (set-window-point outwin (if compilation-scroll-output + (point) + (point-min)))) ;; The setup function is called before compilation-set-window-height ;; so it can set the compilation-window-height buffer locally. (if compilation-process-setup-function @@ -930,6 +955,7 @@ Returns the compilation buffer created." ;; Fake modeline display as if `start-process' were run. (setq mode-line-process ":run") (force-mode-line-update) + (sit-for 0) ; Force redisplay (let ((status (call-process shell-file-name nil outbuf nil "-c" command))) (cond ((numberp status) @@ -944,13 +970,17 @@ exited abnormally with code %d\n" (concat status "\n"))) (t (compilation-handle-exit 'bizarre status status)))) + ;; Without async subprocesses, the buffer is not yet + ;; fontified, so fontify it now. + (let ((font-lock-verbose nil)) ; shut up font-lock messages + (font-lock-fontify-buffer)) (message "Executing `%s'...done" command))) (if (buffer-local-value 'compilation-scroll-output outbuf) (save-selected-window (select-window outwin) (goto-char (point-max)))) ;; Make it so the next C-x ` will use this buffer. - (setq compilation-last-buffer outbuf))) + (setq next-error-last-buffer outbuf))) (defun compilation-set-window-height (window) "Set the height of WINDOW according to `compilation-window-height'." @@ -960,9 +990,8 @@ exited abnormally with code %d\n" ;; If window is alone in its frame, aside from a minibuffer, ;; don't change its height. (not (eq window (frame-root-window (window-frame window)))) - ;; This save-current-buffer prevents us from changing the current - ;; buffer, which might not be the same as the selected window's buffer. - (save-current-buffer + ;; Stef said that doing the saves in this order is safer: + (save-excursion (save-selected-window (select-window window) (enlarge-window (- height (window-height)))))))) @@ -1132,20 +1161,30 @@ variable exists." "Marker to the location from where the next error will be found. The global commands next/previous/first-error/goto-error use this.") +(defvar compilation-messages-start nil + "Buffer position of the beginning of the compilation messages. +If nil, use the beginning of buffer.") + ;; A function name can't be a hook, must be something with a value. (defconst compilation-turn-on-font-lock 'turn-on-font-lock) (defun compilation-setup (&optional minor) - "Prepare the buffer for the compilation parsing commands to work." + "Prepare the buffer for the compilation parsing commands to work. +Optional argument MINOR indicates this is called from +`compilation-minor-mode'." (make-local-variable 'compilation-current-error) + (make-local-variable 'compilation-messages-start) (make-local-variable 'compilation-error-screen-columns) (make-local-variable 'overlay-arrow-position) - (setq compilation-last-buffer (current-buffer)) + ;; Note that compilation-next-error-function is for interfacing + ;; with the next-error function in simple.el, and it's only + ;; coincidentally named similarly to compilation-next-error. + (setq next-error-function 'compilation-next-error-function) (set (make-local-variable 'font-lock-extra-managed-props) '(directory message help-echo mouse-face debug)) (set (make-local-variable 'compilation-locs) (make-hash-table :test 'equal :weakness 'value)) - ;; lazy-lock would never find the message unless it's scrolled to + ;; lazy-lock would never find the message unless it's scrolled to. ;; jit-lock might fontify some things too late. (set (make-local-variable 'font-lock-support-mode) nil) (set (make-local-variable 'font-lock-maximum-size) nil) @@ -1193,7 +1232,7 @@ Turning the mode on runs the normal hook `compilation-minor-mode-hook'." (font-lock-fontify-buffer))) (defun compilation-handle-exit (process-status exit-status msg) - "Write msg in the current buffer and hack its mode-line-process." + "Write MSG in the current buffer and hack its mode-line-process." (let ((buffer-read-only nil) (status (if compilation-exit-message-function (funcall compilation-exit-message-function @@ -1257,8 +1296,16 @@ Just inserts the text, but uses `insert-before-markers'." (insert-before-markers string) (run-hooks 'compilation-filter-hook)))))) +;;; test if a buffer is a compilation buffer, assuming we're in the buffer +(defsubst compilation-buffer-internal-p () + "Test if inside a compilation buffer." + (local-variable-p 'compilation-locs)) + +;;; test if a buffer is a compilation buffer, using compilation-buffer-internal-p (defsubst compilation-buffer-p (buffer) - (local-variable-p 'compilation-locs buffer)) + "Test if BUFFER is a compilation buffer." + (with-current-buffer buffer + (compilation-buffer-internal-p))) (defmacro compilation-loop (< property-change 1+ error) `(while (,< n 0) @@ -1289,7 +1336,6 @@ Does NOT find the source line like \\[next-error]." (or (compilation-buffer-p (current-buffer)) (error "Not in a compilation buffer")) (or pt (setq pt (point))) - (setq compilation-last-buffer (current-buffer)) (let* ((msg (get-text-property pt 'message)) (loc (car msg)) last) @@ -1327,25 +1373,6 @@ Does NOT find the source line like \\[previous-error]." (interactive "p") (compilation-next-error (- n))) -(defun next-error-no-select (n) - "Move point to the next error in the compilation buffer and highlight match. -Prefix arg N says how many error messages to move forwards (or -backwards, if negative). -Finds and highlights the source line like \\[next-error], but does not -select the source buffer." - (interactive "p") - (next-error n) - (pop-to-buffer compilation-last-buffer)) - -(defun previous-error-no-select (n) - "Move point to the previous error in the compilation buffer and highlight match. -Prefix arg N says how many error messages to move backwards (or -forwards, if negative). -Finds and highlights the source line like \\[previous-error], but does not -select the source buffer." - (interactive "p") - (next-error-no-select (- n))) - (defun compilation-next-file (n) "Move point to the next error for a different file than the current one. Prefix arg N says how many files to move forwards (or backwards, if negative)." @@ -1383,73 +1410,35 @@ Use this command in a compilation log buffer. Sets the mark at point there." ;; Return a compilation buffer. ;; If the current buffer is a compilation buffer, return it. -;; If compilation-last-buffer is set to a live buffer, use that. ;; Otherwise, look for a compilation buffer and signal an error ;; if there are none. (defun compilation-find-buffer (&optional other-buffer) - (if (and (not other-buffer) - (compilation-buffer-p (current-buffer))) - ;; The current buffer is a compilation buffer. - (current-buffer) - (if (and compilation-last-buffer (buffer-name compilation-last-buffer) - (compilation-buffer-p compilation-last-buffer) - (or (not other-buffer) (not (eq compilation-last-buffer - (current-buffer))))) - compilation-last-buffer - (let ((buffers (buffer-list))) - (while (and buffers (or (not (compilation-buffer-p (car buffers))) - (and other-buffer - (eq (car buffers) (current-buffer))))) - (setq buffers (cdr buffers))) - (if buffers - (car buffers) - (or (and other-buffer - (compilation-buffer-p (current-buffer)) - ;; The current buffer is a compilation buffer. - (progn - (if other-buffer - (message "This is the only compilation buffer.")) - (current-buffer))) - (error "No compilation started!"))))))) + (next-error-find-buffer other-buffer 'compilation-buffer-internal-p)) ;;;###autoload -(defun next-error (&optional n) - "Visit next compilation error message and corresponding source code. -Prefix arg N says how many error messages to move forwards (or -backwards, if negative). - -\\[next-error] normally uses the most recently started compilation or -grep buffer. However, it can operate on any buffer with output from -the \\[compile] and \\[grep] commands, or, more generally, on any -buffer in Compilation mode or with Compilation Minor mode enabled. To -specify use of a particular buffer for error messages, type -\\[next-error] in that buffer. - -Once \\[next-error] has chosen the buffer for error messages, -it stays with that buffer until you use it in some other buffer which -uses Compilation mode or Compilation Minor mode. - -See variable `compilation-error-regexp-alist' for customization ideas." +(defun compilation-next-error-function (n &optional reset) (interactive "p") - (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) + (set-buffer (compilation-find-buffer)) + (when reset + (setq compilation-current-error nil)) (let* ((columns compilation-error-screen-columns) ; buffer's local value (last 1) (loc (compilation-next-error (or n 1) nil - (or compilation-current-error (point-min)))) + (or compilation-current-error + compilation-messages-start + (point-min)))) (end-loc (nth 2 loc)) (marker (point-marker))) (setq compilation-current-error (point-marker) overlay-arrow-position (if (bolp) compilation-current-error - (save-excursion - (beginning-of-line) - (point-marker))) + (copy-marker (line-beginning-position))) loc (car loc)) ;; If loc contains no marker, no error in that file has been visited. If ;; the marker is invalid the buffer has been killed. So, recalculate all ;; markers for that file. - (unless (and (nthcdr 3 loc) (marker-buffer (nth 3 loc))) + (unless (and (nth 3 loc) (marker-buffer (nth 3 loc))) (with-current-buffer (compilation-find-file marker (caar (nth 2 loc)) (or (cdar (nth 2 loc)) default-directory)) @@ -1472,50 +1461,66 @@ See variable `compilation-error-regexp-alist' for customization ideas." (forward-char (car col)))) (beginning-of-line) (skip-chars-forward " \t")) - (if (nthcdr 3 col) + (if (nth 3 col) (set-marker (nth 3 col) (point)) (setcdr (nthcdr 2 col) `(,(point-marker))))))))) (compilation-goto-locus marker (nth 3 loc) (nth 3 end-loc)) (setcdr (nthcdr 3 loc) t))) ; Set this one as visited. -;;;###autoload (define-key ctl-x-map "`" 'next-error) - -(defun previous-error (n) - "Visit previous compilation error message and corresponding source code. -Prefix arg N says how many error messages to move backwards (or -forwards, if negative). - -This operates on the output from the \\[compile] and \\[grep] commands." - (interactive "p") - (next-error (- n))) - -(defun first-error (n) - "Restart at the first error. -Visit corresponding source code. -With prefix arg N, visit the source code of the Nth error. -This operates on the output from the \\[compile] command." - (interactive "p") - (set-buffer (setq compilation-last-buffer (compilation-find-buffer))) - (setq compilation-current-error nil) - (next-error n)) - -(defcustom compilation-context-lines next-screen-context-lines - "*Display this many lines of leading context before message." - :type 'integer +(defvar compilation-gcpro nil + "Internal variable used to keep some values from being GC'd.") +(make-variable-buffer-local 'compilation-gcpro) + +(defun compilation-fake-loc (marker file &optional line col) + "Preassociate MARKER with FILE. +FILE should be ABSOLUTE-FILENAME or (RELATIVE-FILENAME . DIRNAME). +This is useful when you compile temporary files, but want +automatic translation of the messages to the real buffer from +which the temporary file came. This only works if done before a +message about FILE appears! + +Optional args LINE and COL default to 1 and beginning of +indentation respectively. The marker is expected to reflect +this. In the simplest case the marker points to the first line +of the region that was saved to the temp file. + +If you concatenate several regions into the temp file (e.g. a +header with variable assignments and a code region), you must +call this several times, once each for the last line of one +region and the first line of the next region." + (or (consp file) (setq file (list file))) + (setq file (compilation-get-file-structure file)) + ;; Between the current call to compilation-fake-loc and the first occurrence + ;; of an error message referring to `file', the data is only kept is the + ;; weak hash-table compilation-locs, so we need to prevent this entry + ;; in compilation-locs from being GC'd away. --Stef + (push file compilation-gcpro) + (let ((loc (compilation-assq (or line 1) (cdr file)))) + (setq loc (compilation-assq col loc)) + (if (cdr loc) + (setcdr (cddr loc) (list marker)) + (setcdr loc (list line file marker))) + loc)) + +(defcustom compilation-context-lines 0 + "*Display this many lines of leading context before message. +If nil, don't scroll the compilation output window." + :type '(choice integer (const :tag "No window scrolling" nil)) :group 'compilation :version "21.4") (defsubst compilation-set-window (w mk) - ;; Align the compilation output window W with marker MK near top. - (set-window-start w (save-excursion - (goto-char mk) - (beginning-of-line (- 1 compilation-context-lines)) - (point))) + "Align the compilation output window W with marker MK near top." + (if (integerp compilation-context-lines) + (set-window-start w (save-excursion + (goto-char mk) + (beginning-of-line (- 1 compilation-context-lines)) + (point)))) (set-window-point w mk)) (defun compilation-goto-locus (msg mk end-mk) - "Jump to an error MESSAGE and SOURCE. -All arguments are markers. If SOURCE-END is non nil, mark is set there." + "Jump to an error corresponding to MSG at MK. +All arguments are markers. If END-MK is non nil, mark is set there." (if (eq (window-buffer (selected-window)) (marker-buffer msg)) ;; If the compilation buffer window is selected, @@ -1622,67 +1627,58 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." (overlays-in (point-min) (point-max))) buffer))) -(defun compilation-normalize-filename (filename) - "Convert a filename string found in an error message to make it usable." - - ;; Check for a comint-file-name-prefix and prepend it if - ;; appropriate. (This is very useful for - ;; compilation-minor-mode in an rlogin-mode buffer.) - (and (boundp 'comint-file-name-prefix) - ;; If file name is relative, default-directory will - ;; already contain the comint-file-name-prefix (done - ;; by compile-abbreviate-directory). - (file-name-absolute-p filename) - (setq filename - (concat (with-no-warnings 'comint-file-name-prefix) filename))) - - ;; If compilation-parse-errors-filename-function is - ;; defined, use it to process the filename. - (when compilation-parse-errors-filename-function - (setq filename - (funcall compilation-parse-errors-filename-function - filename))) - - ;; Some compilers (e.g. Sun's java compiler, reportedly) - ;; produce bogus file names like "./bar//foo.c" for file - ;; "bar/foo.c"; expand-file-name will collapse these into - ;; "/foo.c" and fail to find the appropriate file. So we - ;; look for doubled slashes in the file name and fix them - ;; up in the buffer. - (setq filename (command-line-normalize-file-name filename))) - - -;; If directory DIR is a subdir of ORIG or of ORIG's parent, -;; return a relative name for it starting from ORIG or its parent. -;; ORIG-EXPANDED is an expanded version of ORIG. -;; PARENT-EXPANDED is an expanded version of ORIG's parent. -;; Those two args could be computed here, but we run faster by -;; having the caller compute them just once. -(defun compile-abbreviate-directory (dir orig orig-expanded parent-expanded) - ;; Apply canonical abbreviations to DIR first thing. - ;; Those abbreviations are already done in the other arguments passed. - (setq dir (abbreviate-file-name dir)) - - ;; Check for a comint-file-name-prefix and prepend it if appropriate. - ;; (This is very useful for compilation-minor-mode in an rlogin-mode - ;; buffer.) - (if (boundp 'comint-file-name-prefix) - (setq dir (concat comint-file-name-prefix dir))) - - (if (and (> (length dir) (length orig-expanded)) - (string= orig-expanded - (substring dir 0 (length orig-expanded)))) - (setq dir - (concat orig - (substring dir (length orig-expanded))))) - (if (and (> (length dir) (length parent-expanded)) - (string= parent-expanded - (substring dir 0 (length parent-expanded)))) - (setq dir - (concat (file-name-directory - (directory-file-name orig)) - (substring dir (length parent-expanded))))) - dir) +(defun compilation-get-file-structure (file &optional fmt) + "Retrieve FILE's file-structure or create a new one. +FILE should be (ABSOLUTE-FILENAME) or (RELATIVE-FILENAME . DIRNAME)." + + (or (gethash file compilation-locs) + ;; File was not previously encountered, at least not in the form passed. + ;; Let's normalize it and look again. + (let ((filename (car file)) + (default-directory (if (cdr file) + (file-truename (cdr file)) + default-directory))) + + ;; Check for a comint-file-name-prefix and prepend it if appropriate. + ;; (This is very useful for compilation-minor-mode in an rlogin-mode + ;; buffer.) + (if (boundp 'comint-file-name-prefix) + (if (file-name-absolute-p filename) + (setq filename + (concat (with-no-warnings comint-file-name-prefix) filename)) + (setq default-directory + (file-truename + (concat (with-no-warnings comint-file-name-prefix) default-directory))))) + + ;; If compilation-parse-errors-filename-function is + ;; defined, use it to process the filename. + (when compilation-parse-errors-filename-function + (setq filename + (funcall compilation-parse-errors-filename-function + filename))) + + ;; Some compilers (e.g. Sun's java compiler, reportedly) produce bogus + ;; file names like "./bar//foo.c" for file "bar/foo.c"; + ;; expand-file-name will collapse these into "/foo.c" and fail to find + ;; the appropriate file. So we look for doubled slashes in the file + ;; name and fix them. + (setq filename (command-line-normalize-file-name filename)) + + ;; Now eliminate any "..", because find-file would get them wrong. + ;; Make relative and absolute filenames, with or without links, the + ;; same. + (setq filename + (list (abbreviate-file-name + (file-truename (if (cdr file) + (expand-file-name filename) + filename))))) + + ;; Store it for the possibly unnormalized name + (puthash file + ;; Retrieve or create file-structure for normalized name + (or (gethash filename compilation-locs) + (puthash filename (list filename fmt) compilation-locs)) + compilation-locs)))) (add-to-list 'debug-ignored-errors "^No more [-a-z ]+s yet$") @@ -1691,17 +1687,26 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." (defun compile-buffer-substring (n) (if n (match-string n))) (defun compilation-compat-error-properties (err) - ;; Map old-style ERROR to new-style MESSAGE. - (let* ((dst (cdr err)) - (loc (cond ((markerp dst) (list nil nil nil dst)) - ((consp dst) - (list (nth 2 dst) (nth 1 dst) - (cons (cdar dst) (caar dst))))))) - ;; Must start with a face, for font-lock. - `(face nil - message ,(list loc 2) - help-echo "mouse-2: visit the source location" - mouse-face highlight))) + "Map old-style error ERR to new-style message." + ;; Old-style structure is (MARKER (FILE DIR) LINE COL) or + ;; (MARKER . MARKER). + (let ((dst (cdr err))) + (if (markerp dst) + ;; Must start with a face, for font-lock. + `(face nil + message ,(list (list nil nil nil dst) 2) + help-echo "mouse-2: visit the source location" + keymap compilation-button-map + mouse-face highlight) + ;; Too difficult to do it by hand: dispatch to the normal code. + (let* ((file (pop dst)) + (line (pop dst)) + (col (pop dst)) + (filename (pop file)) + (dirname (pop file)) + (fmt (pop file))) + (compilation-internal-error-properties + (cons filename dirname) line nil col nil 2 fmt))))) (defun compilation-compat-parse-errors (limit) (when compilation-parse-errors-function @@ -1739,10 +1744,12 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." (goto-char limit) nil) +;; Beware: this is not only compatiblity code. New code stil uses it. --Stef (defun compilation-forget-errors () ;; In case we hit the same file/line specs, we want to recompute a new ;; marker for them, so flush our cache. (setq compilation-locs (make-hash-table :test 'equal :weakness 'value)) + (setq compilation-gcpro nil) ;; FIXME: the old code reset the directory-stack, so maybe we should ;; put a `directory change' marker of some sort, but where? -stef ;; @@ -1754,9 +1761,19 @@ Pop up the buffer containing MARKER and scroll to MARKER if we ask the user." ;; something equivalent to point-max. So we speculatively move ;; compilation-current-error to point-max (since the external package ;; won't know that it should do it). --stef - (setq compilation-current-error (point-max))) + (setq compilation-current-error nil) + (let* ((proc (get-buffer-process (current-buffer))) + (mark (if proc (process-mark proc))) + (pos (or mark (point-max)))) + (setq compilation-messages-start + ;; In the future, ignore the text already present in the buffer. + ;; Since many process filter functions insert before markers, + ;; we need to put ours just before the insertion point rather + ;; than at the insertion point. If that's not possible, then + ;; don't use a marker. --Stef + (if (> pos (point-min)) (copy-marker (1- pos)) pos)))) (provide 'compile) -;;; arch-tag: 12465727-7382-4f72-b234-79855a00dd8c +;; arch-tag: 12465727-7382-4f72-b234-79855a00dd8c ;;; compile.el ends here diff --git a/lisp/progmodes/cperl-mode.el b/lisp/progmodes/cperl-mode.el index e13198fb240..c651e06b899 100644 --- a/lisp/progmodes/cperl-mode.el +++ b/lisp/progmodes/cperl-mode.el @@ -926,12 +926,9 @@ the faces: please specify bold, italic, underline, shadow and box.) (defun cperl-putback-char (c) ; Emacs 19 (set 'unread-command-events (list c))) ; Avoid undefined warning -(if (boundp 'unread-command-events) - (if cperl-xemacs-p - (defun cperl-putback-char (c) ; XEmacs >= 19.12 - (setq unread-command-events (list (eval '(character-to-event c)))))) - (defun cperl-putback-char (c) ; XEmacs <= 19.11 - (set 'unread-command-event (eval '(character-to-event c))))) ; Avoid warnings +(if cperl-xemacs-p + (defun cperl-putback-char (c) ; XEmacs >= 19.12 + (setq unread-command-events (list (eval '(character-to-event c)))))) (or (fboundp 'uncomment-region) (defun uncomment-region (beg end) diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index ef5d1eba998..184077f6a3a 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -1248,7 +1248,11 @@ where they were found." (defun etags-tags-completion-table () - (let ((table (make-vector 511 0))) + (let ((table (make-vector 511 0)) + (point-max (/ (float (point-max)) 100.0)) + (msg-fmt (format + "Making tags completion table for %s...%%d%%%%" + buffer-file-name))) (save-excursion (goto-char (point-min)) ;; This monster regexp matches an etags tag line. @@ -1264,11 +1268,12 @@ where they were found." \\([-a-zA-Z0-9_+*$?:]+\\)[^-a-zA-Z0-9_+*$?:\177]*\\)\177\ \\(\\([^\n\001]+\\)\001\\)?\\([0-9]+\\)?,\\([0-9]+\\)?\n" nil t) - (intern (if (match-beginning 5) - ;; There is an explicit tag name. - (buffer-substring (match-beginning 5) (match-end 5)) - ;; No explicit tag name. Best guess. - (buffer-substring (match-beginning 3) (match-end 3))) + (intern (prog1 (if (match-beginning 5) + ;; There is an explicit tag name. + (buffer-substring (match-beginning 5) (match-end 5)) + ;; No explicit tag name. Best guess. + (buffer-substring (match-beginning 3) (match-end 3))) + (message msg-fmt (/ (point) point-max))) table))) table)) @@ -1866,6 +1871,7 @@ directory specification." (or gotany (error "File %s not in current tags tables" file))))) (with-current-buffer "*Tags List*" + (require 'apropos) (apropos-mode) (setq buffer-read-only t))) @@ -1884,6 +1890,7 @@ directory specification." (funcall tags-apropos-function regexp)))) (etags-tags-apropos-additional regexp)) (with-current-buffer "*Tags List*" + (require 'apropos) (apropos-mode) ;; apropos-mode is derived from fundamental-mode and it kills ;; all local variables. diff --git a/lisp/progmodes/f90.el b/lisp/progmodes/f90.el index 11553a1fdb6..53165fbecb7 100644 --- a/lisp/progmodes/f90.el +++ b/lisp/progmodes/f90.el @@ -153,7 +153,7 @@ ;;; Code: ;; TODO -;; Support for hideshow, align. +;; Support for align. ;; OpenMP, preprocessor highlighting. (defvar comment-auto-fill-only-comments) @@ -589,6 +589,53 @@ characters long.") (make-variable-buffer-local 'f90-cache-position) +;; Hideshow support. +(defconst f90-end-block-re + (concat "^[ \t0-9]*\\<end\\>[ \t]*" + (regexp-opt '("do" "if" "forall" "function" "interface" + "module" "program" "select" "subroutine" + "type" "where" ) t) + "[ \t]*\\sw*") + "Regexp matching the end of a \"block\" of F90 code. +Used in the F90 entry in `hs-special-modes-alist'.") + +;; Ignore the fact that FUNCTION, SUBROUTINE, WHERE, FORALL have a +;; following "(". DO, CASE, IF can have labels; IF must be +;; accompanied by THEN. +;; A big problem is that many of these statements can be broken over +;; lines, even with embedded comments. We only try to handle this for +;; IF ... THEN statements, assuming and hoping it will be less common +;; for other constructs. We match up to one new-line, provided ") +;; THEN" appears on one line. Matching on just ") THEN" is no good, +;; since that includes ELSE branches. +;; For a fully accurate solution, hideshow would probably have to be +;; modified to allow functions as well as regexps to be used to +;; specify block start and end positions. +(defconst f90-start-block-re + (concat + "^[ \t0-9]*" ; statement number + "\\(\\(" + "\\(\\sw+[ \t]*:[ \t]*\\)?" ; structure label + "\\(do\\|select[ \t]*case\\|if[ \t]*(.*\n?.*)[ \t]*then\\|" + ;; Distinguish WHERE block from isolated WHERE. + "\\(where\\|forall\\)[ \t]*(.*)[ \t]*\\(!\\|$\\)\\)\\)" + "\\|" + "program\\|interface\\|module\\|type\\|function\\|subroutine" + ;; ") THEN" at line end. Problem - also does ELSE. +;;; "\\|.*)[ \t]*then[ \t]*\\($\\|!\\)" + "\\)" + "[ \t]*") + "Regexp matching the start of a \"block\" of F90 code. +A simple regexp cannot do this in fully correct fashion, so this +tries to strike a compromise between complexity and flexibility. +Used in the F90 entry in `hs-special-modes-alist'.") + +;; hs-special-modes-alist is autoloaded. +(add-to-list 'hs-special-modes-alist + `(f90-mode ,f90-start-block-re ,f90-end-block-re + "!" f90-end-of-block nil)) + + ;; Imenu support. (defvar f90-imenu-generic-expression (let ((good-char "[^!\"\&\n \t]") (not-e "[^e!\n\"\& \t]") @@ -850,14 +897,16 @@ line-number before indenting." (defsubst f90-get-present-comment-type () "If point lies within a comment, return the string starting the comment. -For example, \"!\" or \"!!\"." +For example, \"!\" or \"!!\", followed by the appropriate amount of +whitespace, if any." + ;; Include the whitespace for consistent auto-filling of comment blocks. (save-excursion (when (f90-in-comment) (beginning-of-line) - (re-search-forward "!+" (line-end-position)) + (re-search-forward "!+[ \t]*" (line-end-position)) (while (f90-in-string) - (re-search-forward "!+" (line-end-position))) - (match-string 0)))) + (re-search-forward "!+[ \t]*" (line-end-position))) + (match-string-no-properties 0)))) (defsubst f90-equal-symbols (a b) "Compare strings A and B neglecting case and allowing for nil value." @@ -1519,6 +1568,7 @@ is non-nil, call `f90-update-line' after inserting the continuation marker." (cond ((f90-in-string) (insert "&\n&")) ((f90-in-comment) + (delete-horizontal-space 'backwards) ; remove trailing whitespace (insert "\n" (f90-get-present-comment-type))) (t (insert "&") (or no-update (f90-update-line)) diff --git a/lisp/progmodes/flymake.el b/lisp/progmodes/flymake.el new file mode 100644 index 00000000000..2cd62eeecee --- /dev/null +++ b/lisp/progmodes/flymake.el @@ -0,0 +1,2504 @@ +;;; flymake.el -- a universal on-the-fly syntax checker + +;; Copyright (C) 2003 Free Software Foundation + +;; Author: Pavel Kobiakov <pk_at_work@yahoo.com> +;; Maintainer: Pavel Kobiakov <pk_at_work@yahoo.com> +;; Version: 0.3 +;; Keywords: c languages tools + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;; +;; Flymake is a minor Emacs mode performing on-the-fly syntax +;; checks using the external syntax check tool (for C/C++ this +;; is usually the compiler) + +;;; Code: + +;;;_* Provide +(provide 'flymake) + +;;;; [[ Overlay compatibility +(autoload 'make-overlay "overlay" "Overlay compatibility kit." t) +(autoload 'overlayp "overlay" "Overlay compatibility kit." t) +(autoload 'overlays-in "overlay" "Overlay compatibility kit." t) +(autoload 'delete-overlay "overlay" "Overlay compatibility kit." t) +(autoload 'overlay-put "overlay" "Overlay compatibility kit." t) +(autoload 'overlay-get "overlay" "Overlay compatibility kit." t) +;;;; ]] + +;;;; [[ cross-emacs compatibility routines +(defvar flymake-emacs + (cond + ((string-match "XEmacs" emacs-version) 'xemacs) + (t 'emacs) + ) + "Currently used emacs flavor" +) + +(defun flymake-makehash(&optional test) + (cond + ((equal flymake-emacs 'xemacs) (if test (make-hash-table :test test) (make-hash-table))) + (t (makehash test)) + ) +) + +(defun flymake-time-to-float(&optional tm) + "Convert `current-time` to a float number of seconds." + (multiple-value-bind (s0 s1 s2) (or tm (current-time)) + (+ (* (float (ash 1 16)) s0) (float s1) (* 0.0000001 s2))) +) +(defun flymake-float-time() + (cond + ((equal flymake-emacs 'xemacs) (flymake-time-to-float (current-time))) + (t (float-time)) + ) +) + +(defun flymake-replace-regexp-in-string(regexp rep str) + (cond + ((equal flymake-emacs 'xemacs) (replace-in-string str regexp rep)) + (t (replace-regexp-in-string regexp rep str)) + ) +) + +(defun flymake-split-string-remove-empty-edges(str pattern) + "split, then remove first and/or last in case it's empty" + (let* ((splitted (split-string str pattern))) + (if (and (> (length splitted) 0) (= 0 (length (elt splitted 0)))) + (setq splitted (cdr splitted)) + ) + (if (and (> (length splitted) 0) (= 0 (length (elt splitted (1- (length splitted)))))) + (setq splitted (reverse (cdr (reverse splitted)))) + ) + splitted + ) +) +(defun flymake-split-string(str pattern) + (cond + ((equal flymake-emacs 'xemacs) (flymake-split-string-remove-empty-edges str pattern)) + (t (split-string str pattern)) + ) +) + +(defun flymake-get-temp-dir() + (cond + ((equal flymake-emacs 'xemacs) (temp-directory)) + (t temporary-file-directory) + ) +) + +(defun flymake-line-beginning-position() + (save-excursion + (beginning-of-line) + (point) + ) +) + +(defun flymake-line-end-position() + (save-excursion + (end-of-line) + (point) + ) +) + +(defun flymake-popup-menu(pos menu-data) + (cond + ((equal flymake-emacs 'xemacs) + (let* ((x-pos (nth 0 (nth 0 pos))) + (y-pos (nth 1 (nth 0 pos))) + (fake-event-props '(button 1 x 1 y 1))) + (setq fake-event-props (plist-put fake-event-props 'x x-pos)) + (setq fake-event-props (plist-put fake-event-props 'y y-pos)) + (popup-menu (flymake-make-xemacs-menu menu-data) (make-event 'button-press fake-event-props)) + ) + ) + (t (x-popup-menu pos (flymake-make-emacs-menu menu-data))) + ) +) + +(defun flymake-make-emacs-menu(menu-data) + (let* ((menu-title (nth 0 menu-data)) + (menu-items (nth 1 menu-data)) + (menu-commands nil)) + + (setq menu-commands (mapcar (lambda (foo) + (cons (nth 0 foo) (nth 1 foo))) + menu-items)) + (list menu-title (cons "" menu-commands)) + ) +) + +(defun flymake-nop() +) + +(defun flymake-make-xemacs-menu(menu-data) + (let* ((menu-title (nth 0 menu-data)) + (menu-items (nth 1 menu-data)) + (menu-commands nil)) + (setq menu-commands (mapcar (lambda (foo) + (vector (nth 0 foo) (or (nth 1 foo) '(flymake-nop)) t)) + menu-items)) + (cons menu-title menu-commands) + ) +) + +(defun flymake-xemacs-window-edges(&optional window) + (let ((edges (window-pixel-edges window)) + tmp) + (setq tmp edges) + (setcar tmp (/ (car tmp) (face-width 'default))) + (setq tmp (cdr tmp)) + (setcar tmp (/ (car tmp) (face-height 'default))) + (setq tmp (cdr tmp)) + (setcar tmp (/ (car tmp) (face-width 'default))) + (setq tmp (cdr tmp)) + (setcar tmp (/ (car tmp) (face-height 'default))) + edges + ) +) + +(defun flymake-current-row() + "return current row in current frame" + (cond + ((equal flymake-emacs 'xemacs) (count-lines (window-start) (point))) + (t (+ (car (cdr (window-edges))) (count-lines (window-start) (point)))) + ) +) + +(defun flymake-selected-frame() + (cond + ((equal flymake-emacs 'xemacs) (selected-window)) + (t (selected-frame)) + ) +) + +;;;; ]] + +(defcustom flymake-log-level -1 + "Logging level, only messages with level > flymake-log-level will not be logged +-1 = NONE, 0 = ERROR, 1 = WARNING, 2 = INFO, 3 = DEBUG" + :group 'flymake + :type 'integer +) + +(defun flymake-log(level text &rest args) + "Log a message with optional arguments" + (if (<= level flymake-log-level) + (let* ((msg (apply 'format text args))) + (message msg) + ;(with-temp-buffer + ; (insert msg) + ; (insert "\n") + ; (flymake-save-buffer-in-file (current-buffer) "d:/flymake.log" t) ; make log file name customizable + ;) + ) + ) +) + +(defun flymake-ins-after(list pos val) + "insert val into list after position pos" + (let ((tmp (copy-sequence list))) ; (???) + (setcdr (nthcdr pos tmp) (cons val (nthcdr (1+ pos) tmp))) + tmp + ) +) + +(defun flymake-set-at(list pos val) + "set val at position pos in list" + (let ((tmp (copy-sequence list))) ; (???) + (setcar (nthcdr pos tmp) val) + tmp + ) +) + +(defvar flymake-pid-to-names(flymake-makehash) + "pid -> source buffer name, output file name mapping" +) + +(defun flymake-reg-names(pid source-buffer-name) + "Save into in pid map" + (unless (stringp source-buffer-name) + (error "invalid buffer name") + ) + (puthash pid (list source-buffer-name) flymake-pid-to-names) +) + +(defun flymake-get-source-buffer-name(pid) + "Return buffer name stored in pid map" + (nth 0 (gethash pid flymake-pid-to-names)) +) + +(defun flymake-unreg-names(pid) + "Delete pid->buffer name mapping" + (remhash pid flymake-pid-to-names) +) + +(defun flymake-get-buffer-var(buffer var-name) + "switch to buffer if necessary and return local variable var" + (unless (bufferp buffer) + (error "invalid buffer") + ) + + (if (eq buffer (current-buffer)) + (symbol-value var-name) + ;else + (save-excursion + (set-buffer buffer) + (symbol-value var-name) + ) + ) +) + +(defun flymake-set-buffer-var(buffer var-name var-value) + "switch to buffer if necessary and set local variable var-name to var-value" + (unless (bufferp buffer) + (error "invalid buffer") + ) + + (if (eq buffer (current-buffer)) + (set var-name var-value) + ;else + (save-excursion + (set-buffer buffer) + (set var-name var-value) + ) + ) +) + +(defvar flymake-buffer-data(flymake-makehash) + "data specific to syntax check tool, in name-value pairs" +) +(make-variable-buffer-local 'flymake-buffer-data) +(defun flymake-get-buffer-data(buffer) + (flymake-get-buffer-var buffer 'flymake-buffer-data) +) +(defun flymake-set-buffer-data(buffer data) + (flymake-set-buffer-var buffer 'flymake-buffer-data data) +) +(defun flymake-get-buffer-value(buffer name) + (gethash name (flymake-get-buffer-data buffer)) +) +(defun flymake-set-buffer-value(buffer name value) + (puthash name value (flymake-get-buffer-data buffer)) +) + +(defvar flymake-output-residual nil + "" +) +(make-variable-buffer-local 'flymake-output-residual) +(defun flymake-get-buffer-output-residual(buffer) + (flymake-get-buffer-var buffer 'flymake-output-residual) +) +(defun flymake-set-buffer-output-residual(buffer residual) + (flymake-set-buffer-var buffer 'flymake-output-residual residual) +) + +(defcustom flymake-allowed-file-name-masks '((".+\\.c$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.cpp$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.xml$" flymake-xml-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.html?$" flymake-xml-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.cs$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.pl$" flymake-perl-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.h$" flymake-master-make-header-init flymake-master-cleanup flymake-get-real-file-name) + (".+\\.java$" flymake-simple-make-java-init flymake-simple-java-cleanup flymake-get-real-file-name) + (".+[0-9]+\\.tex$" flymake-master-tex-init flymake-master-cleanup flymake-get-real-file-name) + (".+\\.tex$" flymake-simple-tex-init flymake-simple-cleanup flymake-get-real-file-name) + (".+\\.idl$" flymake-simple-make-init flymake-simple-cleanup flymake-get-real-file-name) +; (".+\\.cpp$" 1) +; (".+\\.java$" 3) +; (".+\\.h$" 2 (".+\\.cpp$" ".+\\.c$") +; ("[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" 1 2)) +; (".+\\.idl$" 1) +; (".+\\.odl$" 1) +; (".+[0-9]+\\.tex$" 2 (".+\\.tex$") +; ("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2 )) +; (".+\\.tex$" 1) + ) + "*Files syntax checking is allowed for" + :group 'flymake + :type '(repeat (string symbol symbol symbol)) +) + +(defun flymake-get-file-name-mode-and-masks(file-name) + "return the corresponding entry from flymake-allowed-file-name-masks" + (unless (stringp file-name) + (error "invalid file-name") + ) + (let ((count (length flymake-allowed-file-name-masks)) + (idx 0) + (mode-and-masks nil)) + (while (and (not mode-and-masks) (< idx count)) + (if (string-match (nth 0 (nth idx flymake-allowed-file-name-masks)) file-name) + (setq mode-and-masks (cdr (nth idx flymake-allowed-file-name-masks))) + ) + (setq idx (1+ idx)) + ) + (flymake-log 3 "file %s, init=%s" file-name (car mode-and-masks)) + mode-and-masks + ) +) + +(defun flymake-can-syntax-check-file(file-name) + "Determine whether we can syntax check file-name: nil if cannot, non-nil if can" + (if (flymake-get-init-function file-name) + t + ;else + nil + ) +) + +(defun flymake-get-init-function(file-name) + "return init function to be used for the file" + (let* ((init-f (nth 0 (flymake-get-file-name-mode-and-masks file-name)))) + ;(flymake-log 0 "calling %s" init-f) + ;(funcall init-f (current-buffer)) + ) + (nth 0 (flymake-get-file-name-mode-and-masks file-name)) +) + +(defun flymake-get-cleanup-function(file-name) + "return cleanup function to be used for the file" + (nth 1 (flymake-get-file-name-mode-and-masks file-name)) +) + +(defun flymake-get-real-file-name-function(file-name) + "" + (or (nth 2 (flymake-get-file-name-mode-and-masks file-name)) 'flymake-get-real-file-name) +) + +(defcustom flymake-buildfile-dirs '("." ".." "../.." "../../.." "../../../.." "../../../../.." "../../../../../.." "../../../../../../.." "../../../../../../../.." "../../../../../../../../.." "../../../../../../../../../.." "../../../../../../../../../../..") + "dirs to look for buildfile" + :group 'flymake + :type '(repeat (string)) +) + +(defvar flymake-find-buildfile-cache (flymake-makehash 'equal)) +(defun flymake-get-buildfile-from-cache(dir-name) + (gethash dir-name flymake-find-buildfile-cache) +) +(defun flymake-add-buildfile-to-cache(dir-name buildfile) + (puthash dir-name buildfile flymake-find-buildfile-cache) +) +(defun flymake-clear-buildfile-cache() + (clrhash flymake-find-buildfile-cache) +) + +(defun flymake-find-buildfile(buildfile-name source-dir-name dirs) + "find buildfile (i.e. Makefile, build.xml, etc.) starting from current directory. Return its path or nil if not found" + (if (flymake-get-buildfile-from-cache source-dir-name) + (progn + (flymake-get-buildfile-from-cache source-dir-name) + ) + ;else + (let* ((buildfile-dir nil) + (buildfile nil) + (dir-count (length dirs)) + (dir-idx 0) + (found nil)) + + (while (and (not found) (< dir-idx dir-count)) + + (setq buildfile-dir (concat source-dir-name (nth dir-idx dirs))) + (setq buildfile (concat buildfile-dir "/" buildfile-name)) + + (when (file-exists-p buildfile) + (setq found t) + ) + + (setq dir-idx (1+ dir-idx)) + ) + (if found + (progn + (flymake-log 3 "found buildfile at %s/%s" buildfile-dir buildfile-name) + (flymake-add-buildfile-to-cache source-dir-name buildfile-dir) + buildfile-dir + ) + ;else + (progn + (flymake-log 3 "buildfile for %s not found" source-dir-name) + nil + ) + ) + ) + ) +) + +(defun flymake-fix-path-name(name) + "replace all occurences of '\' with '/'" + (when name + (let* ((new-name (flymake-replace-regexp-in-string "[\\]" "/" (expand-file-name name))) + (last-char (elt new-name (1- (length new-name))))) + (setq new-name (flymake-replace-regexp-in-string "\\./" "" new-name)) + (if (equal "/" (char-to-string last-char)) + (setq new-name (substring new-name 0 (1- (length new-name)))) + ) + new-name + ) + ) +) + +(defun flymake-same-files(file-name-one file-name-two) + "t if file-name-one and file-name-two actually point to the same file" + (equal (flymake-fix-path-name file-name-one) (flymake-fix-path-name file-name-two)) +) + +(defun flymake-ensure-ends-with-slash(path) + (if (not (= (elt path (1- (length path))) (string-to-char "/"))) + (concat path "/") + ;else + path + ) +) + +(defun flymake-get-common-path-prefix(string-one string-two) + "return common prefix for two paths" + (when (and string-one string-two) + (let* ((slash-pos-one -1) + (slash-pos-two -1) + (done nil) + (prefix nil)) + + (setq string-one (flymake-ensure-ends-with-slash string-one)) + (setq string-two (flymake-ensure-ends-with-slash string-two)) + + (while (not done) + (setq slash-pos-one (string-match "/" string-one (1+ slash-pos-one))) + (setq slash-pos-two (string-match "/" string-two (1+ slash-pos-two))) + + (if (and slash-pos-one slash-pos-two + (= slash-pos-one slash-pos-two) + (string= (substring string-one 0 slash-pos-one) (substring string-two 0 slash-pos-two))) + (progn + (setq prefix (substring string-one 0 (1+ slash-pos-one))) + ) + ;else + (setq done t) + ) + ) + prefix + ) + ) +) + +(defun flymake-build-relative-path(from-dir to-dir) + "return rel: from-dir/rel == to-dir" + (if (not (equal (elt from-dir 0) (elt to-dir 0))) + (error "first chars in paths %s, %s must be equal (same drive)" from-dir to-dir) + ;else + (let* ((from (flymake-ensure-ends-with-slash (flymake-fix-path-name from-dir))) + (to (flymake-ensure-ends-with-slash (flymake-fix-path-name to-dir))) + (prefix (flymake-get-common-path-prefix from to)) + (from-suffix (substring from (length prefix))) + (up-count (length (flymake-split-string from-suffix "[/]"))) + (to-suffix (substring to (length prefix))) + (idx 0) + (rel nil)) + + (if (and (> (length to-suffix) 0) (equal "/" (char-to-string (elt to-suffix 0)))) + (setq to-suffix (substring to-suffix 1)) + ) + + (while (< idx up-count) + (if (> (length rel) 0) + (setq rel (concat rel "/")) + ) + (setq rel (concat rel "..")) + (setq idx (1+ idx)) + ) + (if (> (length rel) 0) + (setq rel (concat rel "/")) + ) + (if (> (length to-suffix) 0) + (setq rel (concat rel to-suffix)) + ) + + (or rel "./") + ) + ) +) + +(defcustom flymake-master-file-dirs '("." "./src" "./UnitTest") + "dirs where to llok for master files" + :group 'flymake + :type '(repeat (string)) +) + +(defcustom flymake-master-file-count-limit 32 + "max number of master files to check" + :group 'flymake + :type 'integer +) + +(defun flymake-find-possible-master-files(file-name master-file-dirs masks) + "find (by name and location) all posible master files, which are .cpp and .c for and .h. +Files are searched for starting from the .h directory and max max-level parent dirs. +File contents are not checked." + (let* ((dir-idx 0) + (dir-count (length master-file-dirs)) + (files nil) + (done nil) + (masks-count (length masks))) + + (while (and (not done) (< dir-idx dir-count)) + (let* ((dir (concat (flymake-fix-path-name (file-name-directory file-name)) "/" (nth dir-idx master-file-dirs))) + (masks-idx 0)) + (while (and (file-exists-p dir) (not done) (< masks-idx masks-count)) + (let* ((mask (nth masks-idx masks)) + (dir-files (directory-files dir t mask)) + (file-count (length dir-files)) + (file-idx 0)) + + (flymake-log 3 "dir %s, %d file(s) for mask %s" dir file-count mask) + (while (and (not done) (< file-idx file-count)) + (when (not (file-directory-p (nth file-idx dir-files))) + (setq files (cons (nth file-idx dir-files) files)) + (when (>= (length files) flymake-master-file-count-limit) + (flymake-log 3 "master file count limit (%d) reached" flymake-master-file-count-limit) + (setq done t) + ) + ) + (setq file-idx (1+ file-idx)) + ) + ) + (setq masks-idx (1+ masks-idx)) + ) + ) + (setq dir-idx (1+ dir-idx)) + ) + (when files + (setq flymake-included-file-name (file-name-nondirectory file-name)) + (setq files (sort files 'flymake-master-file-compare)) + (setq flymake-included-file-name nil) + ) + (flymake-log 3 "found %d possible master file(s)" (length files)) + files + ) +) + +(defvar flymake-included-file-name nil ; this is used to pass a parameter to a sort predicate below + "" +) + +(defun flymake-master-file-compare(file-one file-two) + "used in sort to move most possible file names to the beginning of the list (File.h -> File.cpp moved to top" + (and (equal (file-name-sans-extension flymake-included-file-name) + (file-name-sans-extension (file-name-nondirectory file-one))) + (not (equal file-one file-two)) + ) +) + +(defcustom flymake-check-file-limit 8192 + "max number of chars to look at when checking possible master file" + :group 'flymake + :type 'integer +) + +(defun flymake-check-patch-master-file-buffer(master-file-temp-buffer + master-file-name patched-master-file-name + source-file-name patched-source-file-name + include-dirs regexp-list) + "check whether master-file-name is indeed a master file for source-file-name. +For .cpp master file this means it includes source-file-name (.h). +If yes, patch a copy of master-file-name to include patched-source-file-name instead of source-file-name. +Whenether a buffer for master-file-name exists, use it as a source instead of reading master file from disk" + (let* ((found nil) + (regexp (format (nth 0 regexp-list) ; "[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" + (file-name-nondirectory source-file-name))) + (path-idx (nth 1 regexp-list)) + (name-idx (nth 2 regexp-list)) + (inc-path nil) + (inc-name nil) + (search-limit flymake-check-file-limit)) + (save-excursion + (unwind-protect + (progn + (set-buffer master-file-temp-buffer) + (when (> search-limit (point-max)) + (setq search-limit (point-max)) + ) + (flymake-log 3 "checking %s against regexp %s" master-file-name regexp) + (goto-char (point-min)) + (while (and (< (point) search-limit) (re-search-forward regexp search-limit t)) + (let* ((match-beg (match-beginning name-idx)) + (match-end (match-end name-idx))) + + (flymake-log 3 "found possible match for %s" (file-name-nondirectory source-file-name)) + (setq inc-path (match-string path-idx)) + (setq inc-name (match-string name-idx)) + (when (string= inc-name (file-name-nondirectory source-file-name)) + (flymake-log 3 "inc-path=%s inc-name=%s" inc-path inc-name) + (when (flymake-check-include source-file-name inc-path inc-name include-dirs) + (setq found t) + ; replace-match is not used here as it fails in xemacs with + ; 'last match not a buffer' error as check-includes calls replace-in-string + (flymake-replace-region (current-buffer) match-beg match-end + (file-name-nondirectory patched-source-file-name)) + ) + ) + (forward-line 1) + ) + ) + (when found + (flymake-save-buffer-in-file (current-buffer) patched-master-file-name) + ) + ) + ;+(flymake-log 3 "killing buffer %s" (buffer-name master-file-temp-buffer)) + (kill-buffer master-file-temp-buffer) + ) + ) + ;+(flymake-log 3 "check-patch master file %s: %s" master-file-name found) + (when found + (flymake-log 2 "found master file %s" master-file-name) + ) + found + ) +) + +(defun flymake-replace-region(buffer beg end rep) + "replace text in buffer in region (beg; end) with rep" + (save-excursion + (delete-region beg end) + (goto-char beg) + (insert rep) + ) +) + +(defun flymake-read-file-to-temp-buffer(file-name) + "isert contents of file-name into newly created temp buffer" + (let* ((temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (file-name-nondirectory file-name)))))) + (save-excursion + (set-buffer temp-buffer) + (insert-file-contents file-name) + ) + temp-buffer + ) +) + +(defun flymake-copy-buffer-to-temp-buffer(buffer) + "copy contents of buffer into newly created temp buffer" + (let ((contents nil) + (temp-buffer nil)) + (save-excursion + (set-buffer buffer) + (setq contents (buffer-string)) + + (setq temp-buffer (get-buffer-create (generate-new-buffer-name (concat "flymake:" (buffer-name buffer))))) + (set-buffer temp-buffer) + (insert contents) + ) + temp-buffer + ) +) + +(defun flymake-check-include(source-file-name inc-path inc-name include-dirs) + "t if source-file-name is the one found via include dirs using inc-path and inc-name" + (if (file-name-absolute-p inc-path) + (flymake-same-files source-file-name (concat inc-path "/" inc-name)) + ;else + (let* ((count (length include-dirs)) + (idx 0) + (file-name nil) + (found nil)) + (while (and (not found) (< idx count)) + (setq file-name (concat (file-name-directory source-file-name) "/" (nth idx include-dirs))) + (if (> (length inc-path) 0) + (setq file-name (concat file-name "/" inc-path)) + ) + (setq file-name (concat file-name "/" inc-name)) + (when (flymake-same-files source-file-name file-name) + (setq found t) + ) + (setq idx (1+ idx)) + ) + found + ) + ) +) + +(defun flymake-find-buffer-for-file(file-name) + "buffer if there exists a buffer visiting file-name, nil otherwise" + (let ((buffer-name (get-file-buffer file-name))) + (if buffer-name + (get-buffer buffer-name) + ) + ) +) + +(defun flymake-create-master-file(source-file-name patched-source-file-name get-incl-dirs-f create-temp-f masks include-regexp-list) + "save source-file-name with a different name, find master file, patch it and save it to." + (let* ((possible-master-files (flymake-find-possible-master-files source-file-name flymake-master-file-dirs masks)) + (master-file-count (length possible-master-files)) + (idx 0) + (temp-buffer nil) + (master-file-name nil) + (patched-master-file-name nil) + (found nil)) + + (while (and (not found) (< idx master-file-count)) + (setq master-file-name (nth idx possible-master-files)) + (setq patched-master-file-name (funcall create-temp-f master-file-name "flymake_master")) + (if (flymake-find-buffer-for-file master-file-name) + (setq temp-buffer (flymake-copy-buffer-to-temp-buffer (flymake-find-buffer-for-file master-file-name))) + ;else + (setq temp-buffer (flymake-read-file-to-temp-buffer master-file-name)) + ) + (setq found + (flymake-check-patch-master-file-buffer + temp-buffer + master-file-name + patched-master-file-name + source-file-name + patched-source-file-name + (funcall get-incl-dirs-f (file-name-directory master-file-name)) + include-regexp-list)) + (setq idx (1+ idx)) + ) + (if found + (list master-file-name patched-master-file-name) + ;else + (progn + (flymake-log 3 "none of %d master file(s) checked includes %s" master-file-count + (file-name-nondirectory source-file-name)) + nil + ) + ) + ) +) + +(defun flymake-save-buffer-in-file(buffer file-name) + (or buffer + (error "invalid buffer") + ) + (save-excursion + (save-restriction + (set-buffer buffer) + (widen) + (make-directory (file-name-directory file-name) 1) + (write-region (point-min) (point-max) file-name nil 566) + ) + ) + (flymake-log 3 "saved buffer %s in file %s" (buffer-name buffer) file-name) +) + +(defun flymake-save-string-to-file(file-name data) + "save string data to file file-name" + (write-region data nil file-name nil 566) +) + +(defun flymake-read-file-to-string(file-name) + "read file contents and return them as a string" + (with-temp-buffer + (insert-file-contents file-name) + (buffer-substring (point-min) (point-max)) + ) +) + +(defun flymake-process-filter(process output) + "flymake process filter: parse output, highlight err lines" + (let* ((pid (process-id process)) + (source-buffer (get-buffer (flymake-get-source-buffer-name pid)))) + + (flymake-log 3 "received %d byte(s) of output from process %d" (length output) pid) + (when source-buffer + (flymake-parse-output-and-residual source-buffer output) + ) + ) +) + +(defun flymake-process-sentinel(process event) + "Sentinel for syntax check buffers" + (if (memq (process-status process) '(signal exit)) + (let*((exit-status (process-exit-status process)) + (command (process-command process)) + (pid (process-id process)) + (source-buffer (get-buffer (flymake-get-source-buffer-name pid))) + (cleanup-f (flymake-get-cleanup-function (buffer-file-name source-buffer)))) + + (flymake-log 2 "process %d exited with code %d" pid exit-status) + (condition-case err + (progn + (flymake-log 3 "cleaning up using %s" cleanup-f) + (funcall cleanup-f source-buffer) + + (flymake-unreg-names pid) + (delete-process process) + + (when source-buffer + (save-excursion + (set-buffer source-buffer) + + (flymake-parse-residual source-buffer) + (flymake-post-syntax-check source-buffer) + (flymake-set-buffer-is-running source-buffer nil) + ) + ) + ) + (error + (let ((err-str (format "Error in process sentinel for buffer %s: %s" + source-buffer (error-message-string err)))) + (flymake-log 0 err-str) + (flymake-set-buffer-is-running source-buffer nil) + ) + ) + ) + ) + ) +) + +(defun flymake-post-syntax-check(source-buffer) + "" + (flymake-set-buffer-err-info source-buffer (flymake-get-buffer-new-err-info source-buffer)) + (flymake-set-buffer-new-err-info source-buffer nil) + + (flymake-set-buffer-err-info source-buffer (flymake-fix-line-numbers + (flymake-get-buffer-err-info source-buffer) + 1 + (flymake-count-lines source-buffer))) + (flymake-delete-own-overlays source-buffer) + (flymake-highlight-err-lines source-buffer (flymake-get-buffer-err-info source-buffer)) + + (let ((err-count (flymake-get-err-count (flymake-get-buffer-err-info source-buffer) "e")) + (warn-count (flymake-get-err-count (flymake-get-buffer-err-info source-buffer) "w"))) + + (flymake-log 2 "%s: %d error(s), %d warning(s) in %.2f second(s)" + (buffer-name source-buffer) err-count warn-count + (- (flymake-float-time) (flymake-get-buffer-check-start-time source-buffer))) + (flymake-set-buffer-check-start-time source-buffer nil) + (if (and (equal 0 err-count) (equal 0 warn-count)) + (if (equal 0 exit-status) + (flymake-report-status source-buffer "" "") ; PASSED + ;else + (if (not (flymake-get-buffer-check-was-interrupted source-buffer)) + (flymake-report-fatal-status (current-buffer) "CFGERR" + (format "Configuration error has occured while running %s" command)) + ;else + (flymake-report-status source-buffer nil "") ; "STOPPED" + ) + ) + ;else + (flymake-report-status source-buffer (format "%d/%d" err-count warn-count) "") + ) + ) +) + +(defun flymake-parse-output-and-residual(source-buffer output) + "split output into lines, merge in residual if necessary" + (save-excursion + (set-buffer source-buffer) + (let* ((buffer-residual (flymake-get-buffer-output-residual source-buffer)) + (total-output (if buffer-residual (concat buffer-residual output) output)) + (lines-and-residual (flymake-split-output total-output)) + (lines (nth 0 lines-and-residual)) + (new-residual (nth 1 lines-and-residual))) + + (flymake-set-buffer-output-residual source-buffer new-residual) + (flymake-set-buffer-new-err-info source-buffer (flymake-parse-err-lines + (flymake-get-buffer-new-err-info source-buffer) + source-buffer lines)) + ) + ) +) + +(defun flymake-parse-residual(source-buffer) + "parse residual if it's non empty" + (save-excursion + (set-buffer source-buffer) + (when (flymake-get-buffer-output-residual source-buffer) + (flymake-set-buffer-new-err-info source-buffer (flymake-parse-err-lines + (flymake-get-buffer-new-err-info source-buffer) + source-buffer + (list (flymake-get-buffer-output-residual source-buffer)))) + (flymake-set-buffer-output-residual source-buffer nil) + ) + ) +) + +(defvar flymake-err-info nil + "sorted list of line numbers and lists of err info in the form (file, err-text)." +) +(make-variable-buffer-local 'flymake-err-info) +(defun flymake-get-buffer-err-info(buffer) + (flymake-get-buffer-var buffer 'flymake-err-info) +) +(defun flymake-set-buffer-err-info(buffer err-info) + (flymake-set-buffer-var buffer 'flymake-err-info err-info) +) +(defun flymake-er-make-er(line-no line-err-info-list) + (list line-no line-err-info-list) +) +(defun flymake-er-get-line(err-info) + (nth 0 err-info) +) +(defun flymake-er-get-line-err-info-list(err-info) + (nth 1 err-info) +) + +(defvar flymake-new-err-info nil + "the same as flymake -err-info, effective when a syntax check is in progress" +) +(make-variable-buffer-local 'flymake-new-err-info) +(defun flymake-get-buffer-new-err-info(buffer) + (flymake-get-buffer-var buffer 'flymake-new-err-info) +) +(defun flymake-set-buffer-new-err-info(buffer new-err-info) + (flymake-set-buffer-var buffer 'flymake-new-err-info new-err-info) +) + +;; getters/setters for line-err-info: (file, line, type, text). +(defun flymake-ler-make-ler(file line type text &optional full-file) + (list file line type text full-file) +) +(defun flymake-ler-get-file(line-err-info) + (nth 0 line-err-info) +) +(defun flymake-ler-get-line(line-err-info) + (nth 1 line-err-info) +) +(defun flymake-ler-get-type(line-err-info) + (nth 2 line-err-info) +) +(defun flymake-ler-get-text(line-err-info) + (nth 3 line-err-info) +) +(defun flymake-ler-get-full-file(line-err-info) + (nth 4 line-err-info) +) +(defun flymake-ler-set-file(line-err-info file) + (flymake-ler-make-ler file + (flymake-ler-get-line line-err-info) + (flymake-ler-get-type line-err-info) + (flymake-ler-get-text line-err-info) + (flymake-ler-get-full-file line-err-info)) +) +(defun flymake-ler-set-full-file(line-err-info full-file) + (flymake-ler-make-ler (flymake-ler-get-file line-err-info) + (flymake-ler-get-line line-err-info) + (flymake-ler-get-type line-err-info) + (flymake-ler-get-text line-err-info) + full-file) +) +(defun flymake-ler-set-line(line-err-info line) + (flymake-ler-make-ler (flymake-ler-get-file line-err-info) + line + (flymake-ler-get-type line-err-info) + (flymake-ler-get-text line-err-info) + (flymake-ler-get-full-file line-err-info)) +) + +(defun flymake-get-line-err-count(line-err-info-list type) + "return number of errors of specified type - e or w" + (let* ((idx 0) + (count (length line-err-info-list)) + (err-count 0)) + + (while (< idx count) + (when (equal type (flymake-ler-get-type (nth idx line-err-info-list))) + (setq err-count (1+ err-count)) + ) + (setq idx (1+ idx)) + ) + err-count + ) +) + +(defun flymake-get-err-count(err-info-list type) + "return number of errors of specified type for the err-info-list" + (let* ((idx 0) + (count (length err-info-list)) + (err-count 0)) + (while (< idx count) + (setq err-count (+ err-count (flymake-get-line-err-count (nth 1 (nth idx err-info-list)) type))) + (setq idx (1+ idx)) + ) + err-count + ) +) + +(defun flymake-fix-line-numbers(err-info-list min-line max-line) + "replace line-numbers < min-line with min-line and > max-line with max-line - as some compilers might report line number outside the file being compiled" + (let* ((count (length err-info-list)) + (err-info nil) + (line 0)) + (while (> count 0) + (setq err-info (nth (1- count) err-info-list)) + (setq line (flymake-er-get-line err-info)) + (when (or (< line min-line) (> line max-line)) + (setq line (if (< line min-line) min-line max-line)) + (setq err-info-list (flymake-set-at err-info-list (1- count) + (flymake-er-make-er line + (flymake-er-get-line-err-info-list err-info)))) + ) + (setq count (1- count)) + ) + ) + err-info-list +) + +(defun flymake-highlight-err-lines(buffer err-info-list) + "highlight err-lines in buffer using info from err-info-list" + (save-excursion + (set-buffer buffer) + (let* ((idx 0) + (count (length err-info-list))) + (while (< idx count) + (flymake-highlight-line (car (nth idx err-info-list)) (nth 1 (nth idx err-info-list))) + (setq idx (1+ idx)) + ) + ) + ) +) + +(defun flymake-overlay-p(ov) + "Determine whether overlay was created by flymake" + (and (overlayp ov) (overlay-get ov 'flymake-overlay)) +) + +(defun flymake-make-overlay(beg end tooltip-text face mouse-face) + "Allocate a flymake overlay in range beg end" + (when (not (flymake-region-has-flymake-overlays beg end)) + (let ((ov (make-overlay beg end nil t t))) + (overlay-put ov 'face face) + (overlay-put ov 'mouse-face mouse-face) + (overlay-put ov 'help-echo tooltip-text) + (overlay-put ov 'flymake-overlay t) + (overlay-put ov 'priority 100) + ;+(flymake-log 3 "created overlay %s" ov) + ov + ) + (flymake-log 3 "created an overlay at (%d-%d)" beg end) + ) +) + +(defun flymake-delete-own-overlays(buffer) + "Delete all flymake overlays in buffer" + (save-excursion + (set-buffer buffer) + (let ((ov (overlays-in (point-min) (point-max)))) + (while (consp ov) + (when (flymake-overlay-p (car ov)) + (delete-overlay (car ov)) + ;+(flymake-log 3 "deleted overlay %s" ov) + ) + (setq ov (cdr ov)) + ) + ) + ) +) + +(defun flymake-region-has-flymake-overlays(beg end) + "t if specified regions has at least one flymake overlay, nil otrherwise" + (let ((ov (overlays-in beg end)) + (has-flymake-overlays nil)) + (while (consp ov) + (when (flymake-overlay-p (car ov)) + (setq has-flymake-overlays t) + ) + (setq ov (cdr ov)) + ) + ) +) + +(defface flymake-errline-face +;+ '((((class color)) (:foreground "OrangeRed" :bold t :underline t)) +;+ '((((class color)) (:underline "OrangeRed")) + '((((class color)) (:background "LightPink")) + (t (:bold t))) + "Face used for marking error lines" + :group 'flymake +) + +(defface flymake-warnline-face + '((((class color)) (:background "LightBlue2")) + (t (:bold t))) + "Face used for marking warning lines" + :group 'flymake +) + + +(defun flymake-highlight-line(line-no line-err-info-list) + "highlight line line-no in current buffer, perhaps use text from line-err-info-list to enhance highlighting" + (goto-line line-no) + (let* ((line-beg (flymake-line-beginning-position)) + (line-end (flymake-line-end-position)) + (beg line-beg) + (end line-end) + (tooltip-text (flymake-ler-get-text (nth 0 line-err-info-list))) + (face nil)) + + (goto-char line-beg) + (while (looking-at "[ \t]") + (forward-char) + ) + + (setq beg (point)) + + (goto-char line-end) + (while (and (looking-at "[ \t\r\n]") (> (point) 1)) + (backward-char) + ) + + (setq end (1+ (point))) + + (when (<= end beg) + (setq beg line-beg) + (setq end line-end) + ) + (when (= end beg) + (goto-char end) + (forward-line) + (setq end (point)) + ) + (if (> (flymake-get-line-err-count line-err-info-list "e") 0) + (setq face 'flymake-errline-face) + ;else + (setq face 'flymake-warnline-face) + ) + (flymake-make-overlay beg end tooltip-text face nil) + ) +) + +(defun flymake-parse-err-lines(err-info-list source-buffer lines) + "parse err lines, store info in err-info-list" + (let* ((count (length lines)) + (idx 0) + (line-err-info nil) + (real-file-name nil) + (source-file-name (buffer-file-name source-buffer)) + (get-real-file-name-f (flymake-get-real-file-name-function source-file-name))) + + (while (< idx count) + (setq line-err-info (flymake-parse-line (nth idx lines))) + (when line-err-info + (setq real-file-name (funcall get-real-file-name-f source-buffer (flymake-ler-get-file line-err-info))) + (setq line-err-info (flymake-ler-set-full-file line-err-info real-file-name)) + + (if (flymake-same-files real-file-name source-file-name) + (setq line-err-info (flymake-ler-set-file line-err-info nil)) + ;else + (setq line-err-info (flymake-ler-set-file line-err-info (file-name-nondirectory real-file-name))) + ) + + (setq err-info-list (flymake-add-err-info err-info-list line-err-info)) + ) + (flymake-log 3 "parsed '%s', %s line-err-info" (nth idx lines) (if line-err-info "got" "no")) + (setq idx (1+ idx)) + ) + err-info-list + ) +) + +(defun flymake-split-output(output) + "split output into lines, return last one as residual if it does not end with newline char. Returns ((lines) residual)" + (when (and output (> (length output) 0)) + (let* ((lines (flymake-split-string output "[\n\r]+")) + (complete (equal "\n" (char-to-string (aref output (1- (length output)))))) + (residual nil)) + (when (not complete) + (setq residual (car (last lines))) + (setq lines (butlast lines)) + ) + (list lines residual) + ) + ) +) + +(eval-when-compile (require 'compile)) +(defvar flymake-err-line-patterns ; regexp file-idx line-idx col-idx (optional) text-idx(optional), match-end to end of string is error text + (append + '( + ; MS Visual C++ 6.0 + ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)" + 1 3 nil 4) + ; jikes + ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\|Semantic Error\\):[ \t\n]*\\(.+\\)\\)" + 1 3 nil 4) + ; MS midl + ("midl[ ]*:[ ]*\\(command line error .*\\)" + nil nil nil 1) + ; MS C# + ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\),[0-9]+)\: \\(\\(error\\|warning\\|fatal error\\) \\(CS[0-9]+\\):[ \t\n]*\\(.+\\)\\)" + 1 3 nil 4) + ; perl + ("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) + ; LaTeX warnings (fileless) ("\\(LaTeX \\(Warning\\|Error\\): .*\\) on input line \\([0-9]+\\)" 20 3 nil 1) + ; ant/javac + (" *\\(\\[javac\\]\\)? *\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[ \t\n]*\\(.+\\)" + 2 4 nil 5) + ) + compilation-error-regexp-alist) + "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" +) +;(defcustom flymake-err-line-patterns +; '( +; ; MS Visual C++ 6.0 +; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)(\\([0-9]+\\)) \: \\(\\(error\\|warning\\|fatal error\\) \\(C[0-9]+\\):[ \t\n]*\\(.+\\)\\)" +; 1 3 4) +; ; jikes +; ("\\(\\([a-zA-Z]:\\)?[^:(\t\n]+\\)\:\\([0-9]+\\)\:[0-9]+\:[0-9]+\:[0-9]+\: \\(\\(Error\\|Warning\\|Caution\\):[ \t\n]*\\(.+\\)\\)" +; 1 3 4)) +; "patterns for matching error/warning lines, (regexp file-idx line-idx err-text-idx)" +; :group 'flymake +; :type '(repeat (string number number number)) +;) + +(defun flymake-parse-line(line) + "parse line to see whether it's an error of warning, return it's components or nil for no match" + (let ((raw-file-name nil) + (line-no 0) + (err-type "e") + (err-text nil) + (count (length flymake-err-line-patterns)) + (idx 0) + (matched nil)) + (while (and (< idx count) (not matched)) + (when (string-match (car (nth idx flymake-err-line-patterns)) line) + (let* ((file-idx (nth 1 (nth idx flymake-err-line-patterns))) + (line-idx (nth 2 (nth idx flymake-err-line-patterns)))) + + (setq raw-file-name (if file-idx (match-string file-idx line) nil)) + (setq line-no (if line-idx (string-to-int (match-string line-idx line)) 0)) + (setq err-text (if (> (length (nth idx flymake-err-line-patterns)) 4) + (match-string (nth 4 (nth idx flymake-err-line-patterns)) line) + (flymake-patch-err-text (substring line (match-end 0))))) + (or err-text (setq err-text "<no error text>")) + (if (and err-text (string-match "^[wW]arning" err-text)) + (setq err-type "w") + ) + (flymake-log 3 "parse line: file-idx=%s line-idx=%s file=%s line=%s text=%s" file-idx line-idx + raw-file-name line-no err-text) + (setq matched t) + ) + ) + (setq idx (1+ idx)) + ) + (if matched + (flymake-ler-make-ler raw-file-name line-no err-type err-text) + ; else + () + ) + ) +) + +(defun flymake-find-err-info(err-info-list line-no) + "find (line-err-info-list pos) for specified line-no" + (if err-info-list + (let* ((line-err-info-list nil) + (pos 0) + (count (length err-info-list))) + + (while (and (< pos count) (< (car (nth pos err-info-list)) line-no)) + (setq pos (1+ pos)) + ) + (when (and (< pos count) (equal (car (nth pos err-info-list)) line-no)) + (setq line-err-info-list (flymake-er-get-line-err-info-list (nth pos err-info-list))) + ) + (list line-err-info-list pos) + ) + ;else + '(nil 0) + ) +) + +(defun flymake-line-err-info-is-less-or-equal(line-one line-two) + (or (string< (flymake-ler-get-type line-one) (flymake-ler-get-type line-two)) + (and (string= (flymake-ler-get-type line-one) (flymake-ler-get-type line-two)) + (not (flymake-ler-get-file line-one)) (flymake-ler-get-file line-two) + ) + (and (string= (flymake-ler-get-type line-one) (flymake-ler-get-type line-two)) + (or (and (flymake-ler-get-file line-one) (flymake-ler-get-file line-two)) + (and (not (flymake-ler-get-file line-one)) (not (flymake-ler-get-file line-two))) + ) + ) + ) +) + +(defun flymake-add-line-err-info(line-err-info-list line-err-info) + "insert new err info favoring sorting: err-type e/w, filename nil/non-nill" + (if (not line-err-info-list) + (list line-err-info) + ;else + (let* ((count (length line-err-info-list)) + (idx 0)) + (while (and (< idx count) (flymake-line-err-info-is-less-or-equal (nth idx line-err-info-list) line-err-info)) + (setq idx (1+ idx)) + ) + (cond ((equal 0 idx) (setq line-err-info-list (cons line-err-info line-err-info-list))) + (t (setq line-err-info-list (flymake-ins-after line-err-info-list (1- idx) line-err-info))) + ) + line-err-info-list + ) + ) +) + +(defun flymake-add-err-info(err-info-list line-err-info) + "add error info (file line type text) to err info list preserving sort order" + (let* ((count (length err-info-list)) + (line-no (if (flymake-ler-get-file line-err-info) 1 (flymake-ler-get-line line-err-info))) + (info-and-pos (flymake-find-err-info err-info-list line-no)) + (exists (car info-and-pos)) + (pos (nth 1 info-and-pos)) + (line-err-info-list nil) + (err-info nil)) + + (if exists + (setq line-err-info-list (flymake-er-get-line-err-info-list (car (nthcdr pos err-info-list)))) + ) + (setq line-err-info-list (flymake-add-line-err-info line-err-info-list line-err-info)) + + (setq err-info (flymake-er-make-er line-no line-err-info-list)) + (cond (exists (setq err-info-list (flymake-set-at err-info-list pos err-info))) + ((equal 0 pos) (setq err-info-list (cons err-info err-info-list))) + (t (setq err-info-list (flymake-ins-after err-info-list (1- pos) err-info))) + ) + err-info-list + ) +) + +(defun flymake-get-project-include-dirs-imp(basedir) + "include dirs for the project current file belongs to" + (if (flymake-get-project-include-dirs-from-cache basedir) + (progn + (flymake-get-project-include-dirs-from-cache basedir) + ) + ;else + (let* ((command-line (concat "make -C\"" basedir "\" DUMPVARS=INCLUDE_DIRS dumpvars")) + (output (shell-command-to-string command-line)) + (lines (flymake-split-string output "\n")) + (count (length lines)) + (idx 0) + (inc-dirs nil)) + (while (and (< idx count) (not (string-match "^INCLUDE_DIRS=.*" (nth idx lines)))) + (setq idx (1+ idx)) + ) + (when (< idx count) + (let* ((inc-lines (flymake-split-string (nth idx lines) " *-I")) + (inc-count (length inc-lines))) + (while (> inc-count 0) + (when (not (string-match "^INCLUDE_DIRS=.*" (nth (1- inc-count) inc-lines))) + (setq inc-dirs (cons (flymake-replace-regexp-in-string "\"" "" (nth (1- inc-count) inc-lines)) inc-dirs)) + ) + (setq inc-count (1- inc-count)) + ) + ) + ) + (flymake-add-project-include-dirs-to-cache basedir inc-dirs) + inc-dirs + ) + ) +) + +(defcustom flymake-get-project-include-dirs-function 'flymake-get-project-include-dirs-imp + "function used to get project inc dirs, one paramater: basedir name" + :group 'flymake + :type 'function +) + +(defun flymake-get-project-include-dirs(basedir) + (funcall flymake-get-project-include-dirs-function basedir) +) + +(defun flymake-get-system-include-dirs() + "system include dirs - from the 'INCLUDE' env setting" + (let* ((includes (getenv "INCLUDE"))) + (if includes (flymake-split-string includes path-separator) nil) + ) +) + +(defvar flymake-project-include-dirs-cache (flymake-makehash 'equal)) +(defun flymake-get-project-include-dirs-from-cache(base-dir) + (gethash base-dir flymake-project-include-dirs-cache) +) +(defun flymake-add-project-include-dirs-to-cache(base-dir include-dirs) + (puthash base-dir include-dirs flymake-project-include-dirs-cache) +) +(defun flymake-clear-project-include-dirs-cache() + (clrhash flymake-project-include-dirs-cache) +) + +(defun flymake-get-include-dirs(base-dir) + "dirs to use when resolving local filenames" + (let* ((include-dirs (append '(".") (flymake-get-project-include-dirs base-dir) (flymake-get-system-include-dirs)))) + include-dirs + ) +) + +(defun flymake-find-file(rel-file-name include-dirs) + "iterate through include-dirs, return first 'include-dir/rel-file-name' that exists, or just rel-file-name if not" + (let* ((count (length include-dirs)) + (idx 0) + (found nil) + (full-file-name rel-file-name)) + + (while (and (not found) (< idx count)) + (let* ((dir (nth idx include-dirs))) + (setq full-file-name (concat dir "/" rel-file-name)) + (when (file-exists-p full-file-name) + (setq done t) + ) + ) + (setq idx (1+ idx)) + ) + (if found + full-file-name + ;else + rel-file-name + ) + ) +) + +(defun flymake-restore-formatting(source-buffer) + "Remove any formatting made by flymake" +) + +(defun flymake-get-program-dir(buffer) + "dir to start profram in" + (unless (bufferp buffer) + (error "invlid buffer") + ) + (save-excursion + (set-buffer buffer) + default-directory + ) +) + +(defun flymake-safe-delete-file(file-name) + (when (and file-name (file-exists-p file-name)) + (delete-file file-name) + (flymake-log 1 "deleted file %s" file-name) + ) +) + +(defun flymake-safe-delete-directory(dir-name) + (condition-case err + (progn + (delete-directory dir-name) + (flymake-log 1 "deleted dir %s" dir-name) + ) + (error + (flymake-log 1 "failed to delete dir %s, error ignored" dir-name) + ) + ) +) + +(defcustom flymake-compilation-prevents-syntax-check t + "if non-nil, syntax check won't be started in case compilation is running" + :group 'flymake + :type 'boolean +) + +(defun flymake-start-syntax-check(buffer) + "start syntax checking for buffer" + (unless (bufferp buffer) + (error "expected a buffer") + ) + (save-excursion + (set-buffer buffer) + (flymake-log 3 "flymake is running: %s" (flymake-get-buffer-is-running buffer)) + (when (and (not (flymake-get-buffer-is-running buffer)) + (flymake-can-syntax-check-file (buffer-file-name buffer))) + (when (or (not flymake-compilation-prevents-syntax-check) + (not (flymake-compilation-is-running))) ;+ (flymake-rep-ort-status buffer "COMP") + (flymake-clear-buildfile-cache) + (flymake-clear-project-include-dirs-cache) + + (flymake-set-buffer-check-was-interrupted buffer nil) + (flymake-set-buffer-data buffer (flymake-makehash 'equal)) + + (let* ((source-file-name (buffer-file-name buffer)) + (init-f (flymake-get-init-function source-file-name)) + (cleanup-f (flymake-get-cleanup-function source-file-name)) + (cmd-and-args (funcall init-f buffer)) + (cmd (nth 0 cmd-and-args)) + (args (nth 1 cmd-and-args)) + (dir (nth 2 cmd-and-args))) + (if (not cmd-and-args) + (progn + (flymake-log 0 "init function %s for %s failed, cleaning up" init-f source-file-name) + (funcall cleanup-f buffer) + ) + ;else + (progn + (flymake-set-buffer-last-change-time buffer nil) + (flymake-start-syntax-check-process buffer cmd args dir) + ) + ) + ) + ) + ) + ) +) + +(defun flymake-start-syntax-check-process(buffer cmd args dir) + "start syntax check-process" + + (let* ((process nil)) + (condition-case err + (progn + (when dir + (let ((default-directory dir)) + (flymake-log 3 "starting process on dir %s" default-directory) + ) + ) + (setq process (get-process (apply 'start-process "flymake-proc" nil cmd args))) + (set-process-sentinel process 'flymake-process-sentinel) + (set-process-filter process 'flymake-process-filter) + + (flymake-reg-names (process-id process) (buffer-name buffer)) + + (flymake-set-buffer-is-running buffer t) + (flymake-set-buffer-last-change-time buffer nil) + (flymake-set-buffer-check-start-time buffer (flymake-float-time)) + + (flymake-report-status buffer nil "*") + (flymake-log 2 "started process %d, command=%s, dir=%s" + (process-id process) (process-command process) default-directory) + process + ) + (error + (let ((err-str (format "Failed to launch syntax check process '%s' with args %s: %s" + cmd args (error-message-string err))) + (source-file-name (buffer-file-name buffer)) + (cleanup-f (flymake-get-cleanup-function source-file-name))) + (flymake-log 0 err-str) + (funcall cleanup-f buffer) + (flymake-report-fatal-status buffer "PROCERR" err-str) + ) + ) + ) + ) +) + +(defun flymake-kill-process(pid &optional rest) + "kill process pid" + (signal-process pid 9) + (let* ((buffer-name (flymake-get-source-buffer-name pid))) + (when (and buffer-name (get-buffer buffer-name)) + (flymake-set-buffer-check-was-interrupted (get-buffer buffer-name) t) + ) + ) + (flymake-log 1 "killed process %d" pid) +) + +(defun flymake-stop-all-syntax-checks() + "kill all syntax check processes" + (interactive) + (let ((pids (copy-hash-table flymake-pid-to-names))) + (maphash 'flymake-kill-process pids) + ) +) + +(defun flymake-compilation-is-running() + (and (boundp 'compilation-in-progress) + compilation-in-progress) +) + +(defun flymake-compile() + "kill all flymake syntax checks, start compilation" + (interactive) + (flymake-stop-all-syntax-checks) + (call-interactively 'compile) +) + +(defvar flymake-is-running nil + "t if flymake syntax check process is running for the current buffer" +) +(make-variable-buffer-local 'flymake-is-running) +(defun flymake-get-buffer-is-running(buffer) + (flymake-get-buffer-var buffer 'flymake-is-running) +) +(defun flymake-set-buffer-is-running(buffer is-running) + (flymake-set-buffer-var buffer 'flymake-is-running is-running) +) + +(defvar flymake-timer nil + "timer for starting syntax checks" +) +(make-variable-buffer-local 'flymake-timer) +(defun flymake-get-buffer-timer(buffer) + (flymake-get-buffer-var buffer 'flymake-timer) +) +(defun flymake-set-buffer-timer(buffer timer) + (flymake-set-buffer-var buffer 'flymake-timer timer) +) + +(defvar flymake-last-change-time nil + "time of last buffer change" +) +(make-variable-buffer-local 'flymake-last-change-time) +(defun flymake-get-buffer-last-change-time(buffer) + (flymake-get-buffer-var buffer 'flymake-last-change-time) +) +(defun flymake-set-buffer-last-change-time(buffer change-time) + (flymake-set-buffer-var buffer 'flymake-last-change-time change-time) +) + +(defvar flymake-check-start-time nil + "time at which syntax check was started") +(make-variable-buffer-local 'flymake-check-start-time) +(defun flymake-get-buffer-check-start-time(buffer) + (flymake-get-buffer-var buffer 'flymake-check-start-time) +) +(defun flymake-set-buffer-check-start-time(buffer check-start-time) + (flymake-set-buffer-var buffer 'flymake-check-start-time check-start-time) +) + +(defvar flymake-check-was-interrupted nil + "t if syntax check was killed by flymake-compile" +) +(make-variable-buffer-local 'flymake-check-was-interrupted) +(defun flymake-get-buffer-check-was-interrupted(buffer) + (flymake-get-buffer-var buffer 'flymake-check-was-interrupted) +) +(defun flymake-set-buffer-check-was-interrupted(buffer interrupted) + (flymake-set-buffer-var buffer 'flymake-check-was-interrupted interrupted) +) + +(defcustom flymake-no-changes-timeout 0.5 + "time to wait after last change before starting compilation" + :group 'flymake + :type 'number +) + +(defun flymake-on-timer-event(buffer) + "start a syntax check for buffer if necessary" + ;+(flymake-log 3 "timer: running=%s, time=%s, cur-time=%s" (flymake-get-buffer-is-running buffer) (flymake-get-buffer-last-change-time buffer) (flymake-float-time)) + + (when (and (bufferp buffer) (not (flymake-get-buffer-is-running buffer))) + (save-excursion + (set-buffer buffer) + (when (and (flymake-get-buffer-last-change-time buffer) + (> (flymake-float-time) (+ flymake-no-changes-timeout (flymake-get-buffer-last-change-time buffer)))) + (flymake-set-buffer-last-change-time buffer nil) + (flymake-log 3 "starting syntax check as more than 1 second passed since last change") + (flymake-start-syntax-check buffer) + ) + ) + ) +) + +(defun flymake-start-syntax-check-for-current-buffer() + "run flymake-start-syntax-check for current buffer if it isn't already running" + (interactive) + (flymake-start-syntax-check (current-buffer)) +) + +(defun flymake-current-line-no() + "return number of current line in current buffer" + (interactive) + (let ((beg (point-min)) + (end (if (= (point) (point-max)) (point) (1+ (point))))) + (count-lines beg end) + ) +) + +(defun flymake-get-line-count(buffer) + "return number of lines in buffer" + (unless (bufferp buffer) + (error "invalid buffer") + ) + (save-excursion + (set-buffer buffer) + (count-lines (point-min) (point-max)) + ) +) + +(defun flymake-count-lines(buffer) + "return number of lines in buffer" + (save-excursion + (set-buffer buffer) + (count-lines (point-min) (point-max)) + ) +) + +(defun flymake-get-point-pixel-pos() + "return point position in pixels: (x, y)" + (let ((mouse-pos (mouse-position)) + (pixel-pos nil) + (ret nil)) + (if (car (cdr mouse-pos)) + (progn + (set-mouse-position (flymake-selected-frame) (current-column) (flymake-current-row)) + (setq pixel-pos (mouse-pixel-position)) + (set-mouse-position (car mouse-pos) (car (cdr mouse-pos)) (cdr (cdr mouse-pos))) + (setq ret (list (car (cdr pixel-pos)) (cdr (cdr pixel-pos)))) + ) + ;else + (progn + (setq ret '(0 0)) + ) + ) + (flymake-log 3 "mouse pos is %s" ret) + ret + ) +) + +(defun flymake-display-err-menu-for-current-line() + "Display a menu with errors/warnings for current line if it has errors and/or warnings" + (interactive) + (let* ((line-no (flymake-current-line-no)) + (line-err-info-list (nth 0 (flymake-find-err-info (flymake-get-buffer-err-info (current-buffer)) line-no))) + (menu-data (flymake-make-err-menu-data line-no line-err-info-list)) + (choice nil) + (mouse-pos (flymake-get-point-pixel-pos)) + (moved-mouse-pos (list (car mouse-pos) (+ 10 (car (cdr mouse-pos))))) + (menu-pos (list (flymake-get-point-pixel-pos) (selected-window)))) + (if menu-data + (progn + (setq choice (flymake-popup-menu menu-pos menu-data)) + (flymake-log 3 "choice=%s" choice) + (when choice + (eval choice) + ) + ) + ;else + (flymake-log 1 "no errors for line %d" line-no) + ) + ) +) + +(defun flymake-make-err-menu-data(line-no line-err-info-list) + "Make a (menu-title (item-title item-action)*) list with errors/warnings from line-err-info" + (let* ((menu-items nil)) + (when line-err-info-list + (let* ((count (length line-err-info-list)) + (menu-item-text nil)) + (while (> count 0) + (setq menu-item-text (flymake-ler-get-text (nth (1- count) line-err-info-list))) + (let* ((file (flymake-ler-get-file (nth (1- count) line-err-info-list))) + (full-file (flymake-ler-get-full-file (nth (1- count) line-err-info-list))) + (line (flymake-ler-get-line (nth (1- count) line-err-info-list)))) + (if file + (setq menu-item-text (concat menu-item-text " - " file "(" (format "%d" line) ")")) + ) + (setq menu-items (cons (list menu-item-text + (if file (list 'flymake-goto-file-and-line full-file line) nil)) + menu-items)) + ) + (setq count (1- count)) + ) + (flymake-log 3 "created menu-items with %d item(s)" (length menu-items)) + ) + ) + (if menu-items + (let* ((menu-title (format "Line %d: %d error(s), %d warning(s)" line-no + (flymake-get-line-err-count line-err-info-list "e") + (flymake-get-line-err-count line-err-info-list "w")))) + (list menu-title menu-items) + ) + ;else + nil + ) + ) +) + +(defun flymake-goto-file-and-line(file line) + "try to get buffer for file and goto line line in it" + (if (not (file-exists-p file)) + (flymake-log 1 "file %s does not exists" file) + ;else + (progn + (find-file file) + (goto-line line) + ) + ) +) +;; flymake minor mode declarations + +(defvar flymake-mode nil) +(make-variable-buffer-local 'flymake-mode) + +(defvar flymake-mode-line nil + "" +) +(make-variable-buffer-local 'flymake-mode-line) +(defun flymake-get-buffer-mode-line(buffer) + (flymake-get-buffer-var buffer 'flymake-mode-line) +) +(defun flymake-set-buffer-mode-line(buffer mode-line-string) + (flymake-set-buffer-var buffer 'flymake-mode-line mode-line-string) +) + +(defvar flymake-mode-line-e-w nil) +(make-variable-buffer-local 'flymake-mode-line-e-w) +(defun flymake-get-buffer-mode-line-e-w(buffer) + (flymake-get-buffer-var buffer 'flymake-mode-line-e-w) +) +(defun flymake-set-buffer-mode-line-e-w(buffer e-w) + (flymake-set-buffer-var buffer 'flymake-mode-line-e-w e-w) +) + +(defvar flymake-mode-line-status nil) +(make-variable-buffer-local 'flymake-mode-line-status) +(defun flymake-get-buffer-mode-line-status(buffer) + (flymake-get-buffer-var buffer 'flymake-mode-line-status) +) +(defun flymake-set-buffer-mode-line-status(buffer status) + (flymake-set-buffer-var buffer 'flymake-mode-line-status status) +) + +(defun flymake-report-status(buffer e-w &optional status) + "show status in the mode line" + (when (bufferp buffer) + (save-excursion + (set-buffer buffer) + (when e-w + (flymake-set-buffer-mode-line-e-w buffer e-w) + ) + (when status + (flymake-set-buffer-mode-line-status buffer status) + ) + (let* ((mode-line " Flymake")) + (when (> (length (flymake-get-buffer-mode-line-e-w buffer)) 0) + (setq mode-line (concat mode-line ":" (flymake-get-buffer-mode-line-e-w buffer))) + ) + (setq mode-line (concat mode-line (flymake-get-buffer-mode-line-status buffer))) + (flymake-set-buffer-mode-line buffer mode-line) + (force-mode-line-update) + ) + ) + ) +) + +(defun flymake-display-warning(warning) + "display a warning to the user" + (message-box warning) +) + +(defcustom flymake-gui-warnings-enabled t + "enables/disables gui warnings" + :group 'flymake + :type 'boolean +) + +(defun flymake-report-fatal-status(buffer status warning) + "display a warning and switch flymake mode OFF" + (when flymake-gui-warnings-enabled + (flymake-display-warning (format "Flymake: %s. Flymake will be switched OFF" warning)) + ) + (save-excursion + (set-buffer buffer) + (flymake-mode 0) + (flymake-log 0 "switched OFF Flymake mode for buffer %s due to fatal status %s, warning %s" + (buffer-name buffer) status warning) + ) +) + +(defun flymake-mode(&optional arg) + "toggle flymake-mode" + (interactive) + (let ((old-flymake-mode flymake-mode)) + + (setq turn-on + (if (null arg) + (not flymake-mode) + ;else + (> (prefix-numeric-value arg) 0)) + ) + + (if turn-on + (if (flymake-can-syntax-check-file (buffer-file-name)) + (flymake-mode-on) + ;else + (flymake-log 2 "flymake cannot check syntax in buffer %s" (buffer-name)) + ) + ;else + (flymake-mode-off) + ) + (force-mode-line-update) + ) +) + +;;;###autoload +(unless (assq 'flymake-mode minor-mode-alist) + (setq minor-mode-alist (cons '(flymake-mode flymake-mode-line) minor-mode-alist)) +) + +;;;###autoload +(defun flymake-mode-on() + "turn flymake mode on" + (when (not flymake-mode) + (make-local-variable 'after-change-functions) + (setq after-change-functions (cons 'flymake-after-change-function after-change-functions)) + (add-hook 'after-save-hook 'flymake-after-save-hook) + (add-hook 'kill-buffer-hook 'flymake-kill-buffer-hook) + ;+(add-hook 'find-file-hooks 'flymake-find-file-hook) + + (flymake-report-status (current-buffer) "" "") + + (flymake-set-buffer-timer (current-buffer) (run-at-time nil 1 'flymake-on-timer-event (current-buffer))) + + (setq flymake-mode t) + (flymake-log 1 "flymake mode turned ON for buffer %s" (buffer-name (current-buffer))) + (when flymake-start-syntax-check-on-find-file + (flymake-start-syntax-check-for-current-buffer) ; will be started by on-load hook + ) + ) +) + +;;;###autoload +(defun flymake-mode-off() + "turn flymake mode off" + (when flymake-mode + (setq after-change-functions (delq 'flymake-after-change-function after-change-functions)) + (remove-hook 'after-save-hook (function flymake-after-save-hook) t) + (remove-hook 'kill-buffer-hook (function flymake-kill-buffer-hook) t) + ;+(remove-hook 'find-file-hooks (function flymake-find-file-hook) t) + + (flymake-delete-own-overlays (current-buffer)) + + (when (flymake-get-buffer-timer (current-buffer)) + (cancel-timer (flymake-get-buffer-timer (current-buffer))) + (flymake-set-buffer-timer (current-buffer) nil) + ) + + (flymake-set-buffer-is-running (current-buffer) nil) + + (setq flymake-mode nil) + (flymake-log 1 "flymake mode turned OFF for buffer %s" (buffer-name (current-buffer))) + ) +) + +(defcustom flymake-start-syntax-check-on-newline t + "start syntax check if newline char was added/removed from the buffer" + :group 'flymake + :type 'boolean +) + +(defun flymake-after-change-function(start stop len) + "Start syntax check for current buffer if it isn't already running" + ;+(flymake-log 0 "setting change time to %s" (flymake-float-time)) + (let((new-text (buffer-substring start stop))) + (when (and flymake-start-syntax-check-on-newline (equal new-text "\n")) + (flymake-log 3 "starting syntax check as new-line has been seen") + (flymake-start-syntax-check-for-current-buffer) + ) + (flymake-set-buffer-last-change-time (current-buffer) (flymake-float-time)) + ) +) + +(defun flymake-after-save-hook() + (if (local-variable-p 'flymake-mode (current-buffer)) ; (???) other way to determine whether flymake is active in buffer being saved? + (progn + (flymake-log 3 "starting syntax check as buffer was saved") + (flymake-start-syntax-check-for-current-buffer) ; no more mode 3. cannot start check if mode 3 (to temp copies) is active - (???) + ) + ) +) + +(defun flymake-kill-buffer-hook() + (when (flymake-get-buffer-timer (current-buffer)) + (cancel-timer (flymake-get-buffer-timer (current-buffer))) + (flymake-set-buffer-timer (current-buffer) nil) + ) +) + +(defcustom flymake-start-syntax-check-on-find-file t + "statr syntax check on find file" + :group 'flymake + :type 'boolean +) + +(defun flymake-find-file-hook() + ;+(when flymake-start-syntax-check-on-find-file + ;+ (flymake-log 3 "starting syntax check on file open") + ;+ (flymake-start-syntax-check-for-current-buffer) + ;+) + (when (and (not (local-variable-p 'flymake-mode (current-buffer))) + (flymake-can-syntax-check-file (buffer-file-name (current-buffer)))) + (flymake-mode) + (flymake-log 3 "automatically turned ON flymake mode") + ) +) + +(defun flymake-get-first-err-line-no(err-info-list) + "return first line-no with error" + (when err-info-list + (flymake-er-get-line (car err-info-list)) + ) +) + +(defun flymake-get-last-err-line-no(err-info-list) + "return last line-no with error" + (when err-info-list + (flymake-er-get-line (nth (1- (length err-info-list)) err-info-list)) + ) +) + +(defun flymake-get-next-err-line-no(err-info-list line-no) + "return next line with erroe" + (when err-info-list + (let* ((count (length err-info-list)) + (idx 0)) + (while (and (< idx count) (>= line-no (flymake-er-get-line (nth idx err-info-list)))) + (setq idx (1+ idx)) + ) + (if (< idx count) + (flymake-er-get-line (nth idx err-info-list)) + ) + ) + ) +) + +(defun flymake-get-prev-err-line-no(err-info-list line-no) + "return prev line with error" + (when err-info-list + (let* ((count (length err-info-list))) + (while (and (> count 0) (<= line-no (flymake-er-get-line (nth (1- count) err-info-list)))) + (setq count (1- count)) + ) + (if (> count 0) + (flymake-er-get-line (nth (1- count) err-info-list)) + ) + ) + ) +) + +(defun flymake-skip-whitespace() + "move forward until nonwhitespace is reached" + (while (looking-at "[ \t]") + (forward-char) + ) +) + +(defun flymake-goto-line(line-no) + "goto-line, then skip whitespace" + (goto-line line-no) + (flymake-skip-whitespace) +) + +(defun flymake-goto-next-error() + "go to next error in err ring" + (interactive) + (let ((line-no (flymake-get-next-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no)))) + (when (not line-no) + (setq line-no (flymake-get-first-err-line-no (flymake-get-buffer-err-info (current-buffer)))) + (flymake-log 1 "passed end of file") + ) + (if line-no + (flymake-goto-line line-no) + ;else + (flymake-log 1 "no errors in current buffer") + ) + ) +) + +(defun flymake-goto-prev-error() + "go to prev error in err ring" + (interactive) + (let ((line-no (flymake-get-prev-err-line-no (flymake-get-buffer-err-info (current-buffer)) (flymake-current-line-no)))) + (when (not line-no) + (setq line-no (flymake-get-last-err-line-no (flymake-get-buffer-err-info (current-buffer)))) + (flymake-log 1 "passed beginning of file") + ) + (if line-no + (flymake-goto-line line-no) + ;else + (flymake-log 1 "no errors in current buffer") + ) + ) +) + +(defun flymake-patch-err-text(string) + (if (string-match "^[\n\t :0-9]*\\(.*\\)$" string) + (match-string 1 string) + ;else + string + ) +) + +;;;; general init-cleanup and helper routines + +(defun flymake-create-temp-inplace(file-name prefix) + (unless (stringp file-name) + (error "invalid file-name") + ) + (or prefix + (setq prefix "flymake") + ) + (let* ((temp-name (concat (file-name-sans-extension file-name) + "_" prefix + (and (file-name-extension file-name) + (concat "." (file-name-extension file-name)))))) + (flymake-log 3 "create-temp-inplace: file=%s temp=%s" file-name temp-name) + temp-name + ) +) + +(defun flymake-create-temp-with-folder-structure(file-name prefix) + (unless (stringp file-name) + (error "invalid file-name") + ) + + (let* ((dir (file-name-directory file-name)) + (slash-pos (string-match "/" dir)) + (temp-dir (concat (flymake-ensure-ends-with-slash (flymake-get-temp-dir)) (substring dir (1+ slash-pos))))) + + (file-truename (concat (flymake-ensure-ends-with-slash temp-dir) + (file-name-nondirectory file-name))) + ) +) + +(defun flymake-strrchr(str ch) + (let* ((count (length str)) + (pos nil)) + (while (and (not pos) (> count 0)) + (if (= ch (elt str (1- count))) + (setq pos (1- count)) + ) + (setq count (1- count)) + ) + pos + ) +) + +(defun flymake-delete-temp-directory(dir-name) + "attempt to delete temp dir created by flymake-create-temp-with-folder-structure, do not fail on error" + (let* ((temp-dir (flymake-get-temp-dir)) + (suffix (substring dir-name (1+ (length temp-dir)))) + (slash-pos nil)) + + (while (> (length suffix) 0) + ;+(flymake-log 0 "suffix=%s" suffix) + (flymake-safe-delete-directory (file-truename (concat (flymake-ensure-ends-with-slash temp-dir) suffix))) + (setq slash-pos (flymake-strrchr suffix (string-to-char "/"))) + (if slash-pos + (setq suffix (substring suffix 0 slash-pos)) + ;else + (setq suffix "") + ) + ) + ) +) + +(defun flymake-init-create-temp-buffer-copy(buffer create-temp-f) + "make a temporary copy of the current buffer, save its name in buffer data and return the name" + (let* ((source-file-name (buffer-file-name buffer)) + (temp-source-file-name (funcall create-temp-f source-file-name "flymake"))) + + (flymake-save-buffer-in-file buffer temp-source-file-name) + (flymake-set-buffer-value buffer "temp-source-file-name" temp-source-file-name) + + temp-source-file-name + ) +) + +(defun flymake-simple-cleanup(buffer) + "cleanup after flymake-init-create-temp-buffer-copy -- delete temp file" + (let* ((temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name"))) + (flymake-safe-delete-file temp-source-file-name) + (flymake-set-buffer-last-change-time buffer nil) + ) +) + +(defun flymake-get-real-file-name(buffer file-name-from-err-msg) + "Translate file name from error message to `real' file name. Return full-name. Names are real, not patched" + (let* ((real-name nil) + (source-file-name (buffer-file-name buffer)) + (master-file-name (flymake-get-buffer-value buffer "master-file-name")) + (temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name")) + (temp-master-file-name (flymake-get-buffer-value buffer "temp-master-file-name")) + (base-dirs (list (flymake-get-buffer-value buffer "base-dir") + (file-name-directory source-file-name) + (if master-file-name (file-name-directory master-file-name) nil))) + (files (list (list source-file-name source-file-name) + (list temp-source-file-name source-file-name) + (list master-file-name master-file-name) + (list temp-master-file-name master-file-name)))) + + (when (equal 0 (length file-name-from-err-msg)) + (setq file-name-from-err-msg source-file-name) + ) + + (setq real-name (flymake-get-full-patched-file-name file-name-from-err-msg base-dirs files)) + ; if real-name is nil, than file name from err msg is none of the files we've patched + (if (not real-name) + (setq real-name (flymake-get-full-nonpatched-file-name file-name-from-err-msg base-dirs)) + ) + (if (not real-name) + (setq real-name file-name-from-err-msg) + ) + (setq real-name (flymake-fix-path-name real-name)) + (flymake-log 3 "get-real-file-name: file-name=%s real-name=%s" file-name-from-err-msg real-name) + real-name + ) +) + +(defun flymake-get-full-patched-file-name(file-name-from-err-msg base-dirs files) + (let* ((base-dirs-count (length base-dirs)) + (file-count (length files)) + (real-name nil)) + + (while (and (not real-name) (> base-dirs-count 0)) + (setq file-count (length files)) + (while (and (not real-name) (> file-count 0)) + (let* ((this-dir (nth (1- base-dirs-count) base-dirs)) + (this-file (nth 0 (nth (1- file-count) files))) + (this-real-name (nth 1 (nth (1- file-count) files)))) + ;+(flymake-log 0 "this-dir=%s this-file=%s this-real=%s msg-file=%s" this-dir this-file this-real-name file-name-from-err-msg) + (when (and this-dir this-file (flymake-same-files + (flymake-get-absolute-file-name-basedir file-name-from-err-msg this-dir) + this-file)) + (setq real-name this-real-name) + ) + ) + (setq file-count (1- file-count)) + ) + (setq base-dirs-count (1- base-dirs-count)) + ) + real-name + ) +) + +(defun flymake-get-full-nonpatched-file-name(file-name-from-err-msg base-dirs) + (let* ((real-name nil)) + (if (file-name-absolute-p file-name-from-err-msg) + (setq real-name file-name-from-err-msg) + ;else + (let* ((base-dirs-count (length base-dirs))) + (while (and (not real-name) (> base-dirs-count 0)) + (let* ((full-name (flymake-get-absolute-file-name-basedir file-name-from-err-msg + (nth (1- base-dirs-count) base-dirs)))) + (if (file-exists-p full-name) + (setq real-name full-name) + ) + (setq base-dirs-count (1- base-dirs-count)) + ) + ) + ) + ) + real-name + ) +) + +(defun flymake-get-absolute-file-name-basedir(file-name dir-name) + (if (file-name-absolute-p file-name) + file-name + ;else + (concat dir-name "/" file-name) + ) +) + +(defun flymake-init-find-buildfile-dir(buffer source-file-name buildfile-name) + "find buildfile, store its dir in buffer data and return its dir, if found" + (let* ((buildfile-dir (flymake-find-buildfile buildfile-name + (file-name-directory source-file-name) + flymake-buildfile-dirs))) + (if (not buildfile-dir) + (progn + (flymake-log 1 "no buildfile (%s) for %s" buildfile-name source-file-name) + (flymake-report-fatal-status buffer "NOMK" (format "No buildfile (%s) found for %s" buildfile-name source-file-name)) + ) + ;else + (progn + (flymake-set-buffer-value buffer "base-dir" buildfile-dir) + ) + ) + buildfile-dir + ) +) + +(defun flymake-init-create-temp-source-and-master-buffer-copy(buffer get-incl-dirs-f create-temp-f master-file-masks include-regexp-list) + "find master file (or buffer), create it's copy along with a copy of the source file" + (let* ((source-file-name (buffer-file-name buffer)) + (temp-source-file-name (flymake-init-create-temp-buffer-copy buffer create-temp-f)) + (master-file-name nil) + (temp-master-file-name nil) + (master-and-temp-master (flymake-create-master-file + source-file-name temp-source-file-name + get-incl-dirs-f create-temp-f + master-file-masks include-regexp-list))) + + (if (not master-and-temp-master) + (progn + (flymake-log 1 "cannot find master file for %s" source-file-name) + (flymake-report-status buffer "!" "") ; NOMASTER + ) + ;else + (progn + (setq master-file-name (nth 0 master-and-temp-master)) + (setq temp-master-file-name (nth 1 master-and-temp-master)) + (flymake-set-buffer-value buffer "master-file-name" master-file-name) + (flymake-set-buffer-value buffer "temp-master-file-name" temp-master-file-name) + ) + ) + temp-master-file-name + ) +) + +(defun flymake-master-cleanup(buffer) + (flymake-simple-cleanup buffer) + (flymake-safe-delete-file (flymake-get-buffer-value buffer "temp-master-file-name")) +) + +;;;; make-specific init-cleanup routines + +(defun flymake-get-syntax-check-program-args(source-file-name base-dir use-relative-base-dir use-relative-source get-cmd-line-f) + "create a command line for the syntax check command, using get-cmd-line-f" + (let* ((my-base-dir base-dir) + (my-source source-file-name)) + + (when use-relative-base-dir + (setq my-base-dir (flymake-build-relative-path (file-name-directory source-file-name) base-dir)) + ) + + (when use-relative-source + (setq my-source (concat (flymake-build-relative-path base-dir (file-name-directory source-file-name)) + (file-name-nondirectory source-file-name))) + ) + + (funcall get-cmd-line-f my-source my-base-dir) + ) +) + +(defun flymake-get-make-cmdline(source base-dir) + (list "make" + (list "-s" + "-C" + base-dir + (concat "CHK_SOURCES=" source) + "SYNTAX_CHECK_MODE=1" + "check-syntax")) +) + +(defun flymake-get-ant-cmdline(source base-dir) + (list "ant" + (list "-buildfile" + (concat base-dir "/" "build.xml") + (concat "-DCHK_SOURCES=" source) + "check-syntax")) +) + +(defun flymake-simple-make-init-impl(buffer create-temp-f use-relative-base-dir use-relative-source build-file-name get-cmdline-f) + "create syntax check command line for a directly checked source file, use create-temp-f for creating temp copy" + (let* ((args nil) + (source-file-name (buffer-file-name buffer)) + (buildfile-dir (flymake-init-find-buildfile-dir buffer source-file-name build-file-name))) + (if buildfile-dir + (let* ((temp-source-file-name (flymake-init-create-temp-buffer-copy buffer create-temp-f))) + (setq args (flymake-get-syntax-check-program-args temp-source-file-name buildfile-dir + use-relative-base-dir use-relative-source + get-cmdline-f)) + ) + ) + + args + ) +) + +(defun flymake-simple-make-init(buffer) + (flymake-simple-make-init-impl buffer 'flymake-create-temp-inplace t t "Makefile" 'flymake-get-make-cmdline) +) + +(defun flymake-master-make-init(buffer get-incl-dirs-f master-file-masks include-regexp-list) + "create make command line for a source file checked via master file compilation" + (let* ((make-args nil) + (temp-master-file-name (flymake-init-create-temp-source-and-master-buffer-copy + buffer get-incl-dirs-f 'flymake-create-temp-inplace + master-file-masks include-regexp-list))) + (when temp-master-file-name + (let* ((buildfile-dir (flymake-init-find-buildfile-dir buffer temp-master-file-name "Makefile"))) + (if buildfile-dir + (setq make-args (flymake-get-syntax-check-program-args + temp-master-file-name buildfile-dir nil nil 'flymake-get-make-cmdline)) + ) + ) + ) + + make-args + ) +) + +(defun flymake-find-make-buildfile(source-dir) + (flymake-find-buildfile "Makefile" source-dir flymake-buildfile-dirs) +) + +;;;; .h/make specific +(defun flymake-master-make-header-init(buffer) + (flymake-master-make-init buffer + 'flymake-get-include-dirs + '(".+\\.cpp$" ".+\\.c$") + '("[ \t]*#[ \t]*include[ \t]*\"\\([\w0-9/\\_\.]*[/\\]*\\)\\(%s\\)\"" 1 2)) +) + +;;;; .java/make specific +(defun flymake-simple-make-java-init(buffer) + (flymake-simple-make-init-impl buffer 'flymake-create-temp-with-folder-structure nil nil "Makefile" 'flymake-get-make-cmdline) +) + +(defun flymake-simple-ant-java-init(buffer) + (flymake-simple-make-init-impl buffer 'flymake-create-temp-with-folder-structure nil nil "build.xml" 'flymake-get-ant-cmdline) +) + +(defun flymake-simple-java-cleanup(buffer) + "cleanup after flymake-simple-make-java-init -- delete temp file and dirs" + (let* ((temp-source-file-name (flymake-get-buffer-value buffer "temp-source-file-name"))) + (flymake-safe-delete-file temp-source-file-name) + (when temp-source-file-name + (flymake-delete-temp-directory (file-name-directory temp-source-file-name)) + ) + ) +) + +;;;; perl-specific init-cleanup routines + +(defun flymake-perl-init(buffer) + (let* ((temp-file (flymake-init-create-temp-buffer-copy buffer 'flymake-create-temp-inplace)) + (local-file (concat (flymake-build-relative-path (file-name-directory (buffer-file-name (current-buffer))) + (file-name-directory temp-file)) + (file-name-nondirectory temp-file)))) + (list "perl" (list "-wc " local-file)) + ) +) + +;;;; tex-specific init-cleanup routines + +(defun flymake-get-tex-args(file-name) + ;(list "latex" (list "-c-style-errors" file-name)) + (list "texify" (list "--pdf" "--tex-option=-c-style-errors" file-name)) +) + +(defun flymake-simple-tex-init(buffer) + (flymake-get-tex-args (flymake-init-create-temp-buffer-copy buffer 'flymake-create-temp-inplace)) +) + +(defun flymake-master-tex-init(buffer) + (let* ((temp-master-file-name (flymake-init-create-temp-source-and-master-buffer-copy + buffer 'flymake-get-include-dirs-dot 'flymake-create-temp-inplace + '(".+\\.tex$") + '("[ \t]*\\input[ \t]*{\\(.*\\)\\(%s\\)}" 1 2)))) + (when temp-master-file-name + (flymake-get-tex-args temp-master-file-name) + ) + ) +) + +(defun flymake-get-include-dirs-dot(base-dir) + '(".") +) + +;;;; xml-specific init-cleanup routines + +(defun flymake-xml-init(buffer) + (list "xml" (list "val" (flymake-init-create-temp-buffer-copy buffer 'flymake-create-temp-inplace))) +) + +;;; arch-tag: 8f0d6090-061d-4cac-8862-7c151c4a02dd +;;; flymake.el ends here diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index f23eabe6e9c..88d41650c07 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -1700,8 +1700,7 @@ If ALL is nil, only match comments that start in column > 0." (while repeat (setq repeat nil) ;; Adapted from f90-find-breakpoint. - (re-search-backward fortran-break-delimiters-re - (line-beginning-position)) + (re-search-backward fortran-break-delimiters-re bol) (if (not fortran-break-before-delimiters) (if (looking-at fortran-no-break-re) ;; Deal with cases such as "**" split over diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 5163471f47a..2f267787707 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el @@ -1,6 +1,6 @@ ;;; gdb-ui.el --- User Interface for running GDB -;; Author: Nick Roberts <nick@nick.uklinux.net> +;; Author: Nick Roberts <nickrob@gnu.org> ;; Maintainer: FSF ;; Keywords: unix, tools @@ -40,8 +40,15 @@ ;; Kingdon and uses GDB's annotation interface. You don't need to know about ;; annotations to use this mode as a debugger, but if you are interested ;; developing the mode itself, then see the Annotations section in the GDB -;; info manual. Some GDB/MI commands are also used through th CLI command -;; 'interpreter mi <mi-command>'. +;; info manual. +;; +;; GDB developers plan to make the annotation interface obsolete. A new +;; interface called GDB/MI (machine interface) has been designed to replace +;; it. Some GDB/MI commands are used in this file through the CLI command +;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included in the +;; GDB repository for future releases (6.2 onwards) that uses GDB/MI as the +;; primary interface to GDB. It is still under development and is part of a +;; process to migrate Emacs from annotations to GDB/MI. ;; ;; Known Bugs: ;; @@ -53,7 +60,7 @@ (defvar gdb-current-address "main" "Initialisation for Assembler buffer.") (defvar gdb-previous-address nil) (defvar gdb-previous-frame nil) -(defvar gdb-current-frame "main") +(defvar gdb-current-frame nil) (defvar gdb-current-language nil) (defvar gdb-view-source t "Non-nil means that source code can be viewed.") (defvar gdb-selected-view 'source "Code type that user wishes to view.") @@ -63,7 +70,8 @@ (defvar gdb-overlay-arrow-position nil) (defvar gdb-variables '() "A list of variables that are local to the GUD buffer.") - +(defvar gdb-server-prefix nil) + ;;;###autoload (defun gdba (command-line) "Run gdb on program FILE in buffer *gud-FILE*. @@ -73,23 +81,34 @@ and source-file directory for your debugger. If `gdb-many-windows' is nil (the default value) then gdb just pops up the GUD buffer unless `gdb-show-main' is t. In this case it starts with two windows: one displaying the GUD buffer and the -other with the source file with the main routine of the debugee. +other with the source file with the main routine of the inferior. -If `gdb-many-windows' is t the layout below will appear -regardless of the value of `gdb-show-main' unless +If `gdb-many-windows' is t, regardless of the value of +`gdb-show-main', the layout below will appear unless `gdb-use-inferior-io-buffer' is nil when the source buffer occupies the full width of the frame. Keybindings are given in relevant buffer. +Watch expressions appear in the speedbar/slowbar. + +The following interactive lisp functions help control operation : + +`gdb-many-windows' - Toggle the number of windows gdb uses. +`gdb-restore-windows' - To restore the window layout. + +See Info node `(emacs)GDB Graphical Interface' for a more +detailed description of this mode. + + --------------------------------------------------------------------- GDB Toolbar --------------------------------------------------------------------- -GUD buffer (I/O of GDB) | Locals buffer + GUD buffer (I/O of GDB) | Locals buffer | | | --------------------------------------------------------------------- -Source buffer | Input/Output (of debugee) buffer + Source buffer | Input/Output (of inferior) buffer | (comint-mode) | | @@ -98,28 +117,12 @@ Source buffer | Input/Output (of debugee) buffer | | --------------------------------------------------------------------- -Stack buffer | Breakpoints buffer + Stack buffer | Breakpoints buffer RET gdb-frames-select | SPC gdb-toggle-breakpoint | RET gdb-goto-breakpoint | d gdb-delete-breakpoint --------------------------------------------------------------------- - -All the buffers share the toolbar and source should always display in the same -window e.g after typing g on a breakpoint in the breakpoints buffer. Breakpoint -icons are displayed both by setting a break with gud-break and by typing break -in the GUD buffer. - -This works best (depending on the size of your monitor) using most of the -screen. - -Displayed expressions appear in separate frames. Arrays may be displayed -as slices and visualised using the graph program from plotutils if installed. -Pointers in structures may be followed in a tree-like fashion. - -The following interactive lisp functions help control operation : - -`gdb-many-windows' - Toggle the number of windows gdb uses. -`gdb-restore-windows' - To restore the window layout." +" ;; (interactive (list (gud-query-cmdline 'gdba))) ;; @@ -179,12 +182,17 @@ The following interactive lisp functions help control operation : (setq gdb-current-address "main") (setq gdb-previous-address nil) (setq gdb-previous-frame nil) - (setq gdb-current-frame "main") + (setq gdb-current-frame nil) (setq gdb-view-source t) (setq gdb-selected-view 'source) (setq gdb-var-list nil) (setq gdb-var-changed nil) (setq gdb-first-prompt nil) + (setq gdb-prompting nil) + (setq gdb-current-item nil) + (setq gdb-pending-triggers nil) + (setq gdb-output-sink 'user) + (setq gdb-server-prefix "server ") ;; (mapc 'make-local-variable gdb-variables) (setq gdb-buffer-type 'gdba) @@ -213,16 +221,26 @@ speedbar." (require 'tooltip) (let ((expr (tooltip-identifier-from-point (point)))) (if (and (string-equal gdb-current-language "c") - gdb-use-colon-colon-notation) + gdb-use-colon-colon-notation gdb-current-frame) (setq expr (concat gdb-current-frame "::" expr))) (catch 'already-watched (dolist (var gdb-var-list) (if (string-equal expr (car var)) (throw 'already-watched nil))) (set-text-properties 0 (length expr) nil expr) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-create - * " expr "\"\n") + (list + (if (eq gud-minor-mode 'gdba) + (concat "server interpreter mi \"-var-create - * " expr "\"\n") + (concat"-var-create - * " expr "\n")) `(lambda () (gdb-var-create-handler ,expr)))))) - (select-window (get-buffer-window gud-comint-buffer))) + (select-window (get-buffer-window gud-comint-buffer 'visible))) + +(defun gdb-goto-info () + "Go to Emacs info node: GDB Graphical Interface." + (interactive) + (select-frame (make-frame)) + (require 'info) + (Info-goto-node "(emacs)GDB Graphical Interface")) (defconst gdb-var-create-regexp "name=\"\\(.*?\\)\",numchild=\"\\(.*?\\)\",type=\"\\(.*?\\)\"") @@ -306,12 +324,15 @@ speedbar." (setq gdb-var-list (nreverse var-list)))))) (defun gdb-var-update () - (if (not (member 'gdb-var-update (gdb-get-pending-triggers))) + (if (not (member 'gdb-var-update gdb-pending-triggers)) (progn - (gdb-enqueue-input (list "server interpreter mi \"-var-update *\"\n" + (gdb-enqueue-input + (list + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + "server interpreter mi \"-var-update *\"\n" + "-var-update *\n") 'gdb-var-update-handler)) - (gdb-set-pending-triggers (cons 'gdb-var-update - (gdb-get-pending-triggers)))))) + (push 'gdb-var-update gdb-pending-triggers)))) (defconst gdb-var-update-regexp "name=\"\\(.*?\\)\"") @@ -321,12 +342,15 @@ speedbar." (while (re-search-forward gdb-var-update-regexp nil t) (let ((varnum (match-string 1))) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-evaluate-expression " - varnum "\"\n") + (list + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (concat "server interpreter mi \"-var-evaluate-expression " + varnum "\"\n") + (concat "-var-evaluate-expression " varnum "\n")) `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))) - (gdb-set-pending-triggers - (delq 'gdb-var-update (gdb-get-pending-triggers)))) + (setq gdb-pending-triggers + (delq 'gdb-var-update gdb-pending-triggers))) (defun gdb-var-delete () "Delete watched expression from the speedbar." @@ -339,8 +363,11 @@ speedbar." (varnum (cadr var))) (unless (string-match "\\." varnum) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-delete " - varnum "\"\n") + (list + (if (with-current-buffer gud-comint-buffer + (eq gud-minor-mode 'gdba)) + (concat "server interpreter mi \"-var-delete " varnum "\"\n") + (concat "-var-delete " varnum "\n")) 'ignore)) (setq gdb-var-list (delq var gdb-var-list)) (dolist (varchild gdb-var-list) @@ -354,8 +381,11 @@ speedbar." (varnum (cadr var)) (value)) (setq value (read-string "New value: ")) (gdb-enqueue-input - (list (concat "server interpreter mi \"-var-assign " - varnum " " value "\"\n") + (list + (if (with-current-buffer gud-comint-buffer + (eq gud-minor-mode 'gdba)) + (concat "server interpreter mi \"-var-assign " varnum " " value "\"\n") + (concat "-var-assign " varnum " " value "\n")) 'ignore)))) (defcustom gdb-show-changed-values t @@ -370,49 +400,25 @@ TEXT is the text of the button we clicked on, a + or - item. TOKEN is data related to this node. INDENT is the current indentation depth." (cond ((string-match "+" text) ;expand this node - (gdb-var-list-children token)) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (gdb-var-list-children token) + (gdbmi-var-list-children token))) ((string-match "-" text) ;contract this node (dolist (var gdb-var-list) (if (string-match (concat token "\\.") (nth 1 var)) (setq gdb-var-list (delq var gdb-var-list)))) (setq gdb-var-changed t)))) - -;; ====================================================================== -;; -;; In this world, there are gdb variables (of unspecified -;; representation) and buffers associated with those objects. -;; The list of variables is built up by the expansions of -;; def-gdb-variable - -(defmacro def-gdb-var (root-symbol &optional default doc) - (let* ((root (symbol-name root-symbol)) - (accessor (intern (concat "gdb-get-" root))) - (setter (intern (concat "gdb-set-" root))) - (name (intern (concat "gdb-" root)))) - `(progn - (defvar ,name ,default ,doc) - (if (not (memq ',name gdb-variables)) - (push ',name gdb-variables)) - (defun ,accessor () - (buffer-local-value ',name gud-comint-buffer)) - (defun ,setter (val) - (with-current-buffer gud-comint-buffer - (setq ,name val)))))) - -(def-gdb-var buffer-type nil +(defvar gdb-buffer-type nil "One of the symbols bound in `gdb-buffer-rules'.") -(def-gdb-var burst "" - "A string of characters from gdb that have not yet been processed.") - -(def-gdb-var input-queue () +(defvar gdb-input-queue () "A list of gdb command objects.") -(def-gdb-var prompting nil +(defvar gdb-prompting nil "True when gdb is idle with no pending input.") -(def-gdb-var output-sink 'user +(defvar gdb-output-sink 'user "The disposition of the output of the current gdb command. Possible values are these symbols: @@ -430,12 +436,14 @@ Possible values are these symbols: gdb mode sends to gdb on its own behalf. post-emacs -- ignore output until the prompt annotation is received, then go to USER disposition. -") -(def-gdb-var current-item nil +gdba (gdb-ui.el) uses all five values, gdbmi (gdb-mi.el) only two +(user and emacs).") + +(defvar gdb-current-item nil "The most recent command item sent to gdb.") -(def-gdb-var pending-triggers '() +(defvar gdb-pending-triggers '() "A list of trigger functions that have run later than their output handlers.") @@ -479,8 +487,8 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." (set (make-local-variable 'gdb-buffer-type) key) (if (cdr (cdr rules)) (funcall (car (cdr (cdr rules))))) - (set (make-local-variable 'gud-comint-buffer) gud-comint-buffer) - (set (make-local-variable 'gud-minor-mode) 'gdba) + (set (make-local-variable 'gud-minor-mode) + (with-current-buffer gud-comint-buffer gud-minor-mode)) (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) new)))) @@ -548,7 +556,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." (define-key map "\C-c\C-d" 'gdb-inferior-io-eof) map)) -(define-derived-mode gdb-inferior-io-mode comint-mode "Debuggee I/O" +(define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" "Major mode for gdb inferior-io." :syntax-table nil :abbrev-table nil ;; We want to use comint because it has various nifty and familiar @@ -620,20 +628,18 @@ This filter may simply queue output for a later time." ;; is a query, or other non-top-level prompt. (defun gdb-enqueue-input (item) - (if (gdb-get-prompting) + (if gdb-prompting (progn (gdb-send-item item) - (gdb-set-prompting nil)) - (gdb-set-input-queue - (cons item (gdb-get-input-queue))))) + (setq gdb-prompting nil)) + (push item gdb-input-queue))) (defun gdb-dequeue-input () - (let ((queue (gdb-get-input-queue))) + (let ((queue gdb-input-queue)) (and queue (let ((last (car (last queue)))) - (unless (nbutlast queue) (gdb-set-input-queue '())) + (unless (nbutlast queue) (setq gdb-input-queue '())) last)))) - ;; ;; output -- things gdb prints to emacs @@ -662,6 +668,8 @@ This filter may simply queue output for a later time." ("commands" gdb-subprompt) ("overload-choice" gdb-subprompt) ("query" gdb-subprompt) + ;; Need this prompt for GDB 6.1 + ("nquery" gdb-subprompt) ("prompt-for-continue" gdb-subprompt) ("post-prompt" gdb-post-prompt) ("source" gdb-source) @@ -688,89 +696,97 @@ This filter may simply queue output for a later time." (string-to-int (match-string 2 args)))) (setq gdb-current-address (match-string 3 args)) (setq gdb-view-source t) -;; cover for auto-display output which comes *before* -;; stopped annotation - (if (eq (gdb-get-output-sink) 'inferior) (gdb-set-output-sink 'user))) + ;; cover for auto-display output which comes *before* + ;; stopped annotation + (if (eq gdb-output-sink 'inferior) (setq gdb-output-sink 'user))) (defun gdb-send-item (item) (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log)) - (gdb-set-current-item item) - (if (stringp item) - (progn - (gdb-set-output-sink 'user) - (process-send-string (get-buffer-process gud-comint-buffer) item)) - (progn + (setq gdb-current-item item) + (with-current-buffer gud-comint-buffer + (if (eq gud-minor-mode 'gdba) + (progn + (if (stringp item) + (progn + (setq gdb-output-sink 'user) + (process-send-string (get-buffer-process gud-comint-buffer) item)) + (progn + (gdb-clear-partial-output) + (setq gdb-output-sink 'pre-emacs) + (process-send-string (get-buffer-process gud-comint-buffer) + (car item))))) + ; case: eq gud-minor-mode 'gdbmi (gdb-clear-partial-output) - (gdb-set-output-sink 'pre-emacs) + (setq gdb-output-sink 'emacs) (process-send-string (get-buffer-process gud-comint-buffer) - (car item))))) + (car item))))) (defun gdb-pre-prompt (ignored) "An annotation handler for `pre-prompt'. This terminates the collection of output from a previous command if that happens to be in effect." - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'user) t) ((eq sink 'emacs) - (gdb-set-output-sink 'post-emacs)) + (setq gdb-output-sink 'post-emacs)) (t - (gdb-set-output-sink 'user) + (setq gdb-output-sink 'user) (error "Phase error in gdb-pre-prompt (got %s)" sink))))) (defun gdb-prompt (ignored) "An annotation handler for `prompt'. This sends the next command (if any) to gdb." (when gdb-first-prompt (gdb-ann3)) - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'user) t) ((eq sink 'post-emacs) - (gdb-set-output-sink 'user) + (setq gdb-output-sink 'user) (let ((handler - (car (cdr (gdb-get-current-item))))) + (car (cdr gdb-current-item)))) (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) (funcall handler)))) (t - (gdb-set-output-sink 'user) + (setq gdb-output-sink 'user) (error "Phase error in gdb-prompt (got %s)" sink)))) (let ((input (gdb-dequeue-input))) (if input (gdb-send-item input) (progn - (gdb-set-prompting t) + (setq gdb-prompting t) (gud-display-frame))))) (defun gdb-subprompt (ignored) "An annotation handler for non-top-level prompts." - (gdb-set-prompting t)) + (setq gdb-prompting t)) (defun gdb-starting (ignored) "An annotation handler for `starting'. This says that I/O for the subprocess is now the program being debugged, not GDB." - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'user) (progn (setq gud-running t) (if gdb-use-inferior-io-buffer - (gdb-set-output-sink 'inferior)))) + (setq gdb-output-sink 'inferior)))) (t (error "Unexpected `starting' annotation"))))) (defun gdb-stopping (ignored) "An annotation handler for `exited' and other annotations which say that I/O for the subprocess is now GDB, not the program being debugged." (if gdb-use-inferior-io-buffer - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'inferior) - (gdb-set-output-sink 'user)) + (setq gdb-output-sink 'user)) (t (error "Unexpected stopping annotation")))))) (defun gdb-frame-begin (ignored) - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'inferior) - (gdb-set-output-sink 'user)) + (setq gdb-output-sink 'user)) ((eq sink 'user) t) ((eq sink 'emacs) t) (t (error "Unexpected frame-begin annotation (%S)" sink))))) @@ -779,17 +795,17 @@ for the subprocess is now GDB, not the program being debugged." "An annotation handler for `stopped'. It is just like gdb-stopping, except that if we already set the output sink to 'user in gdb-stopping, that is fine." (setq gud-running nil) - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'inferior) - (gdb-set-output-sink 'user)) + (setq gdb-output-sink 'user)) ((eq sink 'user) t) (t (error "Unexpected stopped annotation"))))) (defun gdb-post-prompt (ignored) "An annotation handler for `post-prompt'. This begins the collection of output from the current command if that happens to be appropriate." - (if (not (gdb-get-pending-triggers)) + (if (not gdb-pending-triggers) (progn (gdb-get-current-frame) (gdb-invalidate-frames) @@ -806,13 +822,13 @@ output from the current command if that happens to be appropriate." (dolist (var gdb-var-list) (setcar (nthcdr 5 var) nil)))) (gdb-var-update)))) - (let ((sink (gdb-get-output-sink))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'user) t) ((eq sink 'pre-emacs) - (gdb-set-output-sink 'emacs)) + (setq gdb-output-sink 'emacs)) (t - (gdb-set-output-sink 'user) + (setq gdb-output-sink 'user) (error "Phase error in gdb-post-prompt (got %s)" sink))))) (defun gud-gdba-marker-filter (string) @@ -874,7 +890,7 @@ output from the current command if that happens to be appropriate." output)) (defun gdb-concat-output (so-far new) - (let ((sink (gdb-get-output-sink ))) + (let ((sink gdb-output-sink)) (cond ((eq sink 'user) (concat so-far new)) ((or (eq sink 'pre-emacs) (eq sink 'post-emacs)) so-far) @@ -936,19 +952,17 @@ output from the current command if that happens to be appropriate." `(defun ,name (&optional ignored) (if (and (,demand-predicate) (not (member ',name - (gdb-get-pending-triggers)))) + gdb-pending-triggers))) (progn (gdb-enqueue-input (list ,gdb-command ',output-handler)) - (gdb-set-pending-triggers - (cons ',name - (gdb-get-pending-triggers))))))) + (push ',name gdb-pending-triggers))))) (defmacro def-gdb-auto-update-handler (name trigger buf-key custom-defun) `(defun ,name () - (gdb-set-pending-triggers + (setq gdb-pending-triggers (delq ',trigger - (gdb-get-pending-triggers))) + gdb-pending-triggers)) (let ((buf (gdb-get-buffer ',buf-key))) (and buf (with-current-buffer buf @@ -1080,7 +1094,7 @@ static char *magick[] = { (dolist (buffer (buffer-list)) (with-current-buffer buffer (if (and (eq gud-minor-mode 'gdba) - (not (string-match "^\*" (buffer-name)))) + (not (string-match "\\`\\*.+\\*\\'" (buffer-name)))) (gdb-remove-breakpoint-icons (point-min) (point-max))))) (with-current-buffer (gdb-get-buffer 'gdb-breakpoints-buffer) (save-excursion @@ -1112,10 +1126,11 @@ static char *magick[] = { (save-excursion (goto-line (string-to-number line)) (gdb-put-breakpoint-icon (eq flag ?y))))))))) - (end-of-line)))))) + (end-of-line))))) + (if (gdb-get-buffer 'gdb-assembler-buffer) (gdb-assembler-custom))) (defun gdb-mouse-toggle-breakpoint (event) - "Toggle breakpoint with mouse click in left margin." + "Toggle breakpoint in left fringe/margin with mouse click" (interactive "e") (mouse-minibuffer-check event) (let ((posn (event-end event))) @@ -1135,14 +1150,24 @@ static char *magick[] = { (concat "*breakpoints of " (gdb-get-target-string) "*"))) (defun gdb-display-breakpoints-buffer () + "Display status of user-settable breakpoints." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer))) +(defconst gdb-frame-parameters + '((height . 12) (width . 60) + (unsplittable . t) + (tool-bar-lines . nil) + (menu-bar-lines . nil) + (minibuffer . nil))) + (defun gdb-frame-breakpoints-buffer () + "Display status of user-settable breakpoints in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdb-breakpoints-buffer))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdb-breakpoints-buffer)) + (set-window-dedicated-p (selected-window) t)) (defvar gdb-breakpoints-mode-map (let ((map (make-sparse-keymap)) @@ -1167,7 +1192,9 @@ static char *magick[] = { (setq mode-name "Breakpoints") (use-local-map gdb-breakpoints-mode-map) (setq buffer-read-only t) - (gdb-invalidate-breakpoints)) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (gdb-invalidate-breakpoints) + (gdbmi-invalidate-breakpoints))) (defun gdb-toggle-breakpoint () "Enable/disable the breakpoint at current line." @@ -1180,8 +1207,8 @@ static char *magick[] = { (list (concat (if (eq ?y (char-after (match-beginning 2))) - "server disable " - "server enable ") + gdb-server-prefix "disable " + gdb-server-prefix "enable ") (match-string 1) "\n") 'ignore))))) @@ -1192,28 +1219,31 @@ static char *magick[] = { (if (not (looking-at "\\([0-9]+\\).*point\\s-*\\S-*\\s-*\\(.\\)")) (error "Not recognized as break/watchpoint line") (gdb-enqueue-input - (list (concat "server delete " (match-string 1) "\n") 'ignore)))) + (list (concat gdb-server-prefix "delete " (match-string 1) "\n") 'ignore)))) (defun gdb-goto-breakpoint () - "Display the file in the source buffer at the breakpoint specified on the -current line." + "Display the breakpoint location specified at current line." (interactive) (save-excursion (beginning-of-line 1) - (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t) - (looking-at "\\(\\S-*\\):\\([0-9]+\\)")) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdbmi)) + (looking-at "[0-9]*\\s-*\\S-*\\s-*\\S-*\\s-*.\\s-*\\S-*\\s-*\\(\\S-*\\):\\([0-9]+\\)") + (re-search-forward "in\\s-+\\S-+\\s-+at\\s-+" nil t) + (looking-at "\\(\\S-*\\):\\([0-9]+\\)"))) (if (match-string 2) (let ((line (match-string 2)) (file (match-string 1))) (save-selected-window - (gdb-display-buffer (find-file-noselect - (if (file-exists-p file) - file - (expand-file-name file gdb-cdir)))) - (goto-line (string-to-number line)))))) + (let* ((buf (find-file-noselect (if (file-exists-p file) + file + (expand-file-name file gdb-cdir)))) + (window (gdb-display-buffer buf))) + (with-current-buffer buf + (goto-line (string-to-number line)) + (set-window-point window (point)))))))) (defun gdb-mouse-goto-breakpoint (event) - "Display the file in the source buffer at the selected breakpoint." + "Display the breakpoint location that you click on." (interactive "e") (mouse-set-point event) (gdb-goto-breakpoint)) @@ -1256,14 +1286,17 @@ current line." (concat "*stack frames of " (gdb-get-target-string) "*"))) (defun gdb-display-stack-buffer () + "Display backtrace of current stack." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-stack-buffer))) (defun gdb-frame-stack-buffer () + "Display backtrace of current stack in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdb-stack-buffer))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdb-stack-buffer)) + (set-window-dedicated-p (selected-window) t)) (defvar gdb-frames-mode-map (let ((map (make-sparse-keymap))) @@ -1281,25 +1314,25 @@ current line." (setq buffer-read-only t) (use-local-map gdb-frames-mode-map) (font-lock-mode -1) - (gdb-invalidate-frames)) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (gdb-invalidate-frames) + (gdbmi-invalidate-frames))) (defun gdb-get-frame-number () (save-excursion - (let* ((pos (re-search-backward "^#\\([0-9]*\\)" nil t)) + (let* ((pos (re-search-backward "^#*\\([0-9]*\\)" nil t)) (n (or (and pos (match-string-no-properties 1)) "0"))) n))) (defun gdb-frames-select () - "Make the frame on the current line become the current frame and display the -source in the source buffer." + "Select the frame and display the relevant source." (interactive) (gdb-enqueue-input - (list (concat "server frame " (gdb-get-frame-number) "\n") 'ignore)) + (list (concat gdb-server-prefix "frame " (gdb-get-frame-number) "\n") 'ignore)) (gud-display-frame)) (defun gdb-frames-mouse-select (event) - "Make the selected frame become the current frame and display the source in -the source buffer." + "Select the frame you click on and display the relevant source." (interactive "e") (mouse-set-point event) (gdb-frames-select)) @@ -1313,7 +1346,7 @@ the source buffer." (def-gdb-auto-updated-buffer gdb-threads-buffer gdb-invalidate-threads - "server info threads\n" + (concat gdb-server-prefix "info threads\n") gdb-info-threads-handler gdb-info-threads-custom) @@ -1332,14 +1365,17 @@ the source buffer." (concat "*threads of " (gdb-get-target-string) "*"))) (defun gdb-display-threads-buffer () + "Display IDs of currently known threads." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-threads-buffer))) (defun gdb-frame-threads-buffer () + "Display IDs of currently known threads in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdb-threads-buffer))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdb-threads-buffer)) + (set-window-dedicated-p (selected-window) t)) (defvar gdb-threads-mode-map (let ((map (make-sparse-keymap))) @@ -1351,7 +1387,7 @@ the source buffer." (defun gdb-threads-mode () "Major mode for gdb frames. -\\{gdb-frames-mode-map}" +\\{gdb-threads-mode-map}" (setq major-mode 'gdb-threads-mode) (setq mode-name "Threads") (setq buffer-read-only t) @@ -1364,16 +1400,14 @@ the source buffer." (match-string-no-properties 1))) (defun gdb-threads-select () - "Make the thread on the current line become the current thread and display the -source in the source buffer." + "Select the thread and display the relevant source." (interactive) (gdb-enqueue-input (list (concat "thread " (gdb-get-thread-number) "\n") 'ignore)) (gud-display-frame)) (defun gdb-threads-mouse-select (event) - "Make the selected frame become the current frame and display the source in -the source buffer." + "Select the thread you click on and display the relevant source." (interactive "e") (mouse-set-point event) (gdb-threads-select)) @@ -1387,7 +1421,7 @@ the source buffer." (def-gdb-auto-updated-buffer gdb-registers-buffer gdb-invalidate-registers - "server info registers\n" + (concat gdb-server-prefix "info registers\n") gdb-info-registers-handler gdb-info-registers-custom) @@ -1413,14 +1447,17 @@ the source buffer." (concat "*registers of " (gdb-get-target-string) "*"))) (defun gdb-display-registers-buffer () + "Display integer register contents." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-registers-buffer))) (defun gdb-frame-registers-buffer () + "Display integer register contents in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdb-registers-buffer))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdb-registers-buffer)) + (set-window-dedicated-p (selected-window) t)) ;; ;; Locals buffer. @@ -1438,8 +1475,8 @@ the source buffer." ;; Abbreviate for arrays and structures. ;; These can be expanded using gud-display. (defun gdb-info-locals-handler nil - (gdb-set-pending-triggers (delq 'gdb-invalidate-locals - (gdb-get-pending-triggers))) + (setq gdb-pending-triggers (delq 'gdb-invalidate-locals + gdb-pending-triggers)) (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer))) (with-current-buffer buf (goto-char (point-min)) @@ -1474,24 +1511,29 @@ the source buffer." \\{gdb-locals-mode-map}" (setq major-mode 'gdb-locals-mode) - (setq mode-name "Locals") + (setq mode-name (concat "Locals:" gdb-current-frame)) (setq buffer-read-only t) (use-local-map gdb-locals-mode-map) - (gdb-invalidate-locals)) + (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)) + (gdb-invalidate-locals) + (gdbmi-invalidate-locals))) (defun gdb-locals-buffer-name () (with-current-buffer gud-comint-buffer (concat "*locals of " (gdb-get-target-string) "*"))) (defun gdb-display-locals-buffer () + "Display local variables of current stack and their values." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-locals-buffer))) (defun gdb-frame-locals-buffer () + "Display local variables of current stack and their values in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdb-locals-buffer))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdb-locals-buffer)) + (set-window-dedicated-p (selected-window) t)) ;;;; Window management @@ -1510,9 +1552,9 @@ the source buffer." #'(lambda (win) (if (eq gud-comint-buffer (window-buffer win)) (set-window-dedicated-p win t)))) - (setq answer (get-buffer-window buf)) + (setq answer (get-buffer-window buf 'visible)) (if (not answer) - (let ((window (get-lru-window))) + (let ((window (get-lru-window 'visible))) (if window (progn (set-window-buffer window buf) @@ -1523,7 +1565,7 @@ the source buffer." (if (eq gud-comint-buffer (window-buffer win)) (set-window-dedicated-p win nil))))) (if must-split - (let* ((largest (get-largest-window)) + (let* ((largest (get-largest-window 'visible)) (cur-size (window-height largest)) (new-size (and size (< size cur-size) (- cur-size size)))) (setq answer (split-window largest new-size)) @@ -1532,11 +1574,9 @@ the source buffer." (defun gdb-display-source-buffer (buffer) (if (eq gdb-selected-view 'source) - (progn (gdb-display-buffer buffer) - (get-buffer-window buffer)) - (gdb-display-buffer (gdb-get-buffer 'gdb-assembler-buffer)) - nil)) + (gdb-display-buffer (gdb-get-buffer 'gdb-assembler-buffer))) + (get-buffer-window buffer 'visible)) ;;; Shared keymap initialization: @@ -1545,25 +1585,23 @@ the source buffer." (define-key gud-menu-map [frames] `(menu-item "GDB-Frames" ,menu :visible (eq gud-minor-mode 'gdba))) (define-key menu [gdb] '("Gdb" . gdb-frame-gdb-buffer)) - (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) + (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) + (define-key menu [assembler] '("Machine" . gdb-frame-assembler-buffer)) (define-key menu [registers] '("Registers" . gdb-frame-registers-buffer)) + (define-key menu [locals] '("Locals" . gdb-frame-locals-buffer)) (define-key menu [frames] '("Stack" . gdb-frame-stack-buffer)) - (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer)) - (define-key menu [threads] '("Threads" . gdb-frame-threads-buffer)) -; (define-key menu [assembler] '("Machine" . gdb-frame-assembler-buffer)) -) + (define-key menu [breakpoints] '("Breakpoints" . gdb-frame-breakpoints-buffer))) (let ((menu (make-sparse-keymap "GDB-Windows"))) (define-key gud-menu-map [displays] `(menu-item "GDB-Windows" ,menu :visible (eq gud-minor-mode 'gdba))) (define-key menu [gdb] '("Gdb" . gdb-display-gdb-buffer)) - (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) + (define-key menu [assembler] '("Machine" . gdb-display-assembler-buffer)) + (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) (define-key menu [registers] '("Registers" . gdb-display-registers-buffer)) + (define-key menu [locals] '("Locals" . gdb-display-locals-buffer)) (define-key menu [frames] '("Stack" . gdb-display-stack-buffer)) - (define-key menu [breakpoints] '("Breakpoints" . gdb-display-breakpoints-buffer)) - (define-key menu [threads] '("Threads" . gdb-display-threads-buffer)) -; (define-key menu [assembler] '("Machine" . gdb-display-assembler-buffer)) -) + (define-key menu [breakpoints] '("Breakpoints" . gdb-display-breakpoints-buffer))) (let ((menu (make-sparse-keymap "View"))) (define-key gud-menu-map [view] @@ -1589,11 +1627,14 @@ the source buffer." "Display locals, stack and breakpoint information"))) (defun gdb-frame-gdb-buffer () + "Display GUD buffer in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdba))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdba)) + (set-window-dedicated-p (selected-window) t)) (defun gdb-display-gdb-buffer () + "Display GUD buffer." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdba))) @@ -1601,6 +1642,7 @@ the source buffer." (defvar gdb-main-file nil "Source file from which program execution begins.") (defun gdb-view-source-function () + "Select source view." (interactive) (if gdb-view-source (gdb-display-buffer @@ -1610,8 +1652,10 @@ the source buffer." (setq gdb-selected-view 'source)) (defun gdb-view-assembler() + "Select disassembly view." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer)) + (gdb-invalidate-assembler) (setq gdb-selected-view 'assembler)) ;(defun gdb-view-both() @@ -1656,10 +1700,10 @@ the source buffer." (other-window 1)) (defcustom gdb-many-windows nil - "Nil (the default value) means just pops up the GUD buffer + "Nil (the default value) means just pop up the GUD buffer unless `gdb-show-main' is t. In this case it starts with two windows: one displaying the GUD buffer and the other with the -source file with the main routine of the debugee. Non-nil means +source file with the main routine of the inferior. Non-nil means display the layout shown for `gdba'." :type 'boolean :group 'gud) @@ -1701,15 +1745,15 @@ This arrangement depends on the value of `gdb-many-windows'." "Exit a debugging session cleanly by killing the gdb buffers and resetting the source buffers." (dolist (buffer (buffer-list)) - (if (not (eq buffer gud-comint-buffer)) - (with-current-buffer buffer - (if (memq gud-minor-mode '(gdba pdb)) - (if (string-match "^\*.+*$" (buffer-name)) - (kill-buffer nil) - (gdb-remove-breakpoint-icons (point-min) (point-max) t) - (setq gud-minor-mode nil) - (kill-local-variable 'tool-bar-map) - (setq gud-running nil)))))) + (unless (eq buffer gud-comint-buffer) + (with-current-buffer buffer + (if (memq gud-minor-mode '(gdbmi gdba)) + (if (string-match "\\`\\*.+\\*\\'" (buffer-name)) + (kill-buffer nil) + (gdb-remove-breakpoint-icons (point-min) (point-max) t) + (setq gud-minor-mode nil) + (kill-local-variable 'tool-bar-map) + (setq gud-running nil)))))) (when (markerp gdb-overlay-arrow-position) (move-marker gdb-overlay-arrow-position nil) (setq gdb-overlay-arrow-position nil)) @@ -1791,11 +1835,10 @@ BUFFER nil or omitted means use the current buffer." (when (< left-margin-width 2) (save-current-buffer (setq left-margin-width 2) - (if (get-buffer-window (current-buffer)) - (set-window-margins (get-buffer-window - (current-buffer)) - left-margin-width - right-margin-width)))) + (if (get-buffer-window (current-buffer) 'visible) + (set-window-margins + (get-buffer-window (current-buffer) 'visible) + left-margin-width right-margin-width)))) (put-image (if enabled (or breakpoint-enabled-icon @@ -1819,11 +1862,10 @@ BUFFER nil or omitted means use the current buffer." (when (< left-margin-width 2) (save-current-buffer (setq left-margin-width 2) - (if (get-buffer-window (current-buffer)) - (set-window-margins (get-buffer-window - (current-buffer)) - left-margin-width - right-margin-width)))) + (if (get-buffer-window (current-buffer) 'visible) + (set-window-margins + (get-buffer-window (current-buffer) 'visible) + left-margin-width right-margin-width)))) (gdb-put-string (if enabled "B" "b") (1+ start))))) (defun gdb-remove-breakpoint-icons (start end &optional remove-margin) @@ -1832,11 +1874,10 @@ BUFFER nil or omitted means use the current buffer." (remove-images start end)) (when remove-margin (setq left-margin-width 0) - (if (get-buffer-window (current-buffer)) - (set-window-margins (get-buffer-window - (current-buffer)) - left-margin-width - right-margin-width)))) + (if (get-buffer-window (current-buffer) 'visible) + (set-window-margins + (get-buffer-window (current-buffer) 'visible) + left-margin-width right-margin-width)))) ;; @@ -1848,7 +1889,7 @@ BUFFER nil or omitted means use the current buffer." (def-gdb-auto-updated-buffer gdb-assembler-buffer gdb-invalidate-assembler - (concat "server disassemble " gdb-current-address "\n") + (concat gdb-server-prefix "disassemble " gdb-current-address "\n") gdb-assembler-handler gdb-assembler-custom) @@ -1887,7 +1928,7 @@ BUFFER nil or omitted means use the current buffer." (if (re-search-forward address nil t) (gdb-put-breakpoint-icon (eq flag ?y)))))))) (if (not (equal gdb-current-address "main")) - (set-window-point (get-buffer-window buffer) pos)))) + (set-window-point (get-buffer-window buffer 'visible) pos)))) (defvar gdb-assembler-mode-map (let ((map (make-sparse-keymap))) @@ -1913,14 +1954,17 @@ BUFFER nil or omitted means use the current buffer." (concat "*Machine Code " (gdb-get-target-string) "*"))) (defun gdb-display-assembler-buffer () + "Display disassembly view." (interactive) (gdb-display-buffer (gdb-get-create-buffer 'gdb-assembler-buffer))) (defun gdb-frame-assembler-buffer () + "Display disassembly view in a new frame." (interactive) - (switch-to-buffer-other-frame - (gdb-get-create-buffer 'gdb-assembler-buffer))) + (select-frame (make-frame gdb-frame-parameters)) + (switch-to-buffer (gdb-get-create-buffer 'gdb-assembler-buffer)) + (set-window-dedicated-p (selected-window) t)) ;; modified because if gdb-current-address has changed value a new command ;; must be enqueued to update the buffer with the new output @@ -1929,44 +1973,44 @@ BUFFER nil or omitted means use the current buffer." (progn (unless (string-equal gdb-current-frame gdb-previous-frame) (if (or (not (member 'gdb-invalidate-assembler - (gdb-get-pending-triggers))) + gdb-pending-triggers)) (not (string-equal gdb-current-address gdb-previous-address))) (progn ;; take previous disassemble command off the queue (with-current-buffer gud-comint-buffer - (let ((queue (gdb-get-input-queue)) (item)) + (let ((queue gdb-input-queue) (item)) (dolist (item queue) (if (equal (cdr item) '(gdb-assembler-handler)) - (gdb-set-input-queue - (delete item (gdb-get-input-queue))))))) + (setq gdb-input-queue + (delete item gdb-input-queue)))))) (gdb-enqueue-input - (list (concat "server disassemble " gdb-current-address "\n") + (list (concat gdb-server-prefix "disassemble " gdb-current-address "\n") 'gdb-assembler-handler)) - (gdb-set-pending-triggers - (cons 'gdb-invalidate-assembler - (gdb-get-pending-triggers))) + (push 'gdb-invalidate-assembler gdb-pending-triggers) (setq gdb-previous-address gdb-current-address) (setq gdb-previous-frame gdb-current-frame))))))) (defun gdb-get-current-frame () - (if (not (member 'gdb-get-current-frame (gdb-get-pending-triggers))) + (if (not (member 'gdb-get-current-frame gdb-pending-triggers)) (progn (gdb-enqueue-input - (list (concat "server info frame\n") 'gdb-frame-handler)) - (gdb-set-pending-triggers - (cons 'gdb-get-current-frame - (gdb-get-pending-triggers)))))) + (list (concat gdb-server-prefix "info frame\n") 'gdb-frame-handler)) + (push 'gdb-get-current-frame + gdb-pending-triggers)))) (defun gdb-frame-handler () - (gdb-set-pending-triggers - (delq 'gdb-get-current-frame (gdb-get-pending-triggers))) + (setq gdb-pending-triggers + (delq 'gdb-get-current-frame gdb-pending-triggers)) (with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer) (goto-char (point-min)) (forward-line) - (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*\\)") + (if (looking-at ".*=\\s-+0x\\(\\S-*\\)\\s-+in\\s-+\\(\\S-*?\\);? ") (progn (setq gdb-current-frame (match-string 2)) + (if (gdb-get-buffer 'gdb-locals-buffer) + (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) + (setq mode-name (concat "Locals:" gdb-current-frame)))) (let ((address (match-string 1))) ;; remove leading 0s from output of info frame command. (if (string-match "^0+\\(.*\\)" address) @@ -1986,5 +2030,5 @@ BUFFER nil or omitted means use the current buffer." (provide 'gdb-ui) -;;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352 +;; arch-tag: e9fb00c5-74ef-469f-a088-37384caae352 ;;; gdb-ui.el ends here diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 94937ba1e87..aa9a50a2580 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -216,7 +216,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies `complation-last-buffer' rather than `grep-last-buffer'.") (defvar grep-regexp-alist - '(("^\\(.+?\\)[:( \t]+\\([0-9]+\\)[:) \t]" 1 2) + '(("^\\(.+?\\)[:( \t]+\\([0-9]+\\)\\([:) \t]\\)\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\3\\)?" 1 2 (4 . 5)) ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") @@ -555,7 +555,7 @@ those sub directories of DIR." nil) ;; we change default-directory to dir (and grep-tree-ignore-CVS-directories "-path '*/CVS' -prune -o ") grep-tree-ignore-case)) - (default-directory dir) + (default-directory (file-name-as-directory (expand-file-name dir))) (null-device nil)) ; see grep (grep command-args regexp))) diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index a34b0bb2d48..4ea4fcb6ea2 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el @@ -4,7 +4,7 @@ ;; Maintainer: FSF ;; Keywords: unix, tools -;; Copyright (C) 1992,93,94,95,96,1998,2000,02,2003 Free Software Foundation, Inc. +;; Copyright (C) 1992,93,94,95,96,1998,2000,02,03,04 Free Software Foundation, Inc. ;; This file is part of GNU Emacs. @@ -92,44 +92,44 @@ If SOFT is non-nil, returns nil if the symbol doesn't already exist." Used to grey out relevant toolbar icons.") (easy-mmode-defmap gud-menu-map - '(([refresh] "Refresh" . gud-refresh) + '(([help] menu-item "Help" gdb-goto-info + :enable (memq gud-minor-mode '(gdbmi gdba))) + ([refresh] "Refresh" . gud-refresh) ([run] menu-item "Run" gud-run - :enable (and (not gud-running) - (memq gud-minor-mode '(gdba gdb dbx jdb)))) + :enable (and (not gud-running) + (memq gud-minor-mode '(gdbmi gdba gdb dbx jdb)))) ([until] menu-item "Continue to selection" gud-until - :enable (and (not gud-running) - (memq gud-minor-mode '(gdba gdb perldb)))) + :enable (and (not gud-running) + (memq gud-minor-mode '(gdbmi gdba gdb perldb)))) ([remove] menu-item "Remove Breakpoint" gud-remove - :enable (not gud-running)) + :enable (not gud-running)) ([tbreak] menu-item "Temporary Breakpoint" gud-tbreak - :enable (memq gud-minor-mode '(gdba gdb sdb xdb bashdb))) + :enable (memq gud-minor-mode '(gdbmi gdba gdb sdb xdb bashdb))) ([break] menu-item "Set Breakpoint" gud-break - :enable (not gud-running)) + :enable (not gud-running)) ([up] menu-item "Up Stack" gud-up - :enable (and (not gud-running) - (memq gud-minor-mode - '(gdba gdb dbx xdb jdb pdb bashdb)))) + :enable (and (not gud-running) + (memq gud-minor-mode + '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) ([down] menu-item "Down Stack" gud-down - :enable (and (not gud-running) - (memq gud-minor-mode - '(gdba gdb dbx xdb jdb pdb bashdb)))) + :enable (and (not gud-running) + (memq gud-minor-mode + '(gdbmi gdba gdb dbx xdb jdb pdb bashdb)))) ([print] menu-item "Print Expression" gud-print :enable (not gud-running)) ([watch] menu-item "Watch Expression" gud-watch :enable (and (not gud-running) - (eq gud-minor-mode 'gdba))) + (memq gud-minor-mode '(gdbmi gdba)))) ([finish] menu-item "Finish Function" gud-finish :enable (and (not gud-running) (memq gud-minor-mode - '(gdba gdb xdb jdb pdb bashdb)))) + '(gdbmi gdba gdb xdb jdb pdb bashdb)))) ([stepi] menu-item "Step Instruction" gud-stepi :enable (and (not gud-running) - (memq gud-minor-mode - '(gdba gdb dbx)))) + (memq gud-minor-mode '(gdbmi gdba gdb dbx)))) ([nexti] menu-item "Next Instruction" gud-nexti :enable (and (not gud-running) - (memq gud-minor-mode - '(gdba gdb dbx)))) + (memq gud-minor-mode '(gdbmi gdba gdb dbx)))) ([step] menu-item "Step Line" gud-step :enable (not gud-running)) ([next] menu-item "Next Line" gud-next @@ -171,7 +171,8 @@ Used to grey out relevant toolbar icons.") (gud-stepi . "gud-si") (gud-nexti . "gud-ni") (gud-up . "gud-up") - (gud-down . "gud-down")) + (gud-down . "gud-down") + (gdb-goto-info . "help")) map) (tool-bar-local-item-from-menu (car x) (cdr x) map gud-minor-mode-map))))) @@ -312,11 +313,14 @@ t means that there is no stack, and we are in display-file mode.") (defvar gud-speedbar-menu-items ;; Note to self. Add expand, and turn off items when not available. '(["Jump to stack frame" speedbar-edit-line - (with-current-buffer gud-comint-buffer (not (eq gud-minor-mode 'gdba)))] + (with-current-buffer gud-comint-buffer + (not (memq gud-minor-mode '(gdbmi gdba))))] ["Edit value" speedbar-edit-line - (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))] + (with-current-buffer gud-comint-buffer + (not (memq gud-minor-mode '(gdbmi gdba))))] ["Delete expression" gdb-var-delete - (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))]) + (with-current-buffer gud-comint-buffer + (not (memq gud-minor-mode '(gdbmi gdba))))]) "Additional menu items to add to the speedbar frame.") ;; Make sure our special speedbar mode is loaded @@ -330,7 +334,7 @@ If the GUD BUFFER is not running a supported debugger, then turn off the specialized speedbar mode." (let ((minor-mode (with-current-buffer buffer gud-minor-mode))) (cond - ((eq minor-mode 'gdba) + ((memq minor-mode '(gdbmi gdba)) (when (or gdb-var-changed (not (save-excursion (goto-char (point-min)) @@ -397,7 +401,7 @@ off the specialized speedbar mode." (speedbar-insert-button (car frame) 'speedbar-file-face 'speedbar-highlight-face - (cond ((memq minor-mode '(gdba gdb)) + (cond ((memq minor-mode '(gdbmi gdba gdb)) 'gud-gdb-goto-stackframe) (t (error "Should never be here"))) frame t))) @@ -1401,7 +1405,7 @@ and source-file directory for your debugger." output)) -(defcustom gud-pdb-command-name "pdb" +(defcustom gud-pdb-command-name "pydb" "File name for executing the Python debugger. This should be an executable on your path, or an absolute file name." :type 'string @@ -2339,7 +2343,8 @@ comint mode, which see." ;; Don't put repeated commands in command history many times. (set (make-local-variable 'comint-input-ignoredups) t) (make-local-variable 'paragraph-start) - (set (make-local-variable 'gud-delete-prompt-marker) (make-marker))) + (set (make-local-variable 'gud-delete-prompt-marker) (make-marker)) + (add-hook 'kill-buffer-hook 'gud-kill-buffer-hook nil t)) ;; Cause our buffers to be displayed, by default, ;; in the selected window. @@ -2384,8 +2389,11 @@ comint mode, which see." (if (file-name-directory file-subst) (expand-file-name file-subst) file-subst))) - (filepart (and file-word (concat "-" (file-name-nondirectory file))))) + (filepart (and file-word (concat "-" (file-name-nondirectory file)))) + (existing-buffer (get-buffer (concat "*gud" filepart "*")))) (pop-to-buffer (concat "*gud" filepart "*")) + (when (and existing-buffer (get-buffer-process existing-buffer)) + (error "This program is already running under gdb")) ;; Set the dir, in case the buffer already existed with a different dir. (setq default-directory dir) ;; Set default-directory to the file's directory. @@ -2507,14 +2515,14 @@ It is saved for when this flag is not set.") ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) (set-process-buffer proc nil) - (if (eq gud-minor-mode-type 'gdba) + (if (memq gud-minor-mode-type '(gdbmi gdba)) (gdb-reset) (gud-reset))) ((memq (process-status proc) '(signal exit)) ;; Stop displaying an arrow in a source file. (setq overlay-arrow-position nil) (with-current-buffer gud-comint-buffer - (if (eq gud-minor-mode 'gdba) + (if (memq gud-minor-mode-type '(gdbmi gdba)) (gdb-reset) (gud-reset))) (let* ((obuf (current-buffer))) @@ -2543,19 +2551,18 @@ It is saved for when this flag is not set.") (set-buffer obuf)))))) (defun gud-kill-buffer-hook () - (if gud-minor-mode - (setq gud-minor-mode-type gud-minor-mode))) - -(add-hook 'kill-buffer-hook 'gud-kill-buffer-hook) + (setq gud-minor-mode-type gud-minor-mode) + (condition-case nil + (kill-process (get-buffer-process gud-comint-buffer)) + (error nil))) (defun gud-reset () (dolist (buffer (buffer-list)) - (if (not (eq buffer gud-comint-buffer)) - (save-excursion - (set-buffer buffer) - (when gud-minor-mode - (setq gud-minor-mode nil) - (kill-local-variable 'tool-bar-map)))))) + (unless (eq buffer gud-comint-buffer) + (with-current-buffer buffer + (when gud-minor-mode + (setq gud-minor-mode nil) + (kill-local-variable 'tool-bar-map)))))) (defun gud-display-frame () "Find and obey the last filename-and-line marker from the debugger. @@ -2580,7 +2587,7 @@ Obeying it means displaying in another window the specified file and line." (with-current-buffer gud-comint-buffer (gud-find-file true-file))) (window (and buffer (or (get-buffer-window buffer) - (if (eq gud-minor-mode 'gdba) + (if (memq gud-minor-mode '(gdbmi gdba)) (gdb-display-source-buffer buffer) (display-buffer buffer))))) (pos)) @@ -2704,7 +2711,7 @@ Obeying it means displaying in another window the specified file and line." (forward-line 0) (if (looking-at comint-prompt-regexp) (set-marker gud-delete-prompt-marker (point))) - (if (eq gud-minor-mode 'gdba) + (if (memq gud-minor-mode '(gdbmi gdba)) (apply comint-input-sender (list proc command)) (process-send-string proc (concat command "\n"))))))) diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index a600939ef71..ae0c43c2730 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el @@ -1823,8 +1823,8 @@ Change the default directory for the process buffer to concur." 'hide 'wait) ;; If we don't know anything about the class, update shell routines (if (and idlwave-shell-get-object-class - (not (assoc-ignore-case idlwave-shell-get-object-class - (idlwave-class-alist)))) + (not (assoc-string idlwave-shell-get-object-class + (idlwave-class-alist) t))) (idlwave-shell-maybe-update-routine-info)) idlwave-shell-get-object-class))) diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index bfa507b851a..274480a36de 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el @@ -3,6 +3,7 @@ ;; Copyright (C) 2003, 04 Free Software Foundation, Inc. ;; Author: Dave Love <fx@gnu.org> +;; Maintainer: FSF ;; Created: Nov 2003 ;; Keywords: languages @@ -45,19 +46,18 @@ ;; I've installed a minor mode to do the job properly in Emacs 22. ;; Other things seem more natural or canonical here, e.g. the ;; {beginning,end}-of-defun implementation dealing with nested -;; definitions, and the inferior mode following `cmuscheme'. (The -;; inferior mode should be able to find the source of errors from -;; `python-send-region' & al via `compilation-minor-mode', but I can't -;; make that work with the current (March '04) compile.el.) -;; Successive TABs cycle between possible indentations for the line. +;; definitions, and the inferior mode following `cmuscheme'. The +;; inferior mode can find the source of errors from +;; `python-send-region' & al via `compilation-minor-mode'. Successive +;; TABs cycle between possible indentations for the line. There is +;; symbol completion using lookup in Python. ;; Even where it has similar facilities, this is incompatible with ;; python-mode.el in various respects. For instance, various key ;; bindings are changed to obey Emacs conventions, and things like ;; marking blocks and `beginning-of-defun' behave differently. -;; TODO: See various Fixmes below. It should be possible to arrange -;; some sort of completion using the inferior interpreter. +;; TODO: See various Fixmes below. ;;; Code: @@ -66,10 +66,8 @@ (require 'comint) (eval-when-compile (require 'compile) - (autoload 'Info-last "info") - (autoload 'Info-exit "info") (autoload 'info-lookup-maybe-add-help "info-look")) -(autoload 'compilation-start "compile") ; spurious compiler warning anyway +(autoload 'compilation-start "compile") (defgroup python nil "Silly walks in the Python language" @@ -204,6 +202,8 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." (define-key map "\C-c\C-z" 'python-switch-to-python) (define-key map "\C-c\C-m" 'python-load-file) (define-key map "\C-c\C-l" 'python-load-file) ; a la cmuscheme + (substitute-key-definition 'complete-symbol 'python-complete-symbol + map global-map) ;; Fixme: Add :help to menu. (easy-menu-define python-menu map "Python Mode menu" '("Python" @@ -262,9 +262,7 @@ Used for syntactic keywords. N is the match number (1, 2 or 3)." ;;;; Utility stuff (defsubst python-in-string/comment () - "Return non-nil if point is in a Python literal (a comment or string). -Optional argument LIM indicates the beginning of the containing form, -i.e. the limit on how far back to scan." + "Return non-nil if point is in a Python literal (a comment or string)." (syntax-ppss-context (syntax-ppss))) (defconst python-space-backslash-table @@ -299,16 +297,18 @@ comments and strings, or that the bracket/paren nesting depth is nonzero." (syntax-ppss (line-beginning-position))))))) (defun python-comment-line-p () - "Return non-nil if current line has only a comment or is blank." + "Return non-nil iff current line has only a comment." (save-excursion - (back-to-indentation) - (looking-at (rx (or (syntax comment-start) line-end))))) + (end-of-line) + (when (eq 'comment (syntax-ppss-context (syntax-ppss))) + (back-to-indentation) + (looking-at (rx (or (syntax comment-start) line-end)))))) (defun python-beginning-of-string () "Go to beginning of string around point. Do nothing if not in string." (let ((state (syntax-ppss))) - (when (nth 3 state) + (when (eq 'string (syntax-ppss-context state)) (goto-char (nth 8 state))))) (defun python-open-block-statement-p (&optional bos) @@ -323,7 +323,8 @@ BOS non-nil means point is known to be at beginning of statement." line-end)) (save-excursion (python-end-of-statement)) t) - (not (python-in-string/comment))))) + (not (progn (goto-char (match-beginning 0)) + (python-in-string/comment)))))) (defun python-close-block-statement-p (&optional bos) "Return non-nil if current line is a statement closing a block. @@ -384,7 +385,8 @@ Otherwise indent them to column zero." (defcustom python-honour-comment-indentation nil "Non-nil means indent relative to preceding comment line. Only do this for comments where the leading comment character is followed -by space." +by space. This doesn't apply to comment lines, which are always indented +in lines with preceding comments." :type 'boolean :group 'python) @@ -514,6 +516,16 @@ Set `python-indent' locally to the value guessed." (- python-indent))) 0))))))))) +(defun python-comment-indent () + "`comment-indent-function' for Python." + ;; If previous non-blank line was a comment, use its indentation. + ;; FIXME: This seems unnecessary since the default code delegates to + ;; indent-according-to-mode. --Stef + (unless (bobp) + (save-excursion + (forward-comment -1) + (if (eq ?# (char-after)) (current-column))))) + ;;;; Cycling through the possible indentations with successive TABs. ;; These don't need to be buffer-local since they're only relevant @@ -538,11 +550,17 @@ Set `python-indent' locally to the value guessed." (point)))) (defun python-indentation-levels () - "Return a list of possible indentations for this statement. + "Return a list of possible indentations for this line. Includes the default indentation and those which would close all -enclosing blocks." +enclosing blocks. Assumes the line has already been indented per +`python-indent-line'. Elements of the list are actually pairs: +\(INDENTATION . TEXT), where TEXT is the initial text of the +corresponding block opening (or nil)." (save-excursion - (let ((levels (list (cons (current-indentation) nil)))) + (let ((levels (list (cons (current-indentation) + (save-excursion + (if (python-beginning-of-block) + (python-initial-text))))))) ;; Only one possibility if we immediately follow a block open or ;; are in a continuation line. (unless (or (python-continuation-line-p) @@ -568,8 +586,7 @@ enclosing blocks." (if (> (- (point-max) pos) (point)) (goto-char (- (point-max) pos)))))) -;; Fixme: Is the arg necessary? -(defun python-indent-line (&optional arg) +(defun python-indent-line () "Indent current line as Python code. When invoked via `indent-for-tab-command', cycle through possible indentations for current line. The cycle is broken by a command different @@ -586,13 +603,30 @@ from `indent-for-tab-command', i.e. successive TABs do the cycling." (beginning-of-line) (delete-horizontal-space) (indent-to (car (nth python-indent-index python-indent-list))) - (let ((text (cdr (nth python-indent-index - python-indent-list)))) - (if text (message "Closes: %s" text))))) + (if (python-block-end-p) + (let ((text (cdr (nth python-indent-index + python-indent-list)))) + (if text + (message "Closes: %s" text)))))) (python-indent-line-1) (setq python-indent-list (python-indentation-levels) python-indent-list-length (length python-indent-list) python-indent-index (1- python-indent-list-length))))) + +(defun python-block-end-p () + "Non-nil if this is a line in a statement closing a block, +or a blank line indented to where it would close a block." + (and (not (python-comment-line-p)) + (or (python-close-block-statement-p t) + (< (current-indentation) + (save-excursion + (python-previous-statement) + (current-indentation)))))) + +;; Fixme: Define an indent-region-function. It should probably leave +;; lines alone if the indentation is already at one of the allowed +;; levels. Otherwise, M-C-\ typically keeps indenting more deeply +;; down a function. ;;;; Movement. @@ -629,8 +663,7 @@ start of buffer." "`end-of-defun-function' for Python. Finds end of innermost nested class or method definition." (let ((orig (point)) - (pattern (rx (and line-start (0+ space) - (or "def" "class") space)))) + (pattern (rx (and line-start (0+ space) (or "def" "class") space)))) ;; Go to start of current block and check whether it's at top ;; level. If it is, and not a block start, look forward for ;; definition statement. @@ -829,7 +862,8 @@ move and return nil. Otherwise return t." Makes nested Imenu menus from nested `class' and `def' statements. The nested menus are headed by an item referencing the outer definition; it has a space prepended to the name so that it sorts -first with `imenu--sort-by-name'." +first with `imenu--sort-by-name' (though, unfortunately, sub-menus +precede it)." (unless (boundp 'python-recursing) ; dynamically bound below (goto-char (point-min))) ; normal call from Imenu (let (index-alist ; accumulated value to return @@ -914,13 +948,20 @@ See `python-check-command' for the default." (file-name-nondirectory name)))))))) (setq python-saved-check-command command) (save-some-buffers (not compilation-ask-about-save) nil) - (compilation-start command)) + (let ((compilation-error-regexp-alist + (cons '("(\\([^,]+\\), line \\([0-9]+\\))" 1 2) + compilation-error-regexp-alist))) + (compilation-start command))) ;;;; Inferior mode stuff (following cmuscheme). +;; Fixme: Make sure we can work with IPython. + (defcustom python-python-command "python" "*Shell command to run Python interpreter. -Any arguments can't contain whitespace." +Any arguments can't contain whitespace. +Note that IPython may not work properly; it must at least be used with the +`-cl' flag, i.e. use `ipython -cl'." :group 'python :type 'string) @@ -937,40 +978,66 @@ Additional arguments are added when the command is used by `run-python' et al.") (defvar python-buffer nil - "*The current python process buffer. -To run multiple Python processes, start the first with \\[run-python]. -It will be in a buffer named *Python*. Rename that with -\\[rename-buffer]. Now start a new process with \\[run-python]. It -will be in a new buffer, named *Python*. Switch between the different -process buffers with \\[switch-to-buffer]. - -Commands that send text from source buffers to Python processes have -to choose a process to send to. This is determined by global variable -`python-buffer'. Suppose you have three inferior Pythons running: - Buffer Process - foo python - bar python<2> - *Python* python<3> -If you do a \\[python-send-region-and-go] command on some Python source -code, what process does it go to? - -- In a process buffer (foo, bar, or *Python*), send it to that process. -- In some other buffer (e.g. a source file), send it to the process - attached to `python-buffer'. -Process selection is done by function `python-proc'. - -Whenever \\[run-python] starts a new process, it resets `python-buffer' -to be the new process's buffer. If you only run one process, this will -do the right thing. If you run multiple processes, you can change -`python-buffer' to another process buffer with \\[set-variable].") + "The current python process buffer." + ;; Fixme: a single process is currently assumed, so that this doc + ;; is misleading. + +;; "*The current python process buffer. +;; To run multiple Python processes, start the first with \\[run-python]. +;; It will be in a buffer named *Python*. Rename that with +;; \\[rename-buffer]. Now start a new process with \\[run-python]. It +;; will be in a new buffer, named *Python*. Switch between the different +;; process buffers with \\[switch-to-buffer]. + +;; Commands that send text from source buffers to Python processes have +;; to choose a process to send to. This is determined by global variable +;; `python-buffer'. Suppose you have three inferior Pythons running: +;; Buffer Process +;; foo python +;; bar python<2> +;; *Python* python<3> +;; If you do a \\[python-send-region-and-go] command on some Python source +;; code, what process does it go to? + +;; - In a process buffer (foo, bar, or *Python*), send it to that process. +;; - In some other buffer (e.g. a source file), send it to the process +;; attached to `python-buffer'. +;; Process selection is done by function `python-proc'. + +;; Whenever \\[run-python] starts a new process, it resets `python-buffer' +;; to be the new process's buffer. If you only run one process, this will +;; do the right thing. If you run multiple processes, you can change +;; `python-buffer' to another process buffer with \\[set-variable]." + ) (defconst python-compilation-regexp-alist + ;; FIXME: maybe these should move to compilation-error-regexp-alist-alist. `((,(rx (and line-start (1+ (any " \t")) "File \"" (group (1+ (not (any "\"<")))) ; avoid `<stdin>' &c "\", line " (group (1+ digit)))) - 1 python-compilation-line-number)) + 1 2) + (,(rx (and " in file " (group (1+ not-newline)) " on line " + (group (1+ digit)))) + 1 2)) "`compilation-error-regexp-alist' for inferior Python.") +(defvar inferior-python-mode-map + (let ((map (make-sparse-keymap))) + ;; This will inherit from comint-mode-map. + (define-key map "\C-c\C-l" 'python-load-file) + (define-key map "\C-c\C-v" 'python-check) + ;; Note that we _can_ still use these commands which send to the + ;; Python process even at the prompt iff we have a normal prompt, + ;; i.e. '>>> ' and not '... '. See the comment before + ;; python-send-region. Fixme: uncomment these if we address that. + + ;; (define-key map [(meta ?\t)] 'python-complete-symbol) + ;; (define-key map "\C-c\C-f" 'python-describe-symbol) + map)) + +;; Fixme: This should inherit some stuff from python-mode, but I'm not +;; sure how much: at least some keybindings, like C-c C-f; syntax?; +;; font-locking, e.g. for triple-quoted strings? (define-derived-mode inferior-python-mode comint-mode "Inferior Python" "Major mode for interacting with an inferior Python process. A Python process can be started with \\[run-python]. @@ -991,14 +1058,13 @@ For running multiple processes in multiple buffers, see `python-buffer'. :group 'python (set-syntax-table python-mode-syntax-table) (setq mode-line-process '(":%s")) - ;; Fixme: Maybe install some python-mode bindings too. - (define-key inferior-python-mode-map "\C-c\C-l" 'python-load-file) - (define-key inferior-python-mode-map "\C-c\C-z" 'python-switch-to-python) - (add-hook 'comint-input-filter-functions 'python-input-filter nil t) + (set (make-local-variable 'comint-input-filter) 'python-input-filter) (add-hook 'comint-preoutput-filter-functions #'python-preoutput-filter nil t) - ;; Still required by `comint-redirect-send-command', for instance: - (set (make-local-variable 'comint-prompt-regexp) "^\\([>.]\\{3\\} \\)+") + ;; Still required by `comint-redirect-send-command', for instance + ;; (and we need to match things like `>>> ... >>> '): + (set (make-local-variable 'comint-prompt-regexp) + (rx (and line-start (1+ (and (repeat 3 (any ">.")) ?\ ))))) (set (make-local-variable 'compilation-error-regexp-alist) python-compilation-regexp-alist) (compilation-shell-minor-mode 1)) @@ -1009,15 +1075,9 @@ Default ignores all inputs of 0, 1, or 2 non-blank characters." :type 'regexp :group 'python) -(defvar python-orig-start nil - "Marker to the start of the region passed to the inferior Python. -It can also be a filename.") - (defun python-input-filter (str) "`comint-input-filter' function for inferior Python. -Don't save anything for STR matching `inferior-python-filter-regexp'. -Also resets variables for adjusting error messages." - (setq python-orig-start nil) +Don't save anything for STR matching `inferior-python-filter-regexp'." (not (string-match inferior-python-filter-regexp str))) ;; Fixme: Loses with quoted whitespace. @@ -1030,21 +1090,8 @@ Also resets variables for adjusting error messages." (t (let ((pos (string-match "[^ \t]" string))) (if pos (python-args-to-list (substring string pos)))))))) -(defun python-compilation-line-number (file col) - "Return error descriptor of error found for FILE, column COL. -Used as line-number hook function in `python-compilation-regexp-alist'." - (let ((line (string-to-number (match-string 2)))) - (cons (point-marker) - (if (and (markerp python-orig-start) - (marker-buffer python-orig-start)) - (with-current-buffer (marker-buffer python-orig-start) - (goto-char python-orig-start) - (forward-line (1- line))) - (list (if (stringp python-orig-start) python-orig-start file) - line nil))))) - (defvar python-preoutput-result nil - "Data from output line last `_emacs_out' line seen by the preoutput filter.") + "Data from last `_emacs_out' line seen by the preoutput filter.") (defvar python-preoutput-continuation nil "If non-nil, funcall this when `python-preoutput-filter' sees `_emacs_ok'.") @@ -1055,7 +1102,9 @@ Used as line-number hook function in `python-compilation-regexp-alist'." ;; `python-preoutput-continuation' if we get it. (defun python-preoutput-filter (s) "`comint-preoutput-filter-functions' function: ignore prompts not at bol." - (cond ((and (string-match "\\`[.>]\\{3\\} \\'" s) + (cond ((and (string-match (rx (and string-start (repeat 3 (any ".>")) + " " string-end)) + s) (/= (let ((inhibit-field-text-motion t)) (line-beginning-position)) (point))) @@ -1076,10 +1125,10 @@ Used as line-number hook function in `python-compilation-regexp-alist'." CMD is the Python command to run. NOSHOW non-nil means don't show the buffer automatically. If there is a process already running in `*Python*', switch to -that buffer. Interactively a prefix arg, allows you to edit the initial -command line (default is the value of `python-command'); `-i' etc. args -will be added to this as appropriate. Runs the hooks -`inferior-python-mode-hook' (after the `comint-mode-hook' is run). +that buffer. Interactively, a prefix arg allows you to edit the initial +command line (default is `python-command'); `-i' etc. args will be added +to this as appropriate. Runs the hook `inferior-python-mode-hook' +\(after the `comint-mode-hook' is run). \(Type \\[describe-mode] in the process buffer for a list of commands.)" (interactive (list (if current-prefix-arg (read-string "Run Python: " python-command) @@ -1089,82 +1138,78 @@ will be added to this as appropriate. Runs the hooks ;; Fixme: Consider making `python-buffer' buffer-local as a buffer ;; (not a name) in Python buffers from which `run-python' &c is ;; invoked. Would support multiple processes better. - (unless (comint-check-proc "*Python*") - (let ((cmdlist (append (python-args-to-list cmd) '("-i")))) + (unless (comint-check-proc python-buffer) + (let* ((cmdlist (append (python-args-to-list cmd) '("-i"))) + (path (getenv "PYTHONPATH")) + (process-environment ; to import emacs.py + (push (concat "PYTHONPATH=" data-directory + (if path (concat ":" path))) + process-environment))) (set-buffer (apply 'make-comint "Python" (car cmdlist) nil - (cdr cmdlist)))) + (cdr cmdlist))) + (setq python-buffer "*Python*")) (inferior-python-mode) ;; Load function defintions we need. ;; Before the preoutput function was used, this was done via -c in ;; cmdlist, but that loses the banner and doesn't run the startup - ;; file. - (python-send-string "\ -def _emacs_execfile (file): # execute file and remove it - from os import remove - try: execfile (file, globals (), globals ()) - finally: remove (file) - -def _emacs_args (name): # get arglist of name for eldoc &c - import inspect - parts = name.split ('.') - if len (parts) > 1: - try: exec 'import ' + parts[0] - except: return None - try: exec 'func='+name # lose if name is keyword or undefined - except: return None - if inspect.isbuiltin (func): - doc = func.__doc__ - if doc.find (' ->') != -1: - print '_emacs_out', doc.split (' ->')[0] - elif doc.find ('\\n') != -1: - print '_emacs_out', doc.split ('\\n')[0] - return None - if inspect.ismethod (func): func = func.im_func - if not inspect.isfunction (func): - return None - (args, varargs, varkw, defaults) = inspect.getargspec (func) - print '_emacs_out', func.__name__+inspect.formatargspec (args, varargs, varkw, defaults) - -print '_emacs_ok'")) - (unless noshow (pop-to-buffer (setq python-buffer "*Python*")))) + ;; file. The code might be inline here, but there's enough that it + ;; seems worth putting in a separate file, and it's probably cleaner + ;; to put it in a module. + (python-send-string "import emacs")) + (unless noshow (pop-to-buffer python-buffer))) + +;; Fixme: We typically lose if the inferior isn't in the normal REPL, +;; e.g. prompt is `help> '. Probably raise an error if the form of +;; the prompt is unexpected; actually, it needs to be `>>> ', not +;; `... ', i.e. we're not inputting a block &c. However, this may not +;; be the place to do it, e.g. we might actually want to send commands +;; having set up such a state. + +(defun python-send-command (command) + "Like `python-send-string' but resets `compilation-minor-mode'." + (goto-char (point-max)) + (let ((end (marker-position (process-mark (python-proc))))) + (compilation-forget-errors) + (python-send-string command) + (set-marker compilation-parsing-end end) + (setq compilation-last-buffer (current-buffer)))) (defun python-send-region (start end) "Send the region to the inferior Python process." ;; The region is evaluated from a temporary file. This avoids ;; problems with blank lines, which have different semantics ;; interactively and in files. It also saves the inferior process - ;; buffer filling up with interpreter prompts. We need a function - ;; to remove the temporary file when it has been evaluated, which - ;; unfortunately means using a not-quite pristine interpreter - ;; initially. Unfortunately we also get tracebacks which look like: - ;; - ;; >>> Traceback (most recent call last): - ;; File "<stdin>", line 1, in ? - ;; File "<string>", line 4, in _emacs_execfile - ;; File "/tmp/py7734RSB", line 11 + ;; buffer filling up with interpreter prompts. We need a Python + ;; function to remove the temporary file when it has been evaluated + ;; (though we could probably do it in Lisp with a Comint output + ;; filter). This function also catches exceptions and truncates + ;; tracebacks not to mention the frame of the function itself. ;; ;; The compilation-minor-mode parsing takes care of relating the - ;; reference to the temporary file to the source. Fixme: - ;; comint-filter the first two lines of the traceback? + ;; reference to the temporary file to the source. + ;; + ;; Fixme: Write a `coding' header to the temp file if the region is + ;; non-ASCII. (interactive "r") (let* ((f (make-temp-file "py")) - (command (format "_emacs_execfile(%S)" f)) + (command (format "emacs.eexecfile(%S)" f)) (orig-start (copy-marker start))) - (if (save-excursion - (goto-char start) - (/= 0 (current-indentation))) ; need dummy block - (write-region "if True:\n" nil f nil 'nomsg)) + (when (save-excursion + (goto-char start) + (/= 0 (current-indentation))) ; need dummy block + (save-excursion + (goto-char orig-start) + ;; Wrong if we had indented code at buffer start. + (set-marker orig-start (line-beginning-position 0))) + (write-region "if True:\n" nil f nil 'nomsg)) (write-region start end f t 'nomsg) - (when python-buffer + (let ((proc (python-proc))) ;Make sure we're running a process. (with-current-buffer python-buffer - (let ((end (marker-position (process-mark (python-proc))))) - (set (make-local-variable 'python-orig-start) orig-start) - (set (make-local-variable 'compilation-error-list) nil) - (let ((comint-input-filter-functions - (delete 'python-input-filter comint-input-filter-functions))) - (python-send-string command)) - (set-marker compilation-parsing-end end) - (setq compilation-last-buffer (current-buffer))))))) + (python-send-command command) + ;; Tell compile.el to redirect error locations in file `f' to + ;; positions past marker `orig-start'. It has to be done *after* + ;; python-send-command's call to compilation-forget-errors. + (compilation-fake-loc orig-start f))))) (defun python-send-string (string) "Evaluate STRING in inferior Python process." @@ -1177,6 +1222,8 @@ print '_emacs_ok'")) (interactive) (python-send-region (point-min) (point-max))) +;; Fixme: Try to define the function or class within the relevant +;; module, not just at top level. (defun python-send-defun () "Send the current defun (class or method) to the inferior Python process." (interactive) @@ -1223,39 +1270,33 @@ function location information for debugging, and supports users of module-qualified names." (interactive (comint-get-source "Load Python file: " python-prev-dir/file python-source-modes - t)) ; because execfile needs exact name - (comint-check-source file-name) ; Check to see if buffer needs saved. + t)) ; because execfile needs exact name + (comint-check-source file-name) ; Check to see if buffer needs saving. (setq python-prev-dir/file (cons (file-name-directory file-name) (file-name-nondirectory file-name))) - (when python-buffer + (let ((proc (python-proc))) ;Make sure we have a process. (with-current-buffer python-buffer - (let ((end (marker-position (process-mark (python-proc))))) - (set (make-local-variable 'compilation-error-list) nil) - ;; (set (make-local-variable 'compilation-old-error-list) nil) - (let ((comint-input-filter-functions - (delete 'python-input-filter comint-input-filter-functions))) - (python-send-string - (if (string-match "\\.py\\'" file-name) - ;; Fixme: make sure the directory is in the path list - (let ((module (file-name-sans-extension - (file-name-nondirectory file-name)))) - (set (make-local-variable 'python-orig-start) nil) - (format "\ -if globals().has_key(%S): reload(%s) -else: import %s -" module module module)) - (set (make-local-variable 'python-orig-start) file-name) - (format "execfile('%s')" file-name)))) - (set-marker compilation-parsing-end end) - (setq compilation-last-buffer (current-buffer)))))) - -;; Fixme: Should this start a process if there isn't one? (Unlike cmuscheme.) + ;; Fixme: I'm not convinced by this logic from python-mode.el. + (python-send-command + (if (string-match "\\.py\\'" file-name) + (let ((module (file-name-sans-extension + (file-name-nondirectory file-name)))) + (format "emacs.eimport(%S,%S)" + module (file-name-directory file-name))) + (format "execfile(%S)" file-name))) + (message "%s loaded" file-name)))) + +;; Fixme: If we need to start the process, wait until we've got the OK +;; from the startup. (defun python-proc () - "Return the current Python process. See variable `python-buffer'." - (let ((proc (get-buffer-process (if (eq major-mode 'inferior-python-mode) - (current-buffer) - python-buffer)))) - (or proc (error "No current process. See variable `python-buffer'")))) + "Return the current Python process. +See variable `python-buffer'. Starts a new process if necessary." + (or (if python-buffer + (get-buffer-process (if (eq major-mode 'inferior-python-mode) + (current-buffer) + python-buffer))) + (progn (run-python nil t) + (python-proc)))) ;;;; Context-sensitive help. @@ -1267,33 +1308,47 @@ else: import %s "Syntax table giving `.' symbol syntax. Otherwise inherits from `python-mode-syntax-table'.") +(defvar view-return-to-alist) +(eval-when-compile (autoload 'help-buffer "help-fns")) + ;; Fixme: Should this actually be used instead of info-look, i.e. be -;; bound to C-h S? +;; bound to C-h S? Can we use other pydoc stuff before python 2.2? (defun python-describe-symbol (symbol) - "Get help on SYMBOL using `pydoc'. -Interactively, prompt for symbol." - ;; Note that we do this in the inferior process, not a separate one to + "Get help on SYMBOL using `help'. +Interactively, prompt for symbol. + +Symbol may be anything recognized by the interpreter's `help' command -- +e.g. `CALLS' -- not just variables in scope. +This only works for Python version 2.2 or newer since earlier interpreters +don't support `help'." + ;; Note that we do this in the inferior process, not a separate one, to ;; ensure the environment is appropriate. (interactive (let ((symbol (with-syntax-table python-dotty-syntax-table (current-word))) - (enable-recursive-minibuffers t) - val) - (setq val (read-string (if symbol - (format "Describe symbol (default %s): " - symbol) - "Describe symbol: ") - nil nil symbol)) - (list (or val symbol)))) + (enable-recursive-minibuffers t)) + (list (read-string (if symbol + (format "Describe symbol (default %s): " symbol) + "Describe symbol: ") + nil nil symbol)))) (if (equal symbol "") (error "No symbol")) (let* ((func `(lambda () - (comint-redirect-send-command (format "help(%S)\n" ,symbol) + (comint-redirect-send-command (format "emacs.ehelp(%S)\n" + ,symbol) "*Help*" nil)))) ;; Ensure we have a suitable help buffer. - (let (temp-buffer-show-hook) ; avoid xref stuff - (with-output-to-temp-buffer "*Help*" + ;; Fixme: Maybe process `Related help topics' a la help xrefs and + ;; allow C-c C-f in help buffer. + (let ((temp-buffer-show-hook ; avoid xref stuff + (lambda () + (toggle-read-only 1) + (setq view-return-to-alist + (list (cons (selected-window) help-return-method)))))) + (help-setup-xref (list 'python-describe-symbol symbol) (interactive-p)) + (with-output-to-temp-buffer (help-buffer) (with-current-buffer standard-output - (set (make-local-variable 'comint-redirect-subvert-readonly) t)))) + (set (make-local-variable 'comint-redirect-subvert-readonly) t) + (print-help-return-message)))) (if (and python-buffer (get-buffer python-buffer)) (with-current-buffer python-buffer (funcall func)) @@ -1302,6 +1357,15 @@ Interactively, prompt for symbol." (add-to-list 'debug-ignored-errors "^No symbol") +(defun python-send-receive (string) + "Send STRING to inferior Python (if any) and return result. +The result is what follows `_emacs_out' in the output (or nil)." + (let ((proc (python-proc))) + (python-send-string string) + (setq python-preoutput-result nil) + (accept-process-output proc 5) + python-preoutput-result)) + ;; Fixme: try to make it work with point in the arglist. Also, is ;; there anything reasonable we can do with random methods? ;; (Currently only works with functions.) @@ -1310,14 +1374,9 @@ Interactively, prompt for symbol." Only works when point is in a function name, not its arglist, for instance. Assumes an inferior Python is running." (let ((symbol (with-syntax-table python-dotty-syntax-table - (current-word))) - (proc (and python-buffer (python-proc)))) - (when (and proc symbol) - (python-send-string - (format "_emacs_args(%S)" symbol)) - (setq python-preoutput-result nil) - (accept-process-output proc 1) - python-preoutput-result))) + (current-word)))) + (when symbol + (python-send-receive (format "emacs.eargs(%S)" symbol))))) ;;;; Info-look functionality. @@ -1331,11 +1390,13 @@ Used with `eval-after-load'." ;; Whether info files have a Python version suffix, e.g. in Debian. (versioned (with-temp-buffer - (Info-mode) + (with-no-warnings (Info-mode)) (condition-case () ;; Don't use `info' because it would pop-up a *info* buffer. - (Info-goto-node (format "(python%s-lib)Miscellaneous Index" - version)) + (with-no-warnings + (Info-goto-node (format "(python%s-lib)Miscellaneous Index" + version)) + t) (error nil))))) (info-lookup-maybe-add-help :mode 'python-mode @@ -1401,7 +1462,7 @@ The criterion is either a match for `jython-mode' via (while (re-search-forward (rx (and line-start (or "import" "from") (1+ space) (group (1+ (not (any " \t\n.")))))) - 10000 ; Probably not worth customizing. + (+ (point-min) 10000) ; Probably not worth customizing. t) (if (member (match-string 1) python-jython-packages) (throw 'done t)))) @@ -1519,11 +1580,97 @@ Uses `python-beginning-of-block', `python-end-of-block'." (python-end-of-block) (exchange-point-and-mark)) +;;;; Completion. + +(defun python-symbol-completions (symbol) + "Return a list of completions of the string SYMBOL from Python process. +The list is sorted." + (when symbol + (let ((completions + (condition-case () + (car (read-from-string (python-send-receive + (format "emacs.complete(%S)" symbol)))) + (error nil)))) + (sort + ;; We can get duplicates from the above -- don't know why. + (delete-dups completions) + #'string<)))) + +(defun python-partial-symbol () + "Return the partial symbol before point (for completion)." + (let ((end (point)) + (start (save-excursion + (and (re-search-backward + (rx (and (or buffer-start (regexp "[^[:alnum:]._]")) + (group (1+ (regexp "[[:alnum:]._]"))) + point)) + nil t) + (match-beginning 1))))) + (if start (buffer-substring-no-properties start end)))) + +;; Fixme: We should have an abstraction of this sort of thing in the +;; core. +(defun python-complete-symbol () + "Perform completion on the Python symbol preceding point. +Repeating the command scrolls the completion window." + (interactive) + (let ((window (get-buffer-window "*Completions*"))) + (if (and (eq last-command this-command) + window (window-live-p window) (window-buffer window) + (buffer-name (window-buffer window))) + (with-current-buffer (window-buffer window) + (if (pos-visible-in-window-p (point-max) window) + (set-window-start window (point-min)) + (save-selected-window + (select-window window) + (scroll-up)))) + ;; Do completion. + (let* ((end (point)) + (symbol (python-partial-symbol)) + (completions (python-symbol-completions symbol)) + (completion (if completions + (try-completion symbol completions)))) + (when symbol + (cond ((eq completion t)) + ((null completion) + (message "Can't find completion for \"%s\"" symbol) + (ding)) + ((not (string= symbol completion)) + (delete-region (- end (length symbol)) end) + (insert completion)) + (t + (message "Making completion list...") + (with-output-to-temp-buffer "*Completions*" + (display-completion-list completions)) + (message "Making completion list...%s" "done")))))))) + +(eval-when-compile (require 'hippie-exp)) + +(defun python-try-complete (old) + "Completion function for Python for use with `hippie-expand'." + (when (eq major-mode 'python-mode) ; though we only add it locally + (unless old + (let ((symbol (python-partial-symbol))) + (he-init-string (- (point) (length symbol)) (point)) + (if (not (he-string-member he-search-string he-tried-table)) + (push he-search-string he-tried-table)) + (setq he-expand-list + (and symbol (python-symbol-completions symbol))))) + (while (and he-expand-list + (he-string-member (car he-expand-list) he-tried-table)) + (pop he-expand-list)) + (if he-expand-list + (progn + (he-substitute-string (pop he-expand-list)) + t) + (if old (he-reset-string)) + nil))) + ;;;; Modes. (defvar outline-heading-end-regexp) (defvar eldoc-print-current-symbol-info-function) -(defvar python-mode-running) + ;;;###autoload (define-derived-mode python-mode fundamental-mode "Python" "Major mode for editing Python files. @@ -1565,11 +1712,10 @@ lines count as headers. )) (set (make-local-variable 'parse-sexp-lookup-properties) t) (set (make-local-variable 'comment-start) "# ") - ;; Fixme: define a comment-indent-function? + (set (make-local-variable 'comment-indent-function) #'python-comment-indent) (set (make-local-variable 'indent-line-function) #'python-indent-line) (set (make-local-variable 'paragraph-start) "\\s-*$") - (set (make-local-variable 'fill-paragraph-function) - 'python-fill-paragraph) + (set (make-local-variable 'fill-paragraph-function) 'python-fill-paragraph) (set (make-local-variable 'require-final-newline) t) (set (make-local-variable 'add-log-current-defun-function) #'python-current-defun) @@ -1587,6 +1733,9 @@ lines count as headers. #'python-eldoc-function) (add-hook 'eldoc-mode-hook '(lambda () (run-python 0 t)) nil t) ; need it running + (if (featurep 'hippie-exp) + (set (make-local-variable 'hippie-expand-try-functions-list) + (cons 'python-try-complete hippie-expand-try-functions-list))) (unless font-lock-mode (font-lock-mode 1)) (when python-guess-indent (python-guess-indent)) (set (make-local-variable 'python-command) python-python-command) diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index df2bf6803da..adb5f7b402a 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -648,7 +648,7 @@ implemented as aliases. See `sh-feature'." (rc "else") - (sh "do" "elif" "else" "if" "then" "trap" "type" "until" "while")) + (sh "!" "do" "elif" "else" "if" "then" "trap" "type" "until" "while")) "*List of keywords that may be immediately followed by a builtin or keyword. Given some confusion between keywords and builtins depending on shell and system, the distinction here has been based on whether they influence the diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 1a9251599ce..0e0d89b07e1 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -1,11 +1,12 @@ ;;; sql.el --- specialized comint.el for SQL interpreters -;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1998,99,2000,01,02,03,04 Free Software Foundation, Inc. ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: Michael Mauger <mmaug@yahoo.com> -;; Version: 1.8.0 +;; Version: 2.0.1 ;; Keywords: comm languages processes +;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode ;; This file is part of GNU Emacs. @@ -101,7 +102,7 @@ ;; (const :tag "XyzDB" xyz) -;; 2) Add an entry to the `sql-product-support' list. +;; 2) Add an entry to the `sql-product-alist' list. ;; (xyz ;; :font-lock sql-mode-xyz-font-lock-keywords @@ -136,7 +137,7 @@ ;; using ANSI keywords. See sql-mode-oracle-font-lock-keywords for ;; a more complex example. -;; (defvar sql-mode-xyz-font-lock-keywords sql-mode-ansi-font-lock-keywords +;; (defvar sql-mode-xyz-font-lock-keywords nil ;; "XyzDB SQL keywords used by font-lock.") ;; 6) Add a product highlighting function. @@ -192,13 +193,18 @@ ;;; Thanks to all the people who helped me out: +;; Alex Schroeder <alex@gnu.org> ;; Kai Blauberg <kai.blauberg@metla.fi> ;; <ibalaban@dalet.com> ;; Yair Friedman <yfriedma@JohnBryce.Co.Il> ;; Gregor Zych <zych@pool.informatik.rwth-aachen.de> ;; nino <nino@inform.dk> ;; Berend de Boer <berend@pobox.com> -;; Michael Mauger <mmaug@yahoo.com> +;; Adam Jenkins <adam@thejenkins.org> +;; Michael Mauger <mmaug@yahoo.com> -- improved product support +;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support +;; Harald Maier <maierh@myself.com> -- sql-send-string +;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections @@ -209,6 +215,8 @@ (eval-when-compile (require 'regexp-opt)) (require 'custom) +(eval-when-compile ;; needed in Emacs 19, 20 + (setq max-specpdl-size 2000)) ;;; Allow customization @@ -264,7 +272,7 @@ highlighted properly when you open them." (defvar sql-interactive-product nil "Product under `sql-interactive-mode'.") -(defvar sql-product-support +(defvar sql-product-alist '((ansi :font-lock sql-mode-ansi-font-lock-keywords) (db2 @@ -319,9 +327,9 @@ highlighted properly when you open them." :syntax-alist ((?$ . "w") (?# . "w"))) (postgres :font-lock sql-mode-postgres-font-lock-keywords - :sqli-login (database server) + :sqli-login (user database server) :sqli-connect sql-connect-postgres - :sqli-prompt-regexp "^.*> *" + :sqli-prompt-regexp "^.*[#>] *" :sqli-prompt-length 5) (solid :font-lock sql-mode-solid-font-lock-keywords @@ -372,10 +380,12 @@ following: database. Do product specific configuration of comint in this function. - :sqli-prompt-regexp a regular expression string that matches the - prompt issued by the product interpreter. + :sqli-prompt-regexp a regular expression string that matches + the prompt issued by the product + interpreter. (Not needed in 21.3+) - :sqli-prompt-length the length of the prompt on the line. + :sqli-prompt-length the length of the prompt on the line.(Not + needed in 21.3+) :syntax-alist an alist of syntax table entries to enable special character treatment by font-lock and @@ -412,14 +422,14 @@ buffer is shown using `display-buffer'." (defvar sql-imenu-generic-expression ;; Items are in reverse order because they are rendered in reverse. - '(("Rules/Defaults" "^\\s-*create\\s-+\\(rule\\|default\\)\\s-+\\(\\w+\\)" 2) - ("Sequences" "^\\s-*create\\s-+sequence\\s-+\\(\\w+\\)" 1) - ("Triggers" "^\\s-*\\(create\\s-+\\(or\\s-+replace\\s-+\\)?\\)?trigger\\s-+\\(\\w+\\)" 3) - ("Functions" "^\\s-*\\(create\\s-+\\(or\\s-+replace\\s-+\\)?\\)?function\\s-+\\(\\w+\\)" 3) - ("Procedures" "^\\s-*\\(create\\s-+\\(or\\s-+replace\\s-+\\)?\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4) - ("Packages" "^\\s-*create\\s-+\\(or\\s-+replace\\s-+\\)?package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3) - ("Indexes" "^\\s-*create\\s-+index\\s-+\\(\\w+\\)" 1) - ("Tables/Views" "^\\s-*create\\s-+\\(\\(global\\s-+\\)?\\(temporary\\s-+\\)?table\\|view\\)\\s-+\\(\\w+\\)" 4)) + '(("Rules/Defaults" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(rule\\|default\\)\\s-+\\(\\w+\\)" 3) + ("Sequences" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*sequence\\s-+\\(\\w+\\)" 2) + ("Triggers" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*trigger\\s-+\\(\\w+\\)" 2) + ("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3) + ("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4) + ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3) + ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2) + ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3)) "Define interesting points in the SQL buffer for `imenu'. This is used to set `imenu-generic-expression' when SQL mode is @@ -745,6 +755,7 @@ Based on `comint-mode-map'.") (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-c") 'sql-send-paragraph) (define-key map (kbd "C-c C-r") 'sql-send-region) + (define-key map (kbd "C-c C-s") 'sql-send-string) (define-key map (kbd "C-c C-b") 'sql-send-buffer) map) "Mode map used for `sql-mode'.") @@ -764,6 +775,7 @@ Based on `comint-mode-map'.") (get-buffer-process sql-buffer))] ["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer) (get-buffer-process sql-buffer))] + ["Send String" sql-send-string t] ["--" nil nil] ["Start SQLi session" sql-product-interactive (sql-product-feature :sqli-connect)] ["Show SQLi buffer" sql-show-sqli-buffer t] @@ -792,7 +804,7 @@ Based on `comint-mode-map'.") ["Linter" sql-highlight-linter-keywords :style radio :selected (eq sql-product 'linter)] - ["Microsoft" sql-highlight-ms-keywords + ["MS SQLServer" sql-highlight-ms-keywords :style radio :selected (eq sql-product 'ms)] ["MySQL" sql-highlight-mysql-keywords @@ -828,24 +840,24 @@ Based on `comint-mode-map'.") (defvar sql-mode-abbrev-table nil "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") -(if sql-mode-abbrev-table - () - (let ((nargs (cdr (subr-arity (symbol-function 'define-abbrev)))) - d-a) +(unless sql-mode-abbrev-table + (define-abbrev-table 'sql-mode-abbrev-table nil) + (mapcar ;; In Emacs 21.3+, provide SYSTEM-FLAG to define-abbrev. - (setq d-a - (if (>= nargs 6) - '(lambda (name expansion) (define-abbrev sql-mode-abbrev-table name expansion nil 0 t)) - '(lambda (name expansion) (define-abbrev sql-mode-abbrev-table name expansion)))) - - (define-abbrev-table 'sql-mode-abbrev-table nil) - (funcall d-a "ins" "insert") - (funcall d-a "upd" "update") - (funcall d-a "del" "delete") - (funcall d-a "sel" "select") - (funcall d-a "proc" "procedure") - (funcall d-a "func" "function") - (funcall d-a "cr" "create"))) + '(lambda (abbrev) + (let ((name (car abbrev)) + (expansion (cdr abbrev))) + (condition-case nil + (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) + (error + (define-abbrev sql-mode-abbrev-table name expansion))))) + '(("ins" "insert") + ("upd" "update") + ("del" "delete") + ("sel" "select") + ("proc" "procedure") + ("func" "function") + ("cr" "create")))) ;; Syntax Table @@ -855,9 +867,7 @@ Based on `comint-mode-map'.") (modify-syntax-entry ?/ ". 14" table) (modify-syntax-entry ?* ". 23" table) ;; double-dash starts comment - (if (string-match "XEmacs\\|Lucid" emacs-version) - (modify-syntax-entry ?- ". 56" table) - (modify-syntax-entry ?- ". 12b" table)) + (modify-syntax-entry ?- ". 12b" table) ;; newline and formfeed end coments (modify-syntax-entry ?\n "> b" table) (modify-syntax-entry ?\f "> b" table) @@ -871,55 +881,117 @@ Based on `comint-mode-map'.") ;; Font lock support (defvar sql-mode-font-lock-object-name - (list (concat "^\\s-*\\(create\\(\\s-+or\\s-+replace\\)?\\|drop\\|alter\\)?\\s-+" - "\\(\\(global\\s-+\\)?\\(temporary\\s-+\\)?table\\|view\\|package\\(\\s-+body\\)?\\|" - "proc\\(edure\\)?\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+\\(\\w+\\)") - 8 'font-lock-function-name-face) - - "Pattern to match the names of top-level objects in a CREATE, -DROP or ALTER statement. - -The format of variable should be a valid `font-lock-keywords' -entry.") + (list (concat "^\\s-*\\(create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER + "\\(\\w+\\s-+\\)*" ;; optional intervening keywords + "\\(table\\|view\\|package\\(\\s-+body\\)?\\|proc\\(edure\\)?" + "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" + "\\(\\w+\\)") + 6 'font-lock-function-name-face) + + "Pattern to match the names of top-level objects. + +The pattern matches the name in a CREATE, DROP or ALTER +statement. The format of variable should be a valid +`font-lock-keywords' entry.") + +(defmacro sql-keywords-re (&rest keywords) + "Compile-time generation of regexp matching any one of KEYWORDS." + `(eval-when-compile + (concat "\\b" + (regexp-opt ',keywords t) + "\\b"))) (defvar sql-mode-ansi-font-lock-keywords - (let ((ansi-keywords (eval-when-compile - (concat "\\b" - (regexp-opt '( - -"authorization" "avg" "begin" "close" "cobol" "commit" -"continue" "count" "declare" "double" "end" "escape" -"exec" "fetch" "foreign" "fortran" "found" "go" "goto" "indicator" -"key" "language" "max" "min" "module" "numeric" "open" "pascal" "pli" -"precision" "primary" "procedure" "references" "rollback" -"schema" "section" "some" "sqlcode" "sqlerror" "sum" "work" - -) t) "\\b"))) - (ansi-reserved-words (eval-when-compile - (concat "\\b" - (regexp-opt '( - -"all" "and" "any" "as" "asc" "between" "by" "check" "create" -"current" "default" "delete" "desc" "distinct" "exists" "float" "for" -"from" "grant" "group" "having" "in" "insert" "into" "is" -"like" "not" "null" "of" "on" "option" "or" "order" "privileges" -"public" "select" "set" "table" "to" "union" "unique" -"update" "user" "values" "view" "where" "with" - -) t) "\\b"))) - (ansi-types (eval-when-compile - (concat "\\b" - (regexp-opt '( - -;; ANSI Keywords that look like types -"character" "cursor" "dec" "int" "real" -;; ANSI Reserved Word that look like types -"char" "integer" "smallint" - -) t) "\\b")))) - (list (cons ansi-keywords 'font-lock-keyword-face) - (cons ansi-reserved-words 'font-lock-keyword-face) - (cons ansi-types 'font-lock-type-face))) + (let ((ansi-funcs (sql-keywords-re +"abs" "avg" "bit_length" "cardinality" "cast" "char_length" +"character_length" "coalesce" "convert" "count" "current_date" +"current_path" "current_role" "current_time" "current_timestamp" +"current_user" "extract" "localtime" "localtimestamp" "lower" "max" +"min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user" +"substring" "sum" "system_user" "translate" "treat" "trim" "upper" +"user" +)) + + (ansi-non-reserved (sql-keywords-re +"ada" "asensitive" "assignment" "asymmetric" "atomic" "between" +"bitvar" "called" "catalog_name" "chain" "character_set_catalog" +"character_set_name" "character_set_schema" "checked" "class_origin" +"cobol" "collation_catalog" "collation_name" "collation_schema" +"column_name" "command_function" "command_function_code" "committed" +"condition_number" "connection_name" "constraint_catalog" +"constraint_name" "constraint_schema" "contains" "cursor_name" +"datetime_interval_code" "datetime_interval_precision" "defined" +"definer" "dispatch" "dynamic_function" "dynamic_function_code" +"existing" "exists" "final" "fortran" "generated" "granted" +"hierarchy" "hold" "implementation" "infix" "insensitive" "instance" +"instantiable" "invoker" "key_member" "key_type" "length" "m" +"message_length" "message_octet_length" "message_text" "method" "more" +"mumps" "name" "nullable" "number" "options" "overlaps" "overriding" +"parameter_mode" "parameter_name" "parameter_ordinal_position" +"parameter_specific_catalog" "parameter_specific_name" +"parameter_specific_schema" "pascal" "pli" "position" "repeatable" +"returned_length" "returned_octet_length" "returned_sqlstate" +"routine_catalog" "routine_name" "routine_schema" "row_count" "scale" +"schema_name" "security" "self" "sensitive" "serializable" +"server_name" "similar" "simple" "source" "specific_name" "style" +"subclass_origin" "sublist" "symmetric" "system" "table_name" +"transaction_active" "transactions_committed" +"transactions_rolled_back" "transform" "transforms" "trigger_catalog" +"trigger_name" "trigger_schema" "type" "uncommitted" "unnamed" +"user_defined_type_catalog" "user_defined_type_name" +"user_defined_type_schema" +)) + + (ansi-reserved (sql-keywords-re +"absolute" "action" "add" "admin" "after" "aggregate" "alias" "all" +"allocate" "alter" "and" "any" "are" "as" "asc" "assertion" "at" +"authorization" "before" "begin" "both" "breadth" "by" "call" +"cascade" "cascaded" "case" "catalog" "check" "class" "close" +"collate" "collation" "column" "commit" "completion" "connect" +"connection" "constraint" "constraints" "constructor" "continue" +"corresponding" "create" "cross" "cube" "current" "cursor" "cycle" +"data" "day" "deallocate" "declare" "default" "deferrable" "deferred" +"delete" "depth" "deref" "desc" "describe" "descriptor" "destroy" +"destructor" "deterministic" "diagnostics" "dictionary" "disconnect" +"distinct" "domain" "drop" "dynamic" "each" "else" "end" "equals" +"escape" "every" "except" "exception" "exec" "execute" "external" +"false" "fetch" "first" "for" "foreign" "found" "free" "from" "full" +"function" "general" "get" "global" "go" "goto" "grant" "group" +"grouping" "having" "host" "hour" "identity" "ignore" "immediate" "in" +"indicator" "initialize" "initially" "inner" "inout" "input" "insert" +"intersect" "into" "is" "isolation" "iterate" "join" "key" "language" +"last" "lateral" "leading" "left" "less" "level" "like" "limit" +"local" "locator" "map" "match" "minute" "modifies" "modify" "module" +"month" "names" "natural" "new" "next" "no" "none" "not" "null" "of" +"off" "old" "on" "only" "open" "operation" "option" "or" "order" +"ordinality" "out" "outer" "output" "pad" "parameter" "parameters" +"partial" "path" "postfix" "prefix" "preorder" "prepare" "preserve" +"primary" "prior" "privileges" "procedure" "public" "read" "reads" +"recursive" "references" "referencing" "relative" "restrict" "result" +"return" "returns" "revoke" "right" "role" "rollback" "rollup" +"routine" "rows" "savepoint" "schema" "scroll" "search" "second" +"section" "select" "sequence" "session" "set" "sets" "size" "some" +"space" "specific" "specifictype" "sql" "sqlexception" "sqlstate" +"sqlwarning" "start" "state" "statement" "static" "structure" "table" +"temporary" "terminate" "than" "then" "timezone_hour" +"timezone_minute" "to" "trailing" "transaction" "translation" +"trigger" "true" "under" "union" "unique" "unknown" "unnest" "update" +"usage" "using" "value" "values" "variable" "view" "when" "whenever" +"where" "with" "without" "work" "write" "year" +)) + + (ansi-types (sql-keywords-re +"array" "binary" "bit" "blob" "boolean" "char" "character" "clob" +"date" "dec" "decimal" "double" "float" "int" "integer" "interval" +"large" "national" "nchar" "nclob" "numeric" "object" "precision" +"real" "ref" "row" "scope" "smallint" "time" "timestamp" "varchar" +"varying" "zone" +))) + + `((,ansi-non-reserved . font-lock-keyword-face) + (,ansi-reserved . font-lock-keyword-face) + (,ansi-funcs . font-lock-builtin-face) + (,ansi-types . font-lock-type-face))) "ANSI SQL keywords used by font-lock. @@ -930,66 +1002,156 @@ you define your own sql-mode-ansi-font-lock-keywords. You may want to add functions and PL/SQL keywords.") (defvar sql-mode-oracle-font-lock-keywords - (let ((oracle-keywords (eval-when-compile - (concat "\\b" - (regexp-opt '( -;; Oracle (+ANSI) SQL keywords - -; ANSI keywords -"authorization" "avg" "begin" "close" "cobol" "commit" -"continue" "count" "declare" "double" "end" "escape" -"exec" "fetch" "foreign" "fortran" "found" "go" "goto" "indicator" -"key" "language" "max" "min" "module" "numeric" "open" "pascal" "pli" -"precision" "primary" "procedure" "references" "rollback" -"schema" "section" "some" "sqlcode" "sqlerror" "sum" "work" - -; ANSI reserved words -"all" "and" "any" "as" "asc" "between" "by" "check" "create" -"current" "default" "delete" "desc" "distinct" "exists" "float" "for" -"from" "grant" "group" "having" "in" "insert" "into" "is" -"like" "not" "null" "of" "on" "option" "or" "order" "privileges" -"public" "select" "set" "table" "to" "union" "unique" -"update" "user" "values" "view" "where" "with" - -"access" "add" "admin" "after" "allocate" "alter" "analyze" "archive" -"archivelog" "audit" "authid" "backup" "become" "before" "block" -"body" "cache" "cancel" "cascade" "change" "checkpoint" "cluster" -"comment" "compile" "compress" "compute" "connect" "constraint" -"constraints" "contents" "controlfile" "cross" "currval" "cycle" -"database" "datafile" "dba" "deterministic" "disable" "dismount" -"drop" "dump" "each" "else" "else" "elsif" "enable" "events" "except" -"exceptions" "exclusive" "execute" "exit" "explain" "extent" -"externally" "false" "file" "flush" "force" "freelist" "freelists" -"full" "function" "global" "grant" "groups" "identified" "if" -"immediate" "including" "increment" "index" "initial" "initrans" -"inner" "instance" "intersect" "join" "layer" "left" "level" "link" -"lists" "lock" "logfile" "long" "loop" "manage" "manual" -"maxdatafiles" "maxextents" "maxinistances" "maxlogfiles" -"maxloghistory" "maxlogmembers" "maxtrans" "maxvalue" "merge" -"minextents" "minus" "minvalue" "mode" "modify" "mount" "natural" -"new" "next" "nextval" "noarchivelog" "noaudit" "nocache" "nocompress" -"nocycle" "nomaxvalue" "nominvalue" "none" "noorder" "noresetlogs" -"normal" "nosort" "nowait" "off" "offline" "old" "online" "only" -"optimal" "others" "out" "outer" "over" "own" "package" "parallel" -"parallel_enable" "pctfree" "pctincrease" "pctused" "plan" "pragma" -"preserve" "prior" "private" "profile" "quota" "raise" "raw" "read" -"recover" "referencing" "rename" "replace" "resetlogs" "resource" -"restrict_references" "restricted" "return" "returning" "reuse" -"revoke" "right" "rnds" "rnps" "role" "roles" "row" "rowlabel" -"rownum" "rows" "savepoint" "scn" "segment" "sequence" "session" -"share" "shared" "size" "snapshot" "sort" "statement_id" "statistics" -"stop" "storage" "subtype" "successful" "switch" "synonym" "sysdate" -"system" "tables" "tablespace" "temporary" "then" "thread" "tracing" -"transaction" "trigger" "triggers" "true" "truncate" "type" "uid" -"under" "unlimited" "until" "use" "using" "validate" "when" "while" -"wnds" "wnps" "write" - -) t) "\\b"))) - (oracle-warning-words (eval-when-compile - (concat "\\b" - (regexp-opt '( -;; PLSQL defined exceptions - + (let ((oracle-functions (sql-keywords-re +"abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2" +"avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid" +"chr" "coalesce" "compose" "concat" "convert" "corr" "cos" "cosh" +"count" "covar_pop" "covar_samp" "cume_dist" "current_date" +"current_timestamp" "current_user" "dbtimezone" "decode" "decompose" +"dense_rank" "depth" "deref" "dump" "empty_clob" "existsnode" "exp" +"extract" "extractvalue" "first" "first_value" "floor" "following" +"from_tz" "greatest" "group_id" "grouping_id" "hextoraw" "initcap" +"instr" "lag" "last" "last_day" "last_value" "lead" "least" "length" +"ln" "localtimestamp" "lower" "lpad" "ltrim" "make_ref" "max" "min" +"mod" "months_between" "new_time" "next_day" "nls_charset_decl_len" +"nls_charset_id" "nls_charset_name" "nls_initcap" "nls_lower" +"nls_upper" "nlssort" "ntile" "nullif" "numtodsinterval" +"numtoyminterval" "nvl" "nvl2" "over" "path" "percent_rank" +"percentile_cont" "percentile_disc" "power" "preceding" "rank" +"ratio_to_report" "rawtohex" "rawtonhex" "reftohex" "regr_" +"regr_avgx" "regr_avgy" "regr_count" "regr_intercept" "regr_r2" +"regr_slope" "regr_sxx" "regr_sxy" "regr_syy" "replace" "round" +"row_number" "rowidtochar" "rowidtonchar" "rpad" "rtrim" +"sessiontimezone" "sign" "sin" "sinh" "soundex" "sqrt" "stddev" +"stddev_pop" "stddev_samp" "substr" "sum" "sys_connect_by_path" +"sys_context" "sys_dburigen" "sys_extract_utc" "sys_guid" "sys_typeid" +"sys_xmlagg" "sys_xmlgen" "sysdate" "systimestamp" "tan" "tanh" +"to_char" "to_clob" "to_date" "to_dsinterval" "to_lob" "to_multi_byte" +"to_nchar" "to_nclob" "to_number" "to_single_byte" "to_timestamp" +"to_timestamp_tz" "to_yminterval" "translate" "treat" "trim" "trunc" +"tz_offset" "uid" "unbounded" "unistr" "updatexml" "upper" "user" +"userenv" "var_pop" "var_samp" "variance" "vsize" "width_bucket" "xml" +"xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement" +"xmlforest" "xmlsequence" "xmltransform" +)) + + (oracle-keywords (sql-keywords-re +"abort" "access" "accessed" "account" "activate" "add" "admin" +"advise" "after" "agent" "aggregate" "all" "allocate" "allow" "alter" +"always" "analyze" "ancillary" "and" "any" "apply" "archive" +"archivelog" "array" "as" "asc" "associate" "at" "attribute" +"attributes" "audit" "authenticated" "authid" "authorization" "auto" +"autoallocate" "automatic" "availability" "backup" "before" "begin" +"behalf" "between" "binding" "bitmap" "block" "blocksize" "body" +"both" "buffer_pool" "build" "by" "cache" "call" "cancel" +"cascade" "case" "category" "certificate" "chained" "change" "check" +"checkpoint" "child" "chunk" "class" "clear" "clone" "close" "cluster" +"column" "column_value" "columns" "comment" "commit" "committed" +"compatibility" "compile" "complete" "composite_limit" "compress" +"compute" "connect" "connect_time" "consider" "consistent" +"constraint" "constraints" "constructor" "contents" "context" +"continue" "controlfile" "corruption" "cost" "cpu_per_call" +"cpu_per_session" "create" "cross" "cube" "current" "currval" "cycle" +"dangling" "data" "database" "datafile" "datafiles" "day" "ddl" +"deallocate" "debug" "default" "deferrable" "deferred" "definer" +"delay" "delete" "demand" "desc" "determines" "deterministic" +"dictionary" "dimension" "directory" "disable" "disassociate" +"disconnect" "distinct" "distinguished" "distributed" "dml" "drop" +"each" "element" "else" "enable" "end" "equals_path" "escape" +"estimate" "except" "exceptions" "exchange" "excluding" "exists" +"expire" "explain" "extent" "external" "externally" +"failed_login_attempts" "fast" "file" "final" "finish" "flush" "for" +"force" "foreign" "freelist" "freelists" "freepools" "fresh" "from" +"full" "function" "functions" "generated" "global" "global_name" +"globally" "grant" "group" "grouping" "groups" "guard" "hash" +"hashkeys" "having" "heap" "hierarchy" "id" "identified" "identifier" +"idle_time" "immediate" "in" "including" "increment" "index" "indexed" +"indexes" "indextype" "indextypes" "indicator" "initial" "initialized" +"initially" "initrans" "inner" "insert" "instance" "instantiable" +"instead" "intersect" "into" "invalidate" "is" "isolation" "java" +"join" "keep" "key" "kill" "language" "left" "less" "level" +"levels" "library" "like" "like2" "like4" "likec" "limit" "link" +"list" "lob" "local" "location" "locator" "lock" "log" "logfile" +"logging" "logical" "logical_reads_per_call" +"logical_reads_per_session" "managed" "management" "manual" "map" +"mapping" "master" "matched" "materialized" "maxdatafiles" +"maxextents" "maximize" "maxinstances" "maxlogfiles" "maxloghistory" +"maxlogmembers" "maxsize" "maxtrans" "maxvalue" "member" "memory" +"merge" "migrate" "minextents" "minimize" "minimum" "minus" "minvalue" +"mode" "modify" "monitoring" "month" "mount" "move" "movement" "name" +"named" "natural" "nested" "never" "new" "next" "nextval" "no" +"noarchivelog" "noaudit" "nocache" "nocompress" "nocopy" "nocycle" +"nodelay" "noforce" "nologging" "nomapping" "nomaxvalue" "nominimize" +"nominvalue" "nomonitoring" "none" "noorder" "noparallel" "norely" +"noresetlogs" "noreverse" "normal" "norowdependencies" "nosort" +"noswitch" "not" "nothing" "notimeout" "novalidate" "nowait" "null" +"nulls" "object" "of" "off" "offline" "oidindex" "old" "on" "online" +"only" "open" "operator" "optimal" "option" "or" "order" +"organization" "out" "outer" "outline" "overflow" "overriding" +"package" "packages" "parallel" "parallel_enable" "parameters" +"parent" "partition" "partitions" "password" "password_grace_time" +"password_life_time" "password_lock_time" "password_reuse_max" +"password_reuse_time" "password_verify_function" "pctfree" +"pctincrease" "pctthreshold" "pctused" "pctversion" "percent" +"performance" "permanent" "pfile" "physical" "pipelined" "plan" +"post_transaction" "pragma" "prebuilt" "preserve" "primary" "private" +"private_sga" "privileges" "procedure" "profile" "protection" "public" +"purge" "query" "quiesce" "quota" "range" "read" "reads" "rebuild" +"records_per_block" "recover" "recovery" "recycle" "reduced" "ref" +"references" "referencing" "refresh" "register" "reject" "relational" +"rely" "rename" "reset" "resetlogs" "resize" "resolve" "resolver" +"resource" "restrict" "restrict_references" "restricted" "result" +"resumable" "resume" "retention" "return" "returning" "reuse" +"reverse" "revoke" "rewrite" "right" "rnds" "rnps" "role" "roles" +"rollback" "rollup" "row" "rowdependencies" "rownum" "rows" "sample" +"savepoint" "scan" "schema" "scn" "scope" "segment" "select" +"selectivity" "self" "sequence" "serializable" "session" +"sessions_per_user" "set" "sets" "settings" "shared" "shared_pool" +"shrink" "shutdown" "siblings" "sid" "single" "size" "skip" "some" +"sort" "source" "space" "specification" "spfile" "split" "standby" +"start" "statement_id" "static" "statistics" "stop" "storage" "store" +"structure" "subpartition" "subpartitions" "substitutable" +"successful" "supplemental" "suspend" "switch" "switchover" "synonym" +"sys" "system" "table" "tables" "tablespace" "tempfile" "template" +"temporary" "test" "than" "then" "thread" "through" "time_zone" +"timeout" "to" "trace" "transaction" "trigger" "triggers" "truncate" +"trust" "type" "types" "unarchived" "under" "under_path" "undo" +"uniform" "union" "unique" "unlimited" "unlock" "unquiesce" +"unrecoverable" "until" "unusable" "unused" "update" "upgrade" "usage" +"use" "using" "validate" "validation" "value" "values" "variable" +"varray" "version" "view" "wait" "when" "whenever" "where" "with" +"without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype" +)) + + (oracle-types (sql-keywords-re +"bfile" "blob" "byte" "char" "character" "clob" "date" "dec" "decimal" +"double" "float" "int" "integer" "interval" "long" "national" "nchar" +"nclob" "number" "numeric" "nvarchar2" "precision" "raw" "real" +"rowid" "second" "smallint" "time" "timestamp" "urowid" "varchar" +"varchar2" "varying" "year" "zone" +)) + + (plsql-functions (sql-keywords-re +"%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype" +"%type" "extend" "prior" +)) + + (plsql-keywords (sql-keywords-re +"autonomous_transaction" "bulk" "char_base" "collect" "constant" +"cursor" "declare" "do" "elsif" "exception_init" "execute" "exit" +"extends" "false" "fetch" "forall" "goto" "hour" "if" "interface" +"loop" "minute" "number_base" "ocirowid" "opaque" "others" "rowtype" +"separate" "serially_reusable" "sql" "sqlcode" "sqlerrm" "subtype" +"the" "timezone_abbr" "timezone_hour" "timezone_minute" +"timezone_region" "true" "varrying" "while" +)) + + (plsql-type (sql-keywords-re +"binary_integer" "boolean" "naturaln" "pls_integer" "positive" +"positiven" "record" "signtype" "string" +)) + + (plsql-warning (sql-keywords-re "access_into_null" "case_not_found" "collection_is_null" "cursor_already_open" "dup_val_on_index" "invalid_cursor" "invalid_number" "login_denied" "no_data_found" "not_logged_on" @@ -997,15 +1159,11 @@ add functions and PL/SQL keywords.") "subscript_beyond_count" "subscript_outside_limit" "sys_invalid_rowid" "timeout_on_resource" "too_many_rows" "value_error" "zero_divide" "exception" "notfound" +)) -) t) "\\b"))) - - (oracle-sqlplus-commands - (eval-when-compile - (concat "^\\(\\(" - (regexp-opt '( -;; SQL*Plus commands - + (sqlplus-commands + (eval-when-compile (concat "^\\(\\(" + (regexp-opt '( "@" "@@" "accept" "append" "archive" "attribute" "break" "btitle" "change" "clear" "column" "connect" "copy" "define" "del" "describe" "disconnect" "edit" "execute" "exit" "get" "help" @@ -1040,73 +1198,16 @@ add functions and PL/SQL keywords.") "timi\\(ng\\)?\\|trim\\(out\\)?\\|trims\\(pool\\)?\\|" "und\\(erline\\)?\\|ver\\(ify\\)?\\|wra\\(p\\)?\\)\\)\\)" "\\b.*$" - ))) + )))) - (oracle-types - (eval-when-compile - (concat "\\b" - (regexp-opt '( -;; Oracle Keywords that look like types -;; Oracle Reserved Words that look like types - -"bfile" "binary_integer" "blob" "boolean" "byte" "char" "character" -"clob" "date" "day" "dec" "decimal" "double" "float" "int" "integer" -"interval" "local" "long" "month" "natural" "naturaln" "nchar" "nclob" -"number" "numeric" "nvarchar2" "pls_integer" "positive" "positiven" -"precision" "raw" "real" "rowid" "second" "signtype" "smallint" -"string" "time" "timestamp" "urowid" "varchar" "varchar2" "year" -"zone" - -) t) "\\b"))) - (oracle-builtin-functions (eval-when-compile - (concat "\\b" - (regexp-opt '( -;; Misc Oracle builtin functions - -"abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2" -"avg" "bfilename" "bin_to_num" "bitand" "case" "cast" "ceil" -"chartorowid" "chr" "coalesce" "compose" "concat" "convert" "corr" -"cos" "cosh" "count" "covar_pop" "covar_samp" "cume_dist" -"current_date" "current_timestamp" "current_user" "dbtimezone" -"decode" "decompose" "dense_rank" "depth" "deref" "dump" "empty_blob" -"empty_clob" "existsnode" "exp" "extract" "extractvalue" "first" -"first_value" "floor" "from_tz" "greatest" "group_id" "grouping" -"grouping_id" "hextoraw" "initcap" "instr" "lag" "last" "last_day" -"last_value" "lead" "least" "length" "ln" "localtimestamp" "log" -"lower" "lpad" "ltrim" "make_ref" "max" "min" "mod" "months_between" -"nchr" "new_time" "next_day" "nls_charset_decl_len" "nls_charset_id" -"nls_charset_name" "nls_initcap" "nls_lower" "nlssort" "nls_upper" -"ntile" "nullif" "numtodsinterval" "numtoyminterval" "nvl" "nvl2" -"path" "percent_rank" "percentile_cont" "percentile_disc" "power" -"rank" "ratio_to_report" "rawtohex" "rawtonhex" "ref" "reftohex" -"regr_slope" "regr_intercept" "regr_count" "regr_r2" "regr_avgx" -"regr_avgy" "regr_sxx" "regr_syy" "regr_sxy" "round" -"row_number" "rowidtochar" "rowidtonchar" "rpad" "rtrim" -"sessiontimezone" "sign" "sin" "sinh" "soundex" "sqrt" "stddev" -"stddev_pop" "stddev_samp" "substr" "sum" "sys_connect_by_path" -"sys_context" "sys_dburigen" "sys_extract_utc" "sys_guid" "sys_typeid" -"sys_xmlagg" "sys_xmlgen" "sysdate" "systimestamp" "tan" "tanh" -"to_char" "to_clob" "to_date" "to_dsinterval" "to_lob" "to_multi_byte" -"to_nchar" "to_nclob" "to_number" "to_single_byte" "to_timestamp" -"to_timestamp_tz" "to_yminterval" "translate" "treat" "trim" "trunc" -"tz_offset" "uid" "unistr" "updatexml" "upper" "user" "userenv" -"value" "var_pop" "var_samp" "variance" "vsize" "width_bucket" -"xmlagg" "xmlcolattval" "xmlconcat" "xmlelement" "xmlforest" -"xmlsequence" "xmltransform" - -) t) "\\b")))) - (list (cons oracle-sqlplus-commands 'font-lock-doc-face) - (cons oracle-keywords 'font-lock-keyword-face) - (cons oracle-warning-words 'font-lock-warning-face) - ;; XEmacs doesn't have font-lock-builtin-face - (if (string-match "XEmacs\\|Lucid" emacs-version) - (cons oracle-builtin-functions 'font-lock-preprocessor-face) - ;; GNU Emacs 19 doesn't have it either - (if (string-match "GNU Emacs 19" emacs-version) - (cons oracle-builtin-functions 'font-lock-keyword-face) - ;; Emacs - (cons oracle-builtin-functions 'font-lock-builtin-face))) - (cons oracle-types 'font-lock-type-face))) + `((,sqlplus-commands . font-lock-doc-face) + (,oracle-functions . font-lock-builtin-face) + (,oracle-keywords . font-lock-keyword-face) + (,oracle-types . font-lock-type-face) + (,plsql-functions . font-lock-builtin-face) + (,plsql-keywords . font-lock-keyword-face) + (,plsql-type . font-lock-type-face) + (,plsql-warning . font-lock-warning-face))) "Oracle SQL keywords used by font-lock. @@ -1117,42 +1218,84 @@ you define your own sql-mode-oracle-font-lock-keywords. You may want to add functions and PL/SQL keywords.") (defvar sql-mode-postgres-font-lock-keywords - (let ((postgres-reserved-words (eval-when-compile - (concat "\\b" - (regexp-opt '( -"language" -) t) "\\b"))) - (postgres-types (eval-when-compile - (concat "\\b" - (regexp-opt '( - -"bool" "box" "circle" "char" "char2" "char4" "char8" "char16" "date" -"float4" "float8" "int2" "int4" "int8" "line" "lseg" "money" "path" -"point" "polygon" "serial" "text" "time" "timespan" "timestamp" "varchar" - -) t)"\\b"))) - (postgres-builtin-functions (eval-when-compile - (concat "\\b" - (regexp-opt '( -;; Misc Postgres builtin functions - -"abstime" "age" "area" "box" "center" "date_part" "date_trunc" -"datetime" "dexp" "diameter" "dpow" "float" "float4" "height" -"initcap" "integer" "isclosed" "isfinite" "isoldpath" "isopen" -"length" "lower" "lpad" "ltrim" "pclose" "point" "points" "popen" -"position" "radius" "reltime" "revertpoly" "rpad" "rtrim" "substr" -"substring" "text" "timespan" "translate" "trim" "upgradepath" -"upgradepoly" "upper" "varchar" "width" - -) t) "\\b")))) - (append sql-mode-ansi-font-lock-keywords - (list (cons postgres-reserved-words 'font-lock-keyword-face) - ;; XEmacs doesn't have 'font-lock-builtin-face - (if (string-match "XEmacs\\|Lucid" emacs-version) - (cons postgres-builtin-functions 'font-lock-preprocessor-face) - ;; Emacs - (cons postgres-builtin-functions 'font-lock-builtin-face)) - (cons postgres-types 'font-lock-type-face)))) + (let ((pg-funcs (sql-keywords-re +"abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan" +"atan2" "avg" "bit_length" "both" "broadcast" "btrim" "cbrt" "ceil" +"center" "char_length" "chr" "coalesce" "col_description" "convert" +"cos" "cot" "count" "current_database" "current_date" "current_schema" +"current_schemas" "current_setting" "current_time" "current_timestamp" +"current_user" "currval" "date_part" "date_trunc" "decode" "degrees" +"diameter" "encode" "exp" "extract" "floor" "get_bit" "get_byte" +"has_database_privilege" "has_function_privilege" +"has_language_privilege" "has_schema_privilege" "has_table_privilege" +"height" "host" "initcap" "isclosed" "isfinite" "isopen" "leading" +"length" "ln" "localtime" "localtimestamp" "log" "lower" "lpad" +"ltrim" "masklen" "max" "min" "mod" "netmask" "network" "nextval" +"now" "npoints" "nullif" "obj_description" "octet_length" "overlay" +"pclose" "pg_client_encoding" "pg_function_is_visible" +"pg_get_constraintdef" "pg_get_indexdef" "pg_get_ruledef" +"pg_get_userbyid" "pg_get_viewdef" "pg_opclass_is_visible" +"pg_operator_is_visible" "pg_table_is_visible" "pg_type_is_visible" +"pi" "popen" "position" "pow" "quote_ident" "quote_literal" "radians" +"radius" "random" "repeat" "replace" "round" "rpad" "rtrim" +"session_user" "set_bit" "set_byte" "set_config" "set_masklen" +"setval" "sign" "sin" "split_part" "sqrt" "stddev" "strpos" "substr" +"substring" "sum" "tan" "timeofday" "to_ascii" "to_char" "to_date" +"to_hex" "to_number" "to_timestamp" "trailing" "translate" "trim" +"trunc" "upper" "variance" "version" "width" +)) + + (pg-reserved (sql-keywords-re +"abort" "access" "add" "after" "aggregate" "alignment" "all" "alter" +"analyze" "and" "any" "as" "asc" "assignment" "authorization" +"backward" "basetype" "before" "begin" "between" "binary" "by" "cache" +"called" "cascade" "case" "cast" "characteristics" "check" +"checkpoint" "class" "close" "cluster" "column" "comment" "commit" +"committed" "commutator" "constraint" "constraints" "conversion" +"copy" "create" "createdb" "createuser" "cursor" "cycle" "database" +"deallocate" "declare" "default" "deferrable" "deferred" "definer" +"delete" "delimiter" "desc" "distinct" "do" "domain" "drop" "each" +"element" "else" "encoding" "encrypted" "end" "escape" "except" +"exclusive" "execute" "exists" "explain" "extended" "external" "false" +"fetch" "finalfunc" "for" "force" "foreign" "forward" "freeze" "from" +"full" "function" "grant" "group" "gtcmp" "handler" "hashes" "having" +"immediate" "immutable" "implicit" "in" "increment" "index" "inherits" +"initcond" "initially" "input" "insensitive" "insert" "instead" +"internallength" "intersect" "into" "invoker" "is" "isnull" +"isolation" "join" "key" "language" "leftarg" "level" "like" "limit" +"listen" "load" "local" "location" "lock" "ltcmp" "main" "match" +"maxvalue" "merges" "minvalue" "mode" "move" "natural" "negator" +"next" "nocreatedb" "nocreateuser" "none" "not" "nothing" "notify" +"notnull" "null" "of" "offset" "oids" "on" "only" "operator" "or" +"order" "output" "owner" "partial" "passedbyvalue" "password" "plain" +"prepare" "primary" "prior" "privileges" "procedural" "procedure" +"public" "read" "recheck" "references" "reindex" "relative" "rename" +"reset" "restrict" "returns" "revoke" "rightarg" "rollback" "row" +"rule" "schema" "scroll" "security" "select" "sequence" "serializable" +"session" "set" "sfunc" "share" "show" "similar" "some" "sort1" +"sort2" "stable" "start" "statement" "statistics" "storage" "strict" +"stype" "sysid" "table" "temp" "template" "temporary" "then" "to" +"transaction" "trigger" "true" "truncate" "trusted" "type" +"unencrypted" "union" "unique" "unknown" "unlisten" "until" "update" +"usage" "user" "using" "vacuum" "valid" "validator" "values" +"variable" "verbose" "view" "volatile" "when" "where" "with" "without" +"work" +)) + + (pg-types (sql-keywords-re +"anyarray" "bigint" "bigserial" "bit" "boolean" "box" "bytea" "char" +"character" "cidr" "circle" "cstring" "date" "decimal" "double" +"float4" "float8" "inet" "int2" "int4" "int8" "integer" "internal" +"interval" "language_handler" "line" "lseg" "macaddr" "money" +"numeric" "oid" "opaque" "path" "point" "polygon" "precision" "real" +"record" "regclass" "regoper" "regoperator" "regproc" "regprocedure" +"regtype" "serial" "serial4" "serial8" "smallint" "text" "time" +"timestamp" "varchar" "varying" "void" "zone" +))) + + `((,pg-funcs . font-lock-builtin-face) + (,pg-reserved . font-lock-keyword-face) + (,pg-types . font-lock-type-face))) "Postgres SQL keywords used by font-lock. @@ -1162,10 +1305,7 @@ function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-postgres-font-lock-keywords.") (defvar sql-mode-linter-font-lock-keywords - (let ((linter-keywords (eval-when-compile - (concat "\\b" - (regexp-opt '( - + (let ((linter-keywords (sql-keywords-re "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel" "committed" "count" "countblob" "cross" "current" "data" "database" "datafile" "datafiles" "datesplit" "dba" "dbname" "default" "deferred" @@ -1190,12 +1330,9 @@ you define your own sql-mode-postgres-font-lock-keywords.") "trigger_info_size" "true" "trunc" "uncommitted" "unicode" "unknown" "unlimited" "unlisted" "user" "utf8" "value" "varying" "volumes" "wait" "windows_code" "workspace" "write" "xml" +)) -) t) "\\b"))) - (linter-reserved-words (eval-when-compile - (concat "\\b" - (regexp-opt '( - + (linter-reserved (sql-keywords-re "access" "action" "add" "address" "after" "all" "alter" "always" "and" "any" "append" "as" "asc" "ascic" "async" "at_begin" "at_end" "audit" "aud_obj_name_len" "backup" "base" "before" "between" "blobfile" @@ -1213,22 +1350,16 @@ you define your own sql-mode-postgres-font-lock-keywords.") "start" "stop" "sync" "synchronize" "synonym" "sysdate" "table" "then" "to" "union" "unique" "unlock" "until" "update" "using" "values" "view" "when" "where" "with" "without" +)) -) t) "\\b"))) - (linter-types (eval-when-compile - (concat "\\b" - (regexp-opt '( - + (linter-types (sql-keywords-re "bigint" "bitmap" "blob" "boolean" "char" "character" "date" "datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar" "number" "numeric" "real" "smallint" "varbyte" "varchar" "byte" "cursor" "long" +)) -) t) "\\b"))) - (linter-builtin-functions (eval-when-compile - (concat "\\b" - (regexp-opt '( - + (linter-functions (sql-keywords-re "abs" "acos" "asin" "atan" "atan2" "avg" "ceil" "cos" "cosh" "divtime" "exp" "floor" "getbits" "getblob" "getbyte" "getlong" "getraw" "getstr" "gettext" "getword" "hextoraw" "lenblob" "length" "log" @@ -1239,20 +1370,12 @@ you define your own sql-mode-postgres-font-lock-keywords.") "to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode" "substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap" "instr" "least" "multime" "replace" "width" +))) -) t) "\\b")))) - (append sql-mode-ansi-font-lock-keywords - (list (cons linter-keywords 'font-lock-keywords-face) - (cons linter-reserved-words 'font-lock-keyword-face) - ;; XEmacs doesn't have font-lock-builtin-face - (if (string-match "XEmacs\\|Lucid" emacs-version) - (cons linter-builtin-functions 'font-lock-preprocessor-face) - ;; GNU Emacs 19 doesn't have it either - (if (string-match "GNU Emacs 19" emacs-version) - (cons linter-builtin-functions 'font-lock-keywords-face) - ;; Emacs - (cons linter-builtin-functions 'font-lock-builtin-face))) - (cons linter-types 'font-lock-type-face)))) + `((,linter-keywords . font-lock-keyword-face) + (,linter-reserved . font-lock-keyword-face) + (,linter-functions . font-lock-builtin-face) + (,linter-types . font-lock-type-face))) "Linter SQL keywords used by font-lock. @@ -1261,21 +1384,18 @@ regular expressions are created during compilation by calling the function `regexp-opt'.") (defvar sql-mode-ms-font-lock-keywords - (let ((ms-reserved-words (eval-when-compile - (concat "\\b" - (regexp-opt '( - + (let ((ms-reserved (sql-keywords-re "absolute" "add" "all" "alter" "and" "any" "as" "asc" "authorization" "avg" "backup" "begin" "between" "break" "browse" "bulk" "by" "cascade" "case" "check" "checkpoint" "close" "clustered" "coalesce" "column" "commit" "committed" "compute" "confirm" "constraint" "contains" "containstable" "continue" "controlrow" "convert" "count" "create" "cross" "current" "current_date" "current_time" -"current_timestamp" "current_user" "database" "deallocate" -"declare" "default" "delete" "deny" "desc" "disk" "distinct" -"distributed" "double" "drop" "dummy" "dump" "else" "end" "errlvl" -"errorexit" "escape" "except" "exec" "execute" "exists" "exit" "fetch" -"file" "fillfactor" "first" "floppy" "for" "foreign" "freetext" +"current_timestamp" "current_user" "database" "deallocate" "declare" +"default" "delete" "deny" "desc" "disk" "distinct" "distributed" +"double" "drop" "dummy" "dump" "else" "end" "errlvl" "errorexit" +"escape" "except" "exec" "execute" "exists" "exit" "fetch" "file" +"fillfactor" "first" "floppy" "for" "foreign" "freetext" "freetexttable" "from" "full" "goto" "grant" "group" "having" "holdlock" "identity" "identity_insert" "identitycol" "if" "in" "index" "inner" "insert" "intersect" "into" "is" "isolation" "join" @@ -1295,29 +1415,21 @@ function `regexp-opt'.") "textsize" "then" "to" "top" "tran" "transaction" "trigger" "truncate" "tsequal" "uncommitted" "union" "unique" "update" "updatetext" "updlock" "use" "user" "values" "view" "waitfor" "when" "where" -"while" "with" "work" "writetext" -"collate" "function" "openxml" "returns" - -) t) "\\b"))) - (ms-types (eval-when-compile - (concat "\\b" - (regexp-opt '( +"while" "with" "work" "writetext" "collate" "function" "openxml" +"returns" +)) + (ms-types (sql-keywords-re "binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal" "double" "float" "image" "int" "integer" "money" "national" "nchar" "ntext" "numeric" "numeric" "nvarchar" "precision" "real" "smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint" "uniqueidentifier" "varbinary" "varchar" "varying" - -) t) "\\b"))) +)) (ms-vars "\\b@[a-zA-Z0-9_]*\\b") - (ms-builtin-functions (eval-when-compile - (concat "\\b" - (regexp-opt '( -;; Misc MS builtin functions - + (ms-functions (sql-keywords-re "@@connections" "@@cpu_busy" "@@cursor_rows" "@@datefirst" "@@dbts" "@@error" "@@fetch_status" "@@identity" "@@idle" "@@io_busy" "@@langid" "@@language" "@@lock_timeout" "@@max_connections" @@ -1346,14 +1458,12 @@ function `regexp-opt'.") "suser_id" "suser_name" "suser_sid" "suser_sname" "system_user" "tan" "textptr" "textvalid" "typeproperty" "unicode" "upper" "user" "user_id" "user_name" "var" "varp" "year" +)) -) t) "\\b"))) - - (ms-config-commands + (ms-commands (eval-when-compile (concat "^\\(\\(set\\s-+\\(" (regexp-opt '( - "datefirst" "dateformat" "deadlock_priority" "lock_timeout" "concat_null_yields_null" "cursor_close_on_commit" "disable_def_cnst_chk" "fips_flagger" "identity_insert" "language" @@ -1364,19 +1474,14 @@ function `regexp-opt'.") "ansi_warnings" "forceplan" "showplan_all" "showplan_text" "statistics" "implicit_transactions" "remote_proc_transactions" "transaction" "xact_abort" - ) t) "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$")))) - (list (cons ms-config-commands 'font-lock-doc-face) - (cons ms-reserved-words 'font-lock-keyword-face) - ;; XEmacs doesn't have 'font-lock-builtin-face - (if (string-match "XEmacs\\|Lucid" emacs-version) - (cons ms-builtin-functions 'font-lock-preprocessor-face) - ;; Emacs - (cons ms-builtin-functions 'font-lock-builtin-face)) - (cons ms-vars 'font-lock-variable-name-face) - (cons ms-types 'font-lock-type-face))) + `((,ms-commands . font-lock-doc-face) + (,ms-reserved . font-lock-keyword-face) + (,ms-functions . font-lock-builtin-face) + (,ms-vars . font-lock-variable-name-face) + (,ms-types . font-lock-type-face))) "Microsoft SQLServer SQL keywords used by font-lock. @@ -1385,7 +1490,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-ms-font-lock-keywords.") -(defvar sql-mode-sybase-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-sybase-font-lock-keywords nil "Sybase SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1393,7 +1498,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-sybase-font-lock-keywords.") -(defvar sql-mode-informix-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-informix-font-lock-keywords nil "Informix SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1401,7 +1506,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-informix-font-lock-keywords.") -(defvar sql-mode-interbase-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-interbase-font-lock-keywords nil "Interbase SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1409,7 +1514,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-interbase-font-lock-keywords.") -(defvar sql-mode-ingres-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-ingres-font-lock-keywords nil "Ingres SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1417,7 +1522,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-interbase-font-lock-keywords.") -(defvar sql-mode-solid-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-solid-font-lock-keywords nil "Solid SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1425,7 +1530,76 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-solid-font-lock-keywords.") -(defvar sql-mode-mysql-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-mysql-font-lock-keywords + (let ((mysql-funcs (sql-keywords-re +"ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext" +"bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or" +"bit_xor" "both" "cast" "char_length" "character_length" "coalesce" +"concat" "concat_ws" "connection_id" "conv" "convert" "count" +"curdate" "current_date" "current_time" "current_timestamp" "curtime" +"elt" "encrypt" "export_set" "field" "find_in_set" "found_rows" "from" +"geomcollfromtext" "geomcollfromwkb" "geometrycollectionfromtext" +"geometrycollectionfromwkb" "geometryfromtext" "geometryfromwkb" +"geomfromtext" "geomfromwkb" "get_lock" "group_concat" "hex" "ifnull" +"instr" "interval" "isnull" "last_insert_id" "lcase" "leading" +"length" "linefromtext" "linefromwkb" "linestringfromtext" +"linestringfromwkb" "load_file" "locate" "lower" "lpad" "ltrim" +"make_set" "master_pos_wait" "max" "mid" "min" "mlinefromtext" +"mlinefromwkb" "mpointfromtext" "mpointfromwkb" "mpolyfromtext" +"mpolyfromwkb" "multilinestringfromtext" "multilinestringfromwkb" +"multipointfromtext" "multipointfromwkb" "multipolygonfromtext" +"multipolygonfromwkb" "now" "nullif" "oct" "octet_length" "ord" +"pointfromtext" "pointfromwkb" "polyfromtext" "polyfromwkb" +"polygonfromtext" "polygonfromwkb" "position" "quote" "rand" +"release_lock" "repeat" "replace" "reverse" "rpad" "rtrim" "soundex" +"space" "std" "stddev" "substring" "substring_index" "sum" "sysdate" +"trailing" "trim" "ucase" "unix_timestamp" "upper" "user" "variance" +)) + + (mysql-keywords (sql-keywords-re +"action" "add" "after" "against" "all" "alter" "and" "as" "asc" +"auto_increment" "avg_row_length" "bdb" "between" "by" "cascade" +"case" "change" "character" "check" "checksum" "close" "collate" +"collation" "column" "columns" "comment" "committed" "concurrent" +"constraint" "create" "cross" "data" "database" "default" +"delay_key_write" "delayed" "delete" "desc" "directory" "disable" +"distinct" "distinctrow" "do" "drop" "dumpfile" "duplicate" "else" +"enable" "enclosed" "end" "escaped" "exists" "fields" "first" "for" +"force" "foreign" "from" "full" "fulltext" "global" "group" "handler" +"having" "heap" "high_priority" "if" "ignore" "in" "index" "infile" +"inner" "insert" "insert_method" "into" "is" "isam" "isolation" "join" +"key" "keys" "last" "left" "level" "like" "limit" "lines" "load" +"local" "lock" "low_priority" "match" "max_rows" "merge" "min_rows" +"mode" "modify" "mrg_myisam" "myisam" "natural" "next" "no" "not" +"null" "offset" "oj" "on" "open" "optionally" "or" "order" "outer" +"outfile" "pack_keys" "partial" "password" "prev" "primary" +"procedure" "quick" "raid0" "raid_type" "read" "references" "rename" +"repeatable" "restrict" "right" "rollback" "rollup" "row_format" +"savepoint" "select" "separator" "serializable" "session" "set" +"share" "show" "sql_big_result" "sql_buffer_result" "sql_cache" +"sql_calc_found_rows" "sql_no_cache" "sql_small_result" "starting" +"straight_join" "striped" "table" "tables" "temporary" "terminated" +"then" "to" "transaction" "truncate" "type" "uncommitted" "union" +"unique" "unlock" "update" "use" "using" "values" "when" "where" +"with" "write" "xor" +)) + + (mysql-types (sql-keywords-re +"bigint" "binary" "bit" "blob" "bool" "boolean" "char" "curve" "date" +"datetime" "dec" "decimal" "double" "enum" "fixed" "float" "geometry" +"geometrycollection" "int" "integer" "line" "linearring" "linestring" +"longblob" "longtext" "mediumblob" "mediumint" "mediumtext" +"multicurve" "multilinestring" "multipoint" "multipolygon" +"multisurface" "national" "numeric" "point" "polygon" "precision" +"real" "smallint" "surface" "text" "time" "timestamp" "tinyblob" +"tinyint" "tinytext" "unsigned" "varchar" "year" "year2" "year4" +"zerofill" +))) + + `((,mysql-funcs . font-lock-builtin-face) + (,mysql-keywords . font-lock-keyword-face) + (,mysql-types . font-lock-type-face))) + "MySQL SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1433,7 +1607,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-mysql-font-lock-keywords.") -(defvar sql-mode-sqlite-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-sqlite-font-lock-keywords nil "SQLite SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1441,7 +1615,7 @@ regular expressions are created during compilation by calling the function `regexp-opt'. Therefore, take a look at the source before you define your own sql-mode-sqlite-font-lock-keywords.") -(defvar sql-mode-db2-font-lock-keywords sql-mode-ansi-font-lock-keywords +(defvar sql-mode-db2-font-lock-keywords nil "DB2 SQL keywords used by font-lock. This variable is used by `sql-mode' and `sql-interactive-mode'. The @@ -1463,16 +1637,16 @@ highlighting rules in sql-mode.") (defun sql-product-feature (feature &optional product) "Lookup `feature' needed to support the current SQL product. -See \[sql-product-support] for a list of products and supported features." - (cadr - (memq feature - (assoc (or product sql-product) - sql-product-support)))) +See \[sql-product-alist] for a list of products and supported features." + (plist-get + (cdr (assoc (or product sql-product) + sql-product-alist)) + feature)) (defun sql-product-font-lock (keywords-only imenu) "Sets `font-lock-defaults' and `font-lock-keywords' based on the product-specific keywords and syntax-alists defined in -`sql-product-support'." +`sql-product-alist'." (let ;; Get the product-specific syntax-alist. ((syntax-alist @@ -1483,27 +1657,69 @@ the product-specific keywords and syntax-alists defined in ;; Get the product-specific keywords. (setq sql-mode-font-lock-keywords (append - (eval (sql-product-feature :font-lock)) + (unless (eq sql-product 'ansi) + (eval (sql-product-feature :font-lock))) + ;; Always highlight ANSI keywords + (eval (sql-product-feature :font-lock 'ansi)) + ;; Fontify object names in CREATE, DROP and ALTER DDL + ;; statements (list sql-mode-font-lock-object-name))) - ;; Setup font-lock. (What is the minimum we should have to do - ;; here?) - (setq font-lock-set-defaults nil - font-lock-keywords sql-mode-font-lock-keywords - font-lock-defaults (list 'sql-mode-font-lock-keywords + ;; Setup font-lock. Force re-parsing of `font-lock-defaults'. + (set (make-local-variable 'font-lock-set-defaults) nil) + (setq font-lock-defaults (list 'sql-mode-font-lock-keywords keywords-only t syntax-alist)) + ;; Force font lock to reinitialize if it is already on + ;; Otherwise, we can wait until it can be started. + (when (and (fboundp 'font-lock-mode) + font-lock-mode) + (font-lock-mode-internal nil) + (font-lock-mode-internal t)) + + (add-hook 'font-lock-mode-hook + (lambda () + ;; Provide defaults for new font-lock faces. + (defvar font-lock-builtin-face + (if (boundp 'font-lock-preprocessor-face) + font-lock-preprocessor-face + font-lock-keyword-face)) + (defvar font-lock-doc-face font-lock-string-face)) + nil t) + ;; Setup imenu; it needs the same syntax-alist. (when imenu (setq imenu-syntax-alist syntax-alist)))) ;;;###autoload -(defun sql-add-product-keywords (product keywords) - "Append a `font-lock-keywords' entry to the existing entries defined - for the specified `product'." - - (let ((font-lock (sql-product-feature :font-lock product))) - (set font-lock (append (eval font-lock) (list keywords))))) +(defun sql-add-product-keywords (product keywords &optional append) + "Add highlighting KEYWORDS for SQL PRODUCT. + +PRODUCT should be a symbol, the name of a sql product, such as +`oracle'. KEYWORDS should be a list; see the variable +`font-lock-keywords'. By default they are added at the beginning +of the current highlighting list. If optional argument APPEND is +`set', they are used to replace the current highlighting list. +If APPEND is any other non-nil value, they are added at the end +of the current highlighting list. + +For example: + + (sql-add-product-keywords 'ms + '((\"\\\\b\\\\w+_t\\\\b\" . font-lock-type-face))) + +adds a fontification pattern to fontify identifiers ending in +`_t' as data types." + + (let ((font-lock (sql-product-feature :font-lock product)) + old) + (setq old (eval font-lock)) + (set font-lock + (if (eq append 'set) + keywords + (if append + (append old keywords) + (append keywords old)))))) @@ -1517,10 +1733,6 @@ selected." ;; Setup font-lock (sql-product-font-lock nil t) - ;; Force fontification, if its enabled. - (if font-lock-mode - (font-lock-fontify-buffer)) - ;; Set the mode name to include the product. (setq mode-name (concat "SQL[" (prin1-to-string sql-product) "]")))) @@ -1528,7 +1740,7 @@ selected." "Set `sql-product' to product and enable appropriate highlighting." (interactive "SEnter SQL product: ") - (when (not (assoc product sql-product-support)) + (when (not (assoc product sql-product-alist)) (error "SQL product %s is not supported; treated as ANSI" product) (setq product 'ansi)) @@ -1952,6 +2164,19 @@ Every newline in STRING will be preceded with a space and a backslash." (interactive) (sql-send-region (point-min) (point-max))) +(defun sql-send-string (str) + "Send a string to the SQL process." + (interactive "sSQL Text: ") + (if (buffer-live-p sql-buffer) + (save-excursion + (comint-send-string sql-buffer str) + (comint-send-string sql-buffer "\n") + (message "Sent string to buffer %s." (buffer-name sql-buffer)) + (if sql-pop-to-buffer-after-send-region + (pop-to-buffer sql-buffer) + (display-buffer sql-buffer))) + (message "No SQL process started."))) + (defun sql-toggle-pop-to-buffer-after-send-region (&optional value) "Toggle `sql-pop-to-buffer-after-send-region'. @@ -2611,6 +2836,8 @@ parameters and command options." (setq params (append params (list sql-database)))) (if (not (string= "" sql-server)) (setq params (append (list "-h" sql-server) params))) + (if (not (string= "" sql-user)) + (setq params (append (list "-U" sql-user) params))) (set-buffer (apply 'make-comint "SQL" sql-postgres-program nil params)))) diff --git a/lisp/ps-print.el b/lisp/ps-print.el index 50d7f1d2196..5c019b4f347 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -1262,7 +1262,7 @@ Please send all bug fixes and enhancements to ;; N-up printing. ;; Hook: `ps-print-begin-sheet-hook'. ;; -;; [keinichi] 19990509 Kein'ichi Handa <handa@etl.go.jp> +;; [kenichi] 19990509 Ken'ichi Handa <handa@m17n.org> ;; ;; `ps-print-region-function' ;; @@ -1275,7 +1275,7 @@ Please send all bug fixes and enhancements to ;; PostScript prologue header comment insertion. ;; Skip invisible text better. ;; -;; [keinichi] 19980819 Kein'ichi Handa <handa@etl.go.jp> +;; [kenichi] 19980819 Ken'ichi Handa <handa@m17n.org> ;; ;; Multi-byte buffer handling. ;; @@ -1383,7 +1383,7 @@ Please send all bug fixes and enhancements to ;; prologue code suggestion, for odd/even printing suggestion and for ;; `ps-prologue-file' enhancement. ;; -;; Thanks to Kein'ichi Handa <handa@etl.go.jp> for multi-byte buffer handling. +;; Thanks to Ken'ichi Handa <handa@m17n.org> for multi-byte buffer handling. ;; ;; Thanks to Matthew O Persico <Matthew.Persico@lazard.com> for line number on ;; empty columns. @@ -3501,6 +3501,11 @@ The table depends on the current ps-print setup." #'ps-print-quote (list (concat "\n;;; ps-print version " ps-print-version "\n") + ";; internal vars" + (ps-comment-string "ps-print-emacs-type" ps-print-emacs-type) + (ps-comment-string "ps-windows-system " ps-windows-system) + (ps-comment-string "ps-lp-system " ps-lp-system) + nil '(25 . ps-print-color-p) '(25 . ps-lpr-command) '(25 . ps-lpr-switches) @@ -3657,14 +3662,28 @@ If `ps-prefix-quote' is nil, it's set to t after generating string." (if (> col len) (make-string (- col len) ?\ ) " ") - (cond ((null val) "nil") - ((eq val t) "t") - ((or (symbolp val) (listp val)) (format "'%S" val)) - (t (format "%S" val)))))) + (ps-value-string val)))) (t "") )) +(defun ps-value-string (val) + "Return a string representation of VAL. Used by `ps-print-quote'." + (cond ((null val) + "nil") + ((eq val t) + "t") + ((or (symbolp val) (listp val)) + (format "'%S" val)) + (t + (format "%S" val)))) + + +(defun ps-comment-string (str value) + "Return a comment string like \";; STR = VALUE\"." + (format ";; %s = %s" str (ps-value-string value))) + + (defun ps-value (alist-sym key) "Return value from association list ALIST-SYM which car is `eq' to KEY." (cdr (assq key (symbol-value alist-sym)))) @@ -3718,8 +3737,8 @@ It can be retrieved with `(ps-get ALIST-SYM KEY)'." (format-time-string "%Y-%m-%d")) -(defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd - "Alias for `ps-time-stamp-yyyy-mm-dd' (which see).") +;; Alias for `ps-time-stamp-yyyy-mm-dd' (which see). +(defalias 'ps-time-stamp-iso8601 'ps-time-stamp-yyyy-mm-dd) (defun ps-time-stamp-hh:mm:ss () diff --git a/lisp/recentf.el b/lisp/recentf.el index 7e379822457..efe4ebc63a4 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el @@ -1137,13 +1137,16 @@ default." "Save the recent list. Write data into the file specified by `recentf-save-file'." (interactive) - (with-temp-buffer - (erase-buffer) - (insert (format recentf-save-file-header (current-time-string))) - (recentf-dump-variable 'recentf-list recentf-max-saved-items) - (recentf-dump-variable 'recentf-filter-changer-state) - (write-file (expand-file-name recentf-save-file)) - nil)) + (condition-case error + (with-temp-buffer + (erase-buffer) + (insert (format recentf-save-file-header (current-time-string))) + (recentf-dump-variable 'recentf-list recentf-max-saved-items) + (recentf-dump-variable 'recentf-filter-changer-state) + (write-file (expand-file-name recentf-save-file)) + nil) + (error + (warn "recentf mode: %s" (error-message-string error))))) (defun recentf-load-list () "Load a previously saved recent list. diff --git a/lisp/replace.el b/lisp/replace.el index 2d26cb5cc66..89f55c2829e 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -1,7 +1,7 @@ ;;; replace.el --- replace commands for Emacs -;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002 -;; Free Software Foundation, Inc. +;; Copyright (C) 1985, 86, 87, 92, 94, 96, 1997, 2000, 2001, 2002, +;; 2003, 2004 Free Software Foundation, Inc. ;; Maintainer: FSF @@ -36,9 +36,11 @@ (defvar query-replace-history nil) -(defvar query-replace-interactive nil +(defcustom query-replace-interactive nil "Non-nil means `query-replace' uses the last search string. -That becomes the \"string to replace\".") +That becomes the \"string to replace\"." + :type 'boolean + :group 'matching) (defcustom query-replace-from-history-variable 'query-replace-history "History list to use for the FROM argument of `query-replace' commands. @@ -79,14 +81,15 @@ strings or patterns." query-replace-from-history-variable nil t))) ;; Warn if user types \n or \t, but don't reject the input. - (if (string-match "\\\\[nt]" from) - (let ((match (match-string 0 from))) - (cond - ((string= match "\\n") - (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) - ((string= match "\\t") - (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) - (sit-for 2)))) + (and regexp-flag + (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\[nt]\\)" from) + (let ((match (match-string 3 from))) + (cond + ((string= match "\\n") + (message "Note: `\\n' here doesn't match a newline; to do that, type C-q C-j instead")) + ((string= match "\\t") + (message "Note: `\\t' here doesn't match a tab; to do that, just type TAB"))) + (sit-for 2)))) (save-excursion (setq to (read-from-minibuffer (format "%s %s with: " string from) @@ -159,20 +162,62 @@ Fourth and fifth arg START and END specify the region to operate on. In TO-STRING, `\\&' stands for whatever matched the whole of REGEXP, and `\\=\\N' (where N is a digit) stands for - whatever what matched the Nth `\\(...\\)' in REGEXP." +whatever what matched the Nth `\\(...\\)' in REGEXP. + +When this function is called interactively, the replacement text +can also contain `\\,' followed by a Lisp expression. The escaped +shorthands for `query-replace-regexp-eval' are also valid +here: within the Lisp expression, you can use `\\&' for the whole +match string, `\\N' for partial matches, `\\#&' and `\\#N' for +the respective numeric values, and `\\#' for `replace-count'. + +If your Lisp expression is an identifier and the next +letter in the replacement string would be interpreted as part of it, +you can wrap it with an expression like `\\,(or \\#)'. Incidentally, +for this particular case you may also enter `\\#' in the replacement +text directly. + +When you use `\\,' or `\\#' in the replacement, TO-STRING actually +becomes a list with expanded shorthands. +Use \\[repeat-complex-command] after this command to see details." (interactive (let ((common (query-replace-read-args "Query replace regexp" t))) - (list (nth 0 common) (nth 1 common) (nth 2 common) - ;; These are done separately here - ;; so that command-history will record these expressions - ;; rather than the values they had this time. - (if (and transient-mark-mode mark-active) - (region-beginning)) - (if (and transient-mark-mode mark-active) - (region-end))))) - + (list + (nth 0 common) + (if (string-match "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" + (nth 1 common)) + (let ((to-string (nth 1 common)) pos to-expr char prompt) + (while (string-match + "\\(\\`\\|[^\\]\\)\\(\\\\\\\\\\)*\\\\[,#]" + to-string) + (setq pos (match-end 0)) + (push (substring to-string 0 (- pos 2)) to-expr) + (setq char (aref to-string (1- pos)) + to-string (substring to-string pos)) + (cond ((eq char ?\#) + (push '(number-to-string replace-count) to-expr)) + ((eq char ?\,) + (setq pos (read-from-string to-string)) + (push `(replace-quote ,(car pos)) to-expr) + (setq to-string (substring to-string (cdr pos)))))) + (setq to-expr (nreverse (delete "" (cons to-string to-expr)))) + (replace-match-string-symbols to-expr) + (cons 'replace-eval-replacement + (if (> (length to-expr) 1) + (cons 'concat to-expr) + (car to-expr)))) + (nth 1 common)) + (nth 2 common) + ;; These are done separately here + ;; so that command-history will record these expressions + ;; rather than the values they had this time. + (if (and transient-mark-mode mark-active) + (region-beginning)) + (if (and transient-mark-mode mark-active) + (region-end))))) (perform-replace regexp to-string t t delimited nil nil start end)) + (define-key esc-map [?\C-%] 'query-replace-regexp) (defun query-replace-regexp-eval (regexp to-expr &optional delimited start end) @@ -189,6 +234,7 @@ For convenience, when entering TO-EXPR interactively, you can use `\\&' or `\\0' to stand for whatever matched the whole of REGEXP, and `\\N' (where N is a digit) to stand for whatever matched the Nth `\\(...\\)' in REGEXP. Use `\\#&' or `\\#N' if you want a number instead of a string. +In interactive use, `\\#' in itself stands for `replace-count'. In Transient Mark mode, if the mark is active, operate on the contents of the region. Otherwise, operate from point to the end of the buffer. @@ -538,6 +584,7 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. (set (make-local-variable 'revert-buffer-function) 'occur-revert-function) (make-local-variable 'occur-revert-arguments) (add-hook 'change-major-mode-hook 'font-lock-defontify nil t) + (setq next-error-function 'occur-next-error) (run-hooks 'occur-mode-hook)) (defun occur-revert-function (ignore1 ignore2) @@ -614,6 +661,21 @@ Alternatively, click \\[occur-mode-mouse-goto] on an item to go to it. "Move to the Nth (default 1) previous match in an Occur mode buffer." (interactive "p") (occur-find-match n #'previous-single-property-change "No earlier matches")) + +(defun occur-next-error (&optional argp reset) + "Move to the Nth (default 1) next match in an Occur mode buffer. +Compatibility function for \\[next-error] invocations." + (interactive "p") + (when reset + (occur-find-match 0 #'next-single-property-change "No first match")) + (occur-find-match + (prefix-numeric-value argp) + (if (> 0 (prefix-numeric-value argp)) + #'previous-single-property-change + #'next-single-property-change) + "No more matches") + (occur-mode-goto-occurrence)) + (defcustom list-matching-lines-default-context-lines 0 "*Default number of context lines included around `list-matching-lines' matches. @@ -800,7 +862,9 @@ See also `multi-occur'." (setq occur-revert-arguments (list regexp nlines bufs) buffer-read-only t) (if (> count 0) - (display-buffer occur-buf) + (progn + (display-buffer occur-buf) + (setq next-error-last-buffer occur-buf)) (kill-buffer occur-buf))) (run-hooks 'occur-hook)))) @@ -992,6 +1056,7 @@ N (match-string N) (where N is a string of digits) #N (string-to-number (match-string N)) & (match-string 0) #& (string-to-number (match-string 0)) +# replace-count Note that these symbols must be preceeded by a backslash in order to type them." @@ -1011,7 +1076,9 @@ type them." ((string= "&" name) (setcar n '(match-string 0))) ((string= "#&" name) - (setcar n '(string-to-number (match-string 0)))))))) + (setcar n '(string-to-number (match-string 0)))) + ((string= "#" name) + (setcar n 'replace-count)))))) (setq n (cdr n)))) (defun replace-eval-replacement (expression replace-count) @@ -1020,6 +1087,21 @@ type them." replacement (prin1-to-string replacement t)))) +(defun replace-quote (replacement) + "Quote a replacement string. +This just doubles all backslashes in REPLACEMENT and +returns the resulting string. If REPLACEMENT is not +a string, it is first passed through `prin1-to-string' +with the `noescape' argument set. + +`match-data' is preserved across the call." + (save-match-data + (replace-regexp-in-string "\\\\" "\\\\" + (if (stringp replacement) + replacement + (prin1-to-string replacement t)) + t t))) + (defun replace-loop-through-replacements (data replace-count) ;; DATA is a vector contaning the following values: ;; 0 next-rotate-count @@ -1112,7 +1194,7 @@ make, or the user didn't cancel the call." (unwind-protect ;; Loop finding occurrences that perhaps should be replaced. (while (and keep-going - (not (eobp)) + (not (or (eobp) (and limit (>= (point) limit)))) ;; Use the next match if it is already known; ;; otherwise, search for a match after moving forward ;; one char if progress is required. @@ -1128,7 +1210,10 @@ make, or the user didn't cancel the call." ;; character too far at the end, ;; but this is undone after the ;; while-loop. - (progn (forward-char 1) (not (eobp)))) + (progn + (forward-char 1) + (not (or (eobp) + (and limit (>= (point) limit)))))) (funcall search-function search-string limit t) ;; For speed, use only integers and ;; reuse the list used last time. diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 3e40f118a41..249bdfe00e3 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -207,7 +207,9 @@ may have changed\) back to `save-place-alist'." (delete-region (point-min) (point-max)) (when save-place-forget-unreadable-files (save-place-forget-unreadable-files)) - (print save-place-alist (current-buffer)) + (let ((print-length nil) + (print-level nil)) + (print save-place-alist (current-buffer))) (let ((version-control (cond ((null save-place-version-control) nil) diff --git a/lisp/sb-dir-minus.xpm b/lisp/sb-dir-minus.xpm index 30dcd753505..0bb8a9cd897 100644 --- a/lisp/sb-dir-minus.xpm +++ b/lisp/sb-dir-minus.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_dir__xpm[] = { -"20 15 4 1", +static char * sb_dir_minus_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", -" ....... ", -".+++++++. ", -".+@@@@@@+.......... ", -".+@@@@@@@++++++++++.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@++++++@@@@@+.", -".+@@@@@++++++@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++++++++++++++++++.", -" .................. "}; +"# c #828282", +" ...... ", +" .++++++. ", +".+@@@@@@+......... ", +".+@@@@@@@+++++++++. ", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@+++++@@@@@@+#", +".+@@@@@@.....@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +" #++++++++++++++++# ", +" ################ "}; diff --git a/lisp/sb-dir-plus.xpm b/lisp/sb-dir-plus.xpm index 4289abc0e43..009719bce6d 100644 --- a/lisp/sb-dir-plus.xpm +++ b/lisp/sb-dir-plus.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_dir+_xpm[] = { -"20 15 4 1", +static char * sb_dir_plus_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", -" ....... ", -".+++++++. ", -".+@@@@@@+.......... ", -".+@@@@@@@++++++++++.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -".+@@@@@++++++@@@@@+.", -".+@@@@@++++++@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++++++++++++++++++.", -" .................. "}; +"# c #828282", +" ...... ", +" .++++++. ", +".+@@@@@@+......... ", +".+@@@@@@@+++++++++. ", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@+@@@@@@@@+#", +".+@@@@@@@+.@@@@@@@+#", +".+@@@@@+++++@@@@@@+#", +".+@@@@@@.+...@@@@@+#", +".+@@@@@@@+.@@@@@@@+#", +".+@@@@@@@@.@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +" #++++++++++++++++# ", +" ################ "}; diff --git a/lisp/sb-dir.xpm b/lisp/sb-dir.xpm index 622ce19e937..1c3d3d72b87 100644 --- a/lisp/sb-dir.xpm +++ b/lisp/sb-dir.xpm @@ -1,22 +1,23 @@ /* XPM */ static char * sb_dir_xpm[] = { -"20 15 4 1", +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", -" ....... ", -".+++++++. ", -".+@@@@@@+.......... ", -".+@@@@@@@++++++++++.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++++++++++++++++++.", -" .................. "}; +"# c #828282", +" ...... ", +" .++++++. ", +".+@@@@@@+......... ", +".+@@@@@@@+++++++++. ", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +" #++++++++++++++++# ", +" ################ "}; diff --git a/lisp/sb-mail.xpm b/lisp/sb-mail.xpm index 5716eeb9661..fecc0a1aa38 100644 --- a/lisp/sb-mail.xpm +++ b/lisp/sb-mail.xpm @@ -1,22 +1,23 @@ /* XPM */ static char * sb_mail_xpm[] = { -"20 15 4 1", +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", -"@ c #FFFFFF", -"................... ", -".++++++++++++++++++.", -".++@@@@@@@@@@@@@@++.", -".+@++@@@@@@@@@@++@+.", -".+@@@++@@@@@@++@@@+.", -".+@@@@@++@@++@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@+@@@@@@+@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@+@@@@@@@@@@+@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++@@@@@@@@@@@@@@++.", -".++++++++++++++++++.", -" .................. "}; +"@ c #828282", +"# c #FFFFFF", +" .................. ", +".++++++++++++++++++@", +".++##############++@", +".+#++##########++#+@", +".+###++######++###+@", +".+#####++##++#####+@", +".+#######++#######+@", +".+################+@", +".+####+######+####+@", +".+################+@", +".+##+##########+##+@", +".+################+@", +".++##############++@", +".++++++++++++++++++@", +" @@@@@@@@@@@@@@@@@@ "}; diff --git a/lisp/sb-pg-minus.xpm b/lisp/sb-pg-minus.xpm index 63230ef1c0a..e512d25120a 100644 --- a/lisp/sb-pg-minus.xpm +++ b/lisp/sb-pg-minus.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_file__xpm[] = { -"20 15 4 1", +static char * sb_pg_minus_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", -"@ c #FFFFFF", +"@ c #828282", +"# c #FFFFFF", " ............ ", -" .++++++++++++.", -" .++@@@@@@@@@@+.", -" .+@+@@@@@@@@@@+.", -" .+@@+@@@@@@@@@@+.", -" .+@@@+@@@@@@@@@@+.", -" .+@@@@+@@@@@@@@@@+.", -".+++++++@++++++@@@+.", -".+@@@@@@@++++++@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++++++++++++++++++.", -" .................. "}; +" .++++++++++++@", +" .++##########+@", +" .+#+##########+@", +" .+##+##########+@", +" .+###+##########+@", +" .+####+##########+@", +".+++++++#+++++####+@", +".+########.....###+@", +".+################+@", +".+################+@", +".+################+@", +".+################+@", +".++++++++++++++++++@", +" @@@@@@@@@@@@@@@@@@ "}; diff --git a/lisp/sb-pg-plus.xpm b/lisp/sb-pg-plus.xpm index 0cd4ce81299..f0e74678249 100644 --- a/lisp/sb-pg-plus.xpm +++ b/lisp/sb-pg-plus.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_file+_xpm[] = { -"20 15 4 1", +static char * sb_pg_plus_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", -"@ c #FFFFFF", +"@ c #828282", +"# c #FFFFFF", " ............ ", -" .++++++++++++.", -" .++@@@@@@@@@@+.", -" .+@+@@@@@@@@@@+.", -" .+@@+@@@@@@@@@@+.", -" .+@@@+@@@++@@@@@+.", -" .+@@@@+@@@++@@@@@+.", -".+++++++@++++++@@@+.", -".+@@@@@@@++++++@@@+.", -".+@@@@@@@@@++@@@@@+.", -".+@@@@@@@@@++@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++++++++++++++++++.", -" .................. "}; +" .++++++++++++@", +" .++##########+@", +" .+#+##########+@", +" .+##+##########+@", +" .+###+###+######+@", +" .+####+###+.#####+@", +".+++++++#+++++####+@", +".+########.+...###+@", +".+#########+.#####+@", +".+##########.#####+@", +".+################+@", +".+################+@", +".++++++++++++++++++@", +" @@@@@@@@@@@@@@@@@@ "}; diff --git a/lisp/sb-pg.xpm b/lisp/sb-pg.xpm index 241767abbdf..3a210bfa897 100644 --- a/lisp/sb-pg.xpm +++ b/lisp/sb-pg.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_file_xpm[] = { -"20 15 4 1", +static char * sb_pg_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", -"@ c #FFFFFF", +"@ c #828282", +"# c #FFFFFF", " ............ ", -" .++++++++++++.", -" .++@@@@@@@@@@+.", -" .+@+@@@@@@@@@@+.", -" .+@@+@@@@@@@@@@+.", -" .+@@@+@@@@@@@@@@+.", -" .+@@@@+@@@@@@@@@@+.", -".+++++++@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".++++++++++++++++++.", -" .................. "}; +" .++++++++++++@", +" .++##########+@", +" .+#+##########+@", +" .+##+##########+@", +" .+###+##########+@", +" .+####+##########+@", +".+++++++##########+@", +".+################+@", +".+################+@", +".+################+@", +".+################+@", +".+################+@", +".++++++++++++++++++@", +" @@@@@@@@@@@@@@@@@@ "}; diff --git a/lisp/sb-tag-gt.xpm b/lisp/sb-tag-gt.xpm index 49b8b72a2c1..9db11a13e8f 100644 --- a/lisp/sb-tag-gt.xpm +++ b/lisp/sb-tag-gt.xpm @@ -1,22 +1,23 @@ /* XPM */ static char * sb_tag_gt_xpm[] = { -"20 15 4 1", +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", +"# c #828282", " ", " ", -" ............... ", -" .+++++++++++++++.", -" .+@@@@@++@@@@@@@+.", -" .+@@@@@@+++@@@@@@+.", -".+@@@@@@@++++@@@@@+.", -".+@++@@@@+++++@@@@+.", -".+@++@@@@+++++.@@@+.", -".+@@@@@@@++++.@@@@+.", -" .+@@@@@@+++.@@@@@+.", -" .+@@@@@++.@@@@@@+.", -". .++++++.++++++++.", -" ............... ", +" .............. ", +" .++++++++++++++. ", +" .+@@@@@++@@@@@@@+#", +" .+@@@@@@+++@@@@@@+#", +".+@@@@@@@++++@@@@@+#", +".+@++@@@@+++++@@@@+#", +".+@++@@@@+++++#@@@+#", +".+@@@@@@@++++#@@@@+#", +" #+@@@@@@+++#@@@@@+#", +" #+@@@@@++#@@@@@@+#", +" #++++++#+++++++# ", +" ############## ", " "}; diff --git a/lisp/sb-tag-minus.xpm b/lisp/sb-tag-minus.xpm index f006c4ef4cb..560aaa3aa82 100644 --- a/lisp/sb-tag-minus.xpm +++ b/lisp/sb-tag-minus.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_tag__xpm[] = { -"20 15 4 1", +static char * sb_tag_minus_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", +"# c #828282", " ", " ", -" ............... ", -" .+++++++++++++++.", -" .+@@@@@@@@@@@@@@+.", -" .+@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@++@@++++++@@@@@+.", -".+@++@@++++++@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -" .+@@@@@@@@@@@@@@@+.", -" .+@@@@@@@@@@@@@@+.", -". .+++++++++++++++.", -" ............... ", +" .............. ", +" .++++++++++++++. ", +" .+@@@@@@@@@@@@@@+#", +" .+@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@++@@+++++@@@@@@+#", +".+@++@@@.....@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +" #+@@@@@@@@@@@@@@@+#", +" #+@@@@@@@@@@@@@@+#", +" #++++++++++++++# ", +" ############## ", " "}; diff --git a/lisp/sb-tag-plus.xpm b/lisp/sb-tag-plus.xpm index cf32fef549c..3dcf2f87c5d 100644 --- a/lisp/sb-tag-plus.xpm +++ b/lisp/sb-tag-plus.xpm @@ -1,22 +1,23 @@ /* XPM */ -static char * sb_tag+_xpm[] = { -"20 15 4 1", +static char * sb_tag_plus_xpm[] = { +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", +"# c #828282", " ", " ", -" ............... ", -" .+++++++++++++++.", -" .+@@@@@@@@@@@@@@+.", -" .+@@@@@@++@@@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -".+@++@@++++++@@@@@+.", -".+@++@@++++++@@@@@+.", -".+@@@@@@@++@@@@@@@+.", -" .+@@@@@@++@@@@@@@+.", -" .+@@@@@@@@@@@@@@+.", -". .+++++++++++++++.", -" ............... ", +" .............. ", +" .++++++++++++++. ", +" .+@@@@@@@@@@@@@@+#", +" .+@@@@@@+@@@@@@@@+#", +".+@@@@@@@+.@@@@@@@+#", +".+@++@@+++++@@@@@@+#", +".+@++@@@.+...@@@@@+#", +".+@@@@@@@+.@@@@@@@+#", +" #+@@@@@@@.@@@@@@@+#", +" #+@@@@@@@@@@@@@@+#", +" #++++++++++++++# ", +" ############## ", " "}; diff --git a/lisp/sb-tag-type.xpm b/lisp/sb-tag-type.xpm index 65886989dbd..3abe408a66b 100644 --- a/lisp/sb-tag-type.xpm +++ b/lisp/sb-tag-type.xpm @@ -1,22 +1,23 @@ /* XPM */ static char * sb_tag_type_xpm[] = { -"20 15 4 1", +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", +"# c #828282", " ", " ", -" ............... ", -" .+++++++++++++++.", -" .+@@@@@@@@@@@@@@+.", -" .+@@@@@@++++++@@@+.", -".+@@@@@@@++++++@@@+.", -".+@++@@@@@@++@@@@@+.", -".+@++@@@@@@++@@@@@+.", -".+@@@@@@@@@++@@@@@+.", -" .+@@@@@@@@++@@@@@+.", -" .+@@@@@@@@@@@@@@+.", -". .+++++++++++++++.", -" ............... ", +" .............. ", +" .++++++++++++++. ", +" .+@@@@@@@@@@@@@@+#", +" .+@@@@@@++++++@@@+#", +".+@@@@@@@++++++@@@+#", +".+@++@@@@@@++@@@@@+#", +".+@++@@@@@@++@@@@@+#", +".+@@@@@@@@@++@@@@@+#", +" #+@@@@@@@@++@@@@@+#", +" #+@@@@@@@@@@@@@@+#", +" #++++++++++++++# ", +" ############## ", " "}; diff --git a/lisp/sb-tag-v.xpm b/lisp/sb-tag-v.xpm index 7431e4c5d87..ae447adc8e4 100644 --- a/lisp/sb-tag-v.xpm +++ b/lisp/sb-tag-v.xpm @@ -1,22 +1,23 @@ /* XPM */ static char * sb_tag_v_xpm[] = { -"20 15 4 1", +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", +"# c #828282", " ", " ", -" ............... ", -" .+++++++++++++++.", -" .+@@@@@@@@@@@@@@+.", -" .+@@@++++++++++.@+.", -".+@@@@@++++++++.@@+.", -".+@++@@@++++++.@@@+.", -".+@++@@@@++++.@@@@+.", -".+@@@@@@@@++.@@@@@+.", -" .+@@@@@@@@.@@@@@@+.", -" .+@@@@@@@@@@@@@@+.", -". .+++++++++++++++.", -" ............... ", +" .............. ", +" .++++++++++++++. ", +" .+@@@@@@@@@@@@@@+#", +" .+@@@++++++++++#@+#", +".+@@@@@++++++++#@@+#", +".+@++@@@++++++#@@@+#", +".+@++@@@@++++#@@@@+#", +".+@@@@@@@@++#@@@@@+#", +" #+@@@@@@@@#@@@@@@+#", +" #+@@@@@@@@@@@@@@+#", +" #++++++++++++++# ", +" ############## ", " "}; diff --git a/lisp/sb-tag.xpm b/lisp/sb-tag.xpm index 4c6f1c56c1f..900bfd34b26 100644 --- a/lisp/sb-tag.xpm +++ b/lisp/sb-tag.xpm @@ -1,22 +1,23 @@ /* XPM */ static char * sb_tag_xpm[] = { -"20 15 4 1", +"20 15 5 1", " c None", -". c #828282", +". c #B8B8B8", "+ c #000000", "@ c #FFF993", +"# c #828282", " ", " ", -" ............... ", -" .+++++++++++++++.", -" .+@@@@@@@@@@@@@@+.", -" .+@@@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -".+@++@@@@@@@@@@@@@+.", -".+@++@@@@@@@@@@@@@+.", -".+@@@@@@@@@@@@@@@@+.", -" .+@@@@@@@@@@@@@@@+.", -" .+@@@@@@@@@@@@@@+.", -". .+++++++++++++++.", -" ............... ", +" .............. ", +" .++++++++++++++. ", +" .+@@@@@@@@@@@@@@+#", +" .+@@@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +".+@++@@@@@@@@@@@@@+#", +".+@++@@@@@@@@@@@@@+#", +".+@@@@@@@@@@@@@@@@+#", +" #+@@@@@@@@@@@@@@@+#", +" #+@@@@@@@@@@@@@@+#", +" #++++++++++++++# ", +" ############## ", " "}; diff --git a/lisp/select.el b/lisp/select.el index 01b227d8712..c095ea50c44 100644 --- a/lisp/select.el +++ b/lisp/select.el @@ -176,47 +176,48 @@ Cut buffers are considered obsolete; you should use selections instead." (if coding (setq coding (coding-system-base coding)) (setq coding 'raw-text)) - ;; Suppress producing escape sequences for compositions. - (remove-text-properties 0 (length str) '(composition nil) str) - (cond - ((eq type 'TEXT) - (if (not (multibyte-string-p str)) - ;; Don't have to encode unibyte string. - (setq type 'STRING) - ;; If STR contains only ASCII, Latin-1, and raw bytes, - ;; encode STR by iso-latin-1, and return it as type - ;; `STRING'. Otherwise, encode STR by CODING. In that - ;; case, the returing type depends on CODING. - (let ((charsets (find-charset-string str))) - (setq charsets - (delq 'ascii - (delq 'latin-iso8859-1 - (delq 'eight-bit-control - (delq 'eight-bit-graphic charsets))))) - (if charsets - (setq str (encode-coding-string str coding) - type (if (memq coding '(compound-text - compound-text-with-extensions)) - 'COMPOUND_TEXT - 'STRING)) - (setq type 'STRING - str (encode-coding-string str 'iso-latin-1)))))) - - ((eq type 'COMPOUND_TEXT) - (setq str (encode-coding-string str coding))) - - ((eq type 'STRING) - (if (memq coding '(compound-text - compound-text-with-extensions)) - (setq str (string-make-unibyte str)) - (setq str (encode-coding-string str coding)))) - - ((eq type 'UTF8_STRING) - (setq str (encode-coding-string str 'utf-8))) - - (t - (error "Unknow selection type: %S" type)) - )) + (let ((inhibit-read-only t)) + ;; Suppress producing escape sequences for compositions. + (remove-text-properties 0 (length str) '(composition nil) str) + (cond + ((eq type 'TEXT) + (if (not (multibyte-string-p str)) + ;; Don't have to encode unibyte string. + (setq type 'STRING) + ;; If STR contains only ASCII, Latin-1, and raw bytes, + ;; encode STR by iso-latin-1, and return it as type + ;; `STRING'. Otherwise, encode STR by CODING. In that + ;; case, the returing type depends on CODING. + (let ((charsets (find-charset-string str))) + (setq charsets + (delq 'ascii + (delq 'latin-iso8859-1 + (delq 'eight-bit-control + (delq 'eight-bit-graphic charsets))))) + (if charsets + (setq str (encode-coding-string str coding) + type (if (memq coding '(compound-text + compound-text-with-extensions)) + 'COMPOUND_TEXT + 'STRING)) + (setq type 'STRING + str (encode-coding-string str 'iso-latin-1)))))) + + ((eq type 'COMPOUND_TEXT) + (setq str (encode-coding-string str coding))) + + ((eq type 'STRING) + (if (memq coding '(compound-text + compound-text-with-extensions)) + (setq str (string-make-unibyte str)) + (setq str (encode-coding-string str coding)))) + + ((eq type 'UTF8_STRING) + (setq str (encode-coding-string str 'utf-8))) + + (t + (error "Unknow selection type: %S" type)) + ))) (setq next-selection-coding-system nil) (cons type str)))) diff --git a/lisp/ses.el b/lisp/ses.el index a5cc6bf657c..9439d98c481 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -983,7 +983,7 @@ be set to VALUE." (ses-aset-with-undo (symbol-value def) elem value) (ses-set-with-undo def value)) (let ((inhibit-read-only t) - (fmt (plist-get '(ses--column-widths "(ses-column-widths %S)" + (fmt (plist-get '(ses--col-widths "(ses-column-widths %S)" ses--col-printers "(ses-column-printers %S)" ses--default-printer "(ses-default-printer %S)" ses--header-row "(ses-header-row %S)" diff --git a/lisp/simple.el b/lisp/simple.el index 2d0a176de0c..8da9e8028f0 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1,7 +1,7 @@ ;;; simple.el --- basic editing commands for Emacs ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 99, -;; 2000, 2001, 2002, 2003 +;; 2000, 01, 02, 03, 04 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -37,7 +37,7 @@ (defgroup killing nil - "Killing and yanking commands" + "Killing and yanking commands." :group 'editing) (defgroup paren-matching nil @@ -66,6 +66,154 @@ (setq list (cdr list))) (switch-to-buffer found))) +;;; next-error support framework +(defvar next-error-last-buffer nil + "The most recent next-error buffer. +A buffer becomes most recent when its compilation, grep, or +similar mode is started, or when it is used with \\[next-error] +or \\[compile-goto-error].") + +(defvar next-error-function nil + "Function to use to find the next error in the current buffer. +The function is called with 2 parameters: +ARG is an integer specifying by how many errors to move. +RESET is a boolean which, if non-nil, says to go back to the beginning +of the errors before moving. +Major modes providing compile-like functionality should set this variable +to indicate to `next-error' that this is a candidate buffer and how +to navigate in it.") + +(make-variable-buffer-local 'next-error-function) + +(defsubst next-error-buffer-p (buffer &optional extra-test) + "Test if BUFFER is a next-error capable buffer." + (with-current-buffer buffer + (or (and extra-test (funcall extra-test)) + next-error-function))) + +;; Return a next-error capable buffer according to the following rules: +;; 1. If the current buffer is a next-error capable buffer, return it. +;; 2. If one window on the selected frame displays such buffer, return it. +;; 3. If next-error-last-buffer is set to a live buffer, use that. +;; 4. Otherwise, look for a next-error capable buffer in a buffer list. +;; 5. Signal an error if there are none. +(defun next-error-find-buffer (&optional other-buffer extra-test) + (if (and (not other-buffer) + (next-error-buffer-p (current-buffer) extra-test)) + ;; The current buffer is a next-error capable buffer. + (current-buffer) + (or + (let ((window-buffers + (delete-dups + (delq nil + (mapcar (lambda (w) + (and (next-error-buffer-p (window-buffer w) extra-test) + (window-buffer w))) + (window-list)))))) + (if other-buffer + (setq window-buffers (delq (current-buffer) window-buffers))) + (if (eq (length window-buffers) 1) + (car window-buffers))) + (if (and next-error-last-buffer (buffer-name next-error-last-buffer) + (next-error-buffer-p next-error-last-buffer extra-test) + (or (not other-buffer) (not (eq next-error-last-buffer + (current-buffer))))) + next-error-last-buffer + (let ((buffers (buffer-list))) + (while (and buffers (or (not (next-error-buffer-p (car buffers) extra-test)) + (and other-buffer + (eq (car buffers) (current-buffer))))) + (setq buffers (cdr buffers))) + (if buffers + (car buffers) + (or (and other-buffer + (next-error-buffer-p (current-buffer) extra-test) + ;; The current buffer is a next-error capable buffer. + (progn + (if other-buffer + (message "This is the only next-error capable buffer.")) + (current-buffer))) + (error "No next-error capable buffer found")))))))) + +(defun next-error (arg &optional reset) + "Visit next next-error message and corresponding source code. + +If all the error messages parsed so far have been processed already, +the message buffer is checked for new ones. + +A prefix ARG specifies how many error messages to move; +negative means move back to previous error messages. +Just \\[universal-argument] as a prefix means reparse the error message buffer +and start at the first error. + +The RESET argument specifies that we should restart from the beginning. + +\\[next-error] normally uses the most recently started +compilation, grep, or occur buffer. It can also operate on any +buffer with output from the \\[compile], \\[grep] commands, or, +more generally, on any buffer in Compilation mode or with +Compilation Minor mode enabled, or any buffer in which +`next-error-function' is bound to an appropriate +function. To specify use of a particular buffer for error +messages, type \\[next-error] in that buffer. + +Once \\[next-error] has chosen the buffer for error messages, +it stays with that buffer until you use it in some other buffer which +uses Compilation mode or Compilation Minor mode. + +See variables `compilation-parse-errors-function' and +\`compilation-error-regexp-alist' for customization ideas." + (interactive "P") + (if (consp arg) (setq reset t arg nil)) + (when (setq next-error-last-buffer (next-error-find-buffer)) + ;; we know here that next-error-function is a valid symbol we can funcall + (with-current-buffer next-error-last-buffer + (funcall next-error-function (prefix-numeric-value arg) reset)))) + +(defalias 'goto-next-locus 'next-error) +(defalias 'next-match 'next-error) + +(define-key ctl-x-map "`" 'next-error) + +(defun previous-error (n) + "Visit previous next-error message and corresponding source code. + +Prefix arg N says how many error messages to move backwards (or +forwards, if negative). + +This operates on the output from the \\[compile] and \\[grep] commands." + (interactive "p") + (next-error (- n))) + +(defun first-error (n) + "Restart at the first error. +Visit corresponding source code. +With prefix arg N, visit the source code of the Nth error. +This operates on the output from the \\[compile] command, for instance." + (interactive "p") + (next-error n t)) + +(defun next-error-no-select (n) + "Move point to the next error in the next-error buffer and highlight match. +Prefix arg N says how many error messages to move forwards (or +backwards, if negative). +Finds and highlights the source line like \\[next-error], but does not +select the source buffer." + (interactive "p") + (next-error n) + (pop-to-buffer next-error-last-buffer)) + +(defun previous-error-no-select (n) + "Move point to the previous error in the next-error buffer and highlight match. +Prefix arg N says how many error messages to move backwards (or +forwards, if negative). +Finds and highlights the source line like \\[previous-error], but does not +select the source buffer." + (interactive "p") + (next-error-no-select (- n))) + +;;; + (defun fundamental-mode () "Major mode not specialized for anything in particular. Other major modes are defined by comparison with this one." @@ -159,7 +307,7 @@ than the value of `fill-column' and ARG is nil." (put-text-property from (point) 'rear-nonsticky (cons 'hard sticky))))) -(defun open-line (arg) +(defun open-line (n) "Insert a newline and leave point before it. If there is a fill prefix and/or a left-margin, insert them on the new line if the line would have been blank. @@ -170,23 +318,23 @@ With arg N, insert N newlines." (loc (point)) ;; Don't expand an abbrev before point. (abbrev-mode nil)) - (newline arg) + (newline n) (goto-char loc) - (while (> arg 0) + (while (> n 0) (cond ((bolp) (if do-left-margin (indent-to (current-left-margin))) (if do-fill-prefix (insert-and-inherit fill-prefix)))) (forward-line 1) - (setq arg (1- arg))) + (setq n (1- n))) (goto-char loc) (end-of-line))) (defun split-line (&optional arg) "Split current line, moving portion beyond point vertically down. If the current line starts with `fill-prefix', insert it on the new -line as well. With prefix arg, don't insert fill-prefix on new line. +line as well. With prefix ARG, don't insert fill-prefix on new line. -When called from Lisp code, the arg may be a prefix string to copy." +When called from Lisp code, ARG may be a prefix string to copy." (interactive "*P") (skip-chars-forward " \t") (let* ((col (current-column)) @@ -637,6 +785,23 @@ If nil, don't change the value of `debug-on-error'." :type 'boolean :version "21.1") +(defun eval-expression-print-format (value) + "Format VALUE as a result of evaluated expression. +Return a formatted string which is displayed in the echo area +in addition to the value printed by prin1 in functions which +display the result of expression evaluation." + (if (and (integerp value) + (or (not (memq this-command '(eval-last-sexp eval-print-last-sexp))) + (eq this-command last-command) + (and (boundp 'edebug-active) edebug-active))) + (let ((char-string + (if (or (and (boundp 'edebug-active) edebug-active) + (memq this-command '(eval-last-sexp eval-print-last-sexp))) + (prin1-char value)))) + (if char-string + (format " (0%o, 0x%x) = %s" value value char-string) + (format " (0%o, 0x%x)" value value))))) + ;; We define this, rather than making `eval' interactive, ;; for the sake of completion of names like eval-region, eval-current-buffer. (defun eval-expression (eval-expression-arg @@ -671,7 +836,10 @@ the echo area." (with-no-warnings (let ((standard-output (current-buffer))) (eval-last-sexp-print-value (car values)))) - (prin1 (car values) t)))) + (prog1 + (prin1 (car values) t) + (let ((str (eval-expression-print-format (car values)))) + (if str (princ str t))))))) (defun edit-and-eval-command (prompt command) "Prompting with PROMPT, let user edit COMMAND and eval result. @@ -785,7 +953,8 @@ See also `minibuffer-history-case-insensitive-variables'." nil minibuffer-local-map nil - 'minibuffer-history-search-history))) + 'minibuffer-history-search-history + (car minibuffer-history-search-history)))) ;; Use the last regexp specified, by default, if input is empty. (list (if (string= regexp "") (if minibuffer-history-search-history @@ -987,7 +1156,7 @@ as an argument limits undo to changes within the current region." (undo-start)) ;; get rid of initial undo boundary (undo-more 1)) - ;; If we got this far, the next command should be a consecutive undo. + ;; If we got this far, the next command should be a consecutive undo. (setq this-command 'undo) ;; Check to see whether we're hitting a redo record, and if ;; so, ask the user whether she wants to skip the redo/undo pair. @@ -1935,7 +2104,7 @@ the text, but put the text in the kill ring anyway. This means that you can use the killing commands to copy text from a read-only buffer. This is the primitive for programs to kill text (as opposed to deleting it). -Supply two arguments, character numbers indicating the stretch of text +Supply two arguments, character positions indicating the stretch of text to be killed. Any command that calls this function is a \"kill command\". If the previous command was also a kill command, @@ -2009,11 +2178,12 @@ visual feedback indicating the extent of the region being copied." ;; look like a C-g typed as a command. (inhibit-quit t)) (if (pos-visible-in-window-p other-end (selected-window)) - (unless transient-mark-mode + (unless (and transient-mark-mode + (face-background 'region)) ;; Swap point and mark. (set-marker (mark-marker) (point) (current-buffer)) (goto-char other-end) - (sit-for 1) + (sit-for blink-matching-delay) ;; Swap back. (set-marker (mark-marker) other-end (current-buffer)) (goto-char opoint) @@ -2051,7 +2221,7 @@ The argument is used for internal purposes; do not supply one." The value should be a list of text properties to discard or t, which means to discard all text properties." :type '(choice (const :tag "All" t) (repeat symbol)) - :group 'editing + :group 'killing :version "21.4") (defvar yank-window-start nil) @@ -2261,8 +2431,7 @@ With prefix arg, kill that many lines starting from the current line. If arg is negative, kill backward. Also kill the preceding newline. \(This is meant to make C-x z work well with negative arguments.\) If arg is zero, kill current line but exclude the trailing newline." - (interactive "P") - (setq arg (prefix-numeric-value arg)) + (interactive "p") (if (and (> arg 0) (eobp) (save-excursion (forward-visible-line 0) (eobp))) (signal 'end-of-buffer nil)) (if (and (< arg 0) (bobp) (save-excursion (end-of-visible-line) (bobp))) @@ -3257,15 +3426,14 @@ Setting this variable automatically makes it local to the current buffer.") ;; (Actually some major modes use a different auto-fill function, ;; but this one is the default one.) (defun do-auto-fill () - (let (fc justify bol give-up + (let (fc justify give-up (fill-prefix fill-prefix)) (if (or (not (setq justify (current-justification))) (null (setq fc (current-fill-column))) (and (eq justify 'left) (<= (current-column) fc)) - (save-excursion (beginning-of-line) - (setq bol (point)) - (and auto-fill-inhibit-regexp + (and auto-fill-inhibit-regexp + (save-excursion (beginning-of-line) (looking-at auto-fill-inhibit-regexp)))) nil ;; Auto-filling not required (if (memq justify '(full center right)) @@ -3288,16 +3456,15 @@ Setting this variable automatically makes it local to the current buffer.") ;; Determine where to split the line. (let* (after-prefix (fill-point - (let ((opoint (point))) - (save-excursion - (beginning-of-line) - (setq after-prefix (point)) - (and fill-prefix - (looking-at (regexp-quote fill-prefix)) - (setq after-prefix (match-end 0))) - (move-to-column (1+ fc)) - (fill-move-to-break-point after-prefix) - (point))))) + (save-excursion + (beginning-of-line) + (setq after-prefix (point)) + (and fill-prefix + (looking-at (regexp-quote fill-prefix)) + (setq after-prefix (match-end 0))) + (move-to-column (1+ fc)) + (fill-move-to-break-point after-prefix) + (point)))) ;; See whether the place we found is any good. (if (save-excursion @@ -4116,27 +4283,29 @@ The completion list buffer is available as the value of `standard-output'.") ;; This function goes in completion-setup-hook, so that it is called ;; after the text of the completion list buffer is written. -(defface completion-emphasis +(defface completions-first-difference '((t (:inherit bold))) "Face put on the first uncommon character in completions in *Completions* buffer." :group 'completion) -(defface completion-de-emphasis +(defface completions-common-part '((t (:inherit default))) - "Face put on the common prefix substring in completions in *Completions* buffer." + "Face put on the common prefix substring in completions in *Completions* buffer. +The idea of `completions-common-part' is that you can use it to +make the common parts less visible than normal, so that the rest +of the differing parts is, by contrast, slightly highlighted." :group 'completion) (defun completion-setup-function () - (save-excursion - (let ((mainbuf (current-buffer)) - (mbuf-contents (minibuffer-contents))) - ;; When reading a file name in the minibuffer, - ;; set default-directory in the minibuffer - ;; so it will get copied into the completion list buffer. - (if minibuffer-completing-file-name - (with-current-buffer mainbuf - (setq default-directory (file-name-directory mbuf-contents)))) - (set-buffer standard-output) + (let ((mainbuf (current-buffer)) + (mbuf-contents (minibuffer-contents))) + ;; When reading a file name in the minibuffer, + ;; set default-directory in the minibuffer + ;; so it will get copied into the completion list buffer. + (if minibuffer-completing-file-name + (with-current-buffer mainbuf + (setq default-directory (file-name-directory mbuf-contents)))) + (with-current-buffer standard-output (completion-list-mode) (make-local-variable 'completion-reference-buffer) (setq completion-reference-buffer mainbuf) @@ -4145,35 +4314,36 @@ The completion list buffer is available as the value of `standard-output'.") ;; use the number of chars before the start of the ;; last file name component. (setq completion-base-size - (save-excursion - (set-buffer mainbuf) - (goto-char (point-max)) - (skip-chars-backward "^/") - (- (point) (minibuffer-prompt-end)))) + (with-current-buffer mainbuf + (save-excursion + (goto-char (point-max)) + (skip-chars-backward "^/") + (- (point) (minibuffer-prompt-end))))) ;; Otherwise, in minibuffer, the whole input is being completed. - (save-match-data - (if (minibufferp mainbuf) - (setq completion-base-size 0)))) - ;; Put emphasis and de-emphasis faces on completions. + (if (minibufferp mainbuf) + (setq completion-base-size 0))) + ;; Put faces on first uncommon characters and common parts. (when completion-base-size - (let ((common-string-length (length - (substring mbuf-contents - completion-base-size))) - (element-start (next-single-property-change - (point-min) - 'mouse-face)) - element-common-end) - (while element-start - (setq element-common-end (+ element-start common-string-length)) + (let* ((common-string-length + (- (length mbuf-contents) completion-base-size)) + (element-start (next-single-property-change + (point-min) + 'mouse-face)) + (element-common-end + (+ (or element-start nil) common-string-length)) + (maxp (point-max))) + (while (and element-start (< element-common-end maxp)) (when (and (get-char-property element-start 'mouse-face) (get-char-property element-common-end 'mouse-face)) (put-text-property element-start element-common-end - 'font-lock-face 'completion-de-emphasis) + 'font-lock-face 'completions-common-part) (put-text-property element-common-end (1+ element-common-end) - 'font-lock-face 'completion-emphasis)) - (setq element-start (next-single-property-change + 'font-lock-face 'completions-first-difference)) + (setq element-start (next-single-property-change element-start - 'mouse-face))))) + 'mouse-face)) + (if element-start + (setq element-common-end (+ element-start common-string-length)))))) ;; Insert help string. (goto-char (point-min)) (if (display-mouse-p) @@ -4624,5 +4794,5 @@ works by saving the value of `buffer-invisibility-spec' and setting it to nil." (provide 'simple) -;;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd +;; arch-tag: 24af67c0-2a49-44f6-b3b1-312d8b570dfd ;;; simple.el ends here diff --git a/lisp/smerge-mode.el b/lisp/smerge-mode.el index bd4d8d04a6f..35903dcf749 100644 --- a/lisp/smerge-mode.el +++ b/lisp/smerge-mode.el @@ -65,7 +65,7 @@ (defcustom smerge-diff-switches (append '("-d" "-b") (if (listp diff-switches) diff-switches (list diff-switches))) - "*A list of strings specifying switches to be be passed to diff. + "*A list of strings specifying switches to be passed to diff. Used in `smerge-diff-base-mine' and related functions." :group 'smerge :type '(repeat string)) @@ -324,7 +324,7 @@ according to `smerge-match-conflict'.") ;; Out of range (popup-menu smerge-mode-menu) ;; Install overlay. - (setq o (make-overlay (match-beginning i) (match-end i))) + (setq o (make-overlay (match-beginning i) (match-end i))) (unwind-protect (progn (overlay-put o 'face 'highlight) @@ -477,6 +477,13 @@ An error is raised if not inside a conflict." ;; handle the various conflict styles (cond + ((save-excursion + (goto-char mine-start) + (re-search-forward smerge-begin-re end t)) + ;; There's a nested conflict and we're after the the beginning + ;; of the outer one but before the beginning of the inner one. + (error "There is a nested conflict")) + ((re-search-backward smerge-base-re start t) ;; a 3-parts conflict (set (make-local-variable 'smerge-conflict-style) 'diff3-A) @@ -505,7 +512,7 @@ An error is raised if not inside a conflict." (unwind-protect (add-text-properties start end smerge-text-properties) (restore-buffer-modified-p m))) - + (store-match-data (list start end mine-start mine-end base-start base-end @@ -521,9 +528,11 @@ The submatches are the same as in `smerge-match-conflict'. Returns non-nil if a match is found between the point and LIMIT. The point is moved to the end of the conflict." (when (re-search-forward smerge-begin-re limit t) - (ignore-errors - (smerge-match-conflict) - (goto-char (match-end 0))))) + (condition-case err + (progn + (smerge-match-conflict) + (goto-char (match-end 0))) + (error (smerge-find-conflict limit))))) (defun smerge-diff (n1 n2) (smerge-match-conflict) @@ -673,5 +682,5 @@ buffer names." (provide 'smerge-mode) -;;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690 +;; arch-tag: 605c8d1e-e43d-4943-a6f3-1bcc4333e690 ;;; smerge-mode.el ends here diff --git a/lisp/startup.el b/lisp/startup.el index b3066bffbab..b06b3094769 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1,6 +1,6 @@ ;;; startup.el --- process Emacs shell arguments -;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 +;; Copyright (C) 1985, 86, 92, 94, 95, 96, 97, 98, 99, 2000, 01, 02, 2004 ;; Free Software Foundation, Inc. ;; Maintainer: FSF @@ -575,7 +575,7 @@ or `CVS', and any subdirectory that contains a file named `.nosearch'." (if (eq system-type 'ms-dos) (getenv "TMPDIR"))) (setq auto-save-file-name-transforms - (list (list "\\`/[^/]*:\\(.+/\\)*\\(.*\\)" + (list (list (car (car auto-save-file-name-transforms)) ;; Don't put "\\2" inside expand-file-name, since ;; it will be transformed to "/2" on DOS/Windows. (concat temporary-file-directory "\\2") t))) diff --git a/lisp/subr.el b/lisp/subr.el index 39a9caa3106..5382e5c42f7 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -90,7 +90,9 @@ DOCSTRING is an optional documentation string. But documentation strings are usually not useful in nameless functions. INTERACTIVE should be a call to the function `interactive', which see. It may also be omitted. -BODY should be a list of Lisp expressions." +BODY should be a list of Lisp expressions. + +\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)" ;; Note that this definition should not use backquotes; subr.el should not ;; depend on backquote.el. (list 'function (cons 'lambda cdr))) @@ -161,7 +163,7 @@ the return value (nil if RESULT is omitted). (defmacro declare (&rest specs) "Do not evaluate any arguments and return nil. Treated as a declaration when used at the right place in a -`defmacro' form. \(See Info anchor `(elisp)Definition of declare'." +`defmacro' form. \(See Info anchor `(elisp)Definition of declare'.)" nil) (defsubst caar (x) @@ -180,34 +182,34 @@ Treated as a declaration when used at the right place in a "Return the cdr of the cdr of X." (cdr (cdr x))) -(defun last (x &optional n) - "Return the last link of the list X. Its car is the last element. -If X is nil, return nil. -If N is non-nil, return the Nth-to-last link of X. -If N is bigger than the length of X, return X." +(defun last (list &optional n) + "Return the last link of LIST. Its car is the last element. +If LIST is nil, return nil. +If N is non-nil, return the Nth-to-last link of LIST. +If N is bigger than the length of LIST, return LIST." (if n - (let ((m 0) (p x)) + (let ((m 0) (p list)) (while (consp p) (setq m (1+ m) p (cdr p))) (if (<= n 0) p - (if (< n m) (nthcdr (- m n) x) x))) - (while (consp (cdr x)) - (setq x (cdr x))) - x)) + (if (< n m) (nthcdr (- m n) list) list))) + (while (consp (cdr list)) + (setq list (cdr list))) + list)) -(defun butlast (x &optional n) +(defun butlast (list &optional n) "Returns a copy of LIST with the last N elements removed." - (if (and n (<= n 0)) x - (nbutlast (copy-sequence x) n))) + (if (and n (<= n 0)) list + (nbutlast (copy-sequence list) n))) -(defun nbutlast (x &optional n) +(defun nbutlast (list &optional n) "Modifies LIST to remove the last N elements." - (let ((m (length x))) + (let ((m (length list))) (or n (setq n 1)) (and (< n m) (progn - (if (> n 0) (setcdr (nthcdr (- (1- m) n) x) nil)) - x)))) + (if (> n 0) (setcdr (nthcdr (- (1- m) n) list) nil)) + list)))) (defun delete-dups (list) "Destructively remove `equal' duplicates from LIST. @@ -627,7 +629,11 @@ The normal global definition of the character C-x indirects to this keymap.") (defsubst eventp (obj) "True if the argument is an event object." - (or (integerp obj) + (or (and (integerp obj) + ;; Filter out integers too large to be events. + ;; M is the biggest modifier. + (zerop (logand obj (lognot (1- (lsh ?\M-\^@ 1))))) + (characterp (event-basic-type obj))) (and (symbolp obj) (get obj 'event-symbol-elements)) (and (consp obj) @@ -644,14 +650,16 @@ and `down'." (setq type (car type))) (if (symbolp type) (cdr (get type 'event-symbol-elements)) - (let ((list nil)) - (or (zerop (logand type ?\M-\^@)) + (let ((list nil) + (char (logand type (lognot (logior ?\M-\^@ ?\C-\^@ ?\S-\^@ + ?\H-\^@ ?\s-\^@ ?\A-\^@))))) + (if (not (zerop (logand type ?\M-\^@))) (setq list (cons 'meta list))) - (or (and (zerop (logand type ?\C-\^@)) - (>= (logand type 127) 32)) + (if (or (not (zerop (logand type ?\C-\^@))) + (< char 32)) (setq list (cons 'control list))) - (or (and (zerop (logand type ?\S-\^@)) - (= (logand type 255) (downcase (logand type 255)))) + (if (or (not (zerop (logand type ?\S-\^@))) + (/= char (downcase char))) (setq list (cons 'shift list))) (or (zerop (logand type ?\H-\^@)) (setq list (cons 'hyper list))) @@ -843,9 +851,11 @@ and `event-end' functions." (make-obsolete 'dot-min 'point-min "before 19.15") (make-obsolete 'dot-marker 'point-marker "before 19.15") (make-obsolete 'buffer-flush-undo 'buffer-disable-undo "before 19.15") -(make-obsolete 'baud-rate "use the baud-rate variable instead." "before 19.15") +(make-obsolete 'baud-rate "use the `baud-rate' variable instead." "before 19.15") (make-obsolete 'compiled-function-p 'byte-code-function-p "before 19.15") (make-obsolete 'define-function 'defalias "20.1") +(make-obsolete 'focus-frame "it does nothing." "19.32") +(make-obsolete 'unfocus-frame "it does nothing." "19.32") (defun insert-string (&rest args) "Mocklisp-compatibility insert function. @@ -862,8 +872,8 @@ is converted into a string by expressing it in decimal." "Return the value of the `baud-rate' variable." baud-rate) -(defalias 'focus-frame 'ignore) -(defalias 'unfocus-frame 'ignore) +(defalias 'focus-frame 'ignore "") +(defalias 'unfocus-frame 'ignore "") ;;;; Obsolescence declarations for variables. @@ -1112,16 +1122,17 @@ FILE should be the name of a library, with no directory name." "Open a TCP connection for a service to a host. Returns a subprocess-object to represent the connection. Input and output work as for subprocesses; `delete-process' closes it. + Args are NAME BUFFER HOST SERVICE. NAME is name for process. It is modified if necessary to make it unique. -BUFFER is the buffer (or buffer-name) to associate with the process. +BUFFER is the buffer (or buffer name) to associate with the process. Process output goes at end of that buffer, unless you specify an output stream or filter function to handle the output. BUFFER may be also nil, meaning that this process is not associated - with any buffer -Third arg is name of the host to connect to, or its IP address. -Fourth arg SERVICE is name of the service desired, or an integer -specifying a port number to connect to." + with any buffer. +HOST is name of the host to connect to, or its IP address. +SERVICE is name of the service desired, or an integer specifying + a port number to connect to." (make-network-process :name name :buffer buffer :host host :service service)) @@ -1130,14 +1141,14 @@ specifying a port number to connect to." It returns nil if non-blocking connects are not supported; otherwise, it returns a subprocess-object to represent the connection. -This function is similar to `open-network-stream', except that this -function returns before the connection is established. When the -connection is completed, the sentinel function will be called with -second arg matching `open' (if successful) or `failed' (on error). +This function is similar to `open-network-stream', except that it +returns before the connection is established. When the connection +is completed, the sentinel function will be called with second arg +matching `open' (if successful) or `failed' (on error). Args are NAME BUFFER HOST SERVICE SENTINEL FILTER. NAME, BUFFER, HOST, and SERVICE are as for `open-network-stream'. -Optional args, SENTINEL and FILTER specifies the sentinel and filter +Optional args SENTINEL and FILTER specify the sentinel and filter functions to be used for this network stream." (if (featurep 'make-network-process '(:nowait t)) (make-network-process :name name :buffer buffer :nowait t @@ -1155,17 +1166,17 @@ is called for the new process. Args are NAME BUFFER SERVICE SENTINEL FILTER. NAME is name for the server process. Client processes are named by -appending the ip-address and port number of the client to NAME. -BUFFER is the buffer (or buffer-name) to associate with the server -process. Client processes will not get a buffer if a process filter -is specified or BUFFER is nil; otherwise, a new buffer is created for -the client process. The name is similar to the process name. + appending the ip-address and port number of the client to NAME. +BUFFER is the buffer (or buffer name) to associate with the server + process. Client processes will not get a buffer if a process filter + is specified or BUFFER is nil; otherwise, a new buffer is created for + the client process. The name is similar to the process name. Third arg SERVICE is name of the service desired, or an integer -specifying a port number to connect to. It may also be t to selected -an unused port number for the server. -Optional args, SENTINEL and FILTER specifies the sentinel and filter -functions to be used for the client processes; the server process -does not use these function." + specifying a port number to connect to. It may also be t to select + an unused port number for the server. +Optional args SENTINEL and FILTER specify the sentinel and filter + functions to be used for the client processes; the server process + does not use these function." (if (featurep 'make-network-process '(:server t)) (make-network-process :name name :buffer buffer :service service :server t :noquery t @@ -1176,12 +1187,13 @@ does not use these function." ;; compatibility +(make-obsolete 'process-kill-without-query + "use `process-query-on-exit-flag' or `set-process-query-on-exit-flag'." + "21.5") (defun process-kill-without-query (process &optional flag) "Say no query needed if PROCESS is running when Emacs is exited. Optional second argument if non-nil says to require a query. -Value is t if a query was formerly required. -New code should not use this function; use `process-query-on-exit-flag' -or `set-process-query-on-exit-flag' instead." +Value is t if a query was formerly required." (let ((old (process-query-on-exit-flag process))) (set-process-query-on-exit-flag process nil) old)) @@ -1274,7 +1286,7 @@ any other non-digit terminates the character code and is then used as input.")) (defun read-passwd (prompt &optional confirm default) "Read a password, prompting with PROMPT. Echo `.' for each character typed. End with RET, LFD, or ESC. DEL or C-h rubs out. C-u kills line. -Optional argument CONFIRM, if non-nil, then read it twice to make sure. +If optional CONFIRM is non-nil, read password twice to make sure. Optional DEFAULT is a default password to use instead of empty input." (if confirm (let (success) @@ -1323,13 +1335,16 @@ Optional DEFAULT is a default password to use instead of empty input." (let ((n nil)) (when default (setq prompt - (if (string-match "\\(\\):[^:]*" prompt) - (replace-match (format " [%s]" default) t t prompt 1) - (concat prompt (format " [%s] " default))))) + (if (string-match "\\(\\):[ \t]*\\'" prompt) + (replace-match (format " (default %s)" default) t t prompt 1) + (replace-regexp-in-string "[ \t]*\\'" + (format " (default %s) " default) + prompt t t)))) (while (progn (let ((str (read-from-minibuffer prompt nil nil nil nil - (number-to-string default)))) + (and default + (number-to-string default))))) (setq n (cond ((zerop (length str)) default) ((stringp str) (read str))))) @@ -1454,9 +1469,11 @@ menu bar menus and the frame title." (defun momentary-string-display (string pos &optional exit-char message) "Momentarily display STRING in the buffer at POS. -Display remains until next character is typed. -If the char is EXIT-CHAR (optional third arg, default is SPC) it is swallowed; -otherwise it is then available as input (as a command if nothing else). +Display remains until next event is input. +Optional third arg EXIT-CHAR can be a character, event or event +description list. EXIT-CHAR defaults to SPC. If the input is +EXIT-CHAR it is swallowed; otherwise it is then available as +input (as a command if nothing else). Display MESSAGE (optional fourth arg) in the echo area. If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." (or exit-char (setq exit-char ?\ )) @@ -1486,9 +1503,23 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." (recenter 0)))) (message (or message "Type %s to continue editing.") (single-key-description exit-char)) - (let ((char (read-event))) - (or (eq char exit-char) - (setq unread-command-events (list char))))) + (let (char) + (if (integerp exit-char) + (condition-case nil + (progn + (setq char (read-char)) + (or (eq char exit-char) + (setq unread-command-events (list char)))) + (error + ;; `exit-char' is a character, hence it differs + ;; from char, which is an event. + (setq unread-command-events (list char)))) + ;; `exit-char' can be an event, or an event description + ;; list. + (setq char (read-event)) + (or (eq char exit-char) + (eq char (event-convert-list exit-char)) + (setq unread-command-events (list char)))))) (if insert-end (save-excursion (delete-region pos insert-end))) @@ -1509,9 +1540,12 @@ If MESSAGE is nil, instructions to type EXIT-CHAR are displayed there." (overlay-put o1 (pop props) (pop props))) o1)) -(defun remove-overlays (beg end name val) +(defun remove-overlays (&optional beg end name val) "Clear BEG and END of overlays whose property NAME has value VAL. -Overlays might be moved and or split." +Overlays might be moved and/or split. +BEG and END default respectively to the beginning and end of buffer." + (unless beg (setq beg (point-min))) + (unless end (setq end (point-max))) (if (< end beg) (setq beg (prog1 end (setq end beg)))) (save-excursion @@ -1671,26 +1705,27 @@ If UNDO is present and non-nil, it is a function that will be called (if (nth 4 handler) ;; COMMAND (setq this-command (nth 4 handler))))) -(defun insert-buffer-substring-no-properties (buf &optional start end) - "Insert before point a substring of buffer BUFFER, without text properties. +(defun insert-buffer-substring-no-properties (buffer &optional start end) + "Insert before point a substring of BUFFER, without text properties. BUFFER may be a buffer or a buffer name. -Arguments START and END are character numbers specifying the substring. -They default to the beginning and the end of BUFFER." +Arguments START and END are character positions specifying the substring. +They default to the values of (point-min) and (point-max) in BUFFER." (let ((opoint (point))) - (insert-buffer-substring buf start end) + (insert-buffer-substring buffer start end) (let ((inhibit-read-only t)) (set-text-properties opoint (point) nil)))) -(defun insert-buffer-substring-as-yank (buf &optional start end) - "Insert before point a part of buffer BUFFER, stripping some text properties. -BUFFER may be a buffer or a buffer name. Arguments START and END are -character numbers specifying the substring. They default to the -beginning and the end of BUFFER. Strip text properties from the -inserted text according to `yank-excluded-properties'." +(defun insert-buffer-substring-as-yank (buffer &optional start end) + "Insert before point a part of BUFFER, stripping some text properties. +BUFFER may be a buffer or a buffer name. +Arguments START and END are character positions specifying the substring. +They default to the values of (point-min) and (point-max) in BUFFER. +Strip text properties from the inserted text according to +`yank-excluded-properties'." ;; Since the buffer text should not normally have yank-handler properties, ;; there is no need to handle them here. (let ((opoint (point))) - (insert-buffer-substring buf start end) + (insert-buffer-substring buffer start end) (remove-yank-excluded-properties opoint (point)))) @@ -1698,16 +1733,17 @@ inserted text according to `yank-excluded-properties'." (defun start-process-shell-command (name buffer &rest args) "Start a program in a subprocess. Return the process object for it. -Args are NAME BUFFER COMMAND &rest COMMAND-ARGS. NAME is name for process. It is modified if necessary to make it unique. -BUFFER is the buffer or (buffer-name) to associate with the process. +BUFFER is the buffer (or buffer name) to associate with the process. Process output goes at end of that buffer, unless you specify an output stream or filter function to handle the output. BUFFER may be also nil, meaning that this process is not associated with any buffer -Third arg is command name, the name of a shell command. +COMMAND is the name of a shell command. Remaining arguments are the arguments for the command. -Wildcards and redirection are handled as usual in the shell." +Wildcards and redirection are handled as usual in the shell. + +\(fn NAME BUFFER COMMAND &rest COMMAND-ARGS)" (cond ((eq system-type 'vax-vms) (apply 'start-process name buffer args)) @@ -1766,6 +1802,9 @@ See also `with-temp-buffer'." (declare (indent 1) (debug t)) ;; Most of this code is a copy of save-selected-window. `(let ((save-selected-window-window (selected-window)) + ;; It is necessary to save all of these, because calling + ;; select-window changes frame-selected-window for whatever + ;; frame that window is in. (save-selected-window-alist (mapcar (lambda (frame) (list frame (frame-selected-window frame))) (frame-list)))) @@ -1777,7 +1816,6 @@ See also `with-temp-buffer'." (window-live-p (cadr elt)) (set-frame-selected-window (car elt) (cadr elt)))) (if (window-live-p save-selected-window-window) - ;; This is where the code differs from save-selected-window. (select-window save-selected-window-window 'norecord))))) (defmacro with-temp-file (file &rest body) @@ -2051,7 +2089,7 @@ which separates, but is not part of, the substrings. If nil it defaults to `split-string-default-separators', normally \"[ \\f\\t\\n\\r\\v]+\", and OMIT-NULLS is forced to t. -If OMIT-NULLs is t, zero-length substrings are omitted from the list \(so +If OMIT-NULLS is t, zero-length substrings are omitted from the list \(so that for the default value of SEPARATORS leading and trailing whitespace are effectively trimmed). If nil, all zero-length substrings are retained, which correctly parses CSV format, for example. diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index fc178316045..b2f2269c558 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -1,6 +1,6 @@ ;;; w32-win.el --- parse switches controlling interface with W32 window system -;; Copyright (C) 1993, 1994, 2003 Free Software Foundation, Inc. +;; Copyright (C) 1993, 1994, 2003, 2004 Free Software Foundation, Inc. ;; Author: Kevin Gallo ;; Keywords: terminals @@ -76,6 +76,9 @@ (require 'faces) (require 'select) (require 'menu-bar) +(require 'x-dnd) +(require 'code-pages) + ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles (if (fboundp 'new-fontset) (require 'fontset)) @@ -105,7 +108,10 @@ Switch to a buffer editing the last file dropped." (y (cdr coords))) (if (and (> x 0) (> y 0)) (set-frame-selected-window nil window)) - (mapcar 'find-file (car (cdr (cdr event))))) + (mapcar (lambda (file-name) + (x-dnd-handle-one-url window 'private + (concat "file:" file-name))) + (car (cdr (cdr event))))) (raise-frame))) (defun w32-drag-n-drop-other-frame (event) @@ -1255,5 +1261,13 @@ font dialog to get the matching FONTS. Otherwise use a pop-up menu (if (null font) (error "Font not found"))))) +;;; Set default known names for image libraries +(setq image-library-alist + '((xpm "libXpm-nox4.dll" "libxpm.dll") + (png "libpng13d.dll" "libpng13.dll" "libpng12d.dll" "libpng12.dll" "libpng.dll") + (jpeg "jpeg62.dll" "libjpeg.dll" "jpeg-62.dll" "jpeg.dll") + (tiff "libtiff3.dll" "libtiff.dll") + (gif "libungif.dll"))) + ;;; arch-tag: 69fb1701-28c2-4890-b351-3d1fe4b4f166 ;;; w32-win.el ends here diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 074524622c9..ed5bce00f44 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -2438,7 +2438,10 @@ order until succeed.") (defun x-clipboard-yank () "Insert the clipboard contents, or the last stretch of killed text." (interactive) - (let ((clipboard-text (x-get-selection 'CLIPBOARD)) + (let ((clipboard-text + (condition-case nil + (x-get-selection 'CLIPBOARD) + (error nil))) (x-select-enable-clipboard t)) (if (and clipboard-text (> (length clipboard-text) 0)) (kill-new clipboard-text)) diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el index e4f143c3b87..9535d39b1d1 100644 --- a/lisp/textmodes/artist.el +++ b/lisp/textmodes/artist.el @@ -1,6 +1,6 @@ ;;; artist.el --- draw ascii graphics with your mouse -;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. ;; Author: Tomas Abrahamsson <tab@lysator.liu.se> ;; Maintainer: Tomas Abrahamsson <tab@lysator.liu.se> @@ -1698,19 +1698,14 @@ info-variant-part." (t (cons (car l) (artist-butlast (cdr l)))))) -(defun artist-last (seq &optional n) - "Return the last link in the list SEQ. +(defun artist-last (l &optional n) + "Return the last link in the list L. With optional argument N, returns Nth-to-last link (default 1)." - (if (not n) - (setq n 1)) - (let ((len (length seq))) - (elt seq (- len n)))) + (nth (- (length l) (or n 1)) l)) (defun artist-remove-nulls (l) "Remove nils in list L." - (cond ((null l) nil) - ((null (car l)) (artist-remove-nulls (cdr l))) - (t (cons (car l) (artist-remove-nulls (cdr l)))))) + (remq nil l)) (defun artist-uniq (l) "Remove consecutive duplicates in list L. Comparison is done with `equal'." @@ -3368,8 +3363,8 @@ The POINT-LIST is expected to cover the first quadrant." (append right-half left-half))) -(defun artist-draw-ellipse-general (x y x-radius y-radius) - "Draw an ellipse with center at X, Y and X-RADIUS and Y-RADIUS. +(defun artist-draw-ellipse-general (x1 y1 x-radius y-radius) + "Draw an ellipse with center at X1, Y1 and X-RADIUS and Y-RADIUS. Output is an ellipse, which is a list (END-POINT-1 END-POINT-2 SHAPE-INFO). @@ -3379,15 +3374,15 @@ SHAPE-INFO is a two-element vector on the form [POINT-LIST FILL-INFO]. POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR]. FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE]. -Ellipses with zero y-radius are not drawn correctly." +Ellipses with zero Y-RADIUS are not drawn correctly." (let* ((point-list (artist-ellipse-generate-quadrant x-radius y-radius)) (fill-info (artist-ellipse-compute-fill-info point-list)) (shape-info (make-vector 2 0))) (setq point-list (artist-calculate-new-chars point-list)) (setq point-list (artist-ellipse-mirror-quadrant point-list)) - (setq point-list (artist-ellipse-point-list-add-center x y point-list)) - (setq fill-info (artist-ellipse-fill-info-add-center x y fill-info)) + (setq point-list (artist-ellipse-point-list-add-center x1 y1 point-list)) + (setq fill-info (artist-ellipse-fill-info-add-center x1 y1 fill-info)) ;; Draw the ellipse (setq point-list @@ -3404,12 +3399,12 @@ Ellipses with zero y-radius are not drawn correctly." (aset shape-info 0 point-list) (aset shape-info 1 fill-info) - (artist-make-2point-object (artist-make-endpoint x y) + (artist-make-2point-object (artist-make-endpoint x1 y1) (artist-make-endpoint x-radius y-radius) shape-info))) -(defun artist-draw-ellipse-with-0-height (x y x-radius y-radius) - "Draw an ellipse with center at X, Y and X-RADIUS and Y-RADIUS. +(defun artist-draw-ellipse-with-0-height (x1 y1 x-radius y-radius) + "Draw an ellipse with center at X1, Y1 and X-RADIUS and Y-RADIUS. Output is an ellipse, which is a list (END-POINT-1 END-POINT-2 SHAPE-INFO). @@ -3419,10 +3414,10 @@ SHAPE-INFO is a two-element vector on the form [POINT-LIST FILL-INFO]. POINT-LIST is a list of vectors on the form [X Y SAVED-CHAR NEW-CHAR]. FILL-INFO is a list of vectors on the form [X Y ELLIPSE-WIDTH-ON-THIS-LINE]. -The Y-RADIUS must be 0, but the X-RADUIS must not be 0." +The Y-RADIUS must be 0, but the X-RADIUS must not be 0." (let ((point-list nil) (width (max (- (abs (* 2 x-radius)) 1))) - (left-edge (1+ (- x (abs x-radius)))) + (left-edge (1+ (- x1 (abs x-radius)))) (line-char (if artist-line-char-set artist-line-char ?-)) (i 0) (point-list nil) @@ -3430,7 +3425,7 @@ The Y-RADIUS must be 0, but the X-RADUIS must not be 0." (shape-info (make-vector 2 0))) (while (< i width) (let* ((line-x (+ left-edge i)) - (line-y y) + (line-y y1) (new-coord (artist-new-coord line-x line-y))) (artist-coord-add-saved-char new-coord (artist-get-char-at-xy line-x line-y)) @@ -3440,7 +3435,7 @@ The Y-RADIUS must be 0, but the X-RADUIS must not be 0." (setq i (1+ i)))) (aset shape-info 0 point-list) (aset shape-info 1 fill-info) - (artist-make-2point-object (artist-make-endpoint x y) + (artist-make-2point-object (artist-make-endpoint x1 y1) (artist-make-endpoint x-radius y-radius) shape-info))) @@ -3954,7 +3949,7 @@ The 2-point shape SHAPE is drawn from X1, Y1 to X2, Y2." (defun artist-draw-region-trim-line-endings (min-y max-y) "Trim lines in current draw-region from MIN-Y to MAX-Y. -Trimming here means removing white space at end of a line" +Trimming here means removing white space at end of a line." ;; Safetyc check: switch min-y and max-y if if max-y is smaller (if (< max-y min-y) (let ((tmp min-y)) @@ -4286,7 +4281,7 @@ If optional argument THIS-IS-LAST-POINT is non-nil, this point is the last." (defun artist-key-set-point-common (arg) "Common routine for setting point in current shape. -With ARG set to t, set the last point." +With non-nil ARG, set the last point." (let ((draw-how (artist-go-get-draw-how-from-symbol artist-curr-go)) (col (artist-current-column)) (row (artist-current-line)) @@ -4793,7 +4788,7 @@ If optional argument STATE is positive, turn borders on." (defun artist-mouse-choose-operation (ev op) - "Choose operation for evenvt EV and operation OP." + "Choose operation for event EV and operation OP." (interactive (progn (select-window (posn-window (event-start last-input-event))) diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el index 82b15cf4eb5..15348205c51 100644 --- a/lisp/textmodes/bibtex.el +++ b/lisp/textmodes/bibtex.el @@ -1,6 +1,7 @@ ;;; bibtex.el --- BibTeX mode for GNU Emacs -;; Copyright (C) 1992,94,95,96,97,98,1999,2003 Free Software Foundation, Inc. +;; Copyright (C) 1992,94,95,96,97,98,1999,2003,2004 +;; Free Software Foundation, Inc. ;; Author: Stefan Schoef <schoef@offis.uni-oldenburg.de> ;; Bengt Martensson <bengt@mathematik.uni-Bremen.de> @@ -811,6 +812,7 @@ If non-nil, the column for the equal sign is the value of (define-key km "\C-c\M-y" 'bibtex-yank-pop) (define-key km "\C-c\C-d" 'bibtex-empty-field) (define-key km "\C-c\C-f" 'bibtex-make-field) + (define-key km "\C-c\C-u" 'bibtex-entry-update) (define-key km "\C-c$" 'bibtex-ispell-abstract) (define-key km "\M-\C-a" 'bibtex-beginning-of-entry) (define-key km "\M-\C-e" 'bibtex-end-of-entry) @@ -1122,44 +1124,6 @@ function `bibtex-parse-field-name'.") '(bibtex-mode "@\\S(*\\s(" "\\s)" nil bibtex-hs-forward-sexp nil)) -(defconst bibtex-braced-string-syntax-table - (let ((st (make-syntax-table))) - (modify-syntax-entry ?\{ "(}" st) - (modify-syntax-entry ?\} "){" st) - (modify-syntax-entry ?\[ "." st) - (modify-syntax-entry ?\] "." st) - (modify-syntax-entry ?\( "." st) - (modify-syntax-entry ?\) "." st) - (modify-syntax-entry ?\\ "." st) - (modify-syntax-entry ?\" "." st) - st) - "Syntax-table to parse matched braces.") - -(defconst bibtex-quoted-string-syntax-table - (let ((st (make-syntax-table))) - (modify-syntax-entry ?\\ "\\" st) - (modify-syntax-entry ?\" "\"" st) - st) - "Syntax-table to parse matched quotes.") - -(defun bibtex-parse-field-string () - "Parse a field string enclosed by braces or quotes. -If a syntactically correct string is found, a pair containing the start and -end position of the field string is returned, nil otherwise." - (let ((end-point - (or (and (eq (following-char) ?\") - (save-excursion - (with-syntax-table bibtex-quoted-string-syntax-table - (forward-sexp 1)) - (point))) - (and (eq (following-char) ?\{) - (save-excursion - (with-syntax-table bibtex-braced-string-syntax-table - (forward-sexp 1)) - (point)))))) - (if end-point - (cons (point) end-point)))) - (defun bibtex-parse-association (parse-lhs parse-rhs) "Parse a string of the format <left-hand-side = right-hand-side>. The functions PARSE-LHS and PARSE-RHS are used to parse the corresponding @@ -1199,6 +1163,44 @@ BibTeX field as necessary." ;; Now try again. (bibtex-parse-field-name)))) +(defconst bibtex-braced-string-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\{ "(}" st) + (modify-syntax-entry ?\} "){" st) + (modify-syntax-entry ?\[ "." st) + (modify-syntax-entry ?\] "." st) + (modify-syntax-entry ?\( "." st) + (modify-syntax-entry ?\) "." st) + (modify-syntax-entry ?\\ "." st) + (modify-syntax-entry ?\" "." st) + st) + "Syntax-table to parse matched braces.") + +(defconst bibtex-quoted-string-syntax-table + (let ((st (make-syntax-table))) + (modify-syntax-entry ?\\ "\\" st) + (modify-syntax-entry ?\" "\"" st) + st) + "Syntax-table to parse matched quotes.") + +(defun bibtex-parse-field-string () + "Parse a field string enclosed by braces or quotes. +If a syntactically correct string is found, a pair containing the start and +end position of the field string is returned, nil otherwise." + (let ((end-point + (or (and (eq (following-char) ?\") + (save-excursion + (with-syntax-table bibtex-quoted-string-syntax-table + (forward-sexp 1)) + (point))) + (and (eq (following-char) ?\{) + (save-excursion + (with-syntax-table bibtex-braced-string-syntax-table + (forward-sexp 1)) + (point)))))) + (if end-point + (cons (point) end-point)))) + (defun bibtex-parse-field-text () "Parse the text part of a BibTeX field. The text part is either a string, or an empty string, or a constant followed @@ -1410,7 +1412,7 @@ delimiters if present." (let ((content (buffer-substring-no-properties (nth 0 (cdr bounds)) (nth 1 (cdr bounds))))) (if (and remove-delim - (string-match "\\`{\\(.*\\)}\\'" content)) + (string-match "\\`[{\"]\\(.*\\)[}\"]\\'" content)) (substring content (match-beginning 1) (match-end 1)) content))) @@ -1455,16 +1457,6 @@ The value is actually the tail of LIST whose car matches STRING." (setq list (cdr list))) list)) -(defun bibtex-assoc-of-regexp (string alist) - "Return non-nil if STRING is exactly matched by the car of an -element of ALIST (case ignored). The value is actually the element -of LIST whose car matches STRING." - (let ((case-fold-search t)) - (while (and alist - (not (string-match (concat "\\`\\(?:" (caar alist) "\\)\\'") string))) - (setq alist (cdr alist))) - (car alist))) - (defun bibtex-skip-to-valid-entry (&optional backward) "Unless at beginning of a valid BibTeX entry, move point to beginning of the next valid one. With optional argument BACKWARD non-nil, move backward to @@ -1510,7 +1502,7 @@ FUN will not be called for @String entries." (save-excursion (if (or (and (not bibtex-sort-ignore-string-entries) (string-equal "string" (downcase entry-type))) - (assoc-ignore-case entry-type bibtex-entry-field-alist)) + (assoc-string entry-type bibtex-entry-field-alist t)) (funcall fun key beg end))) (goto-char end))))) @@ -1519,8 +1511,8 @@ FUN will not be called for @String entries." If FLAG is a string, the message is initialized (in this case a value for INTERVAL may be given as well (if not this is set to 5)). If FLAG is done, the message is deinitialized. -If FLAG is absent, a message is echoed if point was incremented -at least INTERVAL percent since last message was echoed." +If FLAG is nil, a message is echoed if point was incremented at least +`bibtex-progress-interval' percent since last message was echoed." (cond ((stringp flag) (setq bibtex-progress-lastmes flag) (setq bibtex-progress-interval (or interval 5) @@ -1685,11 +1677,11 @@ are defined, but only for the head part of the entry "Try to avoid point being at end of a BibTeX field." (end-of-line) (skip-chars-backward " \t") - (cond ((= (preceding-char) ?,) - (forward-char -2))) - (cond ((or (= (preceding-char) ?}) - (= (preceding-char) ?\")) - (forward-char -1)))) + (if (= (preceding-char) ?,) + (forward-char -2)) + (if (or (= (preceding-char) ?}) + (= (preceding-char) ?\")) + (forward-char -1))) (defun bibtex-enclosing-field (&optional noerr) "Search for BibTeX field enclosing point. Point moves to end of field. @@ -1749,6 +1741,15 @@ Beginning (but not end) of entry is given by (`match-beginning' 0)." (error "Unknown tag field: %s. Please submit a bug report" bibtex-last-kill-command)))))) +(defun bibtex-assoc-regexp (regexp alist) + "Return non-nil if REGEXP matches the car of an element of ALIST. +The value is actually the element of ALIST matched by REGEXP. +Case is ignored if `case-fold-search' is non-nil in the current buffer." + (while (and alist + (not (string-match regexp (caar alist)))) + (setq alist (cdr alist))) + (car alist)) + (defun bibtex-format-entry () "Helper function for `bibtex-clean-entry'. Formats current entry according to variable `bibtex-entry-format'." @@ -1763,18 +1764,17 @@ Formats current entry according to variable `bibtex-entry-format'." unify-case inherit-booktitle) bibtex-entry-format)) crossref-key bounds alternatives-there non-empty-alternative - entry-list req creq field-done field-list) + entry-list req-field-list field-done field-list) ;; identify entry type (goto-char (point-min)) (re-search-forward bibtex-entry-type) (let ((beg-type (1+ (match-beginning 0))) (end-type (match-end 0))) - (setq entry-list (assoc-ignore-case (buffer-substring-no-properties - beg-type end-type) - bibtex-entry-field-alist) - req (nth 0 (nth 1 entry-list)) ; required part - creq (nth 0 (nth 2 entry-list))) ; crossref part + (setq entry-list (assoc-string (buffer-substring-no-properties + beg-type end-type) + bibtex-entry-field-alist + t)) ;; unify case of entry name (when (memq 'unify-case format) @@ -1791,20 +1791,32 @@ Formats current entry according to variable `bibtex-entry-format'." ;; determine if entry has crossref field and if at least ;; one alternative is non-empty (goto-char (point-min)) - (while (setq bounds (bibtex-search-forward-field - bibtex-field-name)) - (goto-char (bibtex-start-of-name-in-field bounds)) - (cond ((looking-at "ALT") - (setq alternatives-there t) - (goto-char (bibtex-start-of-text-in-field bounds)) - (if (not (looking-at bibtex-empty-field-re)) - (setq non-empty-alternative t))) - ((and (looking-at "\\(OPT\\)?crossref\\>") - (progn (goto-char (bibtex-start-of-text-in-field bounds)) - (not (looking-at bibtex-empty-field-re)))) - (setq crossref-key - (bibtex-text-in-field-bounds bounds t)))) - (goto-char (bibtex-end-of-field bounds))) + (let* ((fields-alist (bibtex-parse-entry)) + (case-fold-search t) + (field (bibtex-assoc-regexp "\\`\\(OPT\\)?crossref\\'" + fields-alist))) + (setq crossref-key (and field + (not (string-match bibtex-empty-field-re + (cdr field))) + (cdr field)) + req-field-list (if crossref-key + (nth 0 (nth 2 entry-list)) ; crossref part + (nth 0 (nth 1 entry-list)))) ; required part + + (dolist (rfield req-field-list) + (when (nth 3 rfield) ; we should have an alternative + (setq alternatives-there t + field (bibtex-assoc-regexp + (concat "\\`\\(ALT\\)?" (car rfield) "\\'") + fields-alist)) + (if (and field + (not (string-match bibtex-empty-field-re + (cdr field)))) + (cond ((not non-empty-alternative) + (setq non-empty-alternative t)) + ((memq 'required-fields format) + (error "More than one non-empty alternative."))))))) + (if (and alternatives-there (not non-empty-alternative) (memq 'required-fields format)) @@ -1832,18 +1844,23 @@ Formats current entry according to variable `bibtex-entry-format'." ;; quite some redundancy compared with what we need to do ;; anyway. So for speed-up we avoid using them. - (when (and opt-alt - (memq 'opts-or-alts format)) - (if empty-field - ;; Either it is an empty ALT field. Then we have checked - ;; already that we have one non-empty alternative. - ;; Or it is an empty OPT field that we do not miss anyway. - ;; So we can safely delete this field. - (progn (delete-region beg-field end-field) - (setq deleted t)) - ;; otherwise: not empty, delete "OPT" or "ALT" - (goto-char beg-name) - (delete-char 3))) + (if (memq 'opts-or-alts format) + (cond ((and empty-field + (or opt-alt + (let ((field (assoc-string + field-name req-field-list t))) + (or (not field) ; OPT field + (nth 3 field))))) ; ALT field + ;; Either it is an empty ALT field. Then we have checked + ;; already that we have one non-empty alternative. Or it + ;; is an empty OPT field that we do not miss anyway. + ;; So we can safely delete this field. + (delete-region beg-field end-field) + (setq deleted t)) + ;; otherwise: not empty, delete "OPT" or "ALT" + (opt-alt + (goto-char beg-name) + (delete-char 3)))) (unless deleted (push field-name field-list) @@ -1902,16 +1919,17 @@ Formats current entry according to variable `bibtex-entry-format'." ;; if empty field, complain (if (and empty-field (memq 'required-fields format) - (assoc-ignore-case field-name - (if crossref-key creq req))) + (assoc-string field-name req-field-list t)) (error "Mandatory field `%s' is empty" field-name)) ;; unify case of field name (if (memq 'unify-case format) - (let ((fname (car (assoc-ignore-case - field-name (append (nth 0 (nth 1 entry-list)) - (nth 1 (nth 1 entry-list)) - bibtex-user-optional-fields))))) + (let ((fname (car (assoc-string + field-name + (append (nth 0 (nth 1 entry-list)) + (nth 1 (nth 1 entry-list)) + bibtex-user-optional-fields) + t)))) (if fname (progn (delete-region beg-name end-name) @@ -1925,8 +1943,8 @@ Formats current entry according to variable `bibtex-entry-format'." ;; check whether all required fields are present (if (memq 'required-fields format) - (let (altlist (found 0)) - (dolist (fname (if crossref-key creq req)) + (let ((found 0) altlist) + (dolist (fname req-field-list) (if (nth 3 fname) (push (car fname) altlist)) (unless (or (member (car fname) field-list) @@ -1940,7 +1958,7 @@ Formats current entry according to variable `bibtex-entry-format'." (error "Alternative mandatory field `%s' is missing" altlist)) ((> found 1) - (error "Alternative fields `%s' is defined %s times" + (error "Alternative fields `%s' are defined %s times" altlist found)))))) ;; update point @@ -2051,8 +2069,8 @@ and return results as a list." (setq titlestring (substring titlestring 0 (match-beginning 0)))))) ;; gather words from titlestring into a list. Ignore ;; specific words and use only a specific amount of words. - (let (case-fold-search titlewords titlewords-extra titleword end-match - (counter 0)) + (let ((counter 0) + case-fold-search titlewords titlewords-extra titleword end-match) (while (and (or (not (numberp bibtex-autokey-titlewords)) (< counter (+ bibtex-autokey-titlewords bibtex-autokey-titlewords-stretch))) @@ -2079,10 +2097,14 @@ and return results as a list." "Do some abbreviations on TITLEWORD. The rules are defined in `bibtex-autokey-titleword-abbrevs' and `bibtex-autokey-titleword-length'." - (let ((abbrev (bibtex-assoc-of-regexp - titleword bibtex-autokey-titleword-abbrevs))) - (if abbrev - (cdr abbrev) + (let ((case-folde-search t) + (alist bibtex-autokey-titleword-abbrevs)) + (while (and alist + (not (string-match (concat "\\`\\(?:" (caar alist) "\\)\\'") + titleword))) + (setq alist (cdr alist))) + (if alist + (cdar alist) (bibtex-autokey-abbrev titleword bibtex-autokey-titleword-length)))) @@ -2239,8 +2261,8 @@ Return alist of keys if parsing was completed, `aborted' otherwise." ;; This is a crossref. (buffer-substring-no-properties (1+ (match-beginning 3)) (1- (match-end 3)))) - ((assoc-ignore-case (bibtex-type-in-head) - bibtex-entry-field-alist) + ((assoc-string (bibtex-type-in-head) + bibtex-entry-field-alist t) ;; This is an entry. (match-string-no-properties bibtex-key-in-head))))) (if (and (stringp key) @@ -2295,7 +2317,7 @@ Return alist of strings if parsing was completed, `aborted' otherwise." ;; user has aborted by typing a key --> return `aborted' (throw 'userkey 'aborted)) (setq key (bibtex-reference-key-in-string bounds)) - (if (not (assoc-ignore-case key strings)) + (if (not (assoc key strings)) (push (cons key (bibtex-text-in-string bounds t)) strings)) (goto-char (bibtex-end-of-text-in-string bounds))) @@ -2384,6 +2406,7 @@ of a word, all strings are listed. Return completion." (display-completion-list (all-completions part-of-word completions))) (message "Making completion list...done") + ;; return value is handled by choose-completion-string-functions nil)))) (defun bibtex-complete-string-cleanup (str) @@ -2629,6 +2652,34 @@ non-nil. (easy-menu-add bibtex-entry-menu) (run-hooks 'bibtex-mode-hook)) +(defun bibtex-field-list (entry-type) + "Return list of allowed fields for entry ENTRY-TYPE. +More specifically, the return value is a cons pair (REQUIRED . OPTIONAL), +where REQUIRED and OPTIONAL are lists of the required and optional field +names for ENTRY-TYPE according to `bibtex-entry-field-alist'." + (let ((e (assoc-string entry-type bibtex-entry-field-alist t)) + required optional) + (unless e + (error "Bibtex entry type %s not defined" entry-type)) + (if (and (member-ignore-case entry-type bibtex-include-OPTcrossref) + (nth 2 e)) + (setq required (nth 0 (nth 2 e)) + optional (nth 1 (nth 2 e))) + (setq required (nth 0 (nth 1 e)) + optional (nth 1 (nth 1 e)))) + (if bibtex-include-OPTkey + (push (list "key" + "Used for reference key creation if author and editor fields are missing" + (if (or (stringp bibtex-include-OPTkey) + (fboundp bibtex-include-OPTkey)) + bibtex-include-OPTkey)) + optional)) + (if (member-ignore-case entry-type bibtex-include-OPTcrossref) + (push '("crossref" "Reference key of the cross-referenced entry") + optional)) + (setq optional (append optional bibtex-user-optional-fields)) + (cons required optional))) + (defun bibtex-entry (entry-type) "Insert a new BibTeX entry. After insertion it calls the functions in `bibtex-add-entry-hook'." @@ -2638,38 +2689,17 @@ After insertion it calls the functions in `bibtex-add-entry-hook'." bibtex-entry-field-alist nil t nil 'bibtex-entry-type-history))) (list e-t))) - (let* (required optional - (key (if bibtex-maintain-sorted-entries - (bibtex-read-key (format "%s key: " entry-type)))) - (e (assoc-ignore-case entry-type bibtex-entry-field-alist)) - (r-n-o (elt e 1)) - (c-ref (elt e 2))) - (if (not e) - (error "Bibtex entry type %s not defined" entry-type)) - (if (and (member entry-type bibtex-include-OPTcrossref) - c-ref) - (setq required (elt c-ref 0) - optional (elt c-ref 1)) - (setq required (elt r-n-o 0) - optional (elt r-n-o 1))) + (let ((key (if bibtex-maintain-sorted-entries + (bibtex-read-key (format "%s key: " entry-type)))) + (field-list (bibtex-field-list entry-type))) (unless (bibtex-prepare-new-entry (list key nil entry-type)) (error "Entry with key `%s' already exists" key)) (indent-to-column bibtex-entry-offset) (insert "@" entry-type (bibtex-entry-left-delimiter)) - (if key - (insert key)) + (if key (insert key)) (save-excursion - (mapcar 'bibtex-make-field required) - (if (member entry-type bibtex-include-OPTcrossref) - (bibtex-make-optional-field '("crossref"))) - (if bibtex-include-OPTkey - (if (or (stringp bibtex-include-OPTkey) - (fboundp bibtex-include-OPTkey)) - (bibtex-make-optional-field - (list "key" nil bibtex-include-OPTkey)) - (bibtex-make-optional-field '("key")))) - (mapcar 'bibtex-make-optional-field optional) - (mapcar 'bibtex-make-optional-field bibtex-user-optional-fields) + (mapcar 'bibtex-make-field (car field-list)) + (mapcar 'bibtex-make-optional-field (cdr field-list)) (if bibtex-comma-after-last-field (insert ",")) (insert "\n") @@ -2680,15 +2710,39 @@ After insertion it calls the functions in `bibtex-add-entry-hook'." (bibtex-autofill-entry)) (run-hooks 'bibtex-add-entry-hook))) +(defun bibtex-entry-update () + "Update an existing BibTeX entry. +In the BibTeX entry at point, make new fields for those items that may occur +according to `bibtex-entry-field-alist', but are not yet present." + (interactive) + (save-excursion + (bibtex-beginning-of-entry) + ;; For inserting new fields, we use the fact that + ;; bibtex-parse-entry moves point to the end of the last field. + (let* ((fields-alist (bibtex-parse-entry)) + (field-list (bibtex-field-list + (substring (cdr (assoc "=type=" fields-alist)) + 1))) ; don't want @ + (case-fold-search t)) + (dolist (field (car field-list)) + (unless (bibtex-assoc-regexp (concat "\\`\\(ALT\\)?" (car field) "\\'") + fields-alist) + (bibtex-make-field field))) + (dolist (field (cdr field-list)) + (unless (bibtex-assoc-regexp (concat "\\`\\(OPT\\)?" (car field) "\\'") + fields-alist) + (bibtex-make-optional-field field)))))) + (defun bibtex-parse-entry () "Parse entry at point, return an alist. The alist elements have the form (FIELD . TEXT), where FIELD can also be -the special strings \"=type=\" and \"=key=\"." +the special strings \"=type=\" and \"=key=\". For the FIELD \"=key=\" +TEXT may be nil. Move point to the end of the last field." (let (alist bounds) - (when (looking-at bibtex-entry-head) + (when (looking-at bibtex-entry-maybe-empty-head) (push (cons "=type=" (match-string bibtex-type-in-head)) alist) (push (cons "=key=" (match-string bibtex-key-in-head)) alist) - (goto-char (match-end bibtex-key-in-head)) + (goto-char (match-end 0)) (while (setq bounds (bibtex-parse-field bibtex-field-name)) (push (cons (bibtex-name-in-field bounds) (bibtex-text-in-field-bounds bounds)) @@ -2744,7 +2798,7 @@ the special strings \"=type=\" and \"=key=\"." (let* ((name (buffer-substring (if (looking-at "ALT\\|OPT") (match-end 0) (point)) (bibtex-end-of-name-in-field bounds))) - (text (assoc-ignore-case name other))) + (text (assoc-string name other t))) (goto-char (bibtex-start-of-text-in-field bounds)) (if (not (and (looking-at bibtex-empty-field-re) text)) (goto-char (bibtex-end-of-field bounds)) @@ -2774,28 +2828,15 @@ the special strings \"=type=\" and \"=key=\"." (looking-at "OPT\\|ALT")) (match-end 0) mb) (bibtex-end-of-name-in-field bounds))) - (entry-type (progn (re-search-backward - bibtex-entry-maybe-empty-head nil t) - (bibtex-type-in-head))) - (entry-list (assoc-ignore-case entry-type - bibtex-entry-field-alist)) - (c-r-list (elt entry-list 2)) - (req-opt-list (if (and (member entry-type - bibtex-include-OPTcrossref) - c-r-list) - c-r-list - (elt entry-list 1))) - (list-of-entries (append (elt req-opt-list 0) - (elt req-opt-list 1) - bibtex-user-optional-fields - (if (member entry-type - bibtex-include-OPTcrossref) - '(("crossref" "Reference key of the cross-referenced entry"))) - (if bibtex-include-OPTkey - '(("key" "Used for reference key creation if author and editor fields are missing"))))) - (comment (assoc-ignore-case field-name list-of-entries))) + (field-list (bibtex-field-list (progn (re-search-backward + bibtex-entry-maybe-empty-head nil t) + (bibtex-type-in-head)))) + (comment (assoc-string field-name + (append (car field-list) + (cdr field-list)) + t))) (if comment - (message (elt comment 1)) + (message (nth 1 comment)) (message "No comment available"))))) (defun bibtex-make-field (field &optional called-by-yank) @@ -2804,24 +2845,13 @@ FIELD is either a string or a list of the form \(FIELD-NAME COMMENT-STRING INIT ALTERNATIVE-FLAG) as in `bibtex-entry-field-alist'." (interactive - (list (let* ((entry-type - (save-excursion - (bibtex-enclosing-entry-maybe-empty-head) - (bibtex-type-in-head))) - ;; "preliminary" completion list - (fl (nth 1 (assoc-ignore-case - entry-type bibtex-entry-field-alist))) - ;; "full" completion list - (field-list (append (nth 0 fl) - (nth 1 fl) - bibtex-user-optional-fields - (if (member entry-type - bibtex-include-OPTcrossref) - '(("crossref"))) - (if bibtex-include-OPTkey - '(("key"))))) - (completion-ignore-case t)) - (completing-read "BibTeX field name: " field-list + (list (let ((completion-ignore-case t) + (field-list (bibtex-field-list + (save-excursion + (bibtex-enclosing-entry-maybe-empty-head) + (bibtex-type-in-head))))) + (completing-read "BibTeX field name: " + (append (car field-list) (cdr field-list)) nil nil nil bibtex-field-history)))) (unless (consp field) (setq field (list field))) @@ -2848,8 +2878,9 @@ FIELD is either a string or a list of the form ((fboundp init) (insert (funcall init))))) (if (not called-by-yank) (insert (bibtex-field-right-delimiter))) - (if (interactive-p) - (forward-char -1))) + (when (interactive-p) + (forward-char -1) + (bibtex-print-help-message))) (defun bibtex-beginning-of-entry () "Move to beginning of BibTeX entry (beginning of line). @@ -2982,13 +3013,14 @@ the entries of the BibTeX buffer. Return nil if no entry found." "\\(OPT\\)?crossref" t))) (list key (if bounds (bibtex-text-in-field-bounds bounds t)) - entry-name)))) - (list key nil entry-name))))) + entry-name))) + (list key nil entry-name)))))) (defun bibtex-lessp (index1 index2) "Predicate for sorting BibTeX entries with indices INDEX1 and INDEX2. Each index is a list (KEY CROSSREF-KEY ENTRY-NAME). -The predicate depends on the variable `bibtex-maintain-sorted-entries'." +The predicate depends on the variable `bibtex-maintain-sorted-entries'. +If its value is nil use plain sorting." (cond ((not index1) (not index2)) ; indices can be nil ((not index2) nil) ((equal bibtex-maintain-sorted-entries 'crossref) @@ -3017,12 +3049,10 @@ The predicate depends on the variable `bibtex-maintain-sorted-entries'." (defun bibtex-sort-buffer () "Sort BibTeX buffer alphabetically by key. The predicate for sorting is defined via `bibtex-maintain-sorted-entries'. -Text outside of BibTeX entries is not affected. If -`bibtex-sort-ignore-string-entries' is non-nil, @String entries will be -ignored." +If its value is nil use plain sorting. Text outside of BibTeX entries is not +affected. If `bibtex-sort-ignore-string-entries' is non-nil, @String entries +will be ignored." (interactive) - (unless bibtex-maintain-sorted-entries - (error "You must choose a sorting scheme")) (save-restriction (narrow-to-region (bibtex-beginning-of-first-entry) (save-excursion (goto-char (point-max)) @@ -3212,8 +3242,8 @@ Returns t if test was successful, nil otherwise." (let* ((entry-list (progn (goto-char beg) (bibtex-search-entry nil end) - (assoc-ignore-case (bibtex-type-in-head) - bibtex-entry-field-alist))) + (assoc-string (bibtex-type-in-head) + bibtex-entry-field-alist t))) (req (copy-sequence (elt (elt entry-list 1) 0))) (creq (copy-sequence (elt (elt entry-list 2) 0))) crossref-there bounds) @@ -3229,8 +3259,8 @@ Returns t if test was successful, nil otherwise." (push (list (bibtex-current-line) "Questionable month field") error-list)) - (setq req (delete (assoc-ignore-case field-name req) req) - creq (delete (assoc-ignore-case field-name creq) creq)) + (setq req (delete (assoc-string field-name req t) req) + creq (delete (assoc-string field-name creq t) creq)) (if (equal field-name "crossref") (setq crossref-there t)))) (if crossref-there @@ -3523,27 +3553,30 @@ At end of the cleaning process, the functions in (match-end bibtex-key-in-head))) (insert key)) ;; sorting - (let* ((start (bibtex-beginning-of-entry)) - (end (progn (bibtex-end-of-entry) - (if (re-search-forward - bibtex-entry-maybe-empty-head nil 'move) - (goto-char (match-beginning 0))) - (point))) - (entry (buffer-substring start end)) - (index (progn (goto-char start) - (bibtex-entry-index)))) - (delete-region start end) - (unless (prog1 (or called-by-reformat - (if (and bibtex-maintain-sorted-entries - (not (and bibtex-sort-ignore-string-entries - (equal entry-type "string")))) - (bibtex-prepare-new-entry index) - (not (bibtex-find-entry (car index))))) - (insert entry) - (forward-char -1) - (bibtex-beginning-of-entry) ; moves backward - (re-search-forward bibtex-entry-head)) - (error "New inserted entry yields duplicate key"))) + (unless called-by-reformat + (let* ((start (bibtex-beginning-of-entry)) + (end (progn (bibtex-end-of-entry) + (if (re-search-forward + bibtex-entry-maybe-empty-head nil 'move) + (goto-char (match-beginning 0))) + (point))) + (entry (buffer-substring start end)) + (index (progn (goto-char start) + (bibtex-entry-index))) + no-error) + (if (and bibtex-maintain-sorted-entries + (not (and bibtex-sort-ignore-string-entries + (equal entry-type "string")))) + (progn + (delete-region start end) + (setq no-error (bibtex-prepare-new-entry index)) + (insert entry) + (forward-char -1) + (bibtex-beginning-of-entry) ; moves backward + (re-search-forward bibtex-entry-head)) + (setq no-error (bibtex-find-entry (car index)))) + (unless no-error + (error "New inserted entry yields duplicate key")))) ;; final clean up (unless called-by-reformat (save-excursion @@ -3621,91 +3654,89 @@ If `bibtex-align-at-equal-sign' is non-nil, align equal signs, too." (indent-to-column bibtex-entry-offset) (goto-char pnt))) -(defun bibtex-reformat (&optional additional-options called-by-convert-alien) +(defun bibtex-realign () + "Realign BibTeX entries such that they are separated by one blank line." + (goto-char (point-min)) + (let ((case-fold-search t)) + (when (looking-at bibtex-valid-entry-whitespace-re) + (replace-match "\\1")) + (while (re-search-forward bibtex-valid-entry-whitespace-re nil t) + (replace-match "\n\n\\1")))) + +(defun bibtex-reformat (&optional read-options) "Reformat all BibTeX entries in buffer or region. With prefix argument, read options for reformatting from minibuffer. With \\[universal-argument] \\[universal-argument] prefix argument, reuse previous answers (if any) again. -If mark is active it reformats entries in region, if not in whole buffer." +If mark is active reformat entries in region, if not in whole buffer." (interactive "*P") (let* ((pnt (point)) (use-previous-options - (and (equal (prefix-numeric-value additional-options) 16) + (and (equal (prefix-numeric-value read-options) 16) (or bibtex-reformat-previous-options bibtex-reformat-previous-reference-keys))) (bibtex-entry-format - (if additional-options + (if read-options (if use-previous-options bibtex-reformat-previous-options (setq bibtex-reformat-previous-options - (delq nil (list - (if (or called-by-convert-alien - (y-or-n-p "Realign entries (recommended)? ")) - 'realign) - (if (y-or-n-p "Remove empty optional and alternative fields? ") - 'opts-or-alts) - (if (y-or-n-p "Remove delimiters around pure numerical fields? ") - 'numerical-fields) - (if (y-or-n-p (concat (if bibtex-comma-after-last-field "Insert" "Remove") - " comma at end of entry? ")) - 'last-comma) - (if (y-or-n-p "Replace double page dashes by single ones? ") - 'page-dashes) - (if (y-or-n-p "Force delimiters? ") - 'delimiters) - (if (y-or-n-p "Unify case of entry types and field names? ") - 'unify-case))))) + (mapcar (lambda (option) + (if (y-or-n-p (car option)) (cdr option))) + `(("Realign entries (recommended)? " . 'realign) + ("Remove empty optional and alternative fields? " . 'opts-or-alts) + ("Remove delimiters around pure numerical fields? " . 'numerical-fields) + (,(concat (if bibtex-comma-after-last-field "Insert" "Remove") + " comma at end of entry? ") . 'last-comma) + ("Replace double page dashes by single ones? " . 'page-dashes) + ("Force delimiters? " . 'delimiters) + ("Unify case of entry types and field names? " . 'unify-case))))) '(realign))) - (reformat-reference-keys (if additional-options - (if use-previous-options - bibtex-reformat-previous-reference-keys - (setq bibtex-reformat-previous-reference-keys - (y-or-n-p "Generate new reference keys automatically? "))))) - bibtex-autokey-edit-before-use - (bibtex-sort-ignore-string-entries t) + (reformat-reference-keys + (if read-options + (if use-previous-options + bibtex-reformat-previous-reference-keys + (setq bibtex-reformat-previous-reference-keys + (y-or-n-p "Generate new reference keys automatically? "))))) (start-point (if (bibtex-mark-active) (region-beginning) - (bibtex-beginning-of-first-entry) - (bibtex-skip-to-valid-entry) - (point))) + (point-min))) (end-point (if (bibtex-mark-active) (region-end) - (point-max)))) + (point-max))) + (bibtex-sort-ignore-string-entries t) + bibtex-autokey-edit-before-use) + (save-restriction (narrow-to-region start-point end-point) - (when (memq 'realign bibtex-entry-format) - (goto-char (point-min)) - (while (re-search-forward bibtex-valid-entry-whitespace-re nil t) - (replace-match "\n\\1"))) + (if (memq 'realign bibtex-entry-format) + (bibtex-realign)) (goto-char start-point) (bibtex-progress-message "Formatting" 1) (bibtex-map-entries (lambda (key beg end) (bibtex-progress-message) - (bibtex-clean-entry reformat-reference-keys t) - (when (memq 'realign bibtex-entry-format) - (goto-char end) - (bibtex-delete-whitespace) - (open-line 2)))) + (bibtex-clean-entry reformat-reference-keys t))) + (when (memq 'realign bibtex-entry-format) + (bibtex-delete-whitespace) + (open-line (if (eobp) 1 2))) (bibtex-progress-message 'done)) (when (and reformat-reference-keys - bibtex-maintain-sorted-entries - (not called-by-convert-alien)) + bibtex-maintain-sorted-entries) + (bibtex-progress-message "Sorting" 1) (bibtex-sort-buffer) - (kill-local-variable 'bibtex-reference-keys)) + (kill-local-variable 'bibtex-reference-keys) + (bibtex-progress-message 'done)) (goto-char pnt))) -(defun bibtex-convert-alien (&optional do-additional-reformatting) +(defun bibtex-convert-alien (&optional read-options) "Convert an alien BibTeX buffer to be fully usable by BibTeX mode. -If a file does not conform with some standards used by BibTeX mode, +If a file does not conform with all standards used by BibTeX mode, some of the high-level features of BibTeX mode will not be available. This function tries to convert current buffer to conform with these standards. -With prefix argument DO-ADDITIONAL-REFORMATTING -non-nil, read options for reformatting entries from minibuffer." +With prefix argument READ-OPTIONS non-nil, read options for reformatting +entries from minibuffer." (interactive "*P") (message "Starting to validate buffer...") (sit-for 1 nil t) - (goto-char (point-min)) - (while (re-search-forward "[ \t\n]+@" nil t) - (replace-match "\n@")) + (bibtex-realign) (message "If errors occur, correct them and call `bibtex-convert-alien' again") (sit-for 5 nil t) @@ -3714,10 +3745,7 @@ non-nil, read options for reformatting entries from minibuffer." (bibtex-validate)) (message "Starting to reformat entries...") (sit-for 2 nil t) - (bibtex-reformat do-additional-reformatting t) - (when bibtex-maintain-sorted-entries - (message "Starting to sort buffer...") - (bibtex-sort-buffer)) + (bibtex-reformat read-options) (goto-char (point-max)) (message "Buffer is now parsable. Please save it."))) @@ -3890,5 +3918,5 @@ is outside key or BibTeX field." (provide 'bibtex) -;;; arch-tag: ee2be3af-caad-427f-b42a-d20fad630d04 +;; arch-tag: ee2be3af-caad-427f-b42a-d20fad630d04 ;;; bibtex.el ends here diff --git a/lisp/textmodes/fill.el b/lisp/textmodes/fill.el index aaa10fbce5f..a888003402d 100644 --- a/lisp/textmodes/fill.el +++ b/lisp/textmodes/fill.el @@ -155,7 +155,7 @@ Leave one space between words, two at end of sentences or after colons and `sentence-end-without-period'). Remove indentation from each line." (interactive "*r") - (let ((end-spc-re (concat "\\(" sentence-end "\\) *\\| +"))) + (let ((end-spc-re (concat "\\(" (sentence-end) "\\) *\\| +"))) (save-excursion (goto-char beg) ;; Nuke tabs; they get screwed up in a fill. @@ -349,7 +349,7 @@ and `fill-nobreak-invisible'." (save-excursion (skip-chars-backward ". ") (and (looking-at "\\.") - (not (looking-at sentence-end)))) + (not (looking-at (sentence-end))))) ;; Don't split a line if the rest would look like a new paragraph. (unless use-hard-newlines (save-excursion @@ -424,10 +424,10 @@ Point is moved to just past the fill prefix on the first line." ;; loses on split abbrevs ("Mr.\nSmith") (let ((eol-double-space-re (cond - ((not colon-double-space) (concat sentence-end "$")) + ((not colon-double-space) (concat (sentence-end) "$")) ;; Try to add the : inside the `sentence-end' regexp. - ((string-match "\\[[^][]*\\(\\.\\)[^][]*\\]" sentence-end) - (concat (replace-match ".:" nil nil sentence-end 1) "$")) + ((string-match "\\[[^][]*\\(\\.\\)[^][]*\\]" (sentence-end)) + (concat (replace-match ".:" nil nil (sentence-end) 1) "$")) ;; Can't find the right spot to insert the colon. (t "[.?!:][])}\"']*$"))) (sentence-end-without-space-list diff --git a/lisp/textmodes/flyspell.el b/lisp/textmodes/flyspell.el index 3d41042e8d7..aff42866349 100644 --- a/lisp/textmodes/flyspell.el +++ b/lisp/textmodes/flyspell.el @@ -3,6 +3,7 @@ ;; Copyright (C) 1998, 2000, 2001, 2002 Free Software Foundation, Inc. ;; Author: Manuel Serrano <Manuel.Serrano@unice.fr> +;; Maintainer: FSF ;; Keywords: convenience ;; This file is part of GNU Emacs. @@ -1516,46 +1517,51 @@ for the overlay." ;*---------------------------------------------------------------------*/ (defun flyspell-highlight-incorrect-region (beg end poss) "Set up an overlay on a misspelled word, in the buffer from BEG to END." - (unless (run-hook-with-args-until-success - 'flyspell-incorrect-hook beg end poss) - (if (or flyspell-highlight-properties (not (flyspell-properties-at-p beg))) - (progn - ;; we cleanup current overlay at the same position - (if (and (not flyspell-persistent-highlight) - (overlayp flyspell-overlay)) - (delete-overlay flyspell-overlay) - (let ((overlays (overlays-at beg))) - (while (consp overlays) - (if (flyspell-overlay-p (car overlays)) - (delete-overlay (car overlays))) - (setq overlays (cdr overlays))))) - ;; now we can use a new overlay - (setq flyspell-overlay - (make-flyspell-overlay beg end - 'flyspell-incorrect-face - 'highlight)))))) + (let ((inhibit-read-only t)) + (unless (run-hook-with-args-until-success + 'flyspell-incorrect-hook beg end poss) + (if (or flyspell-highlight-properties + (not (flyspell-properties-at-p beg))) + (progn + ;; we cleanup current overlay at the same position + (if (and (not flyspell-persistent-highlight) + (overlayp flyspell-overlay)) + (delete-overlay flyspell-overlay) + (let ((overlays (overlays-at beg))) + (while (consp overlays) + (if (flyspell-overlay-p (car overlays)) + (delete-overlay (car overlays))) + (setq overlays (cdr overlays))))) + ;; now we can use a new overlay + (setq flyspell-overlay + (make-flyspell-overlay + beg end 'flyspell-incorrect-face 'highlight))))))) ;*---------------------------------------------------------------------*/ ;* flyspell-highlight-duplicate-region ... */ ;*---------------------------------------------------------------------*/ (defun flyspell-highlight-duplicate-region (beg end) "Set up an overlay on a duplicated word, in the buffer from BEG to END." - (if (or flyspell-highlight-properties (not (flyspell-properties-at-p beg))) - (progn - ;; we cleanup current overlay at the same position - (if (and (not flyspell-persistent-highlight) - (overlayp flyspell-overlay)) - (delete-overlay flyspell-overlay) - (let ((overlays (overlays-at beg))) - (while (consp overlays) - (if (flyspell-overlay-p (car overlays)) - (delete-overlay (car overlays))) - (setq overlays (cdr overlays))))) - ;; now we can use a new overlay - (setq flyspell-overlay - (make-flyspell-overlay beg end - 'flyspell-duplicate-face - 'highlight))))) + (let ((inhibit-read-only t)) + (unless (run-hook-with-args-until-success + 'flyspell-incorrect-hook beg end poss) + (if (or flyspell-highlight-properties + (not (flyspell-properties-at-p beg))) + (progn + ;; we cleanup current overlay at the same position + (if (and (not flyspell-persistent-highlight) + (overlayp flyspell-overlay)) + (delete-overlay flyspell-overlay) + (let ((overlays (overlays-at beg))) + (while (consp overlays) + (if (flyspell-overlay-p (car overlays)) + (delete-overlay (car overlays))) + (setq overlays (cdr overlays))))) + ;; now we can use a new overlay + (setq flyspell-overlay + (make-flyspell-overlay beg end + 'flyspell-duplicate-face + 'highlight))))))) ;*---------------------------------------------------------------------*/ ;* flyspell-auto-correct-cache ... */ @@ -2061,23 +2067,23 @@ possible corrections as returned by 'ispell-parse-output'. This function is meant to be added to 'flyspell-incorrect-hook'." (when (consp poss) - (let ((temp-buffer (get-buffer-create " *flyspell-temp*")) - found) - (save-excursion - (copy-to-buffer temp-buffer beg end) - (set-buffer temp-buffer) - (goto-char (1+ (point-min))) - (while (and (not (eobp)) (not found)) - (transpose-chars 1) - (if (member (buffer-string) (nth 2 poss)) - (setq found (point)) - (transpose-chars -1) - (forward-char)))) - (when found - (save-excursion - (goto-char (+ beg found -1)) - (transpose-chars -1) - t))))) + (catch 'done + (let ((str (buffer-substring beg end)) + (i 0) (len (- end beg)) tmp) + (while (< (1+ i) len) + (setq tmp (aref str i)) + (aset str i (aref str (1+ i))) + (aset str (1+ i) tmp) + (when (member str (nth 2 poss)) + (save-excursion + (goto-char (+ beg i 1)) + (transpose-chars 1)) + (throw 'done t)) + (setq tmp (aref str i)) + (aset str i (aref str (1+ i))) + (aset str (1+ i) tmp) + (setq i (1+ i)))) + nil))) (defun flyspell-maybe-correct-doubling (beg end poss) "Check replacements for doubled characters. @@ -2091,24 +2097,19 @@ possible corrections as returned by 'ispell-parse-output'. This function is meant to be added to 'flyspell-incorrect-hook'." (when (consp poss) - (let ((temp-buffer (get-buffer-create " *flyspell-temp*")) - found) - (save-excursion - (copy-to-buffer temp-buffer beg end) - (set-buffer temp-buffer) - (goto-char (1+ (point-min))) - (while (and (not (eobp)) (not found)) - (when (char-equal (char-after) (char-before)) - (delete-char 1) - (if (member (buffer-string) (nth 2 poss)) - (setq found (point)) - (insert-char (char-before) 1))) - (forward-char))) - (when found - (save-excursion - (goto-char (+ beg found -1)) - (delete-char 1) - t))))) + (catch 'done + (let ((str (buffer-substring beg end)) + (i 0) (len (- end beg))) + (while (< (1+ i) len) + (when (and (= (aref str i) (aref str (1+ i))) + (member (concat (substring str 0 (1+ i)) + (substring str (+ i 2))) + (nth 2 poss))) + (goto-char (+ beg i)) + (delete-char 1) + (throw 'done t)) + (setq i (1+ i)))) + nil))) ;*---------------------------------------------------------------------*/ ;* flyspell-already-abbrevp ... */ diff --git a/lisp/textmodes/ispell.el b/lisp/textmodes/ispell.el index 39fe89bdaaa..77c63379e2b 100644 --- a/lisp/textmodes/ispell.el +++ b/lisp/textmodes/ispell.el @@ -501,7 +501,8 @@ and then re-start emacs." (choice :tag "Coding system" (const iso-8859-1) (const iso-8859-2) - (const koi8-r)))) + (const koi8-r) + (const windows-1251)))) :group 'ispell) @@ -630,6 +631,10 @@ and then re-start emacs." "[\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]" "[^\341\342\367\347\344\345\263\366\372\351\352\353\354\355\356\357\360\362\363\364\365\346\350\343\376\373\375\370\371\377\374\340\361\301\302\327\307\304\305\243\326\332\311\312\313\314\315\316\317\320\322\323\324\325\306\310\303\336\333\335\330\331\337\334\300\321]" "" nil nil nil koi8-r) + ("russianw" ; russianw.aff (CP1251 charset) + "[\300\301\302\303\304\305\250\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\334\333\332\335\336\337\340\341\342\343\344\345\270\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\374\373\372\375\376\377]" + "[^\300\301\302\303\304\305\250\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\334\333\332\335\336\337\340\341\342\343\344\345\270\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\374\373\372\375\376\377]" + "" nil nil nil windows-1251) ("slovak" ; Slovakian "[A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" "[^A-Za-z\301\304\311\315\323\332\324\300\305\245\335\256\251\310\317\253\322\341\344\351\355\363\372\364\340\345\265\375\276\271\350\357\273\362]" @@ -3274,7 +3279,7 @@ You can bind this to the key C-c i in GNUS or mail by adding to (equal major-mode 'message-mode)) ;GNUS 5 (concat "In article <" "\\|" "[^,;&+=\n]+ <[^,;&+=]+> writes:" "\\|" - message-yank-prefix "\\|" + message-cite-prefix-regexp "\\|" default-prefix)) ((equal major-mode 'mh-letter-mode) ; mh mail message (concat "[^,;&+=\n]+ writes:" "\\|" diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index f7595e24cb5..e9cc4f397de 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el @@ -120,49 +120,62 @@ text indented by a margin setting." This is relevant for filling. See also `sentence-end-without-period' and `colon-double-space'. -If you change this, you should also change `sentence-end'. See Info -node `Sentences'." +This value is used by the function `sentence-end' to construct the +regexp describing the end of a sentence, in case when the value of +the variable `sentence-end' is nil. See Info node `Sentences'." :type 'boolean :group 'fill) (defcustom sentence-end-without-period nil "*Non-nil means a sentence will end without a period. For example, a sentence in Thai text ends with double space but -without a period." +without a period. + +This value is used by the function `sentence-end' to construct the +regexp describing the end of a sentence, in case when the value of +the variable `sentence-end' is nil. See Info node `Sentences'." :type 'boolean :group 'fill) (defcustom sentence-end-without-space "$B!#!%!)!*$A!##.#?#!$(0!$!%!)!*$(G!$!%!)!*(B" "*String containing characters that end sentence without following spaces. -If you change this, you should also change `sentence-end'. See Info -node `Sentences'." + +This value is used by the function `sentence-end' to construct the +regexp describing the end of a sentence, in case when the value of +the variable `sentence-end' is nil. See Info node `Sentences'." :group 'paragraphs :type 'string) -(defcustom sentence-end - (purecopy - ;; This is a bit stupid since it's not auto-updated when the - ;; other variables are changes, but it's still useful info. - (concat (if sentence-end-without-period "\\w \\|") - "\\([.?!][]\"')}]*" - (if sentence-end-double-space - "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)") - "\\|[" sentence-end-without-space "]+\\)" - "[ \t\n]*")) +(defcustom sentence-end nil "*Regexp describing the end of a sentence. The value includes the whitespace following the sentence. All paragraph boundaries also end sentences, regardless. -The default value specifies that in order to be recognized as the end -of a sentence, the ending period, question mark, or exclamation point -must be followed by two spaces, unless it's inside some sort of quotes -or parenthesis. - -See also the variable `sentence-end-double-space', the variable -`sentence-end-without-period' and Info node `Sentences'." +The value nil means to use the default value defined by the +function `sentence-end'. You should always use this function +to obtain the value of this variable." :group 'paragraphs - :type 'regexp) + :type '(choice regexp (const :tag "Use default value" nil))) + +(defun sentence-end () + "Return the regexp describing the end of a sentence. + +This function returns either the value of the variable `sentence-end' +if it is non-nil, or the default value constructed from the +variables `sentence-end-double-space', `sentence-end-without-period' +and `sentence-end-without-space'. The default value specifies +that in order to be recognized as the end of a sentence, the +ending period, question mark, or exclamation point must be +followed by two spaces, unless it's inside some sort of quotes or +parenthesis. See Info node `Sentences'." + (or sentence-end + (concat (if sentence-end-without-period "\\w \\|") + "\\([.?!][]\"'\xd0c9\x5397d)}]*" + (if sentence-end-double-space + "\\($\\| $\\|\t\\| \\)" "\\($\\|[\t ]\\)") + "\\|[" sentence-end-without-space "]+\\)" + "[ \t\n]*"))) (defcustom page-delimiter "^\014" "*Regexp describing line-beginnings that separate pages." @@ -411,7 +424,8 @@ The variable `sentence-end' is a regular expression that matches ends of sentences. Also, every paragraph boundary terminates sentences as well." (interactive "p") (or arg (setq arg 1)) - (let ((opoint (point))) + (let ((opoint (point)) + (sentence-end (sentence-end))) (while (< arg 0) (let ((pos (point)) (par-beg (save-excursion (start-of-paragraph-text) (point)))) diff --git a/lisp/textmodes/picture.el b/lisp/textmodes/picture.el index 0497a823049..b3c69ca657f 100644 --- a/lisp/textmodes/picture.el +++ b/lisp/textmodes/picture.el @@ -636,7 +636,15 @@ Leaves the region surrounding the rectangle." (define-key picture-mode-map "\C-c`" 'picture-movement-nw) (define-key picture-mode-map "\C-c'" 'picture-movement-ne) (define-key picture-mode-map "\C-c/" 'picture-movement-sw) - (define-key picture-mode-map "\C-c\\" 'picture-movement-se))) + (define-key picture-mode-map "\C-c\\" 'picture-movement-se) + (define-key picture-mode-map [(control ?c) left] 'picture-movement-left) + (define-key picture-mode-map [(control ?c) right] 'picture-movement-right) + (define-key picture-mode-map [(control ?c) up] 'picture-movement-up) + (define-key picture-mode-map [(control ?c) down] 'picture-movement-down) + (define-key picture-mode-map [(control ?c) home] 'picture-movement-nw) + (define-key picture-mode-map [(control ?c) prior] 'picture-movement-ne) + (define-key picture-mode-map [(control ?c) end] 'picture-movement-sw) + (define-key picture-mode-map [(control ?c) next] 'picture-movement-se))) (defcustom picture-mode-hook nil "If non-nil, its value is called on entry to Picture mode. diff --git a/lisp/textmodes/table.el b/lisp/textmodes/table.el index 93ea3cc0c14..7b13d498b2e 100644 --- a/lisp/textmodes/table.el +++ b/lisp/textmodes/table.el @@ -1,11 +1,11 @@ ;;; table.el --- create and edit WYSIWYG text based embedded tables -;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2000, 01, 02, 03, 04 Free Software Foundation, Inc. ;; Keywords: wp, convenience ;; Author: Takaaki Ota <Takaaki.Ota@am.sony.com> ;; Created: Sat Jul 08 2000 13:28:45 (PST) -;; Revised: Tue Dec 09 2003 14:36:50 (PST) +;; Revised: Tue Jun 01 2004 11:36:39 (PDT) ;; This file is part of GNU Emacs. @@ -1410,6 +1410,8 @@ the last cache point coordinate." end-of-buffer forward-word backward-word + forward-sentence + backward-sentence forward-paragraph backward-paragraph)) @@ -1434,9 +1436,18 @@ the last cache point coordinate." (cons (cons command func-symbol) table-command-remap-alist)))) '(kill-region + kill-ring-save delete-region copy-region-as-kill - kill-line)) + kill-line + kill-word + backward-kill-word + kill-sentence + backward-kill-sentence + kill-paragraph + backward-kill-paragraph + kill-sexp + backward-kill-sexp)) ;; Pasting Group (mapcar diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 75a064c8959..c35ba53dbaa 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1944,21 +1944,22 @@ for the error messages." (or (null last-filename) (not (string-equal last-filename filename)))) (error-location - (save-excursion - (if (equal filename (concat tex-zap-file ".tex")) - (set-buffer tex-last-buffer-texed) - (set-buffer (find-file-noselect filename))) - (if new-file - (progn (goto-line linenum) (setq last-position nil)) - (goto-char last-position) - (forward-line (- linenum last-linenum))) - ;; first try a forward search for the error text, - ;; then a backward search limited by the last error. - (let ((starting-point (point))) - (or (re-search-forward error-text nil t) - (re-search-backward error-text last-position t) - (goto-char starting-point))) - (point-marker)))) + (with-current-buffer + (if (equal filename (concat tex-zap-file ".tex")) + tex-last-buffer-texed + (find-file-noselect filename)) + (save-excursion + (if new-file + (progn (goto-line linenum) (setq last-position nil)) + (goto-char last-position) + (forward-line (- linenum last-linenum))) + ;; first try a forward search for the error text, + ;; then a backward search limited by the last error. + (let ((starting-point (point))) + (or (re-search-forward error-text nil t) + (re-search-backward error-text last-position t) + (goto-char starting-point))) + (point-marker))))) (goto-char this-error) (if (and compilation-error-list (or (and find-at-least diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 3e79d18a108..cc382b70528 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -2899,7 +2899,7 @@ Default is to leave paragraph indentation as is." 1)) (symbol-value indexvar))))) -(defconst texinfo-indexvar-alist +(defvar texinfo-indexvar-alist '(("cp" . texinfo-cindex) ("fn" . texinfo-findex) ("vr" . texinfo-vindex) @@ -3032,7 +3032,7 @@ Default is to leave paragraph indentation as is." (indent-to 54) (insert (if (nth 2 (car indexelts)) - (format " %d." (nth 2 (car indexelts))) + (format " (line %3d)" (1+ (nth 2 (car indexelts)))) "") "\n")) ;; index entries from @include'd file diff --git a/lisp/thumbs.el b/lisp/thumbs.el index cc692c1f975..1fbf2d224a2 100644 --- a/lisp/thumbs.el +++ b/lisp/thumbs.el @@ -1,15 +1,10 @@ ;;; thumbs.el --- Thumbnails previewer for images files -;;; + +;; Copyright 2004 Free Software Foundation, Inc + ;; Author: Jean-Philippe Theberge <jphiltheberge@videotron.ca> -;; -;; Thanks: Alex Schroeder <alex@gnu.org> for maintaining the package at some time -;; The peoples at #emacs@freenode.net for numerous help -;; RMS for emacs and the GNU project. -;; ;; Keywords: Multimedia -(defconst thumbs-version "2.0") - ;; This file is part of GNU Emacs. ;; GNU Emacs is free software; you can redistribute it and/or modify @@ -26,6 +21,11 @@ ;; along with GNU Emacs; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. +;; +;; Thanks: Alex Schroeder <alex@gnu.org> for maintaining the package at some time +;; The peoples at #emacs@freenode.net for numerous help +;; RMS for emacs and the GNU project. +;; ;;; Commentary: @@ -52,21 +52,12 @@ ;; for that image. C-h m will give you a list of available keybinding. ;;; History: -;; +;; ;;; Code: (require 'dired) -;; Abort if in-line imaging isn't supported (i.e. Emacs-20.7) - -(when (not (display-images-p)) - (error "Your Emacs version (%S) doesn't support in-line images, -was not compiled with image support or is run in console mode. -Upgrade to Emacs 21.1 or newer, compile it with image support -or use a window-system" - emacs-version)) - ;; CUSTOMIZATIONS (defgroup thumbs nil @@ -148,26 +139,26 @@ see some of your images." :group 'thumbs) ;; Initialize some variable, for later use. -(defvar thumbs-temp-file - (concat thumbs-temp-dir thumbs-temp-prefix) +(defvar thumbs-temp-file + (concat thumbs-temp-dir thumbs-temp-prefix) "Temporary filesname for images.") -(defvar thumbs-current-tmp-filename - nil +(defvar thumbs-current-tmp-filename + nil "Temporary filename of current image.") -(defvar thumbs-current-image-filename +(defvar thumbs-current-image-filename nil "Filename of current image.") -(defvar thumbs-current-image-size +(defvar thumbs-current-image-size nil "Size of current image.") -(defvar thumbs-image-num +(defvar thumbs-image-num nil "Number of current image.") -(defvar thumbs-current-dir +(defvar thumbs-current-dir nil "Current directory.") -(defvar thumbs-markedL +(defvar thumbs-markedL nil "List of marked files.") @@ -182,25 +173,6 @@ see some of your images." (make-directory thumbs-thumbsdir) (message "Creating thumbnails directory"))) -(when (not (fboundp 'ignore-errors)) - (defmacro ignore-errors (&rest body) - "Execute FORMS; if anz error occurs, return nil. -Otherwise, return result of last FORM." - (let ((err (thumbs-gensym))) - (list 'condition-case err (cons 'progn body) '(error nil))))) - -(when (not (fboundp 'time-less-p)) - (defun time-less-p (t1 t2) - "Say whether time T1 is less than time T2." - (or (< (car t1) (car t2)) - (and (= (car t1) (car t2)) - (< (nth 1 t1) (nth 1 t2)))))) - -(when (not (fboundp 'caddar)) - (defun caddar (x) - "Return the `car' of the `cdr' of the `cdr' of the `car' of X." - (car (cdr (cdr (car x)))))) - (defvar thumbs-gensym-counter 0) (defun thumbs-gensym (&optional arg) @@ -208,7 +180,7 @@ Otherwise, return result of last FORM." The name is made by appending a number to PREFIX, default \"Thumbs\"." (let ((prefix (if (stringp arg) arg "Thumbs")) (num (if (integerp arg) arg - (prog1 + (prog1 thumbs-gensym-counter (setq thumbs-gensym-counter (1+ thumbs-gensym-counter)))))) (make-symbol (format "%s%d" prefix num)))) @@ -229,9 +201,9 @@ reached." (dirsize (apply '+ (mapcar (lambda (x) (cadr x)) filesL)))) (while (> dirsize thumbs-thumbsdir-max-size) (progn - (message "Deleting file %s" (caddar filesL))) - (delete-file (caddar filesL)) - (setq dirsize (- dirsize (cadar filesL))) + (message "Deleting file %s" (cadr (cdar filesL)))) + (delete-file (cadr (cdar filesL))) + (setq dirsize (- dirsize (car (cdar filesL)))) (setq filesL (cdr filesL))))) ;; Check the thumbsnail directory size and clean it if necessary. @@ -274,7 +246,7 @@ ACTION-PREFIX is the symbol to place before the ACTION command thumbs-image-resizing-step) (thumbs-increment-image-size-element (cdr s) thumbs-image-resizing-step))) - + (defun thumbs-decrement-image-size (s) "Decrement S (a cons of width x heigh)." (cons @@ -289,11 +261,12 @@ if INCREMENT is set, make the image bigger, else smaller. Or, alternatively, a SIZE may be specified." (interactive) ;; cleaning of old temp file - (ignore-errors + (condition-case nil (apply 'delete-file (directory-files thumbs-temp-dir t - thumbs-temp-prefix))) + thumbs-temp-prefix)) + (error nil)) (let ((buffer-read-only nil) (x (if size size @@ -315,7 +288,7 @@ Or, alternatively, a SIZE may be specified." "Resize Image interactively to specified WIDTH and HEIGHT." (interactive "nWidth: \nnHeight: ") (thumbs-resize-image nil (cons width height))) - + (defun thumbs-resize-image-size-down () "Resize image (smaller)." (interactive) @@ -326,22 +299,10 @@ Or, alternatively, a SIZE may be specified." (interactive) (thumbs-resize-image t)) -(defun thumbs-subst-char-in-string (orig rep string) - "Replace occurrences of character ORIG with character REP in STRING. -Return the resulting (new) string. -- (defun borowed to Dave Love)" - (let ((string (copy-sequence string)) - (l (length string)) - (i 0)) - (while (< i l) - (if (= (aref string i) orig) - (aset string i rep)) - (setq i (1+ i))) - string)) - (defun thumbs-thumbname (img) "Return a thumbnail name for the image IMG." (concat thumbs-thumbsdir "/" - (thumbs-subst-char-in-string + (subst-char-in-string ?\ ?\_ (apply 'concat @@ -353,10 +314,14 @@ Return the resulting (new) string. -- (defun borowed to Dave Love)" (let* ((fn (expand-file-name img)) (tn (thumbs-thumbname img))) (if (or (not (file-exists-p tn)) - (not (equal (thumbs-file-size tn) thumbs-geometry))) + ;; This is not the right fix, but I don't understand + ;; the external program or why it produces a geometry + ;; unequal to the one requested -- rms. +;;; (not (equal (thumbs-file-size tn) thumbs-geometry)) + ) (thumbs-call-convert fn tn "sample" thumbs-geometry)) tn)) - + (defun thumbs-image-type (img) "Return image type from filename IMG." (cond ((string-match ".*\\.jpe?g\\'" img) 'jpeg) @@ -372,7 +337,7 @@ Return the resulting (new) string. -- (defun borowed to Dave Love)" (concat (number-to-string (round (car i))) "x" (number-to-string (round (cdr i)))))) - + ;;;###autoload (defun thumbs-find-thumb (img) "Display the thumbnail for IMG." @@ -397,30 +362,28 @@ if MARKED is non-nil, the image is marked." "Insert the thumbnail for IMG at point. if MARKED is non-nil, the image is marked" (thumbs-insert-image - (thumbs-make-thumb img) 'jpeg thumbs-relief marked)) + (thumbs-make-thumb img) 'jpeg thumbs-relief marked) + (put-text-property (1- (point)) (point) + 'thumb-image-file img)) (defun thumbs-do-thumbs-insertion (L) "Insert all thumbs in list L." - (setq thumbs-fileL nil) (let ((i 0)) - (while L + (dolist (img L) + (thumbs-insert-thumb img + (member img thumbs-markedL)) (when (= 0 (mod (setq i (1+ i)) thumbs-per-line)) - (newline)) - (setq thumbs-fileL (cons (cons (point) - (car L)) - thumbs-fileL)) - (thumbs-insert-thumb (car L) - (member (car L) thumbs-markedL)) - (setq L (cdr L))))) + (newline))) + (unless (bobp) (newline)))) (defun thumbs-show-thumbs-list (L &optional buffer-name same-window) + (when (not (display-images-p)) + (error "Images are not supported in this Emacs session")) (funcall (if same-window 'switch-to-buffer 'pop-to-buffer) (or buffer-name "*THUMB-View*")) (let ((inhibit-read-only t)) (erase-buffer) (thumbs-mode) - (make-variable-buffer-local 'thumbs-fileL) - (setq thumbs-fileL nil) (thumbs-do-thumbs-insertion L) (goto-char (point-min)) (setq thumbs-current-dir default-directory) @@ -452,7 +415,7 @@ and SAME-WINDOW to show thumbs in the same window." ;;;###autoload (defalias 'thumbs 'thumbs-show-all-from-dir) -(defun thumbs-find-image (img L &optional num otherwin) +(defun thumbs-find-image (img &optional num otherwin) (funcall (if otherwin 'switch-to-buffer-other-window 'switch-to-buffer) (concat "*Image: " (file-name-nondirectory img) " - " @@ -466,8 +429,6 @@ and SAME-WINDOW to show thumbs in the same window." (make-variable-buffer-local 'thumbs-current-tmp-filename) (make-variable-buffer-local 'thumbs-current-image-size) (make-variable-buffer-local 'thumbs-image-num) - (make-variable-buffer-local 'thumbs-fileL) - (setq thumbs-fileL L) (delete-region (point-min)(point-max)) (thumbs-insert-image img (thumbs-image-type img) 0))) @@ -475,10 +436,8 @@ and SAME-WINDOW to show thumbs in the same window." "Display image IMG for thumbnail at point. use another window it OTHERWIN is t." (interactive) - (let* ((L thumbs-fileL) - (n (point)) - (i (or img (cdr (assoc n L))))) - (thumbs-find-image i L n otherwin))) + (let* ((i (or img (thumbs-current-image)))) + (thumbs-find-image i (point) otherwin))) (defun thumbs-find-image-at-point-other-window () "Display image for thumbnail at point in the preview buffer. @@ -486,6 +445,12 @@ Open another window." (interactive) (thumbs-find-image-at-point nil t)) +(defun thumbs-mouse-find-image (event) + "Display image for thumbnail at mouse click EVENT." + (interactive "e") + (mouse-set-point event) + (thumbs-find-image-at-point)) + (defun thumbs-call-setroot-command (img) "Call the setroot program for IMG." (run-hooks 'thumbs-before-setroot-hook) @@ -494,11 +459,12 @@ Open another window." (shell-quote-argument (expand-file-name img)) thumbs-setroot-command nil t)) (run-hooks 'thumbs-after-setroot-hook)) - + (defun thumbs-set-image-at-point-to-root-window () "Set the image at point as the desktop wallpaper." (interactive) - (thumbs-call-setroot-command (cdr (assoc (point) thumbs-fileL)))) + (thumbs-call-setroot-command + (thumbs-current-image))) (defun thumbs-set-root () "Set the current image as root." @@ -507,78 +473,158 @@ Open another window." (or thumbs-current-tmp-filename thumbs-current-image-filename))) +(defun thumbs-file-alist () + "Make an alist of elements (POS . FILENAME) for all images in thumb buffer." + (save-excursion + (let (list) + (goto-char (point-min)) + (while (not (eobp)) + (if (thumbs-current-image) + (push (cons (point-marker) + (thumbs-current-image)) + list)) + (forward-char 1)) + list))) + +(defun thumbs-file-list () + "Make a list of file names for all images in thumb buffer." + (save-excursion + (let (list) + (goto-char (point-min)) + (while (not (eobp)) + (if (thumbs-current-image) + (push (thumbs-current-image) list)) + (forward-char 1)) + (nreverse list)))) + (defun thumbs-delete-images () "Delete the image at point (and it's thumbnail) (or marked files if any)." (interactive) - (let ((f (or thumbs-markedL (list (cdr (assoc (point) thumbs-fileL)))))) - (if (yes-or-no-p "Really delete %d files?" (length f)) - (progn - (mapcar (lambda (x) - (setq thumbs-fileL (delete (rassoc x thumbs-fileL) thumbs-fileL)) + (let ((files (or thumbs-markedL (list (thumbs-current-image))))) + (if (yes-or-no-p (format "Really delete %d files? " (length files))) + (let ((thumbs-fileL (thumbs-file-alist)) + (inhibit-read-only t)) + (dolist (x files) + (let (failure) + (condition-case () + (progn (delete-file x) - (delete-file (thumbs-thumbname x))) f) - (thumbs-redraw-buffer))))) + (delete-file (thumbs-thumbname x))) + (file-error (setq failure t))) + (unless failure + (when (rassoc x thumbs-fileL) + (goto-char (car (rassoc x thumbs-fileL))) + (delete-region (point) (1+ (point)))) + (setq thumbs-markedL + (delq x thumbs-markedL))))))))) + +(defun thumbs-rename-images (newfile) + "Rename the image at point (and it's thumbnail) (or marked files if any)." + (interactive "FRename to file or directory: ") + (let ((files (or thumbs-markedL (list (thumbs-current-image)))) + failures) + (if (and (not (file-directory-p newfile)) + thumbs-markedL) + (if (file-exists-p newfile) + (error "Renaming marked files to file name `%s'" newfile) + (make-directory newfile t))) + (if (yes-or-no-p (format "Really rename %d files? " (length files))) + (let ((thumbs-fileL (thumbs-file-alist)) + (inhibit-read-only t)) + (dolist (file files) + (let (failure) + (condition-case () + (if (file-directory-p newfile) + (rename-file file + (expand-file-name + (file-name-nondirectory file) + newfile)) + (rename-file file newfile)) + (file-error (setq failure t) + (push file failures))) + (unless failure + (when (rassoc file thumbs-fileL) + (goto-char (car (rassoc file thumbs-fileL))) + (delete-region (point) (1+ (point)))) + (setq thumbs-markedL + (delq file thumbs-markedL))))))) + (if failures + (display-warning 'file-error + (format "Rename failures for %s into %s" + failures newfile) + :error)))) (defun thumbs-kill-buffer () "Kill the current buffer." (interactive) (let ((buffer (current-buffer))) - (ignore-errors (delete-window (selected-window))) + (condition-case nil + (delete-window (selected-window)) + (error nil)) (kill-buffer buffer))) (defun thumbs-show-image-num (num) "Show the image with number NUM." - (let ((inhibit-read-only t)) - (delete-region (point-min)(point-max)) - (let ((i (cdr (assoc num thumbs-fileL)))) - (thumbs-insert-image i (thumbs-image-type i) 0) - (sleep-for 2) - (rename-buffer (concat "*Image: " - (file-name-nondirectory i) - " - " - (number-to-string num) "*"))) - (setq thumbs-image-num num - thumbs-current-image-filename i))) + (let ((image-buffer (get-buffer-create "*Image*"))) + (let ((i (thumbs-current-image))) + (with-current-buffer image-buffer + (thumbs-insert-image i (thumbs-image-type i) 0)) + (setq thumbs-image-num num + thumbs-current-image-filename i)))) (defun thumbs-next-image () "Show next image." (interactive) (let* ((i (1+ thumbs-image-num)) - (l (caar thumbs-fileL)) - (num - (cond ((assoc i thumbs-fileL) i) - ((>= i l) 1) - (t (1+ i))))) - (thumbs-show-image-num num))) + (list (thumbs-file-alist)) + (l (caar list))) + (while (and (/= i thumbs-image-num) (not (assoc i list))) + (setq i (if (>= i l) 1 (1+ i)))) + (thumbs-show-image-num i))) (defun thumbs-previous-image () "Show the previous image." (interactive) (let* ((i (- thumbs-image-num 1)) - (l (caar thumbs-fileL)) - (num - (cond ((assoc i thumbs-fileL) i) - ((<= i 1) l) - (t (- i 1))))) - (thumbs-show-image-num num))) + (list (thumbs-file-alist)) + (l (caar list))) + (while (and (/= i thumbs-image-num) (not (assoc i list))) + (setq i (if (<= i 1) l (1- i)))) + (thumbs-show-image-num i))) (defun thumbs-redraw-buffer () "Redraw the current thumbs buffer." (let ((p (point)) - (inhibit-read-only t)) - (delete-region (point-min)(point-max)) - (thumbs-do-thumbs-insertion (reverse (mapcar 'cdr thumbs-fileL))) - (goto-char (1+ p)))) - + (inhibit-read-only t) + (files (thumbs-file-list))) + (erase-buffer) + (thumbs-do-thumbs-insertion files) + (goto-char p))) + (defun thumbs-mark () "Mark the image at point." (interactive) - (setq thumbs-markedL (cons (cdr (assoc (point) thumbs-fileL)) thumbs-markedL)) - (let ((inhibit-read-only t)) - (delete-char 1) - (thumbs-insert-thumb (cdr (assoc (point) thumbs-fileL)) t)) - (when (eolp)(forward-char))) - + (let ((elt (thumbs-current-image))) + (unless elt + (error "No image here")) + (push elt thumbs-markedL) + (let ((inhibit-read-only t)) + (delete-char 1) + (thumbs-insert-thumb elt t))) + (when (eolp) (forward-char))) + +(defun thumbs-unmark () + "Unmark the image at point." + (interactive) + (let ((elt (thumbs-current-image))) + (unless elt + (error "No image here")) + (setq thumbs-markedL (delete elt thumbs-markedL)) + (let ((inhibit-read-only t)) + (delete-char 1) + (thumbs-insert-thumb elt nil))) + (when (eolp) (forward-char))) + ;; Image modification routines (defun thumbs-modify-image (action &optional arg) @@ -604,8 +650,8 @@ ACTION and ARG should be legal convert command." (defun thumbs-emboss-image (emboss) "Emboss the image with value EMBOSS." (interactive "nEmboss value: ") - (if (or (< emboss 3)(> emboss 31)(evenp emboss)) - (error "Arg must be a odd number between 3 and 31")) + (if (or (< emboss 3) (> emboss 31) (zerop (% emboss 2))) + (error "Arg must be an odd number between 3 and 31")) (thumbs-modify-image "emboss" (number-to-string emboss))) (defun thumbs-monochrome-image () @@ -628,17 +674,24 @@ ACTION and ARG should be legal convert command." (interactive) (thumbs-modify-image "rotate" "90")) +(defun thumbs-current-image () + "Return the name of the image file name at point." + (get-text-property (point) 'thumb-image-file)) + (defun thumbs-forward-char () "Move forward one image." (interactive) (forward-char) - (when (eolp)(forward-char)) + (while (and (not (eobp)) (not (thumbs-current-image))) + (forward-char)) (thumbs-show-name)) (defun thumbs-backward-char () "Move backward one image." (interactive) (forward-char -1) + (while (and (not (bobp)) (not (thumbs-current-image))) + (forward-char -1)) (thumbs-show-name)) (defun thumbs-forward-line () @@ -656,15 +709,15 @@ ACTION and ARG should be legal convert command." (defun thumbs-show-name () "Show the name of the current file." (interactive) - (let ((f (cdr (assoc (point) thumbs-fileL)))) - (message "%s [%s]" f (thumbs-file-size f)))) + (let ((f (thumbs-current-image))) + (and f (message "%s [%s]" f (thumbs-file-size f))))) (defun thumbs-save-current-image () "Save the current image." (interactive) (let ((f (or thumbs-current-tmp-filename thumbs-current-image-filename)) - (sa (read-from-minibuffer "save file as: " + (sa (read-from-minibuffer "Save image file as: " thumbs-current-image-filename))) (copy-file f sa))) @@ -678,6 +731,7 @@ ACTION and ARG should be legal convert command." (defvar thumbs-mode-map (let ((map (make-sparse-keymap))) (define-key map [return] 'thumbs-find-image-at-point) + (define-key map [mouse-2] 'thumbs-mouse-find-image) (define-key map [(meta return)] 'thumbs-find-image-at-point-other-window) (define-key map [(control return)] 'thumbs-set-image-at-point-to-root-window) (define-key map [delete] 'thumbs-delete-images) @@ -687,15 +741,20 @@ ACTION and ARG should be legal convert command." (define-key map [down] 'thumbs-forward-line) (define-key map "d" 'thumbs-dired) (define-key map "m" 'thumbs-mark) + (define-key map "u" 'thumbs-unmark) + (define-key map "R" 'thumbs-rename-images) + (define-key map "x" 'thumbs-delete-images) (define-key map "s" 'thumbs-show-name) (define-key map "q" 'thumbs-kill-buffer) map) "Keymap for `thumbs-mode'.") +(put 'thumbs-mode 'mode-class 'special) (define-derived-mode thumbs-mode fundamental-mode "thumbs" "Preview images in a thumbnails buffer" (make-variable-buffer-local 'thumbs-markedL) + (setq buffer-read-only t) (setq thumbs-markedL nil)) (defvar thumbs-view-image-mode-map @@ -715,6 +774,7 @@ ACTION and ARG should be legal convert command." "Keymap for `thumbs-view-image-mode'.") ;; thumbs-view-image-mode +(put 'thumbs-view-image-mode 'mode-class 'special) (define-derived-mode thumbs-view-image-mode fundamental-mode "image-view-mode") diff --git a/lisp/time-stamp.el b/lisp/time-stamp.el index b6e76ee5394..f574144f4b0 100644 --- a/lisp/time-stamp.el +++ b/lisp/time-stamp.el @@ -5,7 +5,7 @@ ;; This file is part of GNU Emacs. -;; Maintainer's Time-stamp: <2003-02-01 09:26:25 gildea> +;; Maintainer's Time-stamp: <2004-06-13 19:04:36 teirllm> ;; Maintainer: Stephen Gildea <gildea@stop.mail-abuse.org> ;; Keywords: tools @@ -32,7 +32,7 @@ ;; See the top of `time-stamp.el' for another example. ;; To use time-stamping, add this line to your .emacs file: -;; (add-hook 'write-file-hooks 'time-stamp) +;; (add-hook 'before-save-hook 'time-stamp) ;; Now any time-stamp templates in your files will be updated automatically. ;; See the documentation for the functions `time-stamp' @@ -242,7 +242,8 @@ of the time-stamped file itself.") "Update the time stamp string(s) in the buffer. A template in a file can be automatically updated with a new time stamp every time you save the file. Add this line to your .emacs file: - (add-hook 'write-file-hooks 'time-stamp) + (add-hook 'before-save-hook 'time-stamp) +or customize `before-save-hook' through Custom. Normally the template must appear in the first 8 lines of a file and look like one of the following: Time-stamp: <> @@ -318,7 +319,6 @@ template." (setq start (time-stamp-once start search-limit ts-start ts-end ts-format format-lines end-lines)) (setq ts-count (1- ts-count)))) - ;; be sure to return nil so can be used on write-file-hooks nil) (defun time-stamp-once (start search-limit ts-start ts-end diff --git a/lisp/toolbar/README b/lisp/toolbar/README new file mode 100644 index 00000000000..f7c8cb033b4 --- /dev/null +++ b/lisp/toolbar/README @@ -0,0 +1,8 @@ +The following icons are from GTK+ 2.x: + + close.xpm copy.xpm cut.xpm help.xpm home.xpm + index.xpm jump_to.xpm left_arrow.xpm new.xpm open.xpm + paste.xpm preferences.xpm print.xpm right_arrow.xpm save.xpm + saveas.xpm search.xpm spell.xpm undo.xpm up_arrow.xpm + +They are not part of Emacs, but distributed and used by Emacs. diff --git a/lisp/toolbar/alias.pbm b/lisp/toolbar/alias.pbm Binary files differindex 1ebe932c6d4..239bd793002 100644 --- a/lisp/toolbar/alias.pbm +++ b/lisp/toolbar/alias.pbm diff --git a/lisp/toolbar/close.pbm b/lisp/toolbar/close.pbm Binary files differindex 04633c9d1d6..5229be27525 100644 --- a/lisp/toolbar/close.pbm +++ b/lisp/toolbar/close.pbm diff --git a/lisp/toolbar/close.xpm b/lisp/toolbar/close.xpm index ff364d57044..498843be6e2 100644 --- a/lisp/toolbar/close.xpm +++ b/lisp/toolbar/close.xpm @@ -1,32 +1,29 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ +static char * close_xpm[] = { "24 24 2 1", -" c Gray0", -". c None", -/* pixels */ -"........................", -"........................", -"........................", -"........................", -"........................", -"........................", -"....... .... ..........", -"....... .. .........", -"........ . ..........", -"........ ...........", -"......... ............", -"......... ...........", -"........ ..........", -"........ . .........", -"....... ... ........", -"....... ..... .........", -"........................", -"........................", -"........................", -"........................", -"........................", -"........................", -"........................", -"........................" -}; +" c None", +". c #000000", +" ", +" ", +" ", +" ", +" ", +" ", +" . . ", +" . ... ", +" .. .... ", +" .. ... ", +" ..... ", +" ... ", +" ..... ", +" ....... ", +" ... .... ", +" ... .... ", +" ... .. ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/copy.pbm b/lisp/toolbar/copy.pbm Binary files differindex 155be369266..abfd22f93b3 100644 --- a/lisp/toolbar/copy.pbm +++ b/lisp/toolbar/copy.pbm diff --git a/lisp/toolbar/copy.xpm b/lisp/toolbar/copy.xpm index 06efceae29d..6262a95bc39 100644 --- a/lisp/toolbar/copy.xpm +++ b/lisp/toolbar/copy.xpm @@ -1,37 +1,53 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 7 1", -" c Gray0", -". c #424242423a3a", -"X c #68e968e96363", -"o c #a8b1a8b1992b", -"O c #d3d3d3d3bdbd", -"+ c #e419e419cd6b", -"@ c None", -/* pixels */ -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@ @@@@@@@@@@@@@@", -"@@@@@@ Oo @@@@@@@@@@@@@", -"@@@@ .ooOO @@@@ @@@@@@@", -"@@@@ +XoOOo @ Oo @@@@@@", -"@@@@ +.oO++ .ooOO @@@@@@", -"@@@@ XoO+++ +XoOOo @@@@@", -"@@@@ oOO+++ +.oO++ @@@@@", -"@@@@ oO++++ XoOO++o @@@@", -"@@@@@ +++++ oOO++++o @@@", -"@@@@@ o++++ oO++++++ @@@", -"@@@@@@ ++o +++++++o @@", -"@@@@@@ o @@ o++++o @@@", -"@@@@@@@ @@@@@ ++o @@@@@", -"@@@@@@@@@@ @@ o @@@@@@@", -"@@@@@@@ @@ @@@@@@@@@", -"@@@@@@@ @@@@@@@@@@@@", -"@@@@@@@@@@ @@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@" -}; +static char * copy_xpm[] = { +"24 24 26 1", +" c None", +". c #000000", +"+ c #B4B4B4", +"@ c #F8F8F8", +"# c #F6F6F6", +"$ c #C3C3C3", +"% c #E9E9E9", +"& c #989898", +"* c #828282", +"= c #8A8A8A", +"- c #E8E8E8", +"; c #636363", +"> c #5A5A5A", +", c #6B6B6B", +"' c #B3B3B3", +") c #FFFFFF", +"! c #D6D6D6", +"~ c #818181", +"{ c #A7A7A7", +"] c #8F8F8F", +"^ c #C6C6C6", +"/ c #808080", +"( c #E7E7E7", +"_ c #6D6D6D", +": c #767676", +"< c #F5F5F5", +" ", +" ............. ", +" .+@@@@@@@@@#$. ", +" .@%%%%%%%%%%%. ", +" .@&**=%+*%*+%. ", +" .@%%%%%%%%---. ", +" .@;>%,*+-............ ", +" .@%%%%%%.'))))))))))!. ", +" .@&**%*~.)))))))))))). ", +" .@%%%%%-.){]]&)^])]^). ", +" .@;>>%,/.)))))))))))). ", +" .@%%%%%(.)_;):]^)^])). ", +" .@&**%*~.)))))))))))). ", +" .<%%%%%-.){]])]]^)&]). ", +" .$%%%%%-.)))))))))))). ", +" ........)_;;):]^)^]). ", +" .)))))))))))). ", +" .){]])]]^)&]). ", +" .)))))))))))). ", +" .!))))))))))!. ", +" .............. ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/cut.pbm b/lisp/toolbar/cut.pbm Binary files differindex 570260767cb..29bf1abc073 100644 --- a/lisp/toolbar/cut.pbm +++ b/lisp/toolbar/cut.pbm diff --git a/lisp/toolbar/cut.xpm b/lisp/toolbar/cut.xpm index 563d64ec343..3f8e71d22ce 100644 --- a/lisp/toolbar/cut.xpm +++ b/lisp/toolbar/cut.xpm @@ -1,32 +1,67 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 2 1", -" c Gray0", -". c None", -/* pixels */ -"........................", -"........................", -"........................", -"........................", -"........................", -".................. .....", -"................ ......", -"............... .......", -".............. ........", -"............. .........", -".... .... ..... ..", -"... ... .. ... ....", -"... ... ......", -".... ... .........", -".......... ............", -"......... ............", -"........ .. ............", -"....... ... ............", -"....... .. .............", -"....... ..............", -"........................", -"........................", -"........................", -"........................" -}; +static char * cut_xpm[] = { +"24 24 40 1", +" c None", +". c #000000", +"+ c #C9C7C2", +"@ c #E6E4E0", +"# c #EFEEED", +"$ c #494946", +"% c #73726E", +"& c #F0EEED", +"* c #7F7D75", +"= c #F2F1EF", +"- c #D2CFC8", +"; c #E7E7E4", +"> c #BAB5AB", +", c #565653", +"' c #EDECE9", +") c #A4A097", +"! c #817F7E", +"~ c #4E4C48", +"{ c #F6F5F4", +"] c #474541", +"^ c #EFEEEC", +"/ c #8C8B8A", +"( c #F3F2F0", +"_ c #77746D", +": c #323232", +"< c #EBEBEA", +"[ c #605D58", +"} c #F5F4F3", +"| c #CECCC7", +"1 c #363634", +"2 c #6F6E6D", +"3 c #BEBDBB", +"4 c #EAE7E4", +"5 c #B8B5B1", +"6 c #474747", +"7 c #DAD8D4", +"8 c #9B9996", +"9 c #161615", +"0 c #6D6B6A", +"a c #3A3837", +" ", +" ", +" . . ", +" . . ", +" .+. .@. ", +" .#$ %@. ", +" .&*. .=-. ", +" .;>, %'). ", +" !#*. .=-~ ", +" .{>] ~^>. ", +" /(_.:<-[ ", +" .}|123>. ", +" .456>. ", +" .78.. ", +" .90a. ", +" ............. ", +" . ... ... ... ", +" .. .. .. .. ", +" . . . . ", +" .. .. .. .. ", +" .... .. . ", +" .... .... ", +" ", +" "}; diff --git a/lisp/toolbar/help.pbm b/lisp/toolbar/help.pbm Binary files differindex 562cc6137b5..2575f6f2613 100644 --- a/lisp/toolbar/help.pbm +++ b/lisp/toolbar/help.pbm diff --git a/lisp/toolbar/help.xpm b/lisp/toolbar/help.xpm index bca0bf8e4fc..1d65ce03b53 100644 --- a/lisp/toolbar/help.xpm +++ b/lisp/toolbar/help.xpm @@ -1,36 +1,271 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 6 1", -" c Gray0", -". c #65658b8b5e5e", -"X c #934ab2448dfb", -"o c #b35dc8c8afaf", -"O c #e0b2e944df83", -"+ c None", -/* pixels */ -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"+++++++++ ++++++++++", -"++++++++ oOOOO +++++++++", -"+++++++ OOOOOOO ++++++++", -"++++++ oOo oOo +++++++", -"+++++++ O +++ OO +++++++", -"+++++++O ++++ Oo +++++++", -"++++++++++++ OO. +++++++", -"+++++++++++ OOX ++++++++", -"++++++++++ OOX +++++++++", -"+++++++++ XOX ++++++++++", -"+++++++++ OX +++++++++++", -"+++++++++ +++++++++++", -"++++++++++++++++++++++++", -"++++++++++ ++++++++++++", -"+++++++++ Oo +++++++++++", -"+++++++++ oX +++++++++++", -"++++++++++ ++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++" -}; +static char * help_xpm[] = { +"24 24 244 2", +" c None", +". c #000000", +"+ c #454442", +"@ c #1D1D1C", +"# c #040404", +"$ c #1B1B1B", +"% c #3D3C3A", +"& c #4D4C4B", +"* c #2F2F2D", +"= c #C1BFBB", +"- c #ECEAE7", +"; c #F5F3F0", +"> c #F2F0EC", +", c #E1DFDC", +"' c #AFADAA", +") c #272726", +"! c #020202", +"~ c #3F3E3E", +"{ c #36302D", +"] c #181818", +"^ c #FBF8F5", +"/ c #FEFCF8", +"( c #FAF8F5", +"_ c #F5F4F1", +": c #F2F1ED", +"< c #F1EFEB", +"[ c #F1EEEB", +"} c #EAE9E6", +"| c #DAD8D4", +"1 c #100E0E", +"2 c #1F100E", +"3 c #AF3A1E", +"4 c #FBAB93", +"5 c #FAE9E3", +"6 c #F0EFEB", +"7 c #E9E8E5", +"8 c #EAE8E6", +"9 c #ECEAE8", +"0 c #EDEBE9", +"a c #EDEBE8", +"b c #EACFC6", +"c c #D5340A", +"d c #751904", +"e c #100806", +"f c #34160D", +"g c #AF3C20", +"h c #FCCCBD", +"i c #F7BEAD", +"j c #E67554", +"k c #DFDDDB", +"l c #DBD9D6", +"m c #D8D7D3", +"n c #DBDAD6", +"o c #E3E2DE", +"p c #ECEBE8", +"q c #E5572D", +"r c #E33A0B", +"s c #D4340A", +"t c #691504", +"u c #100504", +"v c #582C22", +"w c #0F0F0F", +"x c #FDD4C8", +"y c #F7BFAF", +"z c #E87554", +"A c #D5512B", +"B c #C68270", +"C c #BEBDBA", +"D c #A5A3A0", +"E c #9C9A95", +"F c #B9B7B2", +"G c #D7D6D2", +"H c #E7E5E2", +"I c #E79A85", +"J c #E53C0B", +"K c #E43C0B", +"L c #E23A0B", +"M c #C93009", +"N c #010000", +"O c #040100", +"P c #FAB19C", +"Q c #FACCBE", +"R c #EB8264", +"S c #D8532D", +"T c #C0340F", +"U c #932006", +"V c #141412", +"W c #857974", +"X c #DA370B", +"Y c #EC7C5B", +"Z c #E95B32", +"` c #DE380B", +" . c #9D2306", +".. c #626261", +"+. c #FEF1ED", +"@. c #F09479", +"#. c #DC532B", +"$. c #C0350F", +"%. c #942006", +"&. c #621404", +"*. c #E2522B", +"=. c #F2A690", +"-. c #E74E21", +";. c #E23B0B", +">. c #C99181", +",. c #454342", +"'. c #E5E4E2", +"). c #FCFBFA", +"!. c #E2D8D3", +"~. c #C34C2A", +"{. c #B02B07", +"]. c #9E2D12", +"^. c #EF8D71", +"/. c #F09B83", +"(. c #EADDD7", +"_. c #272724", +":. c #F0EEEC", +"<. c #F3F2EF", +"[. c #D7D6D3", +"}. c #BFBEBB", +"|. c #9E6153", +"1. c #3F0D02", +"2. c #F0B9A9", +"3. c #F6F5F4", +"4. c #E8E7E4", +"5. c #DAD8D5", +"6. c #585652", +"7. c #F6F4F0", +"8. c #DAD8D6", +"9. c #C2C1BE", +"0. c #989691", +"a. c #0A0A08", +"b. c #F6F4F2", +"c. c #F4F3F1", +"d. c #E4E3E0", +"e. c #D3D2CE", +"f. c #63625D", +"g. c #DCDAD8", +"h. c #C7C6C2", +"i. c #ABAAA5", +"j. c #0A0A0A", +"k. c #FAF8F6", +"l. c #EFEDEA", +"m. c #DDDCD8", +"n. c #C6C4C2", +"o. c #3E3E39", +"p. c #1B1B19", +"q. c #F0EEEA", +"r. c #E0DFDD", +"s. c #CCCBC9", +"t. c #C0BFBB", +"u. c #131311", +"v. c #676663", +"w. c #FCFAF8", +"x. c #D6D4D2", +"y. c #BCBAB7", +"z. c #3C3C3A", +"A. c #DEDCD9", +"B. c #7E4B3E", +"C. c #232323", +"D. c #CC9385", +"E. c #FAFAF7", +"F. c #E6E6E2", +"G. c #CDCCCA", +"H. c #B0B0AC", +"I. c #EDE3DF", +"J. c #E78468", +"K. c #DF5D3A", +"L. c #631909", +"M. c #282828", +"N. c #B46E5E", +"O. c #FCC3B2", +"P. c #F1A691", +"Q. c #DCD2CC", +"R. c #C8C6C3", +"S. c #7E7C78", +"T. c #E8AD9C", +"U. c #E96139", +"V. c #EB7452", +"W. c #EF8E72", +"X. c #EA8063", +"Y. c #9E2E13", +"Z. c #3F1811", +"`. c #121212", +" + c #6B433B", +".+ c #E0A191", +"++ c #FDD3C7", +"@+ c #F4AD98", +"#+ c #DE532B", +"$+ c #C83409", +"%+ c #B48274", +"&+ c #383534", +"*+ c #D6340A", +"=+ c #E43D0F", +"-+ c #E8582E", +";+ c #ED7957", +">+ c #F4B6A4", +",+ c #F4B09D", +"'+ c #F0E5E0", +")+ c #F4F3EF", +"!+ c #FDF8F6", +"~+ c #FBCEC1", +"{+ c #F28B6E", +"]+ c #E44E23", +"^+ c #D3370A", +"/+ c #BF2F09", +"(+ c #260800", +"_+ c #190F0B", +":+ c #D5350A", +"<+ c #E43D0C", +"[+ c #E74C1F", +"}+ c #EFBBAB", +"|+ c #F5F4F3", +"1+ c #F5F3F1", +"2+ c #EAB1A0", +"3+ c #DE4316", +"4+ c #C5310A", +"5+ c #591202", +"6+ c #0E0504", +"7+ c #C83009", +"8+ c #E0532B", +"9+ c #E7E6E3", +"0+ c #E7E6E2", +"a+ c #DDDCD9", +"b+ c #CFCECA", +"c+ c #C14724", +"d+ c #AE2907", +"e+ c #290800", +"f+ c #0F0705", +"g+ c #9B2205", +"h+ c #C1A89F", +"i+ c #D1D0CC", +"j+ c #CFCDCA", +"k+ c #C7C6C3", +"l+ c #BBBAB7", +"m+ c #B5B4B1", +"n+ c #A7A6A2", +"o+ c #66564F", +"p+ c #0B0908", +"q+ c #010100", +"r+ c #222221", +"s+ c #51504B", +"t+ c #5D5C57", +"u+ c #3B3B37", +" . . + @ # # $ % ", +" . . . . & # * = - ; > , ' ) ! ~ . . . . ", +". . { ] ^ / ( _ : > < [ } | . 1 . . ", +" . 2 3 4 5 6 - 7 8 9 0 0 a b c d e . ", +" . f g h i j k l m n o } p a q r s t u . . ", +" v w x y z A B C D E F G H I J K L M . N ", +" O P Q R S T U . . . . V W X Y Z K ` .. ", +" ..+.@.#.$.%.. . . &.*.=.-.;.>.! . ", +",.'.).!.~.{.. . . ].^./.(.n _.. ", +"@ :.<.[.}.|.. 1.2.3.4.5.6.. ", +"# 7.6 8.9.0.. a.b.c.d.e.f.. ", +"# > < g.h.i.. j.k.l.m.n.o.. ", +"p., q.r.s.t.u. v.w.9 x.y.. . ", +"z.' [ 7 A.[.B.. C.D.E.F.G.H.. . ", +" ) } 0 I.J.K.L.. M.N.O.P.Q.R.S.. . ", +" ! | T.U.V.W.X.Y.Z.a.`. +.+++@+#+$+%+. . ", +" &+. *+=+-+;+>+,+'+)+k.!+~+{+]+^+/+(+. . ", +" . _+d :+L <+[+}+|+l.1+|+2+3+^+4+5+. . . ", +" . 6+t 7+` 8+9+0+o a+[.b+c+d+e+. . . ", +" . f+. g+h+i+j+k+l+m+n+o+. . . . ", +" . . . p+. q+r+s+t+u+. . . . . . . ", +" . . . . . . . . . . . . ", +" ", +" "}; diff --git a/lisp/toolbar/home.pbm b/lisp/toolbar/home.pbm Binary files differindex 117955f2a74..5be84460652 100644 --- a/lisp/toolbar/home.pbm +++ b/lisp/toolbar/home.pbm diff --git a/lisp/toolbar/home.xpm b/lisp/toolbar/home.xpm index 33d02aaf387..57e8f9cc25a 100644 --- a/lisp/toolbar/home.xpm +++ b/lisp/toolbar/home.xpm @@ -1,36 +1,128 @@ /* XPM */ static char * home_xpm[] = { -"24 24 9 1", -" c None", -". c #020202", -"+ c #6C7962", -"@ c #7A8A6E", -"# c #FEFEFE", -"$ c #7E8E76", -"% c #82927A", -"& c #C8CEC4", -"* c #E3E7E1", -" ", -" ", -" ", -" ", -" . ... ", -" .#. .&. ", -" .#*%..&. ", -" .##&&$.&. ", -" .##&&&&$&. ", -" .*#&&&&&&@. ", -" .##&&&&&&&&+. ", -" .###&&&&&&&&&+. ", -" ...##&&&&&&&&+... ", -" .##&&&&&&&&+. ", -" .##....&&&&+. ", -" .##.&&.&&&&+. ", -" .##.&&.&&&&+. ", -" .#*.&&.&&&&+. ", -" .&+.++.+++++. ", -" ............. ", -" ", -" ", -" ", -" "}; +"24 24 101 2", +" c None", +". c #000000", +"+ c #212121", +"@ c #2C2C2C", +"# c #C1665A", +"$ c #924B37", +"% c #2A2A2A", +"& c #333333", +"* c #343434", +"= c #242424", +"- c #944D3A", +"; c #A05443", +"> c #181818", +", c #474747", +"' c #555555", +") c #8D8D8D", +"! c #383838", +"~ c #191919", +"{ c #974F3C", +"] c #222222", +"^ c #313131", +"/ c #A1A1A1", +"( c #676767", +"_ c #ACACAC", +": c #BCBCBC", +"< c #585858", +"[ c #141414", +"} c #1C1C1C", +"| c #464646", +"1 c #666666", +"2 c #BABABA", +"3 c #7E7E7E", +"4 c #D2D2D2", +"5 c #FFFFFF", +"6 c #4F4F4F", +"7 c #262626", +"8 c #232323", +"9 c #505050", +"0 c #B2B2B2", +"a c #909090", +"b c #9A9A9A", +"c c #838383", +"d c #171717", +"e c #202020", +"f c #717171", +"g c #A6A6A6", +"h c #616161", +"i c #1D1D1D", +"j c #1F1F1F", +"k c #C4C4C4", +"l c #CACACA", +"m c #AEAEAE", +"n c #D1D1D1", +"o c #7C7C7C", +"p c #BFBFBF", +"q c #6C6C6C", +"r c #EEEEEE", +"s c #949494", +"t c #C7C7C7", +"u c #EBEBEB", +"v c #7D7D7D", +"w c #6E6E6E", +"x c #A9A9A9", +"y c #E99E8F", +"z c #DD806D", +"A c #9B5343", +"B c #CECECE", +"C c #626262", +"D c #858585", +"E c #ECA292", +"F c #D0533A", +"G c #934F3E", +"H c #6D6D6D", +"I c #ECA291", +"J c #CF543C", +"K c #371D16", +"L c #5D5D5D", +"M c #868686", +"N c #787878", +"O c #ECA696", +"P c #C95C49", +"Q c #E17C66", +"R c #924E3D", +"S c #888888", +"T c #A0A0A0", +"U c #3D1208", +"V c #D15137", +"W c #919191", +"X c #879981", +"Y c #82947C", +"Z c #8A9B85", +"` c #6E8467", +" . c #5D7555", +".. c #4C6042", +"+. c #3F4F37", +"@. c #303D2A", +"#. c #7F8F7A", +"$. c #64785E", +"%. c #44563E", +"&. c #657460", +"*. c #40503A", +" ", +" . . ", +" . . . . . + @ . ", +" . # $ . . % & * = . ", +" . - ; . > , ' ) ! ~ . ", +" . { . ] ^ / ( _ : < [ . ", +" . . } | 1 2 3 4 : 5 6 7 . ", +" . 8 9 0 a 4 b 5 : 5 : c d . ", +" . e f g 4 b 5 : 5 : 5 : 5 h i . ", +" . j k k l 5 m 5 2 5 2 5 : 5 n o } . ", +" . 8 m p p p p p p p p . . . . . a q = . ", +" . . . . r 5 5 5 5 5 5 5 . s t u . v . . . . ", +" . 4 5 . . . . . 5 . : 5 5 . w . ", +" . x 5 . y z A . 5 . B 5 5 . C . ", +" . D 5 . E F G . 5 . . . . . H . ", +" . . 5 . I J K . k s L L M N . . ", +" . . r . O P G . 5 5 5 5 5 2 . ", +" . 2 . Q # R . : : : : : S . ", +" . T U V # A . 5 5 5 5 5 W . ", +" . . . . . . . . . . . . . . . . . . . . . ", +" } X Y Z X ` ...+.@.. Y #.$.%.&.*.. ", +" . . . . . . . . . . . . . . . . . ", +" . . . ", +" "}; diff --git a/lisp/toolbar/index.pbm b/lisp/toolbar/index.pbm Binary files differindex 5411d49f071..d8aa08a7e53 100644 --- a/lisp/toolbar/index.pbm +++ b/lisp/toolbar/index.pbm diff --git a/lisp/toolbar/index.xpm b/lisp/toolbar/index.xpm index 154e4286083..7e1de12121b 100644 --- a/lisp/toolbar/index.xpm +++ b/lisp/toolbar/index.xpm @@ -1,39 +1,201 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 9 1", -" c Gray0", -". c #4646424233b4", -"X c #6f4d67895151", -"o c #911b871c69df", -"O c #b3d8a9b58836", -"+ c #c280b9779c39", -"@ c #cd0cc646ae2e", -"# c #e0e0e4e4e0e0", -"$ c None", -/* pixels */ -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$ $$", -"$$$$ ################ $$", -"$$$$ ##### O######## $$", -"$$$$ #### oX O####### $$", -"$$$$ @o $$", -"$$$$ #### @o O####### $$", -"$$$$ #### @o O##### $$", -"$$$$ #### @o X. O## $$", -"$$$$ +o OX oX $$", -"$$$$ ## X +o Oo Oo oX $$", -"$$$$ ## o +OoOOoOOOOo $$", -"$$$$ ## O +++OOOOOOOX $$", -"$$$$ O O++O+OOOOOX $$", -"$$$$ ## ooO+++O+OOOOX $$", -"$$$$ ### oO++++OOOOo. $$", -"$$$$ ### XOO++O+OOOo $$$", -"$$$$ o++++OOOoX $$$", -"$$$$$$$$$ XOO+++OOoX $$$", -"$$$$$$$$$$ oO++OOOX $$$$", -"$$$$$$$$$$$ OO++OOX $$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$" -}; +static char * index_xpm[] = { +"24 24 174 2", +" c None", +". c #000000", +"+ c #FDFDFD", +"@ c #F5F5F5", +"# c #F6F6F6", +"$ c #D0D0D0", +"% c #C1C1C1", +"& c #C3C3C3", +"* c #C6C6C6", +"= c #C8C8C8", +"- c #8D8D8D", +"; c #CACACA", +"> c #919191", +", c #EFEFEF", +"' c #878787", +") c #8A8A8A", +"! c #5C5C5C", +"~ c #F8F8F8", +"{ c #EAEAEA", +"] c #CCCCCC", +"^ c #CECECE", +"/ c #979797", +"( c #CDCDCD", +"_ c #A1A1A1", +": c #090600", +"< c #A3A3A3", +"[ c #C5C5C5", +"} c #C4C4C4", +"| c #D1D1D1", +"1 c #D2D2D1", +"2 c #D2D2D2", +"3 c #9A9A9A", +"4 c #E8E8E8", +"5 c #949494", +"6 c #939393", +"7 c #574F4F", +"8 c #FDFDFC", +"9 c #777777", +"0 c #7E7E7E", +"a c #9D9D9D", +"b c #6B6B6B", +"c c #F1F1F1", +"d c #ECECEC", +"e c #CFCFCF", +"f c #575050", +"g c #FDFAF8", +"h c #A5A5A5", +"i c #B9B9B9", +"j c #EEEEEE", +"k c #EDEDED", +"l c #D5D5D5", +"m c #BABABA", +"n c #6D6767", +"o c #F9F1EA", +"p c #9E9E9E", +"q c #B5B5B5", +"r c #D9D9D9", +"s c #D7D7D7", +"t c #BCBCBC", +"u c #625C5B", +"v c #F9EEE4", +"w c #4F4D4A", +"x c #646464", +"y c #747474", +"z c #D6D6D5", +"A c #DFDFDF", +"B c #A0A0A0", +"C c #615C5B", +"D c #F9F0E4", +"E c #746C67", +"F c #FEFDFC", +"G c #FFFEFD", +"H c #131210", +"I c #636363", +"J c #7C7C7C", +"K c #F3F2F2", +"L c #98948F", +"M c #F9EFE3", +"N c #A09489", +"O c #FEFDFD", +"P c #766D68", +"Q c #736961", +"R c #A3A3A2", +"S c #A6A6A6", +"T c #DBDBDB", +"U c #C7C7C7", +"V c #E8E5E2", +"W c #97938E", +"X c #F6E9D8", +"Y c #84817A", +"Z c #FBF3EA", +"` c #908C86", +" . c #F1EDE7", +".. c #7B7975", +"+. c #878786", +"@. c #070000", +"#. c #FAFAFA", +"$. c #DDDDDD", +"%. c #E2DFDC", +"&. c #A8A199", +"*. c #F0E0CE", +"=. c #C8BFB4", +"-. c #D5CCBF", +";. c #DFD7CD", +">. c #DAD3C9", +",. c #DDCFC4", +"'. c #928C84", +"). c #A8A8A8", +"!. c #959595", +"~. c #040000", +"{. c #D9D5D2", +"]. c #D9CABB", +"^. c #D7C8B8", +"/. c #DECFBF", +"(. c #D8C9B9", +"_. c #E3D3C2", +":. c #C9BBAC", +"<. c #D9CEC2", +"[. c #7F766D", +"}. c #909090", +"|. c #D3D3D3", +"1. c #060100", +"2. c #C0BDBA", +"3. c #8C8782", +"4. c #C2B5A7", +"5. c #BFB4A6", +"6. c #B8AB9D", +"7. c #BAAD9E", +"8. c #BEB0A2", +"9. c #948A7F", +"0. c #716860", +"a. c #E2E2E2", +"b. c #A9A9A8", +"c. c #332C2B", +"d. c #5D5954", +"e. c #79736C", +"f. c #958C80", +"g. c #8D8379", +"h. c #988D82", +"i. c #706760", +"j. c #787878", +"k. c #E4E4E4", +"l. c #C2C2C2", +"m. c #201A1A", +"n. c #57514F", +"o. c #625C59", +"p. c #625A53", +"q. c #6B625A", +"r. c #585251", +"s. c #696764", +"t. c #080000", +"u. c #989898", +"v. c #B0B0B0", +"w. c #AFAFAF", +"x. c #999999", +"y. c #9D9897", +"z. c #050000", +"A. c #0C0303", +"B. c #080100", +"C. c #030000", +"D. c #282523", +"E. c #5A5A5A", +"F. c #868686", +"G. c #ECE4E2", +"H. c #DED7D5", +"I. c #D8D1D0", +"J. c #E0DBD7", +"K. c #E9E6E3", +"L. c #FCFBFA", +"M. c #030500", +"N. c #0B0505", +"O. c #14100F", +"P. c #090806", +"Q. c #000100", +" ", +" . . . . . . . . . . . . . . . . . . . . ", +" . + @ @ @ @ @ @ @ # # # # # # # # # $ . ", +" . @ % % % & & & & * * * * * = = = = - . ", +" . # & & & * * * * = = = = = ; ; ; ; > . ", +" . , ' ' ' ) ) ) ) - - - - - > > > > ! . ", +" . ~ { { { { { { { { { { { { { { { { ; . ", +" . # ; ; ; ] ] ] ] ] ^ ^ ^ ^ $ $ $ $ / . ", +" . # ] ] ] ( ^ ^ ^ _ : < [ } | 1 | 2 3 . ", +" . 4 5 5 5 / / / 6 7 8 . 9 0 - a a a b . ", +" . ~ c d d d d d e f g . h i $ j j k * . ", +" . ~ 2 2 2 2 l l m n o . > p q r r r < . ", +" . ~ l l l l s s t u v w . x . y p z < . ", +" . A B B B B < 9 . C D E F . G H . I J . ", +" . ~ @ , , , j . K L M N O P F Q R . S . ", +" . ~ T T T T U . V W X Y Z ` ...+.@.< . ", +" . #.$.$.$.$.& . %.&.*.=.-.;.>.,.'.@.p . ", +" . { ).).).).!.~.{.].^./.(._.:.<.[.@.}.. ", +" . #.@ c c c |.1.2.3.4.5.6.7.8.9.0.@.] . ", +" . #.a.a.a.a.l b.c.d.e.f.g.9.h.i.. j.q . ", +" . #.a.a.a.a.k.l.j.m.n.o.p.q.r.s.t.u.q . ", +" . a.v.v.v.v.v.w.x.y.z.A.t.B.C.D.E.F.m . ", +" . . . . . . . . . ~.G.H.I.J.K.L.M.. . . ", +" ~.N.z.O.C.P.. Q. "}; diff --git a/lisp/toolbar/jump_to.pbm b/lisp/toolbar/jump_to.pbm Binary files differindex effcdcc8bfd..5f5921baf57 100644 --- a/lisp/toolbar/jump_to.pbm +++ b/lisp/toolbar/jump_to.pbm diff --git a/lisp/toolbar/jump_to.xpm b/lisp/toolbar/jump_to.xpm index 2106d015285..8f9897974ab 100644 --- a/lisp/toolbar/jump_to.xpm +++ b/lisp/toolbar/jump_to.xpm @@ -1,39 +1,171 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 9 1", -" c #011b011b011b", -". c #5e0868be52d3", -"X c #7c7c8b8b6e6e", -"o c #8d4d97577838", -"O c #ae51c17b9b26", -"+ c #cedcabd6996e", -"@ c #d305cecebaba", -"# c #e38de39ed709", -"$ c None", -/* pixels */ -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$ $$$$$$$$", -"$$$$$$$$$$$ #@+ $$$$$$", -"$$$$$$$$$$$ ###@+ $$$$$$", -"$$$$$$$ #+++ $$$$$", -"$$$$$$$ o@##O ++++ $$$$$", -"$$$$$$$$ .OO. +++o $$$$$", -"$$$$$$ #@O.. +++ $$$$$$", -"$$$$ #@@Oo.. ++ $$$$$$", -"$$$ #@@OOo. . $$$$$$$$", -"$$$$ #OOO. $ $$$$$$$$$$", -"$$$$$ #OX. $$$$$$$$$$$$$", -"$$$$$$ O. $$$$$$$$$$$$$$", -"$$$$$$$ . $$$$$$$$$$$$$$", -"$$$$$$$$ $$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$", -"$$$$$$$$$$$$$$$$$$$$$$$$" -}; +static char * jump_to_xpm[] = { +"24 24 144 2", +" c None", +". c #000000", +"+ c #9ABC82", +"@ c #C1E3AA", +"# c #A0C487", +"$ c #8F6508", +"% c #AD671D", +"& c #D6AF41", +"* c #E1B744", +"= c #B86F20", +"- c #7E5907", +"; c #D8E7CD", +"> c #D9E7CF", +", c #DDEAD2", +"' c #E4EFDA", +") c #EBF6DF", +"! c #C8EBB0", +"~ c #A2C688", +"{ c #986F26", +"] c #E2B946", +"^ c #EFCD64", +"/ c #F4D268", +"( c #F6D469", +"_ c #E7C24A", +": c #D5B044", +"< c #BC8C31", +"[ c #1A0700", +"} c #D7E6CD", +"| c #B2D29C", +"1 c #B6D69F", +"2 c #BDDEA5", +"3 c #C4E7AC", +"4 c #CAEEB1", +"5 c #A1C387", +"6 c #CBB86E", +"7 c #EDD97E", +"8 c #FEE882", +"9 c #FEE77E", +"0 c #FDDF60", +"a c #FBD14F", +"b c #E4BF49", +"c c #BB8C31", +"d c #CFE2C3", +"e c #B2D19C", +"f c #B5D59F", +"g c #BBDBA4", +"h c #C1E3A9", +"i c #C6E9AE", +"j c #C3E6AB", +"k c #A9CE8D", +"l c #DCBA5C", +"m c #FBE46B", +"n c #FFEB64", +"o c #FFE054", +"p c #FED952", +"q c #F8CF4E", +"r c #C4A13E", +"s c #8BA27B", +"t c #618249", +"u c #628349", +"v c #64864B", +"w c #66894D", +"x c #688B4E", +"y c #678B4D", +"z c #6B9251", +"A c #719755", +"B c #55833A", +"C c #ECC75E", +"D c #FFED59", +"E c #FFE757", +"F c #FFDF54", +"G c #FBD44F", +"H c #E1BD48", +"I c #B36C1F", +"J c #608148", +"K c #628449", +"L c #63854A", +"M c #65894C", +"N c #6C9151", +"O c #527E39", +"P c #B39237", +"Q c #F0C248", +"R c #FFF25B", +"S c #FFEB58", +"T c #FFE155", +"U c #FBD450", +"V c #E3BD49", +"W c #BC983B", +"X c #618349", +"Y c #628549", +"Z c #65884B", +"` c #4D7735", +" . c #907934", +".. c #DCB444", +"+. c #FCDB52", +"@. c #FFEF5A", +"#. c #FFE957", +"$. c #FEDF54", +"%. c #F9D24F", +"&. c #E0BA48", +"*. c #B08F37", +"=. c #52743B", +"-. c #456A2F", +";. c #608248", +">. c #628448", +",. c #476F31", +"'. c #7F6B32", +"). c #D0AF4B", +"!. c #F5CF4E", +"~. c #FFE255", +"{. c #FEDA52", +"]. c #EAC54B", +"^. c #D0AC42", +"/. c #9C5D1A", +"(. c #5A7B42", +"_. c #456C2F", +":. c #6F5C23", +"<. c #A78833", +"[. c #F0C54A", +"}. c #FFDA52", +"|. c #FFDE53", +"1. c #C39032", +"2. c #886423", +"3. c #BC9D3B", +"4. c #F0C84E", +"5. c #FFD551", +"6. c #FED751", +"7. c #FDD550", +"8. c #EDC74C", +"9. c #E5BF49", +"0. c #CCA941", +"a. c #AB7727", +"b. c #B1822D", +"c. c #DCB746", +"d. c #DFBA47", +"e. c #EDC64C", +"f. c #E9C34B", +"g. c #D6B144", +"h. c #C19D3D", +"i. c #AB7C2B", +"j. c #BC7222", +"k. c #BB983B", +"l. c #B09638", +"m. c #A2621B", +" ", +" ", +" . ", +" . . ", +" . + . . . . . . . ", +" . . . . . . @ # . . $ % & * = - . . ", +" . ; > , ' ) ! ! ~ . { ] ^ / ( _ : < [ . ", +" . } | 1 2 3 4 4 3 5 . 6 7 8 9 0 a b c . ", +" . d e f g h i i h j k . l m n o p q r - . ", +" . s t u v w x x y z A B . C D E F G H I . ", +" . s J t K L v v M N O . P Q R S T U V W . ", +" . s J J t X u Y Z ` . ...+.@.#.$.%.&.*.. ", +" . =.-.-.-.-.;.>.,.. '.).!.E E ~.{.].^./.. ", +" . . . . . . (._.. :.<.[.}.|.|.{.%.V 1.$ . ", +" . -.. . 2.3.4.5.6.7.8.9.0.a.. ", +" . . . . b.c.d.e.f.g.h.i.. . ", +" . . $ j.k.l.m.$ . . ", +" . . . . . . ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-copy.xpm b/lisp/toolbar/lc-copy.xpm new file mode 100644 index 00000000000..f50fb51baf5 --- /dev/null +++ b/lisp/toolbar/lc-copy.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char * copy2_xpm[] = { +"24 24 6 1", +" c None", +". c #FFFFFF", +"+ c #000100", +"@ c #6B6B66", +"# c #BBBDBA", +"$ c #504D46", +" ", +" +++++++++++++ ", +" +#..........#+ ", +" +............+ ", +" +.#@@@.#@.@#.+ ", +" +............+ ", +" +.@$.@@#.++++++++++++ ", +" +.......+#..........#+ ", +" +.#@@.@@+............+ ", +" +.......+.#@@#.#@.@#.+ ", +" +.@$$.@@+............+ ", +" +.......+.@@.@@#.#@..+ ", +" +.#@@.@@+............+ ", +" +.......+.#@@.@@#.#@.+ ", +" +#......+............+ ", +" ++++++++.@@@.@@#.#@.+ ", +" +............+ ", +" +.#@@.@@#.#@.+ ", +" +............+ ", +" +#..........#+ ", +" ++++++++++++++ ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-cut.xpm b/lisp/toolbar/lc-cut.xpm new file mode 100644 index 00000000000..750ec729f60 --- /dev/null +++ b/lisp/toolbar/lc-cut.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * cut2_xpm[] = { +"24 24 7 1", +" c None", +". c #000100", +"+ c #BBBDBA", +"@ c #FFFFFF", +"# c #6B6B66", +"$ c #504D46", +"% c #3E4850", +" ", +" ", +" . . ", +" . . ", +" .+. .@. ", +" .@$ #@. ", +" .@#. .@+. ", +" .@+$ #@+. ", +" #@#. .@+$ ", +" .@+$ $@+. ", +" #@#.%@+# ", +" .@+$#++. ", +" .@+$+. ", +" .++.. ", +" ..#$. ", +" ............. ", +" . ... ... ... ", +" .. .. .. .. ", +" . . . . ", +" .. .. .. .. ", +" .... .. . ", +" .... .... ", +" ", +" "}; diff --git a/lisp/toolbar/lc-help.xpm b/lisp/toolbar/lc-help.xpm new file mode 100644 index 00000000000..663460c3a06 --- /dev/null +++ b/lisp/toolbar/lc-help.xpm @@ -0,0 +1,39 @@ +/* XPM */ +static char * help2_xpm[] = { +"24 24 12 1", +" c None", +". c #000100", +"+ c #FFFFFF", +"@ c #BBBDBA", +"# c #C43107", +"$ c #EBA291", +"% c #D15237", +"& c #504D46", +"* c #751805", +"= c #6B6B66", +"- c #974F3D", +"; c #3E4850", +" .. &....& ", +" ....&.;@++++@..&.... ", +".. &.+++++++++@.. .. ", +" . .%$+++++++++@#*. . ", +" ..%$$%+@@@++++###*... ", +" -.$$%%$@@@@@+$####.. ", +" .$$$%#*.....=#%####. ", +" =+$%#*.. .*#$##$.. ", +"&++@%#.. .*$$+@.. ", +".++@@-. *$++@&. ", +".++@@@. .+++@=. ", +".++@@@. .++@@&. ", +".+++@@. =++@@.. ", +"&@++@@-. .$++@@.. ", +" .+++$%*. .-$$@@=.. ", +" .@$%%$%*...&$$$%#$.. ", +" &.###%$$++++$$###... ", +" ..*####$++++$###*... ", +" . .*###+++@@@%#... . ", +" . ..#@@@@@@@&... . ", +" .......&&&..... .. ", +" ........ .... ", +" ", +" "}; diff --git a/lisp/toolbar/lc-home.xpm b/lisp/toolbar/lc-home.xpm new file mode 100644 index 00000000000..c7a7ecfb634 --- /dev/null +++ b/lisp/toolbar/lc-home.xpm @@ -0,0 +1,38 @@ +/* XPM */ +static char * home2_xpm[] = { +"24 24 11 1", +" c None", +". c #000100", +"+ c #BBBDBA", +"@ c #FFFFFF", +"# c #6B6B66", +"$ c #504D46", +"% c #974F3D", +"& c #EBA291", +"* c #87AF85", +"= c #3E4850", +"- c #D15237", +" ", +" .. ", +" .... ..=. ", +" .%%..===.. ", +" .%%..$$#$.. ", +" .%..=+#++$.. ", +" ...$#+#++@$.. ", +" ..$+#++@+@+#.. ", +" ..#+++@+@+@+@#.. ", +" ..+++@+@+@+@+@+#.. ", +" ..+++++++++.....##.. ", +" ....@@@@@@@@.++@.#.... ", +" .+@.....@.+@@.#. ", +" .+@.&&%.@.+@@.#. ", +" .#@.&-%.@.....#. ", +" ..@.&-..++####.. ", +" ..@.&-%.@@@@@+. ", +" .+.&%%.+++++#. ", +" .+.-%%.@@@@@#. ", +" .................... . ", +" .****##$$$.**#$#$. ", +" .. ......... ...... ", +" ... ", +" "}; diff --git a/lisp/toolbar/lc-index.xpm b/lisp/toolbar/lc-index.xpm new file mode 100644 index 00000000000..7a2464f032b --- /dev/null +++ b/lisp/toolbar/lc-index.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * index2_xpm[] = { +"24 24 7 1", +" c None", +". c #BBBDBA", +"+ c #000100", +"@ c #FFFFFF", +"# c #6B6B66", +"$ c #504D46", +"% c #3E4850", +" ", +" ++++++++++++++++++++ ", +" +@@@@@@@@@@@@@@@@@.+ ", +" +@................#+ ", +" +@................#+ ", +" +@#################+ ", +" +@@@@@@@@@@@@@@@@@.+ ", +" +@.................+ ", +" +@........+........+ ", +" +@.......$@+###...#+ ", +" +@@@@@@@.$@+...@@@.+ ", +" +@.......#@+#......+ ", +" +@.......#@$+#+#...+ ", +" +@.....#+#@#@+@++##+ ", +" +@@@@@@+@.@.@#@#.+.+ ", +" +@.....+@.@#@#@##+.+ ", +" +@.....+@.@.....#+.+ ", +" +@.....+........#+#+ ", +" +@@@@@.+.#.....##+.+ ", +" +@@@@@..%$######+#.+ ", +" +@@@@@@.#+$#$#$#+..+ ", +" +@........++++++$#.+ ", +" ++++++++++@...@@++++ ", +" ++++++++ "}; diff --git a/lisp/toolbar/lc-jump_to.xpm b/lisp/toolbar/lc-jump_to.xpm new file mode 100644 index 00000000000..cd7499396c7 --- /dev/null +++ b/lisp/toolbar/lc-jump_to.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * jump_to2_xpm[] = { +"24 24 8 1", +" c None", +". c #D3B354", +"+ c #000100", +"@ c #87AF85", +"# c #974F3D", +"$ c #FFFFFF", +"% c #D15237", +"& c #BBBDBA", +" ", +" ", +" + ", +" ++ ", +" +@+ ++++++ ", +" ++++++@@+ +.#..%#++ ", +" +$$$$$@@@+........++ ", +" +&@@@@@@@@+........+ ", +" +&@@@@@@@@@+.......#+ ", +" +@@@@@@@@@@@+......%+ ", +" +@@@@@@@@@@+........+ ", +" +@@@@@@@@@+.........+ ", +" +@@@@@@@@+#........#+ ", +" ++++++@@+#..........+ ", +" +@++#.........+ ", +" ++ ++........++ ", +" + +.%..#.++ ", +" ++++++ ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-left_arrow.xpm b/lisp/toolbar/lc-left_arrow.xpm new file mode 100644 index 00000000000..61dded3a5aa --- /dev/null +++ b/lisp/toolbar/lc-left_arrow.xpm @@ -0,0 +1,34 @@ +/* XPM */ +static char * left_arrow2_xpm[] = { +"24 24 7 1", +" c None", +". c #87AF85", +"+ c #000100", +"@ c #BBBDBA", +"# c #504D46", +"$ c #6B6B66", +"% c #3E4850", +" ", +" ", +" ", +" + ", +" ++ ", +" +@+ ", +" +@@+ ", +" +@@@++++++++ ", +" +@@@@@@@@@@.+ ", +" +@.@@@@...@.$+ ", +" %@.@@@..@@@@..+ ", +" +@............$+ ", +" +#...........#+ ", +" +#..........#+ ", +" +#..########+ ", +" +#.#++++++++ ", +" +##+ ", +" +#+ ", +" ++ ", +" + ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-new.xpm b/lisp/toolbar/lc-new.xpm new file mode 100644 index 00000000000..e2984bffd4f --- /dev/null +++ b/lisp/toolbar/lc-new.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char * new2_xpm[] = { +"24 24 6 1", +" c None", +". c #FFFFFF", +"+ c #BBBDBA", +"@ c #000100", +"# c #6B6B66", +"$ c #504D46", +" ", +" @@@@@@@@@@@@@ ", +" @+..........+$@ ", +" @...........+++@ ", +" @...........+..+@ ", +" @...........+...#@ ", +" @...........+...++@ ", +" @...........+@@@@@@@ ", +" @............++++##@ ", +" @.............++++#@ ", +" @...............++#@ ", +" @................+#@ ", +" @.................#@ ", +" @.................+@ ", +" @.................+@ ", +" @...............+++@ ", +" @..............++++@ ", +" @.............+++++@ ", +" @............++++++@ ", +" @............++++++@ ", +" @+...+.+.+.++++++++@ ", +" @+++++++++++++++++#@ ", +" @@@@@@@@@@@@@@@@@@ ", +" "}; diff --git a/lisp/toolbar/lc-open.xpm b/lisp/toolbar/lc-open.xpm new file mode 100644 index 00000000000..0e074830bb6 --- /dev/null +++ b/lisp/toolbar/lc-open.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * open2_xpm[] = { +"24 24 8 1", +" c None", +". c #BBBDBA", +"+ c #000100", +"@ c #87AF85", +"# c #FFFFFF", +"$ c #6B6B66", +"% c #504D46", +"& c #3E4850", +" ", +" ", +" ", +" +++++++ ", +" +.#####$% ", +" +#.....@% ", +"+.#......%+ ", +"+..@@@...$%++++++++ ", +"+.@@@@@..@@........+ ", +"+.@@@@@@@@@@@@@@@@$+ ", +"+.$$++++++++++++++++++ ", +"+.$%################..& ", +"+.$+#.................+ ", +"+.%.#...............@$+ ", +"+.+#...............@@%+ ", +"+.$#............@@.@$+ ", +"+....@@@@@.....@@@@$%+ ", +"+.#..@@@@@@@@@@@@$$$+ ", +"+#.@@@@$$$$$$$$$$$$%+ ", +" +++++++++++++++++++ ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-paste.xpm b/lisp/toolbar/lc-paste.xpm new file mode 100644 index 00000000000..c728f0f038c --- /dev/null +++ b/lisp/toolbar/lc-paste.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * paste2_xpm[] = { +"24 24 8 1", +" c None", +". c #FFFFFF", +"+ c #BBBDBA", +"@ c #000100", +"# c #6B6B66", +"$ c #504D46", +"% c #D3B354", +"& c #974F3D", +" @@@@ ", +" @@@@@@+..#@@@@@@ ", +"@.....$.++#$+...+@ ", +"@.++++$.##+$#+++%@ ", +"@.+++$..+++#$#++%@ ", +"@.++$++++++#$$++%@ ", +"@.++#$$$$$$$$#++%@ ", +"@.+++########+++%@ ", +"@.+++++#$@@@@@$$@@@@@ ", +"@.+++++$+...........+@ ", +"@.+++++$.............@ ", +"@.+++++@.+##+..+#.#+.@ ", +"@.+++++@.............@ ", +"@.+++++$.##.###+.+#..@ ", +"@.+++++$.............@ ", +"@.+++++$.+##.###+.+#.@ ", +"@.+++++@.............@ ", +"@.+++++@.##.###+.+#..@ ", +"@.+++++$.............@ ", +"@.+++++$.+##.###+.+#.@ ", +"@+%%%%&@.............@ ", +" @@@@@@@+...........+@ ", +" @@@@@@@@@@@@@ ", +" "}; diff --git a/lisp/toolbar/lc-preferences.xpm b/lisp/toolbar/lc-preferences.xpm new file mode 100644 index 00000000000..cebac821d6e --- /dev/null +++ b/lisp/toolbar/lc-preferences.xpm @@ -0,0 +1,37 @@ +/* XPM */ +static char * preferences2_xpm[] = { +"24 24 10 1", +" c None", +". c #000100", +"+ c #BBBDBA", +"@ c #FFFFFF", +"# c #7A98B0", +"$ c #6B6B66", +"% c #4D687C", +"& c #B0CCE2", +"* c #504D46", +"= c #3E4850", +" .. ", +" .++$. ", +" .+++. .. ", +" .@+. .@$. ", +" .. =@+. .@++. ", +" .+ ..+@+$. .++. ", +" .+++@@+++. .@.. ", +" .+++++++$. .@. ", +" .....@@+$..+. ", +" .@@+.+. ", +" .@.+.. ", +" .+.$*. ", +" ....+.$$$$. ", +" .#&#.. .+++$. ", +" .#&+&%. .@@+$. ", +" .#@#%&%. .@@+$. ", +" .#@#%&#%. .@@+$..", +" .&@#%&#%. .+$*+.", +" .#@#%&#%. .+++.", +" .&@#&#%.. ... ", +" .#&&#%.. ", +" .##%.. ", +" ... ", +" "}; diff --git a/lisp/toolbar/lc-print.xpm b/lisp/toolbar/lc-print.xpm new file mode 100644 index 00000000000..8c67bb632f0 --- /dev/null +++ b/lisp/toolbar/lc-print.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char * print2_xpm[] = { +"24 24 6 1", +" c None", +". c #FFFFFF", +"+ c #000100", +"@ c #BBBDBA", +"# c #6B6B66", +"$ c #504D46", +" ", +" ++++++++++++ ", +" +@..........@+ ", +" +.........@@@+ ", +" +.###.#@@...@+ ", +" +...........@+ ", +" +.##@.#@.@#.@+ ", +" +...........@+ ", +" +.@@.@.@@@..@+ ", +" +....@......@+ ", +" ++.###@##@#@@@++ ", +" +.+@@@@@@@@@@@@+#+ ", +" +..#$++++++++++##@@+ ", +" +....................+ ", +" +@#...............@@@+ ", +" +@#.@@@@@@@@@@@@@@#@#+ ", +" +@#...............$##+ ", +" +@#$$$$$$$$$$$$$$$$##+ ", +" +@@###$#$$$$$$$$$$###+ ", +" +#@@#########$#######+ ", +" ++++++++++++++++++++ ", +" +#@@@@@@@@@@@@@@@##+ ", +" ++++++++++++++++++ ", +" "}; diff --git a/lisp/toolbar/lc-right_arrow.xpm b/lisp/toolbar/lc-right_arrow.xpm new file mode 100644 index 00000000000..a74b70c74b3 --- /dev/null +++ b/lisp/toolbar/lc-right_arrow.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char * right_arrow2_xpm[] = { +"24 24 6 1", +" c None", +". c #87AF85", +"+ c #000100", +"@ c #BBBDBA", +"# c #6B6B66", +"$ c #504D46", +" ", +" ", +" ", +" + ", +" ++ ", +" +.+ ", +" +..+ ", +" ++++++++@..+ ", +" +@@@@@@@@@..+ ", +" +@@..........+ ", +" +..........@..+ ", +" +.............$+ ", +" +............$+ ", +" +...........$+ ", +" +.######...$+ ", +" ++++++++#.$+ ", +" +#$+ ", +" +$+ ", +" ++ ", +" + ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-save.xpm b/lisp/toolbar/lc-save.xpm new file mode 100644 index 00000000000..fd3156abfbf --- /dev/null +++ b/lisp/toolbar/lc-save.xpm @@ -0,0 +1,39 @@ +/* XPM */ +static char * save2_xpm[] = { +"24 24 12 1", +" c None", +". c #FFFFFF", +"+ c #000100", +"@ c #BBBDBA", +"# c #7A98B0", +"$ c #6B6B66", +"% c #EBA291", +"& c #3E4850", +"* c #B0CCE2", +"= c #4D687C", +"- c #504D46", +"; c #974F3D", +" ", +" +++++++++++++++++++ ", +" +**$%%%%%%%%%%%%@$**+ ", +" +*#$%%%%%%%%;;%;;$#=+ ", +" +*#$%%%%%%;%;%;;;$#=+ ", +" +*#$.............$#=+ ", +" +*#$.............$#=+ ", +" +*#$@@@@@@@@@@@@@$#=+ ", +" +*#$.............$#=+ ", +" +*#$.............$#=+ ", +" +*#$@@@@@@@@@@@@@$#$+ ", +" +*#$.............$#&+ ", +" +*##$$$$$$$$$$$$$$#&+ ", +" +*#################&+ ", +" +*###&&&==$$$$&&&#*&+ ", +" +*##&@@....@@@@$==*&+ ", +" +*##&@.$--@@@@@&==*&+ ", +" +*##&..$--@@@@@&==*&+ ", +" +*##&..---@@@..&==*&+ ", +" +###&@@---@@...&==*&+ ", +" +==&@@@@@@..@@&==*&+ ", +" ++++++++++++++++&+ ", +" ", +" "}; diff --git a/lisp/toolbar/lc-saveas.xpm b/lisp/toolbar/lc-saveas.xpm new file mode 100644 index 00000000000..11cc684c22d --- /dev/null +++ b/lisp/toolbar/lc-saveas.xpm @@ -0,0 +1,40 @@ +/* XPM */ +static char * saveas2_xpm[] = { +"24 24 13 1", +" c None", +". c #000100", +"+ c #BBBDBA", +"@ c #7A98B0", +"# c #FFFFFF", +"$ c #6B6B66", +"% c #3E4850", +"& c #B0CCE2", +"* c #4D687C", +"= c #EBA291", +"- c #504D46", +"; c #D3B354", +"> c #974F3D", +" .. ", +" .;;. ", +" .............;;-... ", +" .&&$========.;;-.%@@. ", +" .&@$=======.;;-.>-@*. ", +" .&@$======.;;-.>>%@*. ", +" .&@$#####.;;-.++#$@*. ", +" .&@$####.;;-.++##$@*. ", +" .&@$+++.;;-.+++++$@*. ", +" .&@$###.;-.++####$@*. ", +" .&@$##.-..++#####$@*. ", +" .&@$++..+++++++++$@$. ", +" .&@$###++########$@%. ", +" .&@@$$$$$$$$$$$$$$@%. ", +" .&@@@@@@@@@@@@@@@@@%. ", +" .&@@@%%%**$$$$%%%@&%. ", +" .&@@%++####++++$**&%. ", +" .&@@%+#$--+++++%**&%. ", +" .&@@%##$--+++++%**&%. ", +" .&@@%##---+++##%**&%. ", +" .@@@%++---++###%**&%. ", +" .**%++++++##++%**&%. ", +" ................%. ", +" "}; diff --git a/lisp/toolbar/lc-search.xpm b/lisp/toolbar/lc-search.xpm new file mode 100644 index 00000000000..478b63ff648 --- /dev/null +++ b/lisp/toolbar/lc-search.xpm @@ -0,0 +1,33 @@ +/* XPM */ +static char * search2_xpm[] = { +"24 24 6 1", +" c None", +". c #FFFFFF", +"+ c #BBBDBA", +"@ c #000100", +"# c #6B6B66", +"$ c #504D46", +" ", +" @@@@@@@@@@@@@ ", +" @+..........+$@ ", +" @...........+++@ ", +" @...........+..+@ ", +" @...........+...#@ ", +" @...........+...++@ ", +" @....+$@@$+.+@@@@@@@ ", +" @...+$+++#$+.++++##@ ", +" @...$+..++#$..++++#@ ", +" @...@+.++++@+...++#@ ", +" @...@++++++@++...+#@ ", +" @...$#+++++$++....#@ ", +" @...+$#+++@@++....+@ ", +" @...+#$@@$#@@+....+@ ", +" @....++++++@@@+++++@ ", +" @....++++++#@@@++++@ ", +" @.....++++++#@@@+++@ ", +" @..........++#@@+++@ ", +" @..........++++++++@ ", +" @+...+.+.+.++++++++@ ", +" @+++++++++++++#####@ ", +" @@@@@@@@@@@@@@@@@@ ", +" "}; diff --git a/lisp/toolbar/lc-spell.xpm b/lisp/toolbar/lc-spell.xpm new file mode 100644 index 00000000000..ec952467cc5 --- /dev/null +++ b/lisp/toolbar/lc-spell.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * spell2_xpm[] = { +"24 24 8 1", +" c None", +". c #000100", +"+ c #87AF85", +"@ c #504D46", +"# c #BBBDBA", +"$ c #6B6B66", +"% c #3E4850", +"& c #FFFFFF", +" ", +" ", +" ", +" ", +" ... .... ... ", +" .. . .. . .. . ", +" .. . .... .. ", +" ..... .. . .. ", +" .. . .. . .. . . ", +" .. . .... ... ... ", +" .+. ", +" .. .+@ ", +" .+. .++. ", +" @+. %#+. ", +" .++. .#+$. ", +" .++.&++. ", +" .+++++$. ", +" .++++. ", +" .+++@. ", +" .++. ", +" .+@. ", +" .. ", +" ", +" "}; diff --git a/lisp/toolbar/lc-undo.xpm b/lisp/toolbar/lc-undo.xpm new file mode 100644 index 00000000000..8172fb2c951 --- /dev/null +++ b/lisp/toolbar/lc-undo.xpm @@ -0,0 +1,32 @@ +/* XPM */ +static char * undo2_xpm[] = { +"24 24 5 1", +" c None", +". c #D3B354", +"+ c #000100", +"@ c #FFFFFF", +"# c #6B6B66", +" ", +" ", +" ", +" + ", +" ++ ", +" +@+ ", +" +@.++++ ", +" +@......+ ", +" +@........+ ", +" +...........+ ", +" +..........++ ", +" +..........+ ", +" +..+++....+ ", +" +.+ ++...+ ", +" ++ ++..+ ", +" + +..+ ", +" +..+ ", +" +.+ ", +" +.#+ ", +" +..+ ", +" ++ ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/lc-up_arrow.xpm b/lisp/toolbar/lc-up_arrow.xpm new file mode 100644 index 00000000000..ed4b7526015 --- /dev/null +++ b/lisp/toolbar/lc-up_arrow.xpm @@ -0,0 +1,35 @@ +/* XPM */ +static char * up_arrow2_xpm[] = { +"24 24 8 1", +" c None", +". c #87AF85", +"+ c #000100", +"@ c #504D46", +"# c #6B6B66", +"$ c #BBBDBA", +"% c #FFFFFF", +"& c #3E4850", +" ", +" ", +" + ", +" &$+ ", +" +%.@+ ", +" +%...@+ ", +" +%.....@+ ", +" +%......#@+ ", +" +%.......##@+ ", +" +%$$.....#@@@@+ ", +" +++++$.....@+++++ ", +" +$....#@+ ", +" +$....#@+ ", +" +$...##@+ ", +" +$...##@+ ", +" +$...##@+ ", +" +...#@@@+ ", +" +++++++++ ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/left_arrow.pbm b/lisp/toolbar/left_arrow.pbm Binary files differindex 6d6f07f0983..56005e71c3f 100644 --- a/lisp/toolbar/left_arrow.pbm +++ b/lisp/toolbar/left_arrow.pbm diff --git a/lisp/toolbar/left_arrow.xpm b/lisp/toolbar/left_arrow.xpm index b3f0ae4ab9a..586fe4489c0 100644 --- a/lisp/toolbar/left_arrow.xpm +++ b/lisp/toolbar/left_arrow.xpm @@ -1,35 +1,69 @@ /* XPM */ static char * left_arrow_xpm[] = { -"24 24 9 1", +"24 24 43 1", " c None", -". c #020202", -"+ c #121A12", -"@ c #78A16E", -"# c #86AD7D", -"$ c #B2C6AE", -"% c #263222", -"& c #E7EDE6", -"* c #497241", +". c #000000", +"+ c #B9D0B9", +"@ c #CDDECB", +"# c #B6C7B6", +"$ c #B1C9B0", +"% c #B3C4B3", +"& c #B4CBB2", +"* c #B5CEB5", +"= c #B7CCB5", +"- c #B9CEB7", +"; c #BAD1BA", +"> c #BBCFBA", +", c #BBD0B9", +"' c #B2C9B0", +") c #7EAB78", +"! c #AAC7A8", +"~ c #B3CAB1", +"{ c #B0C9B0", +"] c #B0C9AE", +"^ c #AEC7AC", +"/ c #AAC5A8", +"( c #A9C4A7", +"_ c #698267", +": c #2D2D2D", +"< c #CFDFCC", +"[ c #ADC8AB", +"} c #B0C7AE", +"| c #ADC6AB", +"1 c #678C63", +"2 c #9BAD9A", +"3 c #85AE81", +"4 c #87AF84", +"5 c #87B083", +"6 c #88AF84", +"7 c #88B085", +"8 c #86AF82", +"9 c #547150", +"0 c #3C5235", +"a c #5B7950", +"b c #4A6342", +"c c #3B5035", +"d c #415639", " ", " ", " ", -" ", -" ", -" .. ", -" ..$. ", -" ..&&$. ", -" ..&&&&$. ", -" ..&&&&&&$. ", -" .+&&&&&&&&$. ", -" ..$&&&&&&&&&$% ", -" ..**@@@#####@. ", -" ..**@#@###@. ", -" ..**@#@#@. ", -" ..**@@@. ", -" ..*@*. ", -" ..*. ", -" .. ", -" ", +" . ", +" .. ", +" .+. ", +" .@#. ", +" .@$%........ ", +" .@&*=-;->,'). ", +" .@!~{]^///^(_. ", +" :<[}||[!^^}^[1. ", +" .23444445645789. ", +" .0aaaaaaaaaaab. ", +" .0aaaaaaaaaab. ", +" .0aabccccccd. ", +" .0ab........ ", +" .0b. ", +" .b. ", +" .. ", +" . ", " ", " ", " ", diff --git a/lisp/toolbar/new.pbm b/lisp/toolbar/new.pbm Binary files differindex 93415bf901e..1fae8c09eec 100644 --- a/lisp/toolbar/new.pbm +++ b/lisp/toolbar/new.pbm diff --git a/lisp/toolbar/new.xpm b/lisp/toolbar/new.xpm index bd45e8962a8..2d4690edd3c 100644 --- a/lisp/toolbar/new.xpm +++ b/lisp/toolbar/new.xpm @@ -1,37 +1,154 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 7 1", -" c Gray0", -". c #61b761b7600a", -"X c #828282827474", -"o c #a5d8a5d89550", -"O c #d305d305bc3c", -"+ c #ea03ea03d271", -"@ c None", -/* pixels */ -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@", -"@@@@@@@@@@@@@ @@@@@@@@@@", -"@@@@@@@@@@@ o @@@@@@@@@", -"@@@@@@@@@ oO+ @@@@@@@@@", -"@@@@@@@ oOOOO+ @@@@@@@@", -"@@@@@ oOOOOOO+o @@@@@@@", -"@@@@ ..OOOOOO+++.@@@@@@@", -"@@@@ +.OOOOO+++++ @@@@@@", -"@@@@ ++.OOO++++++o @@@@@", -"@@@@ ++.oOO+++++++ @@@@@", -"@@@@ +.oOO+++++++++ @@@@", -"@@@@ oOO++++++++++O @@@", -"@@@@ .OOO+++++++++++O @@", -"@@@@ oOO++++++++++++X @@", -"@@@@@ +++++++++++++ @@@", -"@@@@@ O++++++++++O @@@@@", -"@@@@@@.+++++++++X @@@@@@", -"@@@@@@ +++++++O @@@@@@@@", -"@@@@@@@ +++++o @@@@@@@@@", -"@@@@@@@ O++O. @@@@@@@@@@", -"@@@@@@@@ +o @@@@@@@@@@@@", -"@@@@@@@@@ @@@@@@@@@@@@@", -"@@@@@@@@@@@@@@@@@@@@@@@@" -}; +static char * new_xpm[] = { +"24 24 127 2", +" c None", +". c #000000", +"+ c #D3D3D3", +"@ c #F6F6F6", +"# c #FFFFFF", +"$ c #F9F9F9", +"% c #DADADA", +"& c #585858", +"* c #C7C7C7", +"= c #D1D1D1", +"- c #D6D6D6", +"; c #FEFEFE", +"> c #FDFDFD", +", c #C0C0C0", +"' c #E1E1E1", +") c #F0F0F0", +"! c #9B9B9B", +"~ c #FCFCFB", +"{ c #FBFBFB", +"] c #AFAFAE", +"^ c #E9E9E9", +"/ c #DFDFDF", +"( c #8F8F8F", +"_ c #FAFAF9", +": c #F9F9F8", +"< c #A4A4A3", +"[ c #F4F4F4", +"} c #CFCFCF", +"| c #A2A2A2", +"1 c #F8F8F7", +"2 c #F8F7F6", +"3 c #9E9E9E", +"4 c #F7F6F5", +"5 c #F6F6F4", +"6 c #F4F3F2", +"7 c #DEDDDC", +"8 c #D3D2D0", +"9 c #B7B7B5", +"0 c #9F9E9D", +"a c #706F6F", +"b c #65625A", +"c c #F5F4F3", +"d c #F2F2F0", +"e c #E4E4E2", +"f c #DAD9D7", +"g c #D8D8D6", +"h c #CDCCCA", +"i c #AFAEAC", +"j c #88847B", +"k c #F3F3F1", +"l c #EFEFED", +"m c #EEEDEB", +"n c #EDECEA", +"o c #E9E8E6", +"p c #D5D4D3", +"q c #C4C3C2", +"r c #8F8A81", +"s c #F6F5F4", +"t c #F5F5F3", +"u c #F1F1EF", +"v c #F1F0EE", +"w c #ECEBE9", +"x c #EAE9E7", +"y c #E5E4E2", +"z c #E4E3E0", +"A c #D2D1CE", +"B c #8D887E", +"C c #F3F2F1", +"D c #F0F0EE", +"E c #F0EFED", +"F c #EFEEEC", +"G c #E8E7E5", +"H c #E5E4E1", +"I c #E2E1DE", +"J c #E1DFDC", +"K c #979288", +"L c #A49E93", +"M c #E8E7E4", +"N c #E7E6E3", +"O c #E3E2DF", +"P c #E2E0DD", +"Q c #E1E0DC", +"R c #E0DFDB", +"S c #A19C90", +"T c #EDEDEB", +"U c #EBEAE8", +"V c #E9E8E5", +"W c #E6E4E1", +"X c #E3E2DE", +"Y c #DFDEDA", +"Z c #DEDDD9", +"` c #DDDCD8", +" . c #A19B90", +".. c #E7E5E2", +"+. c #E4E3DF", +"@. c #DCDBD7", +"#. c #E6E5E2", +"$. c #E5E4E0", +"%. c #E2E1DD", +"&. c #DBD9D5", +"*. c #D9D7D3", +"=. c #9F998D", +"-. c #E4E2DF", +";. c #DDDBD7", +">. c #DCDAD6", +",. c #D8D6D2", +"'. c #9E988D", +"). c #EDEDED", +"!. c #E1E0DD", +"~. c #E0DEDA", +"{. c #D8D6D1", +"]. c #D7D5D1", +"^. c #9D978B", +"/. c #E1DFDB", +"(. c #DEDCD8", +"_. c #D7D6D1", +":. c #D5D3CE", +"<. c #9B958A", +"[. c #999891", +"}. c #A39E92", +"|. c #A39D92", +"1. c #A39D91", +"2. c #A29C90", +"3. c #A19B8F", +"4. c #9D978C", +"5. c #9B968A", +"6. c #676359", +" ", +" . . . . . . . . . . . . . ", +" . + @ # # # # # # # # $ % & . ", +" . @ # # # # # # # # # # * = - . ", +" . # # # # # # # ; # ; > , ' ) ! . ", +" . # # # # # ; > ~ > ~ { ] ^ # / ( . ", +" . # # # ; > ~ { _ { _ : < ) # [ } | . ", +" . # ; > ~ { _ : 1 : 1 2 3 . . . . . . . ", +" . # ~ { _ : 1 2 4 2 4 5 6 7 8 9 0 a b . ", +" . # _ : 1 2 4 5 c 5 c 6 d e f g h i j . ", +" . # 1 2 4 5 c 6 k 6 k d l m n o p q r . ", +" . # s t 6 6 k d u d u v m w x y z A B . ", +" . # 6 C d D l v E v E F w G H z I J K . ", +" . # 6 C d D l v E v E F w G H z I J L . ", +" . # D l l F m n n n n w M N O P Q R S . ", +" . # T n w w w U V U V V H W X Y Z ` .. ", +" . # U o o G M M N M N ..+.X R Z ` @. .. ", +" . # N #.#.#.H W $.W $.+.%.R Z @.&.*.=.. ", +" . $ z O X -.+.%.X %.X Q Q Z ;.>.*.,.'.. ", +" . ).!.J Q R %.R Q R Q Y ~.;.>.*.{.].^.. ", +" . = /.~.Y Z R Z ~.Z ~.(.(.>.>.,._.:.<.. ", +" . [.}.L |.1.|.S 2.S 2.3. .=.=.4.4.5.6.. ", +" . . . . . . . . . . . . . . . . . . ", +" "}; diff --git a/lisp/toolbar/open.pbm b/lisp/toolbar/open.pbm Binary files differindex 3d2be258a67..9c614e43f31 100644 --- a/lisp/toolbar/open.pbm +++ b/lisp/toolbar/open.pbm diff --git a/lisp/toolbar/open.xpm b/lisp/toolbar/open.xpm index 62b70e7468b..6b95c7e476d 100644 --- a/lisp/toolbar/open.xpm +++ b/lisp/toolbar/open.xpm @@ -1,34 +1,200 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 4 1", -" c Gray0", -". c #999990907b7b", -"X c #fffffefef7f7", -"o c None", -/* pixels */ -"oooooooooooooooooooooooo", -"oooooooooooooooooooooooo", -"oooooooooooooooooooooooo", -"oooooooooooooooooooooooo", -"oooooooooooooooooooooooo", -"oooooooooooooo oooooooo", -"ooooooooooo .. ooooooo", -"oooo oo ....XXo ooo", -"ooo .. ....XXXX .. ooo", -"ooo .....XXXXX .... ooo", -"oooo ..XXXXX ...... ooo", -"oooo ..XXX ........ ooo", -"ooooo .XX .......... ooo", -"ooooo ..X .......... ooo", -"oooooo .X .......... ooo", -"oooooo .. ........ oooo", -"ooooooo . ...... oooooo", -"ooooooo . ..... oooooooo", -"oooooooo ... ooooooooo", -"oooooooo . ooooooooooo", -"ooooooooo ooooooooooooo", -"oooooooooooooooooooooooo", -"oooooooooooooooooooooooo", -"oooooooooooooooooooooooo" -}; +static char * open_xpm[] = { +"24 24 173 2", +" c None", +". c #000000", +"+ c #010100", +"@ c #B5B8A5", +"# c #E4E7D2", +"$ c #878A76", +"% c #33342B", +"& c #0B0B0B", +"* c #E2E5CF", +"= c #CFD4AF", +"- c #CED3AE", +"; c #B2B696", +"> c #2D2D25", +", c #23241D", +"' c #9D9F90", +") c #C6CAA6", +"! c #C4C9A5", +"~ c #C6CBA7", +"{ c #C7CCA8", +"] c #C9CEA9", +"^ c #555847", +"/ c #1A1B15", +"( c #20201A", +"_ c #D4D6C2", +": c #BEC2A0", +"< c #B3B896", +"[ c #B0B595", +"} c #B3B797", +"| c #B6BB99", +"1 c #BBC09E", +"2 c #BCC19F", +"3 c #81856C", +"4 c #3E3F32", +"5 c #010101", +"6 c #DADDC8", +"7 c #AFB494", +"8 c #AAAF8F", +"9 c #A3A789", +"0 c #A6AA8B", +"a c #A9AD8E", +"b c #A7AB8D", +"c c #A4A88A", +"d c #A1A588", +"e c #AAAD96", +"f c #B3B5A5", +"g c #B8BBAA", +"h c #BABCAB", +"i c #C1C3B2", +"j c #C7CAB7", +"k c #CACDBB", +"l c #BABDA8", +"m c #0C0C09", +"n c #DDDFCB", +"o c #969B7E", +"p c #9DA286", +"q c #95987C", +"r c #96997E", +"s c #9A9D81", +"t c #999D80", +"u c #9DA184", +"v c #A5AA8B", +"w c #A4A98A", +"x c #A3A889", +"y c #A2A588", +"z c #A2A587", +"A c #9FA386", +"B c #9B9E83", +"C c #898D74", +"D c #D8DBC9", +"E c #84866E", +"F c #7D8169", +"G c #151612", +"H c #D7DAC9", +"I c #797D67", +"J c #3D3F34", +"K c #E0E0D9", +"L c #EBEDDD", +"M c #E8EBD9", +"N c #E7EAD8", +"O c #E3E6D4", +"P c #DEE1D0", +"Q c #DADCCC", +"R c #DADCD1", +"S c #2B2C28", +"T c #D7DAC6", +"U c #6F735E", +"V c #0D0D0D", +"W c #F4F4EC", +"X c #CACFAB", +"Y c #C6CBA8", +"Z c #C2C6A4", +"` c #ABB091", +" . c #23251E", +".. c #494B3D", +"+. c #DCDCD4", +"@. c #EAECDD", +"#. c #CDD2AD", +"$. c #CCD1AC", +"%. c #CACFAA", +"&. c #BABF9D", +"*. c #B5B999", +"=. c #81836C", +"-. c #070806", +";. c #D5D8C4", +">. c #161616", +",. c #F2F2EA", +"'. c #C9CEAA", +"). c #C8CDA9", +"!. c #C4C9A6", +"~. c #C1C5A3", +"{. c #BCC09F", +"]. c #B6BB9A", +"^. c #B0B494", +"/. c #9DA185", +"(. c #535445", +"_. c #B6B8A7", +":. c #747470", +"<. c #ECECE2", +"[. c #C3C8A5", +"}. c #C2C7A4", +"|. c #C0C5A2", +"1. c #BFC4A1", +"2. c #BDC2A0", +"3. c #B9BD9C", +"4. c #B9BE9D", +"5. c #A9AD8F", +"6. c #A3A78A", +"7. c #80836D", +"8. c #020201", +"9. c #A6A998", +"0. c #B8BC9B", +"a. c #AFB394", +"b. c #ACB091", +"c. c #A8AC8E", +"d. c #A6AA8C", +"e. c #9FA286", +"f. c #9B9F83", +"g. c #9A9D82", +"h. c #8A8D75", +"i. c #4F5243", +"j. c #070705", +"k. c #9E9F91", +"l. c #E5E6DA", +"m. c #ADB192", +"n. c #A5A98C", +"o. c #9FA387", +"p. c #999D81", +"q. c #95987E", +"r. c #92957B", +"s. c #8C8F76", +"t. c #8A8D74", +"u. c #71735F", +"v. c #080908", +"w. c #E3E5D9", +"x. c #C0C3AF", +"y. c #94987C", +"z. c #8F9379", +"A. c #8B8F75", +"B. c #8A8E74", +"C. c #888C73", +"D. c #858970", +"E. c #868971", +"F. c #82866E", +"G. c #80836C", +"H. c #7D8069", +"I. c #797C66", +"J. c #727560", +"K. c #717460", +"L. c #71745F", +"M. c #6A6D59", +"N. c #434538", +"O. c #080907", +"P. c #050504", +" ", +" ", +" ", +" . . . . . . . ", +" + @ # # # # # $ % ", +" & * = = = - - ; > ", +", ' * ) ! ~ { ] ] ^ / ", +"( _ : < [ } | 1 2 3 4 5 . . . . . . . ", +", 6 7 8 9 0 8 a b c d e f g h i j k l . ", +"m n o p q r s t r u v w x y 9 z A B C . ", +". D E F G . . . . . . . . . . . . . . . 5 5 ", +". H I J K L M M M M M M M M M M M N O P Q R S ", +". T U V W = = = = = = = = = - - - X Y Z 1 ` . ", +". T ..+.@.#.- - #.- #.#.#.#.#.$.%.Y Z &.*.=.-. ", +". ;.>.,.X %.X %.'.%.'.{ ).).Y !.~.{.].^./.(.m ", +". _.:.<.[.}.}.Z |.Z 1.2.|.2.3.4.} [ 5.6.7.8. ", +". 9.+.0.0.*.} } [ [ a.a.a.b.c.d.e.f.g.h.i.j. ", +". k.l.m.5.d.n.6.6.d o.e.f.p.q.r.s.t.t.u.v. ", +". w.x.y.z.A.B.C.C.D.E.F.G.H.I.J.K.L.M.N.O. ", +" . . . . . . . . . . . . . . . . . . P. ", +" ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/paste.pbm b/lisp/toolbar/paste.pbm Binary files differindex e51819c682a..17e3a82c0c6 100644 --- a/lisp/toolbar/paste.pbm +++ b/lisp/toolbar/paste.pbm diff --git a/lisp/toolbar/paste.xpm b/lisp/toolbar/paste.xpm index bc4fc3b965e..cdd86366d66 100644 --- a/lisp/toolbar/paste.xpm +++ b/lisp/toolbar/paste.xpm @@ -1,35 +1,116 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 5 1", -" c Gray0", -". c #62ee62ee62ee", -"X c Gray68", -"o c Gray82", -"O c None", -/* pixels */ -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOO OOOOOOOOOOOO", -"OOOOOOO ooo OOOOOO OOOO", -"OOOOO ooooo OOO OOO", -"OOO oo. .Xoo OO OOO", -"OO ooo.oX..oo OOOOO OOOO", -"OO ooo.X..oooo OOOOOOOOO", -"OOO oo..Xooooo O OOOOOO", -"OOO oooooooooo oX OOOOO", -"OOOO ooooooo XXoo OOOOO", -"OOOO ooooooo o.XooX OOOO", -"OOOOO oooooo o.Xooo OOOO", -"OOOOO oooooo .XooooX OOO", -"OOOOOO ooooX XooooooX OO", -"OOOOOO XXOXX Xooooooo OO", -"OOOOOOO XXXX oooooooX O", -"OOOOOOO XX O XooooX OO", -"OOOOOOOO OOOO ooX OOOO", -"OOOOOOOOOOOOOO X OOOOOO", -"OOOOOOOOOOOOOOO OOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO" -}; +static char * paste_xpm[] = { +"24 24 89 1", +" c None", +". c #000000", +"+ c #B9B9B9", +"@ c #FEFEFE", +"# c #F9F9F9", +"$ c #757575", +"% c #F5F5E8", +"& c #565651", +"* c #FFFFFF", +"= c #A0A0A0", +"- c #939393", +"; c #7C7C7C", +"> c #C5C5BB", +", c #CFC6A0", +"' c #D7CEAA", +") c #ADA689", +"! c #4B483C", +"~ c #6D6D6D", +"{ c #6C6C6C", +"] c #A9A9A9", +"^ c #3D3A30", +"/ c #979178", +"( c #C1B898", +"_ c #8A793D", +": c #C3BB9A", +"< c #AFA78A", +"[ c #444236", +"} c #FAFAFA", +"| c #EFEFEF", +"1 c #C7C7C7", +"2 c #D8D8D8", +"3 c #D2D2D2", +"4 c #7B7B7B", +"5 c #302E26", +"6 c #89846C", +"7 c #C4BC9A", +"8 c #847235", +"9 c #C5C5C5", +"0 c #A7A7A7", +"a c #ADADAD", +"b c #9A9A9A", +"c c #9B9B9B", +"d c #868686", +"e c #424242", +"f c #847033", +"g c #C9C09E", +"h c #464337", +"i c #35332A", +"j c #2D2B23", +"k c #C6BE9D", +"l c #826F33", +"m c #7F7964", +"n c #4C493C", +"o c #171612", +"p c #13120F", +"q c #3E3B31", +"r c #282210", +"s c #474438", +"t c #B3B3B3", +"u c #D6D6D6", +"v c #B7AE90", +"w c #B1AA8C", +"x c #37352B", +"y c #151410", +"z c #8F8F8F", +"A c #989898", +"B c #C6C6C6", +"C c #B9B293", +"D c #11100D", +"E c #434035", +"F c #636363", +"G c #767676", +"H c #AAA48B", +"I c #A5A086", +"J c #A19A7F", +"K c #312F26", +"L c #AFA88C", +"M c #050403", +"N c #12110E", +"O c #A9A489", +"P c #A39E85", +"Q c #EBE7D0", +"R c #D2C9A5", +"S c #A29053", +"T c #8E7C3D", +"U c #88793B", +"V c #806C2F", +"W c #78652B", +"X c #251F0C", +" .... ", +" ......+@#$...... ", +".%%%%%&*=-;&>%%%,. ", +".%''')!*~{]^/(''_. ", +".%::<[}|123456<78. ", +".%''!900abcde!)'f. ", +".%g:6hijjjjj56<kl. ", +".%'''////////(''l. ", +".%g::::mnopppp^qr.... ", +".%'''''st***********u. ", +".%vwwwwx*************. ", +".%'''''y*0zzA**Bz*zB*. ", +".%CwwwwD*************. ", +".%'''''E*~F*GzzB*Bz**. ", +".%HIJJJK*************. ", +".%'''''E*0zz*zzzB*Az*. ", +".%LIJJJM*************. ", +".%'''''N*~F*GzzB*Bz**. ", +".%OPJJJK*************. ", +".Q'''''E*0zz*zzzB*Az*. ", +".RSTUVWX*************. ", +" .......u***********u. ", +" ............. ", +" "}; diff --git a/lisp/toolbar/preferences.pbm b/lisp/toolbar/preferences.pbm Binary files differindex 08819766ec0..00c7da36cdf 100644 --- a/lisp/toolbar/preferences.pbm +++ b/lisp/toolbar/preferences.pbm diff --git a/lisp/toolbar/preferences.xpm b/lisp/toolbar/preferences.xpm index e9a7656bcdc..3cdc884dd4d 100644 --- a/lisp/toolbar/preferences.xpm +++ b/lisp/toolbar/preferences.xpm @@ -1,35 +1,114 @@ /* XPM */ static char * preferences_xpm[] = { -"24 24 8 1", +"24 24 87 1", " c None", ". c #000000", -"+ c #E1E0E0", -"@ c #D7C99B", -"# c #9A6C4E", -"$ c #A4A199", -"% c #858579", -"& c #AD8E30", -" ", -" ", -" ", -" .. ", -" ..++. . ", -" ..++++. .@. ", -" ...+++++++. .@#. ", -" ..++++++++++. .@#. ", -" .++++++#++++++.@#. ", -" .+++++#++++++.@#. ", -" .++#+#+++++.@#. ", -" .++#$#++++.@#.+. ", -" .++##+++.@#.++@. ", -" .++++++.@#.+++@%. ", -" .++++&+..@$$$$%. ", -" .++++..$$$$$$@. ", -" .+$%%$+++++.. ", -" .+++++++++. ", -" .++++++.. ", -" .++++@. ", -" .++.. ", -" .. ", -" ", +"+ c #BAB5AB", +"@ c #D0CDC6", +"# c #88857D", +"$ c #C9C6BE", +"% c #CCC8C1", +"& c #E5E3E0", +"* c #FFFFFF", +"= c #757575", +"- c #2E2E2E", +"; c #F6F5F5", +"> c #CCCCCC", +", c #AFAFAF", +"' c #D3D1CB", +") c #C1C0BF", +"! c #F0EFED", +"~ c #797772", +"{ c #DCDCDC", +"] c #A5A19C", +"^ c #EAE9E5", +"/ c #F3F1F0", +"( c #EDEDED", +"_ c #A19D96", +": c #C1BDB4", +"< c #DBD8D3", +"[ c #D9D6D1", +"} c #89857E", +"| c #FCFCFC", +"1 c #EAE9E6", +"2 c #F5F4F3", +"3 c #C6C2BA", +"4 c #F0EFEE", +"5 c #F4F4F3", +"6 c #CBC7C0", +"7 c #ECECEB", +"8 c #676560", +"9 c #54524D", +"0 c #777676", +"a c #797978", +"b c #85827E", +"c c #79756F", +"d c #7590AE", +"e c #A4BAD0", +"f c #90A6BE", +"g c #9F9F9E", +"h c #BEBDBC", +"i c #B8B4AD", +"j c #87837C", +"k c #D3DFEA", +"l c #A2AEBC", +"m c #9DB6CE", +"n c #637B95", +"o c #E2E2E2", +"p c #EEEEED", +"q c #849CB6", +"r c #D7E2ED", +"s c #8D98A5", +"t c #9DB8D2", +"u c #607791", +"v c #EDEDEC", +"w c #99ADC3", +"x c #DFE7F0", +"y c #8193A9", +"z c #586D84", +"A c #5B7189", +"B c #F1F1F1", +"C c #EEEDEB", +"D c #A7A6A5", +"E c #726F6A", +"F c #A1B4C8", +"G c #EEF3F6", +"H c #60768F", +"I c #DEDDDC", +"J c #787776", +"K c #4E4E4D", +"L c #91A6BE", +"M c #F0F4F7", +"N c #97A5B6", +"O c #BFBEBD", +"P c #AAAAA9", +"Q c #ACACAB", +"R c #B0C6DB", +"S c #EDF2F6", +"T c #818A95", +"U c #6C85A1", +"V c #C0D1E2", +" .. ", +" .+@#. ", +" .$%+. .. ", +" .&$. .*=. ", +" .. -;$. .*>,. ", +" .' ..)!+~. .{,. ", +" .]%%^/+++. .(.. ", +" ._:%$<[+}. .|. ", +" .....123}..>. ", +" .456.,. ", +" .7.,.. ", +" .,.89. ", +" ....,.0abc. ", +" .def.. .ghij. ", +" .dklmn. .op6}. ", +" .qrsntu. .v/$}. ", +" .wxyztdA. .BCDE..", +" .FGyHtdA. .IJK,.", +" .LMNHtdA. .OPQ.", +" .RSTtdA.. ... ", +" .UtVLA.. ", +" .UUn.. ", +" ... ", " "}; diff --git a/lisp/toolbar/print.pbm b/lisp/toolbar/print.pbm Binary files differindex 63cea6d84d2..a4ab55c2cd8 100644 --- a/lisp/toolbar/print.pbm +++ b/lisp/toolbar/print.pbm diff --git a/lisp/toolbar/print.xpm b/lisp/toolbar/print.xpm index 06dee7c26bf..95f2f400800 100644 --- a/lisp/toolbar/print.xpm +++ b/lisp/toolbar/print.xpm @@ -1,36 +1,202 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 6 1", -" c #043904390439", -". c #40403f3f3f3f", -"X c #5a1a5a0458f3", -"o c #a74da686a5ec", -"O c #e88de7c9e66c", -"+ c None", -/* pixels */ -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++ ++++++++++", -"+++++++++++ OOX +++++++", -"++++++++++ OOOOOO. +++", -"+++++++++ OOOOOOOOOo +++", -"+++++++++.OOOOOOOOO ++++", -"+++++++ oOOOOOOOOX+++++", -"+++++ OooXOOOOOOo ++++", -"+++ OOOOOoXXooOO.XX ++", -"++ ooOOOOOOOOoXXX.X.. ++", -"++ ooooOOOOOOOOOO.... ++", -"++ ooooooOOOOOOO..... ++", -"++ XooooooooOOO...... ++", -"++ X.XoooooooX....... ++", -"++ XX...XooooX...... ++", -"+++ XXXX...XX..... ++++", -"+++++ .XXXXX... +++++", -"++++++++ .XX.. +++++++", -"+++++++++++ ++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++", -"++++++++++++++++++++++++" -}; +static char * print_xpm[] = { +"24 24 175 2", +" c None", +". c #000000", +"+ c #C7C7C7", +"@ c #FAFAFA", +"# c #FCFCFC", +"$ c #FBFBFB", +"% c #F8F8F8", +"& c #AFAFAF", +"* c #F9F9F9", +"= c #E5E5E5", +"- c #E3E3E3", +"; c #E2E2E2", +"> c #E0E0E0", +", c #DFDFDF", +"' c #DCDCDC", +") c #DBDBDB", +"! c #B6B6B6", +"~ c #6B6B6B", +"{ c #676767", +"] c #818181", +"^ c #E7E7E7", +"/ c #606060", +"( c #A0A0A0", +"_ c #DADADA", +": c #E1E1E1", +"< c #B7B7B7", +"[ c #FDFDFD", +"} c #EFEFEF", +"| c #EEEEEE", +"1 c #EDEDED", +"2 c #ECECEC", +"3 c #EBEBEB", +"4 c #E9E9E9", +"5 c #E8E8E8", +"6 c #BFBFBF", +"7 c #8A8A8A", +"8 c #6A6A6A", +"9 c #9E9E9E", +"0 c #F6F6F6", +"a c #909090", +"b c #A2A2A2", +"c c #AAAAAA", +"d c #F4F4F4", +"e c #CECECE", +"f c #ADADAD", +"g c #AEAEAE", +"h c #BEBEBE", +"i c #A6A6A6", +"j c #CDCDCD", +"k c #F5F5F5", +"l c #DEDEDE", +"m c #DDDDDD", +"n c #C9C9C9", +"o c #878787", +"p c #888888", +"q c #D0D0D0", +"r c #6E6E6E", +"s c #797979", +"t c #D1D1D1", +"u c #A1A1A1", +"v c #B3B3B3", +"w c #FFFFFF", +"x c #CACACA", +"y c #A7A7A7", +"z c #A5A5A5", +"A c #A4A4A4", +"B c #A3A3A3", +"C c #87847C", +"D c #EAE8E3", +"E c #8D8982", +"F c #53524C", +"G c #807D74", +"H c #AAA9A5", +"I c #BAB5AB", +"J c #F3F3F3", +"K c #C3C1BD", +"L c #8B8B89", +"M c #E6E5E1", +"N c #F9F9F8", +"O c #FAFAF9", +"P c #F9F9F7", +"Q c #F7F6F5", +"R c #F7F7F4", +"S c #F6F5F4", +"T c #F2F1EE", +"U c #F0EFEC", +"V c #E5E5E4", +"W c #9F9F9F", +"X c #DFDED9", +"Y c #A4A3A1", +"Z c #6C6B6A", +"` c #F5F4F3", +" . c #D5D5D5", +".. c #D3D3D3", +"+. c #D4D4D3", +"@. c #D4D4D4", +"#. c #A9A9A9", +"$. c #B5B5B5", +"%. c #CDCDCB", +"&. c #B5B5B4", +"*. c #DCDAD3", +"=. c #6B6B6A", +"-. c #999896", +";. c #918F87", +">. c #999895", +",. c #E6E4E1", +"'. c #F0EEEC", +"). c #FAF9F9", +"!. c #F9F8F7", +"~. c #F8F7F6", +"{. c #F8F8F7", +"]. c #F4F3F1", +"^. c #F2F1EF", +"/. c #565655", +"(. c #858482", +"_. c #9C9B99", +":. c #6B6A68", +"<. c #585858", +"[. c #5E5C57", +"}. c #524F4B", +"|. c #4A4845", +"1. c #4B4A46", +"2. c #4B4946", +"3. c #4A4844", +"4. c #494743", +"5. c #484642", +"6. c #474541", +"7. c #464440", +"8. c #514F4B", +"9. c #53514E", +"0. c #7B7A77", +"a. c #797771", +"b. c #949391", +"c. c #989694", +"d. c #868480", +"e. c #6E6C66", +"f. c #706D67", +"g. c #5C5955", +"h. c #67645F", +"i. c #5B5954", +"j. c #585651", +"k. c #5D5B56", +"l. c #595652", +"m. c #53504C", +"n. c #575450", +"o. c #595752", +"p. c #5C5956", +"q. c #5B5956", +"r. c #61615E", +"s. c #696861", +"t. c #77756F", +"u. c #7E7B77", +"v. c #979690", +"w. c #96938D", +"x. c #807E77", +"y. c #7D7A74", +"z. c #787770", +"A. c #716F6A", +"B. c #6E6C67", +"C. c #595753", +"D. c #63615C", +"E. c #686661", +"F. c #6F6E68", +"G. c #6D6C66", +"H. c #72716B", +"I. c #76746F", +"J. c #6A6963", +"K. c #8B8880", +"L. c #B2AFA8", +"M. c #B6B3AD", +"N. c #BFBDB6", +"O. c #BDBBB4", +"P. c #B0AEA6", +"Q. c #ABA8A2", +"R. c #9C9991", +" ", +" . . . . . . . . . . . . ", +" . + @ # # # # # # # $ % & . ", +" . * = - - - ; > , , ' ) ! . ", +" . # ~ { ] ^ / ( _ : > > < . ", +" . [ } | 1 1 | 2 2 3 4 5 6 . ", +" . [ 7 8 9 0 a b 4 c a d + . ", +" . [ # # # # $ $ # # $ $ e . ", +" . [ f g = h % h i j 3 # j . ", +" . k l l l m l l , l 5 : n . ", +" . . @ o ~ p q r s t p u q v . . ", +" . w . x y z A z z i B b u u 9 . C . ", +" . w D E F . . . . . . . . . . G C H I . ", +" . w w J w w w w w w w w w w w w w w w w D . ", +" . K L M N O N P Q R O O S T T U V D W X I . ", +" . Y Z ` h .! ..! +.< @.#...$.%.&.*.=.-.;.. ", +" . >.=.,.'.Q N @ ).N !.~.{.{.].].].^./.(.;.. ", +" . _.:.<.[.}.|.1.2.2.2.3.4.5.6.4.7.8.9.0.a.. ", +" . b.c.d.e.f.g.h.i.j.i.k.l.m.n.o.p.q.r.s.t.. ", +" . u.v.w.;.x.y.z.t.A.t.A.B.C.D.E.F.G.H.I.J.. ", +" . . . . . . . . . . . . . . . . . . . . ", +" . K.L.M.N.N.N.N.N.O.P.L.Q.P.R.R.R.G G . ", +" . . . . . . . . . . . . . . . . . . ", +" "}; diff --git a/lisp/toolbar/right_arrow.pbm b/lisp/toolbar/right_arrow.pbm Binary files differindex 583f2bd13fa..cd32579c6bd 100644 --- a/lisp/toolbar/right_arrow.pbm +++ b/lisp/toolbar/right_arrow.pbm diff --git a/lisp/toolbar/right_arrow.xpm b/lisp/toolbar/right_arrow.xpm index 9e0b14749a8..da8156879d6 100644 --- a/lisp/toolbar/right_arrow.xpm +++ b/lisp/toolbar/right_arrow.xpm @@ -1,35 +1,67 @@ /* XPM */ static char * right_arrow_xpm[] = { -"24 24 9 1", +"24 24 41 1", " c None", -". c #020202", -"+ c #1A1A1A", -"@ c #779D6D", -"# c #88AE80", -"$ c #97B78B", -"% c #9EBA92", -"& c #E9EFE8", -"* c #3C5936", +". c #000000", +"+ c #8CA782", +"@ c #B1CDAE", +"# c #77A16E", +"$ c #B4CEB1", +"% c #ACC8A9", +"& c #709867", +"* c #C1D6BD", +"= c #BDD3B8", +"- c #BFD4BB", +"; c #C2D7BE", +"> c #B0CAAD", +", c #B2CBB0", +"' c #AAC7A8", +") c #0F1308", +"! c #AEC5A8", +"~ c #AEC8AD", +"{ c #ABC7A8", +"] c #AAC6A7", +"^ c #A8C6A5", +"/ c #ADC8AD", +"( c #A8C7A8", +"_ c #A5C4A3", +": c #7F9F76", +"< c #A6BFA0", +"[ c #ABC7AA", +"} c #A7C5A4", +"| c #A9C7A6", +"1 c #AFC8AD", +"2 c #A4C3A2", +"3 c #6B9060", +"4 c #778E6F", +"5 c #698D60", +"6 c #6B9063", +"7 c #445B2C", +"8 c #6B8661", +"9 c #5B7950", +"0 c #6C8562", +"a c #65815C", +"b c #506B46", " ", " ", " ", -" ", -" ", -" .. ", -" .&.. ", -" .&&&.. ", -" .&&&&&.. ", -" .&&&&&&&.. ", -" .&&&&&&&&&+. ", -" +&&&&&&&&&&%.. ", -" .%#######@@*.. ", -" .%#####@@*.. ", -" .%###@@*.. ", -" .$#@@*.. ", -" .#@*.. ", -" .*.. ", -" .. ", -" ", +" . ", +" .. ", +" .+. ", +" .@#. ", +" ........$%&. ", +" .*=-;;;;>,'&) ", +" .!~{{{]^'/(_:. ", +" .<[^}^|{%'{123. ", +" .45666666666657. ", +" .8999999999997. ", +" .099999999997. ", +" .abbbbbb9997. ", +" ........b97. ", +" .b7. ", +" .7. ", +" .. ", +" . ", " ", " ", " ", diff --git a/lisp/toolbar/save.pbm b/lisp/toolbar/save.pbm Binary files differindex e153a144432..b69576096bf 100644 --- a/lisp/toolbar/save.pbm +++ b/lisp/toolbar/save.pbm diff --git a/lisp/toolbar/save.xpm b/lisp/toolbar/save.xpm index 8bdb36315be..cfa651dfaf3 100644 --- a/lisp/toolbar/save.xpm +++ b/lisp/toolbar/save.xpm @@ -1,35 +1,247 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 5 1", -" c #01be01be01be", -". c #62dd62dd62dd", -"X c Gray62", -"o c #e625e625e625", -"O c None", -/* pixels */ -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOO OOOOOOOOO", -"OOOOOOOOOOO X. OOOOOOOO", -"OOOOOOOOO oXoX OOOOOOOO", -"OOOOOOO oXoooXX OOOOOOO", -"OOOOO oXoooooo. OOOOOOO", -"OOO XoooooooooX OOOOOO", -"OO XooooooooooooX OOOOOO", -"OO .XoooooooooooX. OOOOO", -"OOO XooooooooooXXX OOOOO", -"OOO .XoooooooXX..X. OOOO", -"OOOO XoooooXX...X.X OOOO", -"OOOO .XooXX.Xoo.X.X. OOO", -"OOOOO XXX.oooooX.X. OOO", -"OOOOO .XXoo.ooooXX OOO", -"OOOOOO XX.o XooX. OOOOO", -"OOOOOO .XXooXoX OOOOOOO", -"OOOOOOO .X.oX OOOOOOOOO", -"OOOOOOOO OOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO" -}; +static char * save_xpm[] = { +"24 24 220 2", +" c None", +". c #000000", +"+ c #C3D7F4", +"@ c #A9CDE5", +"# c #75757A", +"$ c #EFC5BB", +"% c #F1C8BE", +"& c #F0C6BC", +"* c #EEBCB2", +"= c #EEBEB5", +"- c #EEC1B8", +"; c #EDBFB6", +"> c #E9B7AD", +", c #E9B8AF", +"' c #E9B9B1", +") c #E5BFBA", +"! c #737277", +"~ c #B3CDE3", +"{ c #A1BED6", +"] c #BBD6E8", +"^ c #8AAAC5", +"/ c #605F68", +"( c #E08D7E", +"_ c #E0826E", +": c #E0806E", +"< c #DC7A68", +"[ c #DC8171", +"} c #DA7868", +"| c #D48173", +"1 c #D47D6E", +"2 c #CE7265", +"3 c #CF7264", +"4 c #CE7567", +"5 c #C4675B", +"6 c #C36558", +"7 c #626169", +"8 c #87A3B7", +"9 c #567187", +"0 c #BAD5E9", +"a c #88A7C3", +"b c #686670", +"c c #C8817B", +"d c #CB7C74", +"e c #CB7A73", +"f c #CB7B73", +"g c #CC7C72", +"h c #CB7D73", +"i c #BF6B64", +"j c #CC7A70", +"k c #C16A62", +"l c #CC7C73", +"m c #C2655B", +"n c #C36459", +"o c #BA6C6A", +"p c #819EB6", +"q c #547086", +"r c #B6D3E7", +"s c #87ABC1", +"t c #737373", +"u c #FFFFFF", +"v c #83A0B8", +"w c #526C80", +"x c #B9D3E7", +"y c #85A4BF", +"z c #4F697C", +"A c #B9D3E6", +"B c #84A3BF", +"C c #CECECE", +"D c #CDCDCD", +"E c #BFBFBF", +"F c #88A4BB", +"G c #486276", +"H c #B7D2E7", +"I c #82A0BB", +"J c #636363", +"K c #465E70", +"L c #B5CAE5", +"M c #7FA2B9", +"N c #87A3BA", +"O c #455C6D", +"P c #AECCE5", +"Q c #7DA0B6", +"R c #C5C5C5", +"S c #546069", +"T c #B0D1E4", +"U c #83A1B6", +"V c #735B5B", +"W c #515C64", +"X c #AACEE3", +"Y c #7B9BB2", +"Z c #7A8E9A", +"` c #7A7A7A", +" . c #6B6F72", +".. c #6F6F6F", +"+. c #696969", +"@. c #6F777E", +"#. c #86A2B9", +"$. c #3A515D", +"%. c #A9C9E2", +"&. c #7494AF", +"*. c #829FB7", +"=. c #7F9DB6", +"-. c #7E9CB5", +";. c #7998B2", +">. c #85A1B8", +",. c #8CA7BD", +"'. c #8AA5BB", +"). c #364A59", +"!. c #ABC4E2", +"~. c #7294AD", +"{. c #6F90AC", +"]. c #7192AE", +"^. c #414A4E", +"/. c #424A51", +"(. c #525B63", +"_. c #626F79", +":. c #5F6C76", +"<. c #5C6971", +"[. c #5A666F", +"}. c #58636B", +"|. c #57636A", +"1. c #3B5360", +"2. c #39424B", +"3. c #7897B3", +"4. c #A4B9CB", +"5. c #364853", +"6. c #AAC9E2", +"7. c #7091AA", +"8. c #6F8FA7", +"9. c #4A5359", +"0. c #97938C", +"a. c #DFDDDA", +"b. c #E3E1DE", +"c. c #EBEAE8", +"d. c #EAE9E7", +"e. c #CFCEC9", +"f. c #C9C6C0", +"g. c #9B968E", +"h. c #566168", +"i. c #4B657A", +"j. c #54738C", +"k. c #AAC6DD", +"l. c #34464E", +"m. c #AAC9E1", +"n. c #6C8EA6", +"o. c #6C8CA4", +"p. c #40474D", +"q. c #DAD8D3", +"r. c #E7E6E2", +"s. c #67655E", +"t. c #524F47", +"u. c #D9D7D4", +"v. c #C7C5BF", +"w. c #C0BCB5", +"x. c #B8B3AB", +"y. c #434C54", +"z. c #4D697F", +"A. c #4F6F84", +"B. c #B3CADC", +"C. c #313E49", +"D. c #A8C8E1", +"E. c #6B8DA6", +"F. c #728FA4", +"G. c #E2E1DD", +"H. c #F0EFEC", +"I. c #CDCAC6", +"J. c #C2BFB9", +"K. c #CAC6C0", +"L. c #DCDAD7", +"M. c #4B555D", +"N. c #4E697F", +"O. c #BACCDC", +"P. c #A4C4DE", +"Q. c #698BA3", +"R. c #708AA1", +"S. c #383E43", +"T. c #E0DEDA", +"U. c #514E46", +"V. c #4F4C44", +"W. c #C7C4BE", +"X. c #CBC8C2", +"Y. c #E1E0DC", +"Z. c #E9E8E6", +"`. c #475158", +" + c #4E6879", +".+ c #4D6C80", +"++ c #A3C3DB", +"@+ c #383F43", +"#+ c #778999", +"$+ c #6E899E", +"%+ c #65859C", +"&+ c #33383C", +"*+ c #D7D4D0", +"=+ c #D6D4D0", +"-+ c #4E4A43", +";+ c #4D4942", +">+ c #D1CEC9", +",+ c #E6E5E2", +"'+ c #EDECEA", +")+ c #454F55", +"!+ c #486173", +"~+ c #4D6678", +"{+ c #A1C1DA", +"]+ c #373C40", +"^+ c #0C0D0F", +"/+ c #4E5E6A", +"(+ c #5B6E7C", +"_+ c #4F5B62", +":+ c #A4A099", +"<+ c #CCC9C3", +"[+ c #D7D5D1", +"}+ c #E4E2E0", +"|+ c #DDDBD7", +"1+ c #B8B5B0", +"2+ c #3E474D", +"3+ c #4A6176", +"4+ c #4A6070", +"5+ c #9BC3D8", +"6+ c #363C41", +"7+ c #28323E", +" ", +" . . . . . . . . . . . . . . . . . . . ", +" . + @ # $ % & * = - ; > , > , ' ) ! ~ { . ", +" . ] ^ / ( _ : < [ } | 1 2 3 4 5 6 7 8 9 . ", +" . 0 a b c d e f g h i j k l m n o b p q . ", +" . r s t u u u u u u u u u u u u u t v w . ", +" . x y t u u u u u u u u u u u u u t v z . ", +" . A B t C D D D D D D D D D D D E t F G . ", +" . H I J u u u u u u u u u u u u u t F K . ", +" . L M t u u u u u u u u u u u u u t N O . ", +" . P Q t C D D D D D D D D D D D R t N S . ", +" . T U V u u u u u u u u u u u u u t v W . ", +" . X Y Z ` t t t t t ...t t t t +.@.#.$.. ", +" . %.&.p v #.*.=.-.*.;.#.>.>.N *.,.v '.).. ", +" . !.~.{.].^./.(._.:.<.[.}.|.(.1.2.3.4.5.. ", +" . 6.7.8.9.0.a.b.c.c.d.a.e.f.g.h.i.j.k.l.. ", +" . m.n.o.p.q.r.s.t.t.u.v.w.x.e.y.z.A.B.C.. ", +" . D.E.F.p.G.H.s.t.t.I.J.w.K.L.M.N.A.O.C.. ", +" . P.Q.R.S.T.c.U.V.V.W.w.X.Y.Z.`. +.+++@+. ", +" . #+$+%+&+*+=+-+;+;+w.>+,+'+,+)+!+~+{+]+. ", +" ^+/+(+_+:+w.x.<+<+[+}+d.|+1+2+3+4+5+6+. ", +" . . . . . . . . . . . . . . . . 7+. ", +" ", +" "}; diff --git a/lisp/toolbar/saveas.pbm b/lisp/toolbar/saveas.pbm Binary files differindex 9a9022e058e..6bf6b8f25eb 100644 --- a/lisp/toolbar/saveas.pbm +++ b/lisp/toolbar/saveas.pbm diff --git a/lisp/toolbar/saveas.xpm b/lisp/toolbar/saveas.xpm index 87d9174f67f..2830b06c928 100644 --- a/lisp/toolbar/saveas.xpm +++ b/lisp/toolbar/saveas.xpm @@ -1,35 +1,289 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 5 1", -" c #01be01be01be", -". c #62dd62dd62dd", -"X c Gray62", -"o c #e625e625e625", -"O c None", -/* pixels */ -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOO OOOO", -"OOOOOOOOOOOOOOOOOO X OOO", -"OOOOOOOOOOOOO OO X. OOO", -"OOOOOOOOOOO X. X. OOOO", -"OOOOOOOOO oXoX X. OOOOO", -"OOOOOOO oXoOo X. OOOOOO", -"OOOOO oXoOoO X. OOOOOOO", -"OOO XooOOoO X. OOOOOO", -"OO XooOoXoO X. oX OOOOOO", -"OO .XooXoO X. OoX. OOOOO", -"OOO XooXOX. ooXXX OOOOO", -"OOO .XoOX ooXX..X. OOOO", -"OOOO XoOXooXX...X.X OOOO", -"OOOO .XooXX.Xoo.X.X. OOO", -"OOOOO XXX.oooooX.X. OOO", -"OOOOO .XXoo.ooooXX OOO", -"OOOOOO XX.o XooX. OOOOO", -"OOOOOO .XXooXoX OOOOOOO", -"OOOOOOO .X.oX OOOOOOOOO", -"OOOOOOOO OOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO" -}; +static char * saveas_xpm[] = { +"24 24 262 2", +" c None", +". c #000000", +"+ c #FBE73B", +"@ c #F2B64D", +"# c #FCEB3D", +"$ c #F7B544", +"% c #5D502C", +"& c #C3D7F4", +"* c #A9CDE5", +"= c #75757A", +"- c #EFC5BB", +"; c #F1C8BE", +"> c #F0C6BC", +", c #EEBCB2", +"' c #EEBEB5", +") c #EEC1B8", +"! c #EDBFB6", +"~ c #E8B6AC", +"{ c #FCE93B", +"] c #F7B545", +"^ c #6C5F34", +"/ c #434345", +"( c #92A7B9", +"_ c #96B1C7", +": c #BBD6E8", +"< c #8AAAC5", +"[ c #605F68", +"} c #E08D7E", +"| c #E0826E", +"1 c #E0806E", +"2 c #DC7A68", +"3 c #DC8171", +"4 c #DA7868", +"5 c #D38072", +"6 c #FAE43A", +"7 c #F4B244", +"8 c #615030", +"9 c #783E35", +"0 c #4D4C52", +"a c #7790A2", +"b c #526D82", +"c c #BAD5E9", +"d c #88A7C3", +"e c #686670", +"f c #C8817B", +"g c #CB7C74", +"h c #CB7A73", +"i c #CB7B73", +"j c #CC7C72", +"k c #CA7C72", +"l c #F9DF39", +"m c #F3AF42", +"n c #614F2F", +"o c #8F4941", +"p c #945554", +"q c #5B5A62", +"r c #7B97AE", +"s c #536F84", +"t c #B6D3E7", +"u c #87ABC1", +"v c #737373", +"w c #FFFFFF", +"x c #FEFEFE", +"y c #F9DC38", +"z c #EFB44D", +"A c #665A32", +"B c #BBBBBB", +"C c #CDCDCD", +"D c #E4E4E4", +"E c #6E6E6E", +"F c #819EB6", +"G c #526C80", +"H c #B9D3E7", +"I c #85A4BF", +"J c #F8D837", +"K c #F0A93F", +"L c #655930", +"M c #BABABA", +"N c #CCCCCC", +"O c #E5E5E5", +"P c #F7F7F7", +"Q c #727272", +"R c #83A0B8", +"S c #4F697C", +"T c #B9D3E6", +"U c #84A3BF", +"V c #CECECE", +"W c #F6D236", +"X c #EDA43E", +"Y c #5C5130", +"Z c #949494", +"` c #A3A3A3", +" . c #B7B7B7", +".. c #C6C6C6", +"+. c #BDBDBD", +"@. c #88A4BB", +"#. c #486276", +"$. c #B7D2E7", +"%. c #82A0BB", +"&. c #636363", +"*. c #FDFDFD", +"=. c #D7AE74", +"-. c #61562F", +";. c #465E70", +">. c #B5CAE5", +",. c #7FA2B9", +"'. c #4F4115", +"). c #87A3BA", +"!. c #455C6D", +"~. c #AECCE5", +"{. c #7DA0B6", +"]. c #CBCBCB", +"^. c #9B9B9B", +"/. c #9C9C9C", +"(. c #A7A7A7", +"_. c #B8B8B8", +":. c #C5C5C5", +"<. c #546069", +"[. c #B0D1E4", +"}. c #83A1B6", +"|. c #735B5B", +"1. c #F0F0F0", +"2. c #D9D9D9", +"3. c #D3D3D3", +"4. c #E1E1E1", +"5. c #EDEDED", +"6. c #F8F8F8", +"7. c #515C64", +"8. c #AACEE3", +"9. c #7B9BB2", +"0. c #7A8E9A", +"a. c #7A7A7A", +"b. c #707070", +"c. c #6C6C6C", +"d. c #6F6F6F", +"e. c #6A6E71", +"f. c #696969", +"g. c #6F777E", +"h. c #86A2B9", +"i. c #3A515D", +"j. c #A9C9E2", +"k. c #7494AF", +"l. c #7E9BB4", +"m. c #7D9AB3", +"n. c #7998B2", +"o. c #85A1B8", +"p. c #829FB7", +"q. c #8CA7BD", +"r. c #8AA5BB", +"s. c #364A59", +"t. c #ABC4E2", +"u. c #7294AD", +"v. c #6F90AC", +"w. c #7192AE", +"x. c #414A4E", +"y. c #424A51", +"z. c #525B63", +"A. c #626F79", +"B. c #5F6C76", +"C. c #5C6971", +"D. c #5A666F", +"E. c #58636B", +"F. c #57636A", +"G. c #3B5360", +"H. c #39424B", +"I. c #7897B3", +"J. c #A4B9CB", +"K. c #364853", +"L. c #AAC9E2", +"M. c #7091AA", +"N. c #6F8FA7", +"O. c #4A5359", +"P. c #97938C", +"Q. c #DFDDDA", +"R. c #E3E1DE", +"S. c #EBEAE8", +"T. c #EAE9E7", +"U. c #CFCEC9", +"V. c #C9C6C0", +"W. c #9B968E", +"X. c #566168", +"Y. c #4B657A", +"Z. c #54738C", +"`. c #AAC6DD", +" + c #34464E", +".+ c #AAC9E1", +"++ c #6C8EA6", +"@+ c #6C8CA4", +"#+ c #40474D", +"$+ c #DAD8D3", +"%+ c #E7E6E2", +"&+ c #67655E", +"*+ c #524F47", +"=+ c #D9D7D4", +"-+ c #C7C5BF", +";+ c #C0BCB5", +">+ c #B8B3AB", +",+ c #434C54", +"'+ c #4D697F", +")+ c #4F6F84", +"!+ c #B3CADC", +"~+ c #313E49", +"{+ c #A8C8E1", +"]+ c #6B8DA6", +"^+ c #728FA4", +"/+ c #E2E1DD", +"(+ c #F0EFEC", +"_+ c #CDCAC6", +":+ c #C2BFB9", +"<+ c #CAC6C0", +"[+ c #DCDAD7", +"}+ c #4B555D", +"|+ c #4E697F", +"1+ c #BACCDC", +"2+ c #A4C4DE", +"3+ c #698BA3", +"4+ c #708AA1", +"5+ c #383E43", +"6+ c #E0DEDA", +"7+ c #514E46", +"8+ c #4F4C44", +"9+ c #C7C4BE", +"0+ c #CBC8C2", +"a+ c #E1E0DC", +"b+ c #E9E8E6", +"c+ c #475158", +"d+ c #4E6879", +"e+ c #4D6C80", +"f+ c #A3C3DB", +"g+ c #383F43", +"h+ c #778999", +"i+ c #6E899E", +"j+ c #65859C", +"k+ c #33383C", +"l+ c #D7D4D0", +"m+ c #D6D4D0", +"n+ c #4E4A43", +"o+ c #4D4942", +"p+ c #D1CEC9", +"q+ c #E6E5E2", +"r+ c #EDECEA", +"s+ c #454F55", +"t+ c #486173", +"u+ c #4D6678", +"v+ c #A1C1DA", +"w+ c #373C40", +"x+ c #0C0D0F", +"y+ c #4E5E6A", +"z+ c #5B6E7C", +"A+ c #4F5B62", +"B+ c #A4A099", +"C+ c #CCC9C3", +"D+ c #D7D5D1", +"E+ c #E4E2E0", +"F+ c #DDDBD7", +"G+ c #B8B5B0", +"H+ c #3E474D", +"I+ c #4A6176", +"J+ c #4A6070", +"K+ c #9BC3D8", +"L+ c #363C41", +"M+ c #28323E", +" . . ", +" . + @ . ", +" . . . . . . . . . . . . . # $ % . . . ", +" . & * = - ; > , ' ) ! ~ . { ] ^ . / ( _ . ", +" . : < [ } | 1 2 3 4 5 . 6 7 8 . 9 0 a b . ", +" . c d e f g h i j k . l m n . o p q r s . ", +" . t u v w w w w x . y z A . B C D E F G . ", +" . H I v w w w x . J K L . M N O P Q R S . ", +" . T U v V C N . W X Y . Z ` ...+.v @.#.. ", +" . $.%.&.w w *.. =.-.. M N D P *.w v @.;.. ", +" . >.,.v w x . '.. . M N D P *.w w v ).!.. ", +" . ~.{.v V ].. . ^./.(._...].C C :.v ).<.. ", +" . [.}.|.w *.1.2.3.4.5.6.x w w w w v R 7.. ", +" . 8.9.0.a.Q b.c.c.d.e.E v v v v f.g.h.i.. ", +" . j.k.F R h.F l.m.F n.h.o.o.).p.q.R r.s.. ", +" . t.u.v.w.x.y.z.A.B.C.D.E.F.z.G.H.I.J.K.. ", +" . L.M.N.O.P.Q.R.S.S.T.Q.U.V.W.X.Y.Z.`. +. ", +" . .+++@+#+$+%+&+*+*+=+-+;+>+U.,+'+)+!+~+. ", +" . {+]+^+#+/+(+&+*+*+_+:+;+<+[+}+|+)+1+~+. ", +" . 2+3+4+5+6+S.7+8+8+9+;+0+a+b+c+d+e+f+g+. ", +" . h+i+j+k+l+m+n+o+o+;+p+q+r+q+s+t+u+v+w+. ", +" x+y+z+A+B+;+>+C+C+D+E+T.F+G+H+I+J+K+L+. ", +" . . . . . . . . . . . . . . . . M+. ", +" "}; diff --git a/lisp/toolbar/search.pbm b/lisp/toolbar/search.pbm Binary files differindex 9336eea6874..0e8a15e6a2e 100644 --- a/lisp/toolbar/search.pbm +++ b/lisp/toolbar/search.pbm diff --git a/lisp/toolbar/search.xpm b/lisp/toolbar/search.xpm index ff8732201e4..ad6300528e9 100644 --- a/lisp/toolbar/search.xpm +++ b/lisp/toolbar/search.xpm @@ -1,38 +1,234 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 8 1", -" c #011801180102", -". c #464646463e3e", -"X c #5c5c5c5c57a0", -"o c #878787877979", -"O c #a910a91097af", -"+ c #ce5ace5ab851", -"@ c #e79de79dd134", -"# c None", -/* pixels */ -"########################", -"########################", -"############# ##########", -"########### O #########", -"######### O@@.#########", -"####### O@@@@@ ########", -"##### O+@@@@@@O #######", -"#### XX@++@@@@@@.#######", -"#### @.O+@@@@@@@@ ######", -"#### @@.++@@@@@@@O #####", -"#### @@.o+O. .+@@ #####", -"#### @XO+O.O++o.+@@ ####", -"#### O+@.O@@+Oo.@@+ ###", -"#### X@@@ +#+OOO @@@@ ##", -"#### O@@@ +@OOOo @@@o ##", -"##### @@@.oOOOoX.@@ ###", -"##### O@@O.oOOX @ #####", -"######X@@@O. .X ######", -"###### @@@@@@@+ #####", -"####### @@@@@O ## ####", -"####### O@@+. #### ###", -"######## @O ####### ###", -"######### #############", -"########################" -}; +static char * search_xpm[] = { +"24 24 207 2", +" c None", +". c #000000", +"+ c #D3D3D3", +"@ c #F6F6F6", +"# c #FFFFFF", +"$ c #F9F9F9", +"% c #DADADA", +"& c #585858", +"* c #C7C7C7", +"= c #D1D1D1", +"- c #D6D6D6", +"; c #FEFEFE", +"> c #FDFDFD", +", c #C0C0C0", +"' c #E1E1E1", +") c #F0F0F0", +"! c #9B9B9B", +"~ c #FCFCFB", +"{ c #FBFBFB", +"] c #AFAFAE", +"^ c #E9E9E9", +"/ c #DFDFDF", +"( c #8F8F8F", +"_ c #FAFAF9", +": c #F9F9F8", +"< c #A4A4A3", +"[ c #F4F4F4", +"} c #CFCFCF", +"| c #A2A2A2", +"1 c #B8B8B8", +"2 c #47473F", +"3 c #0A0A09", +"4 c #4B4B43", +"5 c #B4B4B3", +"6 c #F7F6F5", +"7 c #9E9E9E", +"8 c #A9A9A8", +"9 c #34342E", +"0 c #9D9D8D", +"a c #CFCFB9", +"b c #C4C4AF", +"c c #8D8D7F", +"d c #353530", +"e c #ACACAA", +"f c #F1F0EF", +"g c #DEDDDC", +"h c #D3D2D0", +"i c #B7B7B5", +"j c #9F9E9D", +"k c #706F6F", +"l c #65625A", +"m c #46463F", +"n c #9C9C8C", +"o c #E2E2D0", +"p c #EDEDE7", +"q c #C0C0AC", +"r c #B2B29F", +"s c #828274", +"t c #4C4C44", +"u c #E4E4E2", +"v c #E1E1DF", +"w c #DAD9D7", +"x c #D8D8D6", +"y c #CDCCCA", +"z c #AFAEAC", +"A c #88847B", +"B c #F8F8F7", +"C c #090908", +"D c #D5D5BF", +"E c #FBFBFA", +"F c #C3C3AE", +"G c #B5B5A2", +"H c #A6A695", +"I c #9C9C8F", +"J c #080807", +"K c #CFCFCD", +"L c #E3E2E0", +"M c #ECEBE9", +"N c #E9E8E6", +"O c #D5D4D3", +"P c #C4C3C2", +"Q c #8F8A81", +"R c #F6F5F4", +"S c #F3F3F1", +"T c #090909", +"U c #CACAB5", +"V c #DDDDD0", +"W c #B7B7A4", +"X c #AAAA98", +"Y c #9B9B8B", +"Z c #AEAEA3", +"` c #BBBAB9", +" . c #E8E7E5", +".. c #E5E4E2", +"+. c #E4E3E0", +"@. c #D2D1CE", +"#. c #8D887E", +"$. c #F4F3F2", +"%. c #F0EFEE", +"&. c #474740", +"*. c #929283", +"=. c #BABAA7", +"-. c #ADAD9B", +";. c #9F9F8E", +">. c #ACACA1", +",. c #CFCFCB", +"'. c #4C4C45", +"). c #B3B2B1", +"!. c #E2E1DE", +"~. c #E1DFDC", +"{. c #979288", +"]. c #949493", +"^. c #34342F", +"/. c #878779", +"(. c #A0A090", +"_. c #AEAEA2", +":. c #C3C3BE", +"<. c #010101", +"[. c #B1B0AF", +"}. c #D2D1CF", +"|. c #A49E93", +"1. c #F0F0EE", +"2. c #EDEDEB", +"3. c #DDDDDB", +"4. c #898988", +"5. c #414141", +"6. c #737271", +"7. c #A4A3A1", +"8. c #DFDEDB", +"9. c #E2E0DD", +"0. c #E1E0DC", +"a. c #E0DFDB", +"b. c #A19C90", +"c. c #E1E0DE", +"d. c #CBCAC9", +"e. c #B2B1B0", +"f. c #A3A2A1", +"g. c #9D9C9A", +"h. c #9E9D9C", +"i. c #9F9F9D", +"j. c #ABAAA7", +"k. c #DCDBD7", +"l. c #DEDDD9", +"m. c #DDDCD8", +"n. c #A19B90", +"o. c #EBEAE8", +"p. c #E6E5E3", +"q. c #C8C7C4", +"r. c #B6B6B3", +"s. c #B0AFAD", +"t. c #B3B2B0", +"u. c #747371", +"v. c #9D9C99", +"w. c #DAD9D5", +"x. c #E7E6E3", +"y. c #E6E5E2", +"z. c #E3E2DF", +"A. c #DBDAD7", +"B. c #D4D3D0", +"C. c #D0CFCB", +"D. c #D1CFCC", +"E. c #D1D0CC", +"F. c #C9C8C4", +"G. c #6B6B69", +"H. c #CECDC9", +"I. c #D6D4D0", +"J. c #9F998D", +"K. c #E3E2DE", +"L. c #E4E2DF", +"M. c #DFDEDA", +"N. c #D5D4D0", +"O. c #C0BFBC", +"P. c #7B7A78", +"Q. c #BCBAB6", +"R. c #CECCC8", +"S. c #9D978C", +"T. c #EDEDED", +"U. c #E1E0DD", +"V. c #E2E1DD", +"W. c #DBDAD6", +"X. c #BBB9B6", +"Y. c #A6A4A1", +"Z. c #9E9C99", +"`. c #ACABA7", +" + c #C7C5C2", +".+ c #9B9589", +"++ c #E1DFDB", +"@+ c #E0DEDA", +"#+ c #DEDCD8", +"$+ c #DAD8D4", +"%+ c #BDBCB8", +"&+ c #ACABA8", +"*+ c #B2B1AD", +"=+ c #C6C4C0", +"-+ c #999388", +";+ c #999891", +">+ c #A39E92", +",+ c #A39D92", +"'+ c #A39D91", +")+ c #A29C90", +"!+ c #A19B8F", +"~+ c #9D978B", +"{+ c #989286", +"]+ c #918C82", +"^+ c #938D83", +"/+ c #979286", +"(+ c #666258", +" ", +" . . . . . . . . . . . . . ", +" . + @ # # # # # # # # $ % & . ", +" . @ # # # # # # # # # # * = - . ", +" . # # # # # # # ; # ; > , ' ) ! . ", +" . # # # # # ; > ~ > ~ { ] ^ # / ( . ", +" . # # # ; > ~ { _ { _ : < ) # [ } | . ", +" . # ; > ~ 1 2 3 3 4 5 6 7 . . . . . . . ", +" . # ~ { 8 9 0 a b c d e f g h i j k l . ", +" . # _ : m n o p q r s t u v w x y z A . ", +" . # B 6 C D E F G H I J K L M N O P Q . ", +" . # R S T U V W X Y Z 3 ` w ...+.@.#.. ", +" . # $.%.&.*.=.-.;.>.,.'.).h !.+.!.~.{.. ", +" . # $.%.].^./.(._.:.<.<.[.}.!.+.!.~.|.. ", +" . # 1.2.3.4.4 3 3 5.6.<.<.7.8.9.0.a.b.. ", +" . # 2.M c.d.e.f.g.h.i.<.<.<.j.k.l.m.n.. ", +" . # o.N p.w q.r.z s.t.u.. <.<.v.w.k.n.. ", +" . # x.y.y.z.A.B.C.D.E.F.G.<.<.<.H.I.J.. ", +" . $ +.z.K.L.K.a.a.M.M.N.O.P.<.<.Q.R.S.. ", +" . T.U.~.0.a.V.a.0.a.0.W.E.X.Y.Z.`. +.+. ", +" . = ++@+M.l.a.l.@+l.@+#+$+R.%+&+*+=+-+. ", +" . ;+>+|.,+'+,+b.)+b.)+!+n.~+{+]+^+/+(+. ", +" . . . . . . . . . . . . . . . . . . ", +" "}; diff --git a/lisp/toolbar/spell.pbm b/lisp/toolbar/spell.pbm Binary files differindex c641babe8ed..39a00c8946a 100644 --- a/lisp/toolbar/spell.pbm +++ b/lisp/toolbar/spell.pbm diff --git a/lisp/toolbar/spell.xpm b/lisp/toolbar/spell.xpm index a2c2282b48b..b53f4510602 100644 --- a/lisp/toolbar/spell.xpm +++ b/lisp/toolbar/spell.xpm @@ -1,35 +1,64 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 5 1", -" c Gray0", -". c #41415b5b3939", -"X c #4c2f6b4e42d1", -"o c #5fe086865454", -"O c None", -/* pixels */ -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOO OO OOO OOOOOOOO", -"OOO OO O OO O OO OOOOOOO", -"OOO O OO OOOOOOOOOO", -"OOO OO O OO O OO OOOOOOO", -"OOO OO O OOO OOOO OO", -"OOOOOOOOOOOOOOOOOOO OOO", -"OOOOOOOOOOO OOOOO OOOO", -"OOOOOOOOOOO X OOO . OOOO", -"OOOOOOOOOOOO X O X OOOOO", -"OOOOOOOOOOOO Xo o. OOOOO", -"OOOOOOOOOOOOO XoX OOOOOO", -"OOOOOOOOOOOOO Xo. OOOOOO", -"OOOOOOOOOOOOOO X OOOOOOO", -"OOOOOOOOOOOOOO X OOOOOOO", -"OOOOOOOOOOOOOOO OOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO" -}; +static char * spell_xpm[] = { +"24 24 37 1", +" c None", +". c #000000", +"+ c #8BBB8C", +"@ c #ABD0AC", +"# c #1A3B1A", +"$ c #8ABA88", +"% c #B4D5B4", +"& c #70A770", +"* c #132C13", +"= c #77A676", +"- c #2D2D2D", +"; c #CBDFCB", +"> c #6FAE6E", +", c #A8CBA6", +"' c #6D9D6C", +") c #D0E4D0", +"! c #6FAF6F", +"~ c #587055", +"{ c #B8D6B8", +"] c #5B9159", +"^ c #D4E4D4", +"/ c #67AF67", +"( c #5D905B", +"_ c #9FC59D", +": c #93BE92", +"< c #B5D1B5", +"[ c #67AF68", +"} c #63A261", +"| c #BBD6BA", +"1 c #82B881", +"2 c #75AF74", +"3 c #6B8868", +"4 c #9DC39D", +"5 c #7DB17B", +"6 c #6BA368", +"7 c #485C46", +"8 c #89BA88", +" ", +" ", +" ", +" ", +" ... .... ... ", +" .. . .. . .. . ", +" .. . .... .. ", +" ..... .. . .. ", +" .. . .. . .. . . ", +" .. . .... ... ... ", +" .+. ", +" .. .@# ", +" .$. .%&. ", +" *=. -;>. ", +" .,'. .)!~. ", +" .{].^/(. ", +" ._:<[}~. ", +" .|123. ", +" .4567. ", +" .83. ", +" .37. ", +" .. ", +" ", +" "}; diff --git a/lisp/toolbar/tool-bar.el b/lisp/toolbar/tool-bar.el index 425789eb80e..bf1c229ccb9 100644 --- a/lisp/toolbar/tool-bar.el +++ b/lisp/toolbar/tool-bar.el @@ -96,7 +96,8 @@ PROPS are additional items to add to the menu item specification. See Info node `(elisp)Tool Bar'. Items are added from left to right. ICON is the base name of a file containing the image to use. The -function will first try to use ICON.xpm, then ICON.pbm, and finally +function will first try to use lc-ICON.xpm if display-color-cells +is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally ICON.xbm, using `find-image'. Use this function only to make bindings in the global value of `tool-bar-map'. @@ -112,24 +113,24 @@ PROPS are additional items to add to the menu item specification. See Info node `(elisp)Tool Bar'. Items are added from left to right. ICON is the base name of a file containing the image to use. The -function will first try to use ICON.xpm, then ICON.pbm, and finally +function will first try to use lc-ICON.xpm if display-color-cells +is less or equal to 256, then ICON.xpm, then ICON.pbm, and finally ICON.xbm, using `find-image'." (let* ((fg (face-attribute 'tool-bar :foreground)) (bg (face-attribute 'tool-bar :background)) (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg)) (if (eq bg 'unspecified) nil (list :background bg)))) + (xpm-spec (list :type 'xpm :file (concat icon ".xpm"))) + (xpm-lo-spec (if (> (display-color-cells) 256) + nil + (list :type 'xpm :file (concat "lc-" icon ".xpm")))) + (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors)) + (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors)) (image (find-image (if (display-color-p) - (list (list :type 'xpm :file (concat icon ".xpm")) - (append (list :type 'pbm :file (concat icon ".pbm")) - colors) - (append (list :type 'xbm :file (concat icon ".xbm")) - colors)) - (list (append (list :type 'pbm :file (concat icon ".pbm")) - colors) - (append (list :type 'xbm :file (concat icon ".xbm")) - colors) - (list :type 'xpm :file (concat icon ".xpm"))))))) + (list xpm-lo-spec xpm-spec pbm-spec xbm-spec) + (list pbm-spec xbm-spec xpm-lo-spec xpm-spec))))) + (when (and (display-images-p) image) (unless (image-mask-p image) (setq image (append image '(:mask heuristic)))) @@ -170,17 +171,15 @@ MAP must contain appropriate binding for `[menu-bar]' which holds a keymap." (bg (face-attribute 'tool-bar :background)) (colors (nconc (if (eq fg 'unspecified) nil (list :foreground fg)) (if (eq bg 'unspecified) nil (list :background bg)))) + (xpm-spec (list :type 'xpm :file (concat icon ".xpm"))) + (xpm-lo-spec (if (> (display-color-cells) 256) + nil + (list :type 'xpm :file (concat "lc-" icon ".xpm")))) + (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors)) + (xbm-spec (append (list :type 'xbm :file (concat icon ".xbm")) colors)) (spec (if (display-color-p) - (list (list :type 'xpm :file (concat icon ".xpm")) - (append (list :type 'pbm :file (concat icon ".pbm")) - colors) - (append (list :type 'xbm :file (concat icon ".xbm")) - colors)) - (list (append (list :type 'pbm :file (concat icon ".pbm")) - colors) - (append (list :type 'xbm :file (concat icon ".xbm")) - colors) - (list :type 'xpm :file (concat icon ".xpm"))))) + (list xpm-lo-spec xpm-spec pbm-spec xbm-spec) + (list pbm-spec xbm-spec xpm-lo-spec xpm-spec))) (image (find-image spec)) submap key) (when (and (display-images-p) image) @@ -239,11 +238,14 @@ MAP must contain appropriate binding for `[menu-bar]' which holds a keymap." (tool-bar-add-item-from-menu 'undo "undo" nil :visible '(not (eq 'special (get major-mode 'mode-class)))) - (tool-bar-add-item-from-menu 'kill-region "cut" nil + (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut]) + "cut" nil :visible '(not (eq 'special (get major-mode 'mode-class)))) - (tool-bar-add-item-from-menu 'menu-bar-kill-ring-save "copy") - (tool-bar-add-item-from-menu 'yank "paste" nil + (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy]) + "copy") + (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste]) + "paste" nil :visible '(not (eq 'special (get major-mode 'mode-class)))) (tool-bar-add-item-from-menu 'nonincremental-search-forward "search") diff --git a/lisp/toolbar/undo.pbm b/lisp/toolbar/undo.pbm Binary files differindex 5bed67caa40..7f9b8975d2f 100644 --- a/lisp/toolbar/undo.pbm +++ b/lisp/toolbar/undo.pbm diff --git a/lisp/toolbar/undo.xpm b/lisp/toolbar/undo.xpm index c48b0fdae6f..ca5bd760937 100644 --- a/lisp/toolbar/undo.xpm +++ b/lisp/toolbar/undo.xpm @@ -1,35 +1,58 @@ /* XPM */ -static char *magick[] = { -/* columns rows colors chars-per-pixel */ -"24 24 5 1", -" c Gray0", -". c #ae6e66e76a0a", -"X c #c6c67d7d8181", -"o c #e4e4e4e4dcdc", -"O c None", -/* pixels */ -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOO OOOOOOOOOOOOOO", -"OOOOOOOO OOOOOOOOOOOOOO", -"OOOOOOO oX OOOOOOOOOOO", -"OOOOOO ooooX. OOOOOOOOO", -"OOOOOOO oo .. OOOOOOOO", -"OOOOOOOO OOO . OOOOOOOO", -"OOOOOOOOO OOOO . OOOOOOO", -"OOOOOOOOOOOOOOO OOOOOOO", -"OOOOOOOOOOOOOOO OOOOOOO", -"OOOOOOOOOOOOOOO OOOOOOOO", -"OOOOOOOOOOOOOO OOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO", -"OOOOOOOOOOOOOOOOOOOOOOOO" -}; +static char * undo_xpm[] = { +"24 24 31 1", +" c None", +". c #000000", +"+ c #EFE5BA", +"@ c #EFE7C1", +"# c #EED680", +"$ c #EFE4B6", +"% c #D5B75D", +"& c #B29544", +"* c #D1B051", +"= c #C0AF73", +"- c #C0A048", +"; c #986B07", +"> c #D1940C", +", c #E0B74C", +"' c #D9C374", +") c #8F6406", +"! c #D59D1C", +"~ c #B1933F", +"{ c #DFB74A", +"] c #CCB76D", +"^ c #B8820A", +"/ c #D9A72E", +"( c #D7A62C", +"_ c #C7B26A", +": c #D4B150", +"< c #A39256", +"[ c #E2CB79", +"} c #C9B46B", +"| c #8D7E4A", +"1 c #AE9C5C", +"2 c #96864F", +" ", +" ", +" ", +" . ", +" .. ", +" .+. ", +" .@#.... ", +" .$####%&. ", +" .+#######*. ", +" .=#########-. ", +" .;>>>>>>,#'.. ", +" .)>>>>>>!#~. ", +" .)>...;>{]. ", +" .;. ..^/#. ", +" .. ..>#. ", +" . .(_. ", +" .:<. ", +" .[. ", +" .}|. ", +" .12. ", +" .. ", +" ", +" ", +" "}; diff --git a/lisp/toolbar/up_arrow.pbm b/lisp/toolbar/up_arrow.pbm Binary files differindex ca7e04f7a50..7c792bef796 100644 --- a/lisp/toolbar/up_arrow.pbm +++ b/lisp/toolbar/up_arrow.pbm diff --git a/lisp/toolbar/up_arrow.xpm b/lisp/toolbar/up_arrow.xpm index 44243cfe7f6..09963557d1b 100644 --- a/lisp/toolbar/up_arrow.xpm +++ b/lisp/toolbar/up_arrow.xpm @@ -1,33 +1,91 @@ /* XPM */ static char * up_arrow_xpm[] = { -"24 24 9 1", +"24 24 67 1", " c None", -". c #020202", -"+ c #121A12", -"@ c #78A16E", -"# c #86AD7D", -"$ c #B2C6AE", -"% c #263222", -"& c #E7EDE6", -"* c #497241", +". c #000000", +"+ c #2F2F2F", +"@ c #A5B4A4", +"# c #E8F4E6", +"$ c #96B892", +"% c #41533C", +"& c #F1FFF0", +"* c #B8D6B7", +"= c #9FC49D", +"- c #66815E", +"; c #B6D4B5", +"> c #B9D7B8", +", c #A1C69F", +"' c #68835F", +") c #637D5B", +"! c #3F5239", +"~ c #B8D7B7", +"{ c #A2C7A0", +"] c #6A8561", +"^ c #657F5C", +"/ c #617959", +"( c #3E4F39", +"_ c #F0FEEF", +": c #B7D5B6", +"< c #657E5C", +"[ c #5D7555", +"} c #D6EAD6", +"| c #BFD4BF", +"1 c #C0D5C0", +"2 c #637C5B", +"3 c #4D6246", +"4 c #4C6046", +"5 c #C7E1C6", +"6 c #A1C69E", +"7 c #67815E", +"8 c #627B59", +"9 c #3D4E39", +"0 c #D0E7D0", +"a c #B5D3B4", +"b c #A0C39D", +"c c #607958", +"d c #B5D2B4", +"e c #9DC19B", +"f c #647D5B", +"g c #607858", +"h c #C6E0C5", +"i c #B4D2B3", +"j c #9CBF99", +"k c #C5DFC4", +"l c #B1CEB0", +"m c #99BC97", +"n c #617A59", +"o c #5E7756", +"p c #C0D9BF", +"q c #AFCCAE", +"r c #AECBAD", +"s c #93B690", +"t c #607857", +"u c #5E7656", +"v c #8DB389", +"w c #748A72", +"x c #71916E", +"y c #5A7257", +"z c #4D6247", +"A c #4D6146", +"B c #43543D", " ", " ", -" ", -" ", -" .. ", -" .. ", -" .$*. ", -" +&*. ", -" .&&@*. ", -" .&&@*. ", -" .&&&@@*. ", -" .&&&##*. ", -" .&&&&#@@*. ", -" .&&&&###*. ", -" .&&&&&##@@*. ", -" .&&&&&###@@. ", -" .$$$$$$@@@@**. ", -" ......%....... ", +" . ", +" +@. ", +" .#$%. ", +" .&*=-%. ", +" .&;>,')!. ", +" .&~;>{]^/(. ", +" ._~>:>,]</[(. ", +" .}|1>~~,'23444. ", +" .....5;;6789..... ", +" .0;ab^c9. ", +" .5;defg9. ", +" .haij2g9. ", +" .kilmno9. ", +" .pqrstu9. ", +" .vwxyzAB. ", +" ......... ", " ", " ", " ", diff --git a/lisp/tree-widget.el b/lisp/tree-widget.el new file mode 100644 index 00000000000..54323e41dd3 --- /dev/null +++ b/lisp/tree-widget.el @@ -0,0 +1,736 @@ +;;; tree-widget.el --- Tree widget + +;; Copyright (C) 2004 Free Software Foundation, Inc. + +;; Author: David Ponce <david@dponce.com> +;; Maintainer: David Ponce <david@dponce.com> +;; Created: 16 Feb 2001 +;; Keywords: extensions + +;; This file is part of GNU Emacs + +;; This program is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: +;; +;; This library provide a tree widget useful to display data +;; structures organized in a hierarchical order. +;; +;; The following properties are specific to the tree widget: +;; +;; :open +;; Set to non-nil to unfold the tree. By default the tree is +;; folded. +;; +;; :node +;; Specify the widget used to represent a tree node. By default +;; this is an `item' widget which displays the tree-widget :tag +;; property value if defined or a string representation of the +;; tree-widget value. +;; +;; :keep +;; Specify a list of properties to keep when the tree is +;; folded so they can be recovered when the tree is unfolded. +;; This property can be used in child widgets too. +;; +;; :dynargs +;; Specify a function to be called when the tree is unfolded, to +;; dynamically provide the tree children in response to an unfold +;; request. This function will be passed the tree widget and +;; must return a list of child widgets. That list will be stored +;; as the :args property of the parent tree. + +;; To speed up successive unfold requests, the :dynargs function +;; can directly return the :args value if non-nil. Refreshing +;; child values can be achieved by giving the :args property the +;; value nil, then redrawing the tree. +;; +;; :has-children +;; Specify if this tree has children. This property has meaning +;; only when used with the above :dynargs one. It indicates that +;; child widgets exist but will be dynamically provided when +;; unfolding the node. +;; +;; :open-control (default `tree-widget-open-control') +;; :close-control (default `tree-widget-close-control') +;; :empty-control (default `tree-widget-empty-control') +;; :leaf-control (default `tree-widget-leaf-control') +;; :guide (default `tree-widget-guide') +;; :end-guide (default `tree-widget-end-guide') +;; :no-guide (default `tree-widget-no-guide') +;; :handle (default `tree-widget-handle') +;; :no-handle (default `tree-widget-no-handle') +;; +;; The above nine properties define the widgets used to draw the tree. +;; For example, using widgets that display this values: +;; +;; open-control "[-] " +;; close-control "[+] " +;; empty-control "[X] " +;; leaf-control "[>] " +;; guide " |" +;; noguide " " +;; end-guide " `" +;; handle "-" +;; no-handle " " +;; +;; A tree will look like this: +;; +;; [-] 1 open-control +;; |-[+] 1.0 guide+handle+close-control +;; |-[X] 1.1 guide+handle+empty-control +;; `-[-] 1.2 end-guide+handle+open-control +;; |-[>] 1.2.1 no-guide+no-handle+guide+handle+leaf-control +;; `-[>] 1.2.2 no-guide+no-handle+end-guide+handle+leaf-control +;; +;; By default, the tree widget try to use images instead of strings to +;; draw a nice-looking tree. See the `tree-widget-themes-directory' +;; and `tree-widget-theme' options for more details. +;; + +;;; History: +;; + +;;; Code: +(eval-when-compile (require 'cl)) +(require 'wid-edit) + +;;; Customization +;; +(defgroup tree-widget nil + "Customization support for the Tree Widget Library." + :version "21.4" + :group 'widgets) + +(defcustom tree-widget-image-enable + (not (or (featurep 'xemacs) (< emacs-major-version 21))) + "*non-nil means that tree-widget will try to use images." + :type 'boolean + :group 'tree-widget) + +(defcustom tree-widget-themes-directory "tree-widget" + "*Name of the directory where to lookup for image themes. +When nil use the directory where the tree-widget library is located. +When a relative name is specified, try to locate that sub-directory in +`load-path', then in the data directory, and use the first one found. +Default is to search for a \"tree-widget\" sub-directory. + +The data directory is the value of: + - the variable `data-directory' on GNU Emacs; + - `(locate-data-directory \"tree-widget\")' on XEmacs." + :type '(choice (const :tag "Default" "tree-widget") + (const :tag "With the library" nil) + (directory :format "%{%t%}:\n%v")) + :group 'tree-widget) + +(defcustom tree-widget-theme nil + "*Name of the theme to use to lookup for images. +The theme name must be a subdirectory in `tree-widget-themes-directory'. +If nil use the \"default\" theme. +When a image is not found in the current theme, the \"default\" theme +is searched too. +A complete theme should contain images with these file names: + +Name Represents +----------- ------------------------------------------------ +open opened node (for example an open folder) +close closed node (for example a close folder) +empty empty node (a node without children) +leaf leaf node (for example a document) +guide a vertical guide line +no-guide an invisible guide line +end-guide the end of a vertical guide line +handle an horizontal line drawn before a node control +no-handle an invisible handle +----------- ------------------------------------------------" + :type '(choice (const :tag "Default" nil) + (string :tag "Name")) + :group 'tree-widget) + +(defcustom tree-widget-image-properties-emacs + '(:ascent center :mask (heuristic t)) + "*Properties of GNU Emacs images." + :type 'plist + :group 'tree-widget) + +(defcustom tree-widget-image-properties-xemacs + nil + "*Properties of XEmacs images." + :type 'plist + :group 'tree-widget) + +;;; Image support +;; +(eval-when-compile ;; GNU Emacs/XEmacs compatibility stuff + (cond + ;; XEmacs + ((featurep 'xemacs) + (defsubst tree-widget-use-image-p () + "Return non-nil if image support is currently enabled." + (and tree-widget-image-enable + widget-glyph-enable + (console-on-window-system-p))) + (defsubst tree-widget-create-image (type file &optional props) + "Create an image of type TYPE from FILE. +Give the image the specified properties PROPS. +Return the new image." + (apply 'make-glyph `([,type :file ,file ,@props]))) + (defsubst tree-widget-image-formats () + "Return the list of image formats, file name suffixes associations. +See also the option `widget-image-file-name-suffixes'." + (delq nil + (mapcar + #'(lambda (fmt) + (and (valid-image-instantiator-format-p (car fmt)) fmt)) + widget-image-file-name-suffixes))) + ) + ;; GNU Emacs + (t + (defsubst tree-widget-use-image-p () + "Return non-nil if image support is currently enabled." + (and tree-widget-image-enable + widget-image-enable + (display-images-p))) + (defsubst tree-widget-create-image (type file &optional props) + "Create an image of type TYPE from FILE. +Give the image the specified properties PROPS. +Return the new image." + (apply 'create-image `(,file ,type nil ,@props))) + (defsubst tree-widget-image-formats () + "Return the list of image formats, file name suffixes associations. +See also the option `widget-image-conversion'." + (delq nil + (mapcar + #'(lambda (fmt) + (and (image-type-available-p (car fmt)) fmt)) + widget-image-conversion))) + )) + ) + +;; Buffer local cache of theme data. +(defvar tree-widget--theme nil) + +(defsubst tree-widget-theme-name () + "Return the current theme name, or nil if no theme is active." + (and tree-widget--theme (aref tree-widget--theme 0))) + +(defsubst tree-widget-set-theme (&optional name) + "In the current buffer, set the theme to use for images. +The current buffer should be where the tree widget is drawn. +Optional argument NAME is the name of the theme to use, which defaults +to the value of the variable `tree-widget-theme'. +Does nothing if NAME is the name of the current theme." + (or name (setq name (or tree-widget-theme "default"))) + (unless (equal name (tree-widget-theme-name)) + (set (make-local-variable 'tree-widget--theme) + (make-vector 4 nil)) + (aset tree-widget--theme 0 name))) + +(defun tree-widget-themes-directory () + "Locate the directory where to search for a theme. +It is defined in variable `tree-widget-themes-directory'. +Return the absolute name of the directory found, or nil if the +specified directory is not accessible." + (let ((found (aref tree-widget--theme 1))) + (if found + ;; The directory is available in the cache. + (unless (eq found 'void) found) + (cond + ;; Use the directory where tree-widget is located. + ((null tree-widget-themes-directory) + (setq found (locate-library "tree-widget")) + (when found + (setq found (file-name-directory found)) + (or (file-accessible-directory-p found) + (setq found nil)))) + ;; Check accessibility of absolute directory name. + ((file-name-absolute-p tree-widget-themes-directory) + (setq found (expand-file-name tree-widget-themes-directory)) + (or (file-accessible-directory-p found) + (setq found nil))) + ;; Locate a sub-directory in `load-path' and data directory. + (t + (let ((path + (append load-path + ;; The data directory depends on which, GNU + ;; Emacs or XEmacs, is running. + (list (if (fboundp 'locate-data-directory) + (locate-data-directory "tree-widget") + data-directory))))) + (while (and path (not found)) + (when (car path) + (setq found (expand-file-name + tree-widget-themes-directory (car path))) + (or (file-accessible-directory-p found) + (setq found nil))) + (setq path (cdr path)))))) + ;; Store the result in the cache for later use. + (aset tree-widget--theme 1 (or found 'void)) + found))) + +(defsubst tree-widget-set-image-properties (props) + "In current theme, set images properties to PROPS." + (aset tree-widget--theme 2 props)) + +(defun tree-widget-image-properties (file) + "Return properties of images in current theme. +If the \"tree-widget-theme-setup.el\" file exists in the directory +where is located the image FILE, load it to setup theme images +properties. Typically that file should contain something like this: + + (tree-widget-set-image-properties + (if (featurep 'xemacs) + '(:ascent center) + '(:ascent center :mask (heuristic t)) + )) + +By default, use the global properties provided in variables +`tree-widget-image-properties-emacs' or +`tree-widget-image-properties-xemacs'." + ;; If properties are in the cache, use them. + (or (aref tree-widget--theme 2) + (progn + ;; Load tree-widget-theme-setup if available. + (load (expand-file-name + "tree-widget-theme-setup" + (file-name-directory file)) t t) + ;; If properties have been setup, use them. + (or (aref tree-widget--theme 2) + ;; By default, use supplied global properties. + (tree-widget-set-image-properties + (if (featurep 'xemacs) + tree-widget-image-properties-xemacs + tree-widget-image-properties-emacs)))))) + +(defun tree-widget-find-image (name) + "Find the image with NAME in current theme. +NAME is an image file name sans extension. +Search first in current theme, then in default theme. +A theme is a sub-directory of the root theme directory specified in +variable `tree-widget-themes-directory'. +Return the first image found having a supported format in those +returned by the function `tree-widget-image-formats', or nil if not +found." + (when (tree-widget-use-image-p) + ;; Ensure there is an active theme. + (tree-widget-set-theme (tree-widget-theme-name)) + ;; If the image is in the cache, return it. + (or (cdr (assoc name (aref tree-widget--theme 3))) + ;; Search the image in the current, then default themes. + (let ((default-directory (tree-widget-themes-directory))) + (when default-directory + (let* ((theme (tree-widget-theme-name)) + (path (mapcar 'expand-file-name + (if (equal theme "default") + '("default") + (list theme "default")))) + (formats (tree-widget-image-formats)) + (found + (catch 'found + (dolist (dir path) + (dolist (fmt formats) + (dolist (ext (cdr fmt)) + (let ((file (expand-file-name + (concat name ext) dir))) + (and (file-readable-p file) + (file-regular-p file) + (throw 'found + (cons (car fmt) file))))))) + nil))) + (when found + (let ((image + (tree-widget-create-image + (car found) (cdr found) + (tree-widget-image-properties (cdr found))))) + ;; Store image in the cache for later use. + (push (cons name image) (aref tree-widget--theme 3)) + image)))))))) + +;;; Widgets +;; +(defvar tree-widget-button-keymap + (let (parent-keymap mouse-button1 keymap) + (if (featurep 'xemacs) + (setq parent-keymap widget-button-keymap + mouse-button1 [button1]) + (setq parent-keymap widget-keymap + mouse-button1 [down-mouse-1])) + (setq keymap (copy-keymap parent-keymap)) + (define-key keymap mouse-button1 'widget-button-click) + keymap) + "Keymap used inside node handle buttons.") + +(define-widget 'tree-widget-control 'push-button + "Base `tree-widget' control." + :format "%[%t%]" + :button-keymap tree-widget-button-keymap ; XEmacs + :keymap tree-widget-button-keymap ; Emacs + ) + +(define-widget 'tree-widget-open-control 'tree-widget-control + "Control widget that represents a opened `tree-widget' node." + :tag "[-] " + ;;:tag-glyph (tree-widget-find-image "open") + :notify 'tree-widget-close-node + :help-echo "Hide node" + ) + +(define-widget 'tree-widget-empty-control 'tree-widget-open-control + "Control widget that represents an empty opened `tree-widget' node." + :tag "[X] " + ;;:tag-glyph (tree-widget-find-image "empty") + ) + +(define-widget 'tree-widget-close-control 'tree-widget-control + "Control widget that represents a closed `tree-widget' node." + :tag "[+] " + ;;:tag-glyph (tree-widget-find-image "close") + :notify 'tree-widget-open-node + :help-echo "Show node" + ) + +(define-widget 'tree-widget-leaf-control 'item + "Control widget that represents a leaf node." + :tag " " ;; Need at least a char to display the image :-( + ;;:tag-glyph (tree-widget-find-image "leaf") + :format "%t" + ) + +(define-widget 'tree-widget-guide 'item + "Widget that represents a guide line." + :tag " |" + ;;:tag-glyph (tree-widget-find-image "guide") + :format "%t" + ) + +(define-widget 'tree-widget-end-guide 'item + "Widget that represents the end of a guide line." + :tag " `" + ;;:tag-glyph (tree-widget-find-image "end-guide") + :format "%t" + ) + +(define-widget 'tree-widget-no-guide 'item + "Widget that represents an invisible guide line." + :tag " " + ;;:tag-glyph (tree-widget-find-image "no-guide") + :format "%t" + ) + +(define-widget 'tree-widget-handle 'item + "Widget that represent a node handle." + :tag " " + ;;:tag-glyph (tree-widget-find-image "handle") + :format "%t" + ) + +(define-widget 'tree-widget-no-handle 'item + "Widget that represent an invisible node handle." + :tag " " + ;;:tag-glyph (tree-widget-find-image "no-handle") + :format "%t" + ) + +(define-widget 'tree-widget 'default + "Tree widget." + :format "%v" + :convert-widget 'widget-types-convert-widget + :value-get 'widget-value-value-get + :value-create 'tree-widget-value-create + :value-delete 'tree-widget-value-delete + ) + +;;; Widget support functions +;; +(defun tree-widget-p (widget) + "Return non-nil if WIDGET is a `tree-widget' widget." + (let ((type (widget-type widget))) + (while (and type (not (eq type 'tree-widget))) + (setq type (widget-type (get type 'widget-type)))) + (eq type 'tree-widget))) + +(defsubst tree-widget-get-super (widget property) + "Return WIDGET's inherited PROPERTY value." + (widget-get (get (widget-type (get (widget-type widget) + 'widget-type)) + 'widget-type) + property)) + +(defsubst tree-widget-super-format-handler (widget escape) + "Call WIDGET's inherited format handler to process ESCAPE character." + (let ((handler (tree-widget-get-super widget :format-handler))) + (and handler (funcall handler widget escape)))) + +(defun tree-widget-format-handler (widget escape) + "For WIDGET, signal that the %p format template is obsolete. +Call WIDGET's inherited format handler to process other ESCAPE +characters." + (if (eq escape ?p) + (message "The %%p format template is obsolete and ignored") + (tree-widget-super-format-handler widget escape))) +(make-obsolete 'tree-widget-format-handler + 'tree-widget-super-format-handler) + +(defsubst tree-widget-node (widget) + "Return the tree WIDGET :node value. +If not found setup a default 'item' widget." + (let ((node (widget-get widget :node))) + (unless node + (setq node `(item :tag ,(or (widget-get widget :tag) + (widget-princ-to-string + (widget-value widget))))) + (widget-put widget :node node)) + node)) + +(defsubst tree-widget-open-control (widget) + "Return the opened node control specified in WIDGET." + (or (widget-get widget :open-control) + 'tree-widget-open-control)) + +(defsubst tree-widget-close-control (widget) + "Return the closed node control specified in WIDGET." + (or (widget-get widget :close-control) + 'tree-widget-close-control)) + +(defsubst tree-widget-empty-control (widget) + "Return the empty node control specified in WIDGET." + (or (widget-get widget :empty-control) + 'tree-widget-empty-control)) + +(defsubst tree-widget-leaf-control (widget) + "Return the leaf node control specified in WIDGET." + (or (widget-get widget :leaf-control) + 'tree-widget-leaf-control)) + +(defsubst tree-widget-guide (widget) + "Return the guide line widget specified in WIDGET." + (or (widget-get widget :guide) + 'tree-widget-guide)) + +(defsubst tree-widget-end-guide (widget) + "Return the end of guide line widget specified in WIDGET." + (or (widget-get widget :end-guide) + 'tree-widget-end-guide)) + +(defsubst tree-widget-no-guide (widget) + "Return the invisible guide line widget specified in WIDGET." + (or (widget-get widget :no-guide) + 'tree-widget-no-guide)) + +(defsubst tree-widget-handle (widget) + "Return the node handle line widget specified in WIDGET." + (or (widget-get widget :handle) + 'tree-widget-handle)) + +(defsubst tree-widget-no-handle (widget) + "Return the node invisible handle line widget specified in WIDGET." + (or (widget-get widget :no-handle) + 'tree-widget-no-handle)) + +(defun tree-widget-keep (arg widget) + "Save in ARG the WIDGET properties specified by :keep." + (dolist (prop (widget-get widget :keep)) + (widget-put arg prop (widget-get widget prop)))) + +(defun tree-widget-children-value-save (widget &optional args node) + "Save WIDGET children values. +Children properties and values are saved in ARGS if non-nil else in +WIDGET :args property value. Data node properties and value are saved +in NODE if non-nil else in WIDGET :node property value." + (let ((args (or args (widget-get widget :args))) + (node (or node (tree-widget-node widget))) + (children (widget-get widget :children)) + (node-child (widget-get widget :tree-widget--node)) + arg child) + (while (and args children) + (setq arg (car args) + args (cdr args) + child (car children) + children (cdr children)) + (if (tree-widget-p child) +;;;; The child is a tree node. + (progn + ;; Backtrack :args and :node properties. + (widget-put arg :args (widget-get child :args)) + (widget-put arg :node (tree-widget-node child)) + ;; Save :open property. + (widget-put arg :open (widget-get child :open)) + ;; The node is open. + (when (widget-get child :open) + ;; Save the widget value. + (widget-put arg :value (widget-value child)) + ;; Save properties specified in :keep. + (tree-widget-keep arg child) + ;; Save children. + (tree-widget-children-value-save + child (widget-get arg :args) (widget-get arg :node)))) +;;;; Another non tree node. + ;; Save the widget value + (widget-put arg :value (widget-value child)) + ;; Save properties specified in :keep. + (tree-widget-keep arg child))) + (when (and node node-child) + ;; Assume that the node child widget is not a tree! + ;; Save the node child widget value. + (widget-put node :value (widget-value node-child)) + ;; Save the node child properties specified in :keep. + (tree-widget-keep node node-child)) + )) + +(defvar tree-widget-after-toggle-functions nil + "Hooks run after toggling a `tree-widget' folding. +Each function will receive the `tree-widget' as its unique argument. +This variable should be local to each buffer used to display +widgets.") + +(defun tree-widget-close-node (widget &rest ignore) + "Close the `tree-widget' node associated to this control WIDGET. +WIDGET's parent should be a `tree-widget'. +IGNORE other arguments." + (let ((tree (widget-get widget :parent))) + ;; Before folding the node up, save children values so next open + ;; can recover them. + (tree-widget-children-value-save tree) + (widget-put tree :open nil) + (widget-value-set tree nil) + (run-hook-with-args 'tree-widget-after-toggle-functions tree))) + +(defun tree-widget-open-node (widget &rest ignore) + "Open the `tree-widget' node associated to this control WIDGET. +WIDGET's parent should be a `tree-widget'. +IGNORE other arguments." + (let ((tree (widget-get widget :parent))) + (widget-put tree :open t) + (widget-value-set tree t) + (run-hook-with-args 'tree-widget-after-toggle-functions tree))) + +(defun tree-widget-value-delete (widget) + "Delete tree WIDGET children." + ;; Delete children + (widget-children-value-delete widget) + ;; Delete node child + (widget-delete (widget-get widget :tree-widget--node)) + (widget-put widget :tree-widget--node nil)) + +(defun tree-widget-value-create (tree) + "Create the TREE widget." + (let* ((widget-image-enable (tree-widget-use-image-p)) ; Emacs + (widget-glyph-enable widget-image-enable) ; XEmacs + (node (tree-widget-node tree)) + children buttons) + (if (widget-get tree :open) +;;;; Unfolded node. + (let* ((args (widget-get tree :args)) + (dynargs (widget-get tree :dynargs)) + (flags (widget-get tree :tree-widget--guide-flags)) + (rflags (reverse flags)) + (guide (tree-widget-guide tree)) + (noguide (tree-widget-no-guide tree)) + (endguide (tree-widget-end-guide tree)) + (handle (tree-widget-handle tree)) + (nohandle (tree-widget-no-handle tree)) + ;; Lookup for images and set widgets' tag-glyphs here, + ;; to allow to dynamically change the image theme. + (guidi (tree-widget-find-image "guide")) + (noguidi (tree-widget-find-image "no-guide")) + (endguidi (tree-widget-find-image "end-guide")) + (handli (tree-widget-find-image "handle")) + (nohandli (tree-widget-find-image "no-handle")) + child) + (when dynargs + ;; Request the definition of dynamic children + (setq dynargs (funcall dynargs tree)) + ;; Unless children have changed, reuse the widgets + (unless (eq args dynargs) + (setq args (mapcar 'widget-convert dynargs)) + (widget-put tree :args args))) + ;; Insert the node control + (push (widget-create-child-and-convert + tree (if args (tree-widget-open-control tree) + (tree-widget-empty-control tree)) + :tag-glyph (tree-widget-find-image + (if args "open" "empty"))) + buttons) + ;; Insert the node element + (widget-put tree :tree-widget--node + (widget-create-child-and-convert tree node)) + ;; Insert children + (while args + (setq child (car args) + args (cdr args)) + ;; Insert guide lines elements + (dolist (f rflags) + (widget-create-child-and-convert + tree (if f guide noguide) + :tag-glyph (if f guidi noguidi)) + (widget-create-child-and-convert + tree nohandle :tag-glyph nohandli) + ) + (widget-create-child-and-convert + tree (if args guide endguide) + :tag-glyph (if args guidi endguidi)) + ;; Insert the node handle line + (widget-create-child-and-convert + tree handle :tag-glyph handli) + ;; If leaf node, insert a leaf node control + (unless (tree-widget-p child) + (push (widget-create-child-and-convert + tree (tree-widget-leaf-control tree) + :tag-glyph (tree-widget-find-image "leaf")) + buttons)) + ;; Insert the child element + (push (widget-create-child-and-convert + tree child + :tree-widget--guide-flags (cons (if args t) flags)) + children))) +;;;; Folded node. + ;; Insert the closed node control + (push (widget-create-child-and-convert + tree (tree-widget-close-control tree) + :tag-glyph (tree-widget-find-image "close")) + buttons) + ;; Insert the node element + (widget-put tree :tree-widget--node + (widget-create-child-and-convert tree node))) + ;; Save widget children and buttons + (widget-put tree :children (nreverse children)) + (widget-put tree :buttons buttons) + )) + +;;; Utilities +;; +(defun tree-widget-map (widget fun) + "For each WIDGET displayed child call function FUN. +FUN is called with three arguments like this: + + (FUN CHILD IS-NODE WIDGET) + +where: +- - CHILD is the child widget. +- - IS-NODE is non-nil if CHILD is WIDGET node widget." + (when (widget-get widget :tree-widget--node) + (funcall fun (widget-get widget :tree-widget--node) t widget) + (dolist (child (widget-get widget :children)) + (if (tree-widget-p child) + ;; The child is a tree node. + (tree-widget-map child fun) + ;; Another non tree node. + (funcall fun child nil widget))))) + +(provide 'tree-widget) + +;;; arch-tag: c3a1ada2-1663-41dc-9d16-2479ed8320e8 +;;; tree-widget.el ends here diff --git a/lisp/type-break.el b/lisp/type-break.el index 26ac7f87ecb..253e1406f06 100644 --- a/lisp/type-break.el +++ b/lisp/type-break.el @@ -30,10 +30,10 @@ ;; The docstring for the function `type-break-mode' summarizes most of the ;; details of the interface. -;; This package relies on the assumption that you live entirely in emacs, +;; This package relies on the assumption that you live entirely in Emacs, ;; as the author does. If that's not the case for you (e.g. you often -;; suspend emacs or work in other windows) then this won't help very much; -;; it will depend on just how often you switch back to emacs. At the very +;; suspend Emacs or work in other windows) then this won't help very much; +;; it will depend on just how often you switch back to Emacs. At the very ;; least, you will want to turn off the keystroke thresholds and rest ;; interval tracking. @@ -95,7 +95,7 @@ use either \\[customize] or the function `type-break-mode'." (defcustom type-break-good-rest-interval (/ type-break-interval 6) "*Number of seconds of idle time considered to be an adequate typing rest. -When this variable is non-nil, emacs checks the idle time between +When this variable is non-nil, Emacs checks the idle time between keystrokes. If this idle time is long enough to be considered a \"good\" rest from typing, then the next typing break is simply rescheduled for later. @@ -105,6 +105,17 @@ asked whether or not really to interrupt the break." :group 'type-break) ;;;###autoload +(defcustom type-break-good-break-interval nil + "*Number of seconds considered to be an adequate explicit typing rest. + +When this variable is non-nil, its value is considered to be a \"good\" +length (in seconds) for a break initiated by the command `type-break', +overriding `type-break-good-rest-interval'. This provides querying of +break interruptions when `type-break-good-rest-interval' is nil." + :type 'integer + :group 'type-break) + +;;;###autoload (defcustom type-break-keystroke-threshold ;; Assuming typing speed is 35wpm (on the average, do you really ;; type more than that in a minute? I spend a lot of time reading mail @@ -200,15 +211,30 @@ Format specifiers are as used by `format-time-string'." '(type-break-demo-boring type-break-demo-life type-break-demo-hanoi) "*List of functions to consider running as demos during typing breaks. When a typing break begins, one of these functions is selected randomly -to have emacs do something interesting. +to have Emacs do something interesting. Any function in this list should start a demo which ceases as soon as a key is pressed." :type '(repeat function) :group 'type-break) +(defcustom type-break-demo-boring-stats nil + "*Show word per minute and keystroke figures in the Boring demo." + :type 'boolean + :group 'type-break) + +(defcustom type-break-terse-messages nil + "*Use slightly terser messages." + :type 'boolean + :group 'type-break) + +(defcustom type-break-file-name (convert-standard-filename "~/.type-break") + "*Name of file used to save state across sessions." + :type 'file + :group 'type-break) + (defvar type-break-post-command-hook '(type-break-check) - "Hook run indirectly by post-command-hook for typing break functions. + "Hook run indirectly by `post-command-hook' for typing break functions. This is not really intended to be set by the user, but it's probably harmless to do so. Mainly it is used by various parts of the typing break program to delay actions until after the user has completed some command. @@ -257,7 +283,7 @@ See also `type-break-mode-line-format' and its members." This variable, in conjunction with `type-break-warning-countdown-string-type' \(which indicates whether this value is a number of keystrokes or seconds) -is installed in mode-line-format to notify of imminent typing breaks.") +is installed in `mode-line-format' to notify of imminent typing breaks.") (defvar type-break-warning-countdown-string-type nil "Indicates the unit type of `type-break-warning-countdown-string'. @@ -275,6 +301,8 @@ It will be either \"seconds\" or \"keystrokes\".") (defvar type-break-current-keystroke-warning-interval nil) (defvar type-break-time-warning-count 0) (defvar type-break-keystroke-warning-count 0) +(defvar type-break-interval-start nil) + ;;;###autoload (defun type-break-mode (&optional prefix) @@ -284,7 +312,7 @@ This is a minor mode, but it is global to all buffers by default. When this mode is enabled, the user is encouraged to take typing breaks at appropriate intervals; either after a specified amount of time or when the user has exceeded a keystroke threshold. When the time arrives, the user -is asked to take a break. If the user refuses at that time, emacs will ask +is asked to take a break. If the user refuses at that time, Emacs will ask again in a short period of time. The idea is to give the user enough time to find a good breaking point in his or her work, but be sufficiently annoying to discourage putting typing breaks off indefinitely. @@ -309,9 +337,18 @@ affect the time schedule; it simply provides a default for the If set, the variable `type-break-good-rest-interval' specifies the minimum amount of time which is considered a reasonable typing break. Whenever that time has elapsed, typing breaks are automatically rescheduled for -later even if emacs didn't prompt you to take one first. Also, if a break +later even if Emacs didn't prompt you to take one first. Also, if a break is ended before this much time has elapsed, the user will be asked whether -or not to continue. +or not to continue. A nil value for this variable prevents automatic +break rescheduling, making `type-break-interval' an upper bound on the time +between breaks. In this case breaks will be prompted for as usual before +the upper bound if the keystroke threshold is reached. + +If `type-break-good-rest-interval' is nil and +`type-break-good-break-interval' is set, then confirmation is required to +interrupt a break before `type-break-good-break-interval' seconds +have passed. This provides for an upper bound on the time between breaks +together with confirmation of interruptions to these breaks. The variable `type-break-keystroke-threshold' is used to determine the thresholds at which typing breaks should be considered. You can use @@ -335,7 +372,12 @@ a typing break occur. They include: `type-break-query-function' `type-break-query-interval' -Finally, the command `type-break-statistics' prints interesting things." +The command `type-break-statistics' prints interesting things. + +Finally, a file (named `type-break-file-name') is used to store information +across Emacs sessions. This provides recovery of the break status between +sessions and after a crash. Manual changes to the file may result in +problems." (interactive "P") (type-break-check-post-command-hook) @@ -356,13 +398,52 @@ Finally, the command `type-break-statistics' prints interesting things." minor-mode-alist))) (type-break-keystroke-reset) (type-break-mode-line-countdown-or-break nil) - (type-break-schedule) + + (if (boundp 'save-some-buffers-always) + (add-to-list 'save-some-buffers-always + (expand-file-name type-break-file-name))) + + (setq type-break-time-last-break (type-break-get-previous-time)) + + ;; schedule according to break time from session file + (type-break-schedule + (let (diff) + (if (and type-break-time-last-break + (< (setq diff (type-break-time-difference + type-break-time-last-break + (current-time))) + type-break-interval)) + ;; use the file's value + (progn + (setq type-break-keystroke-count + (type-break-get-previous-count)) + ;; file the time, in case it was read from the auto-save file + (type-break-file-time type-break-interval-start) + (setq type-break-interval-start type-break-time-last-break) + (- type-break-interval diff)) + ;; schedule from now + (setq type-break-interval-start (current-time)) + (type-break-file-time type-break-interval-start) + type-break-interval)) + type-break-interval-start + type-break-interval) + (and (interactive-p) - (message "Type Break mode is enabled and reset"))) + (message "Type Break mode is enabled and set"))) (t (type-break-keystroke-reset) (type-break-mode-line-countdown-or-break nil) (type-break-cancel-schedule) + (do-auto-save) + (with-current-buffer (find-file-noselect type-break-file-name + 'nowarn) + (set-buffer-modified-p nil) + (unlock-buffer) + (kill-this-buffer)) + (if (boundp 'save-some-buffers-always) + (setq save-some-buffers-always + (remove (expand-file-name type-break-file-name) + save-some-buffers-always))) (and (interactive-p) (message "Type Break mode is disabled"))))) type-break-mode) @@ -370,7 +451,7 @@ Finally, the command `type-break-statistics' prints interesting things." (defun type-break-mode-line-message-mode (&optional prefix) "Enable or disable warnings in the mode line about typing breaks. -A negative prefix argument disables this mode. +A negative PREFIX argument disables this mode. No argument or any non-negative argument enables it. The user may also enable or disable this mode simply by setting the @@ -398,7 +479,7 @@ When enabled, the user is periodically queried about whether to take a typing break at that moment. The function which does this query is specified by the variable `type-break-query-function'. -A negative prefix argument disables this mode. +A negative PREFIX argument disables this mode. No argument or any non-negative argument enables it. The user may also enable or disable this mode simply by setting the @@ -413,6 +494,89 @@ variable of the same name." type-break-query-mode) +;;; session file functions + +(defvar type-break-auto-save-file-name + (let ((buffer-file-name type-break-file-name)) + (make-auto-save-file-name)) + "Auto-save name of `type-break-file-name'.") + +(defun type-break-file-time (&optional time) + "File break time in `type-break-file-name', unless the file is locked." + (if (not (stringp (file-locked-p type-break-file-name))) + (with-current-buffer (find-file-noselect type-break-file-name + 'nowarn) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert (format "%s\n\n" (or time type-break-interval-start))) + ;; file saving is left to auto-save + )))) + +(defun type-break-file-keystroke-count () + "File keystroke count in `type-break-file-name', unless the file is locked." + (if (not (stringp (file-locked-p type-break-file-name))) + (with-current-buffer (find-file-noselect type-break-file-name + 'nowarn) + (save-excursion + (let ((inhibit-read-only t)) + (goto-char (point-min)) + (forward-line) + (delete-region (point) (save-excursion (end-of-line) (point))) + (insert (format "%s" type-break-keystroke-count)) + ;; file saving is left to auto-save + ))))) + +(defun timep (time) + "If TIME is in the format returned by `current-time' then +return TIME, else return nil." + (and (listp time) + (eq (length time) 3) + (integerp (car time)) + (integerp (nth 1 time)) + (integerp (nth 2 time)) + time)) + +(defun type-break-choose-file () + "Return file to read from." + (cond + ((and (file-exists-p type-break-auto-save-file-name) + (file-readable-p type-break-auto-save-file-name)) + type-break-auto-save-file-name) + ((and (file-exists-p type-break-file-name) + (file-readable-p type-break-file-name)) + type-break-file-name) + (t nil))) + +(defun type-break-get-previous-time () + "Get previous break time from `type-break-file-name'. +Returns nil if the file is missing or if the time breaks with the +`current-time' format." + (let ((file (type-break-choose-file))) + (if file + (timep ;; returns expected format, else nil + (with-current-buffer (find-file-noselect file 'nowarn) + (save-excursion + (goto-char (point-min)) + (read (current-buffer)))))))) + +(defun type-break-get-previous-count () + "Get previous keystroke count from `type-break-file-name'. +Return 0 if the file is missing or if the form read is not an +integer." + (let ((file (type-break-choose-file))) + (if (and file + (integerp + (setq file + (with-current-buffer + (find-file-noselect file 'nowarn) + (save-excursion + (goto-char (point-min)) + (forward-line 1) + (read (current-buffer))))))) + file + 0))) + + ;;;###autoload (defun type-break () "Take a typing break. @@ -425,6 +589,8 @@ as per the function `type-break-schedule'." (interactive) (do-auto-save) (type-break-cancel-schedule) + ;; remove any query scheduled during interactive invocation + (remove-hook 'type-break-post-command-hook 'type-break-do-query) (let ((continue t) (start-time (current-time))) (setq type-break-time-last-break start-time) @@ -435,7 +601,8 @@ as per the function `type-break-schedule'." (other-window 1)) (delete-other-windows) (scroll-right (window-width)) - (message "Press any key to resume from typing break.") + (unless type-break-terse-messages + (message "Press any key to resume from typing break.")) (random t) (let* ((len (length type-break-demo-functions)) @@ -445,36 +612,45 @@ as per the function `type-break-schedule'." (funcall fn) (error nil)))) - (cond - (type-break-good-rest-interval - (let ((break-secs (type-break-time-difference - start-time (current-time)))) - (cond - ((>= break-secs type-break-good-rest-interval) - (setq continue nil)) - ;; 60 seconds may be too much leeway if the break is only 3 - ;; minutes to begin with. You can just say "no" to the query - ;; below if you're in that much of a hurry. - ;((> 60 (abs (- break-secs type-break-good-rest-interval))) - ; (setq continue nil)) - ((funcall - type-break-query-function - (format "%sYou really ought to rest %s more. Continue break? " - (type-break-time-stamp) - (type-break-format-time (- type-break-good-rest-interval - break-secs))))) - (t - (setq continue nil))))) - (t (setq continue nil))))) + (let ((good-interval (or type-break-good-rest-interval + type-break-good-break-interval))) + (cond + (good-interval + (let ((break-secs (type-break-time-difference + start-time (current-time)))) + (cond + ((>= break-secs good-interval) + (setq continue nil)) + ;; 60 seconds may be too much leeway if the break is only 3 + ;; minutes to begin with. You can just say "no" to the query + ;; below if you're in that much of a hurry. + ;;((> 60 (abs (- break-secs good-interval))) + ;; (setq continue nil)) + ((funcall + type-break-query-function + (format + (if type-break-terse-messages + "%s%s remaining. Continue break? " + "%sYou really ought to rest %s more. Continue break? ") + (type-break-time-stamp) + (type-break-format-time (- good-interval + break-secs))))) + (t + (setq continue nil))))) + (t (setq continue nil)))))) (type-break-keystroke-reset) + (type-break-file-time) (type-break-mode-line-countdown-or-break nil) (type-break-schedule)) -(defun type-break-schedule (&optional time) +(defun type-break-schedule (&optional time start interval) "Schedule a typing break for TIME seconds from now. -If time is not specified, default to `type-break-interval'." +If time is not specified it defaults to `type-break-interval'. +START and INTERVAL are used when recovering a break. +START is the start of the break (defaults to now). +INTERVAL is the full length of an interval (defaults to TIME)." (interactive (list (and current-prefix-arg (prefix-numeric-value current-prefix-arg)))) (or time (setq time type-break-interval)) @@ -483,7 +659,8 @@ If time is not specified, default to `type-break-interval'." (type-break-time-warning-schedule time 'reset) (type-break-run-at-time (max 1 time) nil 'type-break-alarm) (setq type-break-time-next-break - (type-break-time-sum (current-time) time))) + (type-break-time-sum (or start (current-time)) + (or interval time)))) (defun type-break-cancel-schedule () (type-break-cancel-time-warning-schedule) @@ -532,6 +709,7 @@ If time is not specified, default to `type-break-interval'." (remove-hook 'type-break-post-command-hook 'type-break-time-warning) (setq type-break-current-time-warning-interval type-break-time-warning-intervals) + (setq type-break-time-warning-count 0) ; avoid warnings after break (setq type-break-warning-countdown-string nil)) (defun type-break-alarm () @@ -556,6 +734,7 @@ If time is not specified, default to `type-break-interval'." This may be the case either because the scheduled time has come \(and the minimum keystroke threshold has been reached\) or because the maximum keystroke threshold has been exceeded." + (type-break-file-keystroke-count) (let* ((min-threshold (car type-break-keystroke-threshold)) (max-threshold (cdr type-break-keystroke-threshold))) (and type-break-good-rest-interval @@ -657,16 +836,19 @@ keystroke threshold has been exceeded." ;; from taking place before this one has even returned. ;; The condition-case wrapper will reschedule on quit. (type-break-cancel-schedule) + ;; Also prevent a second query when the break is interrupted. + (remove-hook 'type-break-post-command-hook 'type-break-do-query) (funcall type-break-query-function (format "%s%s" (type-break-time-stamp) - "Take a break from typing now? "))) + (if type-break-terse-messages + "Break now? " + "Take a break from typing now? ")))) (type-break)) (t (type-break-schedule type-break-query-interval))) (quit - (type-break-schedule type-break-query-interval))) - (remove-hook 'type-break-post-command-hook 'type-break-do-query)))) + (type-break-schedule type-break-query-interval)))))) (defun type-break-noninteractive-query (&optional ignored-args) "Null query function which doesn't interrupt user and assumes `no'. @@ -810,7 +992,7 @@ based on a fairly simple algorithm involving assumptions about the average length of words (5). For the minimum threshold, it uses about a fifth of the computed maximum threshold. -When called from lisp programs, the optional args WORDLEN and FRAC can be +When called from Lisp programs, the optional args WORDLEN and FRAC can be used to override the default assumption about average word length and the fraction of the maximum threshold to which to set the minimum threshold. FRAC should be the inverse of the fractional value; for example, a value of @@ -891,6 +1073,7 @@ FRAC should be the inverse of the fractional value; for example, a value of (t (format "%d seconds" secs))))) (defun type-break-keystroke-reset () + (setq type-break-interval-start (current-time)) ; not a keystroke (setq type-break-keystroke-count 0) (setq type-break-keystroke-warning-count 0) (setq type-break-current-keystroke-warning-interval @@ -903,7 +1086,7 @@ With optional non-nil ALL, force redisplay of all mode-lines." (and all (save-excursion (set-buffer (other-buffer)))) (set-buffer-modified-p (buffer-modified-p))) -;; If an exception occurs in emacs while running the post command hook, the +;; If an exception occurs in Emacs while running the post command hook, the ;; value of that hook is clobbered. This is because the value of the ;; variable is temporarily set to nil while it's running to prevent ;; recursive application, but it also means an exception aborts the routine @@ -916,7 +1099,7 @@ With optional non-nil ALL, force redisplay of all mode-lines." ;;; Timer wrapper functions ;;; ;;; These shield type-break from variations in the interval timer packages -;;; for different versions of emacs. +;;; for different versions of Emacs. (defun type-break-run-at-time (time repeat function) (condition-case nil (or (require 'timer) (require 'itimer)) (error nil)) @@ -1002,44 +1185,83 @@ With optional non-nil ALL, force redisplay of all mode-lines." ;; Boring demo, but doesn't use many cycles (defun type-break-demo-boring () "Boring typing break demo." - (let ((rmsg "Press any key to resume from typing break") + (let ((rmsg (if type-break-terse-messages + "" + "Press any key to resume from typing break")) (buffer-name "*Typing Break Buffer*") - line col pos - elapsed timeleft tmsg) + lines elapsed timeleft tmsg) (condition-case () (progn (switch-to-buffer (get-buffer-create buffer-name)) (buffer-disable-undo (current-buffer)) - (erase-buffer) - (setq line (1+ (/ (window-height) 2))) - (setq col (/ (- (window-width) (length rmsg)) 2)) - (insert (make-string line ?\C-j) - (make-string col ?\ ) - rmsg) - (forward-line -1) - (beginning-of-line) - (setq pos (point)) + (setq lines (/ (window-body-height) 2)) + (unless type-break-terse-messages (setq lines (1- lines))) + (if type-break-demo-boring-stats + (setq lines (- lines 2))) + (setq lines (make-string lines ?\C-j)) (while (not (input-pending-p)) - (delete-region pos (progn - (goto-char pos) - (end-of-line) - (point))) + (erase-buffer) (setq elapsed (type-break-time-difference type-break-time-last-break (current-time))) - (cond - (type-break-good-rest-interval - (setq timeleft (- type-break-good-rest-interval elapsed)) - (if (> timeleft 0) - (setq tmsg (format "You should rest for %s more" - (type-break-format-time timeleft))) - (setq tmsg (format "Typing break has lasted %s" - (type-break-format-time elapsed))))) - (t - (setq tmsg (format "Typing break has lasted %s" - (type-break-format-time elapsed))))) - (setq col (/ (- (window-width) (length tmsg)) 2)) - (insert (make-string col ?\ ) tmsg) + (let ((good-interval (or type-break-good-rest-interval + type-break-good-break-interval))) + (cond + (good-interval + (setq timeleft (- good-interval elapsed)) + (if (> timeleft 0) + (setq tmsg + (format (if type-break-terse-messages + "Break remaining: %s" + "You should rest for %s more") + (type-break-format-time timeleft))) + (setq tmsg + (format (if type-break-terse-messages + "Break complete (%s elapsed in total)" + "Typing break has lasted %s") + (type-break-format-time elapsed))))) + (t + (setq tmsg + (format (if type-break-terse-messages + "Break has lasted %s" + "Typing break has lasted %s") + (type-break-format-time elapsed)))))) + (insert lines + (make-string (/ (- (window-width) (length tmsg)) 2) ?\ ) + tmsg) + (if (> (length rmsg) 0) + (insert "\n" + (make-string (/ (- (window-width) (length rmsg)) 2) + ?\ ) + rmsg)) + (if type-break-demo-boring-stats + (let* + ((message + (format + (if type-break-terse-messages + "Since last break: %s keystrokes\n" + "Since your last break you've typed %s keystrokes\n") + type-break-keystroke-count)) + (column-spaces + (make-string (/ (- (window-width) (length message)) 2) + ?\ )) + (wpm (/ (/ (float type-break-keystroke-count) 5) + (/ (type-break-time-difference + type-break-interval-start + type-break-time-last-break) + 60.0)))) + (insert "\n\n" column-spaces message) + (if type-break-terse-messages + (insert (format " %s%.2f wpm" + column-spaces + wpm)) + (setq message + (format "at an average of %.2f words per minute" + wpm)) + (insert + (make-string (/ (- (window-width) (length message)) 2) + ?\ ) + message)))) (goto-char (point-min)) (sit-for 60)) (read-char) diff --git a/lisp/url/url-dav.el b/lisp/url/url-dav.el new file mode 100644 index 00000000000..d6c5ffffa43 --- /dev/null +++ b/lisp/url/url-dav.el @@ -0,0 +1,983 @@ +;;; url-dav.el --- WebDAV support + +;; Copyright (C) 2001, 2004 Free Software Foundation, Inc. + +;; Author: Bill Perry <wmperry@gnu.org> +;; Maintainer: Bill Perry <wmperry@gnu.org> +;; Keywords: url, vc + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;; DAV is in RFC 2518. + +;;; Commentary: + +;;; Code: + +(eval-when-compile + (require 'cl)) + +(require 'xml) +(require 'url-util) +(require 'url-handlers) + +(defvar url-dav-supported-protocols '(1 2) + "List of supported DAV versions.") + +(defun url-intersection (l1 l2) + "Return a list of the elements occuring in both of the lists L1 and L2." + (if (null l2) + l2 + (let (result) + (while l1 + (if (member (car l1) l2) + (setq result (cons (pop l1) result)) + (pop l1))) + (nreverse result)))) + +;;;###autoload +(defun url-dav-supported-p (url) + (and (featurep 'xml) + (fboundp 'xml-expand-namespace) + (url-intersection url-dav-supported-protocols + (plist-get (url-http-options url) 'dav)))) + +(defun url-dav-node-text (node) + "Return the text data from the XML node NODE." + (mapconcat (lambda (txt) + (if (stringp txt) + txt + "")) (xml-node-children node) " ")) + + +;;; Parsing routines for the actual node contents. +;; +;; I am not incredibly happy with how this code looks/works right +;; now, but it DOES work, and if we get the API right, our callers +;; won't have to worry about the internal representation. + +(defconst url-dav-datatype-attribute + 'urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/dt) + +(defun url-dav-process-integer-property (node) + (truncate (string-to-number (url-dav-node-text node)))) + +(defun url-dav-process-number-property (node) + (string-to-number (url-dav-node-text node))) + +(defconst url-dav-iso8601-regexp + (let* ((dash "-?") + (colon ":?") + (4digit "\\([0-9][0-9][0-9][0-9]\\)") + (2digit "\\([0-9][0-9]\\)") + (date-fullyear 4digit) + (date-month 2digit) + (date-mday 2digit) + (time-hour 2digit) + (time-minute 2digit) + (time-second 2digit) + (time-secfrac "\\(\\.[0-9]+\\)?") + (time-numoffset (concat "[-+]\\(" time-hour "\\):" time-minute)) + (time-offset (concat "Z" time-numoffset)) + (partial-time (concat time-hour colon time-minute colon time-second + time-secfrac)) + (full-date (concat date-fullyear dash date-month dash date-mday)) + (full-time (concat partial-time time-offset)) + (date-time (concat full-date "T" full-time))) + (list (concat "^" full-date) + (concat "T" partial-time) + (concat "Z" time-numoffset))) + "List of regular expressions matching iso8601 dates. +1st regular expression matches the date. +2nd regular expression matches the time. +3rd regular expression matches the (optional) timezone specification.") + +(defun url-dav-process-date-property (node) + (require 'parse-time) + (let* ((date-re (nth 0 url-dav-iso8601-regexp)) + (time-re (nth 1 url-dav-iso8601-regexp)) + (tz-re (nth 2 url-dav-iso8601-regexp)) + (date-string (url-dav-node-text node)) + re-start + time seconds minute hour fractional-seconds + day month year day-of-week dst tz) + ;; We need to populate 'time' with + ;; (SEC MIN HOUR DAY MON YEAR DOW DST TZ) + + ;; Nobody else handles iso8601 correctly, lets do it ourselves. + (when (string-match date-re date-string re-start) + (setq year (string-to-int (match-string 1 date-string)) + month (string-to-int (match-string 2 date-string)) + day (string-to-int (match-string 3 date-string)) + re-start (match-end 0)) + (when (string-match time-re date-string re-start) + (setq hour (string-to-int (match-string 1 date-string)) + minute (string-to-int (match-string 2 date-string)) + seconds (string-to-int (match-string 3 date-string)) + fractional-seconds (string-to-int (or + (match-string 4 date-string) + "0")) + re-start (match-end 0)) + (when (string-match tz-re date-string re-start) + (setq tz (match-string 1 date-string))) + (url-debug 'dav "Parsed iso8601%s date" (if tz "tz" "")) + (setq time (list seconds minute hour day month year day-of-week dst tz)))) + + ;; Fall back to having Gnus do fancy things for us. + (when (not time) + (setq time (parse-time-string date-string))) + + (if time + (setq time (apply 'encode-time time)) + (url-debug 'dav "Unable to decode date (%S) (%s)" + (xml-node-name node) date-string)) + time)) + +(defun url-dav-process-boolean-property (node) + (/= 0 (string-to-int (url-dav-node-text node)))) + +(defun url-dav-process-uri-property (node) + ;; Returns a parsed representation of the URL... + (url-generic-parse-url (url-dav-node-text node))) + +(defun url-dav-find-parser (node) + "Find a function to parse the XML node NODE." + (or (get (xml-node-name node) 'dav-parser) + (let ((fn (intern (format "url-dav-process-%s" (xml-node-name node))))) + (if (not (fboundp fn)) + (setq fn 'url-dav-node-text) + (put (xml-node-name node) 'dav-parser fn)) + fn))) + +(defmacro url-dav-dispatch-node (node) + `(funcall (url-dav-find-parser ,node) ,node)) + +(defun url-dav-process-DAV:prop (node) + ;; A prop node has content model of ANY + ;; + ;; Some predefined nodes have special meanings though. + ;; + ;; DAV:supportedlock - list of DAV:lockentry + ;; DAV:source + ;; DAV:iscollection - boolean + ;; DAV:getcontentlength - integer + ;; DAV:ishidden - boolean + ;; DAV:getcontenttype - string + ;; DAV:resourcetype - node who's name is the resource type + ;; DAV:getlastmodified - date + ;; DAV:creationdate - date + ;; DAV:displayname - string + ;; DAV:getetag - unknown + (let ((children (xml-node-children node)) + (node-type nil) + (props nil) + (value nil) + (handler-func nil)) + (when (not children) + (error "No child nodes in DAV:prop")) + + (while children + (setq node (car children) + node-type (intern + (or + (cdr-safe (assq url-dav-datatype-attribute + (xml-node-attributes node))) + "unknown")) + value nil) + + (case node-type + ((dateTime.iso8601tz + dateTime.iso8601 + dateTime.tz + dateTime.rfc1123 + dateTime + date) ; date is our 'special' one... + ;; Some type of date/time string. + (setq value (url-dav-process-date-property node))) + (int + ;; Integer type... + (setq value (url-dav-process-integer-property node))) + ((number float) + (setq value (url-dav-process-number-property node))) + (boolean + (setq value (url-dav-process-boolean-property node))) + (uri + (setq value (url-dav-process-uri-property node))) + (otherwise + (if (not (eq node-type 'unknown)) + (url-debug 'dav "Unknown data type in url-dav-process-prop: %s" + node-type)) + (setq value (url-dav-dispatch-node node)))) + + (setq props (plist-put props (xml-node-name node) value) + children (cdr children))) + props)) + +(defun url-dav-process-DAV:supportedlock (node) + ;; DAV:supportedlock is a list of DAV:lockentry items. + ;; DAV:lockentry in turn contains a DAV:lockscope and DAV:locktype. + ;; The DAV:lockscope must have a single node beneath it, ditto for + ;; DAV:locktype. + (let ((children (xml-node-children node)) + (results nil) + scope type) + (while children + (when (and (not (stringp (car children))) + (eq (xml-node-name (car children)) 'DAV:lockentry)) + (setq scope (assq 'DAV:lockscope (xml-node-children (car children))) + type (assq 'DAV:locktype (xml-node-children (car children)))) + (when (and scope type) + (setq scope (xml-node-name (car (xml-node-children scope))) + type (xml-node-name (car (xml-node-children type)))) + (push (cons type scope) results))) + (setq children (cdr children))) + results)) + +(defun url-dav-process-subnode-property (node) + ;; Returns a list of child node names. + (delq nil (mapcar 'car-safe (xml-node-children node)))) + +(defalias 'url-dav-process-DAV:depth 'url-dav-process-integer-property) +(defalias 'url-dav-process-DAV:resourcetype 'url-dav-process-subnode-property) +(defalias 'url-dav-process-DAV:locktype 'url-dav-process-subnode-property) +(defalias 'url-dav-process-DAV:lockscope 'url-dav-process-subnode-property) +(defalias 'url-dav-process-DAV:getcontentlength 'url-dav-process-integer-property) +(defalias 'url-dav-process-DAV:getlastmodified 'url-dav-process-date-property) +(defalias 'url-dav-process-DAV:creationdate 'url-dav-process-date-property) +(defalias 'url-dav-process-DAV:iscollection 'url-dav-process-boolean-property) +(defalias 'url-dav-process-DAV:ishidden 'url-dav-process-boolean-property) + +(defun url-dav-process-DAV:locktoken (node) + ;; DAV:locktoken can have one or more DAV:href children. + (delq nil (mapcar (lambda (n) + (if (stringp n) + n + (url-dav-dispatch-node n))) + (xml-node-children node)))) + +(defun url-dav-process-DAV:owner (node) + ;; DAV:owner can contain anything. + (delq nil (mapcar (lambda (n) + (if (stringp n) + n + (url-dav-dispatch-node n))) + (xml-node-children node)))) + +(defun url-dav-process-DAV:activelock (node) + ;; DAV:activelock can contain: + ;; DAV:lockscope + ;; DAV:locktype + ;; DAV:depth + ;; DAV:owner (optional) + ;; DAV:timeout (optional) + ;; DAV:locktoken (optional) + (let ((children (xml-node-children node)) + (results nil)) + (while children + (if (listp (car children)) + (push (cons (xml-node-name (car children)) + (url-dav-dispatch-node (car children))) + results)) + (setq children (cdr children))) + results)) + +(defun url-dav-process-DAV:lockdiscovery (node) + ;; Can only contain a list of DAV:activelock objects. + (let ((children (xml-node-children node)) + (results nil)) + (while children + (cond + ((stringp (car children)) + ;; text node? why? + nil) + ((eq (xml-node-name (car children)) 'DAV:activelock) + (push (url-dav-dispatch-node (car children)) results)) + (t + ;; Ignore unknown nodes... + nil)) + (setq children (cdr children))) + results)) + +(defun url-dav-process-DAV:status (node) + ;; The node contains a standard HTTP/1.1 response line... we really + ;; only care about the numeric status code. + (let ((status (url-dav-node-text node))) + (if (string-match "\\`[ \r\t\n]*HTTP/[0-9.]+ \\([0-9]+\\)" status) + (string-to-int (match-string 1 status)) + 500))) + +(defun url-dav-process-DAV:propstat (node) + ;; A propstate node can have the following children... + ;; + ;; DAV:prop - a list of properties and values + ;; DAV:status - An HTTP/1.1 status line + (let ((children (xml-node-children node)) + (props nil) + (status nil)) + (when (not children) + (error "No child nodes in DAV:propstat")) + + (setq props (url-dav-dispatch-node (assq 'DAV:prop children)) + status (url-dav-dispatch-node (assq 'DAV:status children))) + + ;; Need to parse out the HTTP status + (setq props (plist-put props 'DAV:status status)) + props)) + +(defun url-dav-process-DAV:response (node) + (let ((children (xml-node-children node)) + (propstat nil) + (href)) + (when (not children) + (error "No child nodes in DAV:response")) + + ;; A response node can have the following children... + ;; + ;; DAV:href - URL the response is for. + ;; DAV:propstat - see url-dav-process-propstat + ;; DAV:responsedescription - text description of the response + (setq propstat (assq 'DAV:propstat children) + href (assq 'DAV:href children)) + + (when (not href) + (error "No href in DAV:response")) + + (when (not propstat) + (error "No propstat in DAV:response")) + + (setq propstat (url-dav-dispatch-node propstat) + href (url-dav-dispatch-node href)) + (cons href propstat))) + +(defun url-dav-process-DAV:multistatus (node) + (let ((children (xml-node-children node)) + (results nil)) + (while children + (push (url-dav-dispatch-node (car children)) results) + (setq children (cdr children))) + results)) + + +;;; DAV request/response generation/processing +(defun url-dav-process-response (buffer url) + "Parse a WebDAV response from BUFFER, interpreting it relative to URL. + +The buffer must have been retrieved by HTTP or HTTPS and contain an +XML document." + (declare (special url-http-content-type + url-http-response-status + url-http-end-of-headers)) + (let ((tree nil) + (overall-status nil)) + (when buffer + (unwind-protect + (with-current-buffer buffer + (goto-char url-http-end-of-headers) + (setq overall-status url-http-response-status) + + ;; XML documents can be transferred as either text/xml or + ;; application/xml, and we are required to accept both of + ;; them. + (if (and + url-http-content-type + (string-match "\\`\\(text\\|application\\)/xml" + url-http-content-type)) + (setq tree (xml-parse-region (point) (point-max))))) + ;; Clean up after ourselves. + (kill-buffer buffer))) + + ;; We should now be + (if (eq (xml-node-name (car tree)) 'DAV:multistatus) + (url-dav-dispatch-node (car tree)) + (url-debug 'dav "Got back singleton response for URL(%S)" url) + (let ((properties (url-dav-dispatch-node (car tree)))) + ;; We need to make sure we have a DAV:status node in there for + ;; higher-level code; + (setq properties (plist-put properties 'DAV:status overall-status)) + ;; Make this look like a DAV:multistatus parse tree so that + ;; nobody but us needs to know the difference. + (list (cons url properties)))))) + +(defun url-dav-request (url method tag body + &optional depth headers namespaces) + "Perform WebDAV operation METHOD on URL. Return the parsed responses. +Automatically creates an XML request body if TAG is non-nil. +BODY is the XML document fragment to be enclosed by <TAG></TAG>. + +DEPTH is how deep the request should propogate. Default is 0, meaning +it should apply only to URL. A negative number means to use +`Infinity' for the depth. Not all WebDAV servers support this depth +though. + +HEADERS is an assoc list of extra headers to send in the request. + +NAMESPACES is an assoc list of (NAMESPACE . EXPANSION), and these are +added to the <TAG> element. The DAV=DAV: namespace is automatically +added to this list, so most requests can just pass in nil." + ;; Take care of the default value for depth... + (setq depth (or depth 0)) + + ;; Now lets translate it into something webdav can understand. + (if (< depth 0) + (setq depth "Infinity") + (setq depth (int-to-string depth))) + (if (not (assoc "DAV" namespaces)) + (setq namespaces (cons '("DAV" . "DAV:") namespaces))) + + (let* ((url-request-extra-headers `(("Depth" . ,depth) + ("Content-type" . "text/xml") + ,@headers)) + (url-request-method method) + (url-request-data + (if tag + (concat + "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n" + "<" (symbol-name tag) " " + ;; add in the appropriate namespaces... + (mapconcat (lambda (ns) + (concat "xmlns:" (car ns) "='" (cdr ns) "'")) + namespaces "\n ") + ">\n" + body + "</" (symbol-name tag) ">\n")))) + (url-dav-process-response (url-retrieve-synchronously url) url))) + +;;;###autoload +(defun url-dav-get-properties (url &optional attributes depth namespaces) + "Return properties for URL, up to DEPTH levels deep. + +Returns an assoc list, where the key is the filename (possibly a full +URI), and the value is a standard property list of DAV property +names (ie: DAV:resourcetype)." + (url-dav-request url "PROPFIND" 'DAV:propfind + (if attributes + (mapconcat (lambda (attr) + (concat "<DAV:prop><" + (symbol-name attr) + "/></DAV:prop>")) + attributes "\n ") + " <DAV:allprop/>") + depth nil namespaces)) + +(defmacro url-dav-http-success-p (status) + "Return whether PROPERTIES was the result of a successful DAV request." + `(= (/ (or ,status 500) 100) 2)) + + +;;; Locking support +(defvar url-dav-lock-identifier (concat "mailto:" user-mail-address) + "*URL used as contact information when creating locks in DAV. +This will be used as the contents of the DAV:owner/DAV:href tag to +identify the owner of a LOCK when requesting it. This will be shown +to other users when the DAV:lockdiscovery property is requested, so +make sure you are comfortable with it leaking to the outside world.") + +;;;###autoload +(defun url-dav-lock-resource (url exclusive &optional depth) + "Request a lock on URL. If EXCLUSIVE is non-nil, get an exclusive lock. +Optional 3rd argument DEPTH says how deep the lock should go, default is 0 +\(lock only the resource and none of its children\). + +Returns a cons-cell of (SUCCESSFUL-RESULTS . FAILURE-RESULTS). +SUCCESSFUL-RESULTS is a list of (URL STATUS locktoken). +FAILURE-RESULTS is a list of (URL STATUS)." + (setq exclusive (if exclusive "<DAV:exclusive/>" "<DAV:shared/>")) + (let* ((body + (concat + " <DAV:lockscope>" exclusive "</DAV:lockscope>\n" + " <DAV:locktype> <DAV:write/> </DAV:locktype>\n" + " <DAV:owner>\n" + " <DAV:href>" url-dav-lock-identifier "</DAV:href>\n" + " </DAV:owner>\n")) + (response nil) ; Responses to the LOCK request + (result nil) ; For walking thru the response list + (child-url nil) + (child-status nil) + (failures nil) ; List of failure cases (URL . STATUS) + (successes nil)) ; List of success cases (URL . STATUS) + (setq response (url-dav-request url "LOCK" 'DAV:lockinfo body + depth '(("Timeout" . "Infinite")))) + + ;; Get the parent URL ready for expand-file-name + (if (not (vectorp url)) + (setq url (url-generic-parse-url url))) + + ;; Walk thru the response list, fully expand the URL, and grab the + ;; status code. + (while response + (setq result (pop response) + child-url (url-expand-file-name (pop result) url) + child-status (or (plist-get result 'DAV:status) 500)) + (if (url-dav-http-success-p child-status) + (push (list url child-status "huh") successes) + (push (list url child-status) failures))) + (cons successes failures))) + +;;;###autoload +(defun url-dav-active-locks (url &optional depth) + "Return an assoc list of all active locks on URL." + (let ((response (url-dav-get-properties url '(DAV:lockdiscovery) depth)) + (properties nil) + (child nil) + (child-url nil) + (child-results nil) + (results nil)) + (if (not (vectorp url)) + (setq url (url-generic-parse-url url))) + + (while response + (setq child (pop response) + child-url (pop child) + child-results nil) + (when (and (url-dav-http-success-p (plist-get child 'DAV:status)) + (setq child (plist-get child 'DAV:lockdiscovery))) + ;; After our parser has had its way with it, The + ;; DAV:lockdiscovery property is a list of DAV:activelock + ;; objects, which are comprised of DAV:activelocks, which + ;; assoc lists of properties and values. + (while child + (if (assq 'DAV:locktoken (car child)) + (let ((tokens (cdr (assq 'DAV:locktoken (car child)))) + (owners (cdr (assq 'DAV:owner (car child))))) + (dolist (token tokens) + (dolist (owner owners) + (push (cons token owner) child-results))))) + (pop child))) + (if child-results + (push (cons (url-expand-file-name child-url url) child-results) + results))) + results)) + +;;;###autoload +(defun url-dav-unlock-resource (url lock-token) + "Release the lock on URL represented by LOCK-TOKEN. +Returns t iff the lock was successfully released." + (declare (special url-http-response-status)) + (let* ((url-request-extra-headers (list (cons "Lock-Token" + (concat "<" lock-token ">")))) + (url-request-method "UNLOCK") + (url-request-data nil) + (buffer (url-retrieve-synchronously url)) + (result nil)) + (when buffer + (unwind-protect + (with-current-buffer buffer + (setq result (url-dav-http-success-p url-http-response-status))) + (kill-buffer buffer))) + result)) + + +;;; file-name-handler stuff +(defun url-dav-file-attributes-mode-string (properties) + (let ((modes (make-string 10 ?-)) + (supported-locks (plist-get properties 'DAV:supportedlock)) + (executable-p (equal (plist-get properties 'http://apache.org/dav/props/executable) + "T")) + (directory-p (memq 'DAV:collection (plist-get properties 'DAV:resourcetype))) + (readable t) + (lock nil)) + ;; Assume we can read this, otherwise the PROPFIND would have + ;; failed. + (when readable + (aset modes 1 ?r) + (aset modes 4 ?r) + (aset modes 7 ?r)) + + (when directory-p + (aset modes 0 ?d)) + + (when executable-p + (aset modes 3 ?x) + (aset modes 6 ?x) + (aset modes 9 ?x)) + + (while supported-locks + (setq lock (car supported-locks) + supported-locks (cdr supported-locks)) + (case (car lock) + (DAV:write + (case (cdr lock) + (DAV:shared ; group permissions (possibly world) + (aset modes 5 ?w)) + (DAV:exclusive + (aset modes 2 ?w)) ; owner permissions? + (otherwise + (url-debug 'dav "Unrecognized DAV:lockscope (%S)" (cdr lock))))) + (otherwise + (url-debug 'dav "Unrecognized DAV:locktype (%S)" (car lock))))) + modes)) + +(autoload 'url-http-head-file-attributes "url-http") + +;;;###autoload +(defun url-dav-file-attributes (url &optional id-format) + (let ((properties (cdar (url-dav-get-properties url))) + (attributes nil)) + (if (and properties + (url-dav-http-success-p (plist-get properties 'DAV:status))) + ;; We got a good DAV response back.. + (setq attributes + (list + ;; t for directory, string for symbolic link, or nil + ;; Need to support DAV Bindings to figure out the + ;; symbolic link issues. + (if (memq 'DAV:collection (plist-get properties 'DAV:resourcetype)) t nil) + + ;; Number of links to file... Needs DAV Bindings. + 1 + + ;; File uid - no way to figure out? + 0 + + ;; File gid - no way to figure out? + 0 + + ;; Last access time - ??? + nil + + ;; Last modification time + (plist-get properties 'DAV:getlastmodified) + + ;; Last status change time... just reuse last-modified + ;; for now. + (plist-get properties 'DAV:getlastmodified) + + ;; size in bytes + (or (plist-get properties 'DAV:getcontentlength) 0) + + ;; file modes as a string like `ls -l' + ;; + ;; Should be able to build this up from the + ;; DAV:supportedlock attribute pretty easily. Getting + ;; the group info could be impossible though. + (url-dav-file-attributes-mode-string properties) + + ;; t iff file's gid would change if it were deleted & + ;; recreated. No way for us to know that thru DAV. + nil + + ;; inode number - meaningless + nil + + ;; device number - meaningless + nil)) + ;; Fall back to just the normal http way of doing things. + (setq attributes (url-http-head-file-attributes url id-format))) + attributes)) + +;;;###autoload +(defun url-dav-save-resource (url obj &optional content-type lock-token) + "Save OBJ as URL using WebDAV. +URL must be a fully qualified URL. +OBJ may be a buffer or a string." + (declare (special url-http-response-status)) + (let ((buffer nil) + (result nil) + (url-request-extra-headers nil) + (url-request-method "PUT") + (url-request-data + (cond + ((bufferp obj) + (with-current-buffer obj + (buffer-string))) + ((stringp obj) + obj) + (t + (error "Invalid object to url-dav-save-resource"))))) + + (if lock-token + (push + (cons "If" (concat "(<" lock-token ">)")) + url-request-extra-headers)) + + ;; Everything must always have a content-type when we submit it. + (push + (cons "Content-type" (or content-type "application/octet-stream")) + url-request-extra-headers) + + ;; Do the save... + (setq buffer (url-retrieve-synchronously url)) + + ;; Sanity checking + (when buffer + (unwind-protect + (with-current-buffer buffer + (setq result (url-dav-http-success-p url-http-response-status))) + (kill-buffer buffer))) + result)) + +(eval-when-compile + (defmacro url-dav-delete-something (url lock-token &rest error-checking) + "Delete URL completely, with no sanity checking whatsoever. DO NOT USE. +This is defined as a macro that will not be visible from compiled files. +Use with care, and even then think three times. +" + `(progn + ,@error-checking + (url-dav-request ,url "DELETE" nil nil -1 + (if ,lock-token + (list + (cons "If" + (concat "(<" ,lock-token ">)")))))))) + + +;;;###autoload +(defun url-dav-delete-directory (url &optional recursive lock-token) + "Delete the WebDAV collection URL. +If optional second argument RECURSIVE is non-nil, then delete all +files in the collection as well." + (let ((status nil) + (props nil) + (props nil)) + (setq props (url-dav-delete-something + url lock-token + (setq props (url-dav-get-properties url '(DAV:getcontenttype) 1)) + (if (and (not recursive) + (/= (length props) 1)) + (signal 'file-error (list "Removing directory" + "directory not empty" url))))) + + (mapc (lambda (result) + (setq status (plist-get (cdr result) 'DAV:status)) + (if (not (url-dav-http-success-p status)) + (signal 'file-error (list "Removing directory" + "Errror removing" + (car result) status)))) + props)) + nil) + +;;;###autoload +(defun url-dav-delete-file (url &optional lock-token) + "Delete file named URL." + (let ((props nil) + (status nil)) + (setq props (url-dav-delete-something + url lock-token + (setq props (url-dav-get-properties url)) + (if (eq (plist-get (cdar props) 'DAV:resourcetype) 'DAV:collection) + (signal 'file-error (list "Removing old name" "is a collection" url))))) + + (mapc (lambda (result) + (setq status (plist-get (cdr result) 'DAV:status)) + (if (not (url-dav-http-success-p status)) + (signal 'file-error (list "Removing old name" + "Errror removing" + (car result) status)))) + props)) + nil) + +;;;###autoload +(defun url-dav-directory-files (url &optional full match nosort files-only) + "Return a list of names of files in DIRECTORY. +There are three optional arguments: +If FULL is non-nil, return absolute file names. Otherwise return names + that are relative to the specified directory. +If MATCH is non-nil, mention only file names that match the regexp MATCH. +If NOSORT is non-nil, the list is not sorted--its order is unpredictable. + NOSORT is useful if you plan to sort the result yourself." + (let ((properties (url-dav-get-properties url '(DAV:resourcetype) 1)) + (child-url nil) + (child-props nil) + (files nil) + (parsed-url (url-generic-parse-url url))) + + (if (= (length properties) 1) + (signal 'file-error (list "Opening directory" "not a directory" url))) + + (while properties + (setq child-props (pop properties) + child-url (pop child-props)) + (if (and (eq (plist-get child-props 'DAV:resourcetype) 'DAV:collection) + files-only) + ;; It is a directory, and we were told to return just files. + nil + + ;; Fully expand the URL and then rip off the beginning if we + ;; are not supposed to return fully-qualified names. + (setq child-url (url-expand-file-name child-url parsed-url)) + (if (not full) + (setq child-url (substring child-url (length url)))) + + ;; We don't want '/' as the last character in filenames... + (if (string-match "/$" child-url) + (setq child-url (substring child-url 0 -1))) + + ;; If we have a match criteria, then apply it. + (if (or (and match (not (string-match match child-url))) + (string= child-url "") + (string= child-url url)) + nil + (push child-url files)))) + + (if nosort + files + (sort files 'string-lessp)))) + +;;;###autoload +(defun url-dav-file-directory-p (url) + "Return t if URL names an existing DAV collection." + (let ((properties (cdar (url-dav-get-properties url '(DAV:resourcetype))))) + (eq (plist-get properties 'DAV:resourcetype) 'DAV:collection))) + +;;;###autoload +(defun url-dav-make-directory (url &optional parents) + "Create the directory DIR and any nonexistent parent dirs." + (declare (special url-http-response-status)) + (let* ((url-request-extra-headers nil) + (url-request-method "MKCOL") + (url-request-data nil) + (buffer (url-retrieve-synchronously url)) + (result nil)) + (when buffer + (unwind-protect + (with-current-buffer buffer + (case url-http-response-status + (201 ; Collection created in its entirety + (setq result t)) + (403 ; Forbidden + nil) + (405 ; Method not allowed + nil) + (409 ; Conflict + nil) + (415 ; Unsupported media type (WTF?) + nil) + (507 ; Insufficient storage + nil) + (otherwise + nil))) + (kill-buffer buffer))) + result)) + +;;;###autoload +(defun url-dav-rename-file (oldname newname &optional overwrite) + (if (not (and (string-match url-handler-regexp oldname) + (string-match url-handler-regexp newname))) + (signal 'file-error + (list "Cannot rename between different URL backends" + oldname newname))) + + (let* ((headers nil) + (props nil) + (status nil) + (directory-p (url-dav-file-directory-p oldname)) + (exists-p (url-http-file-exists-p newname))) + + (if (and exists-p + (or + (null overwrite) + (and (numberp overwrite) + (not (yes-or-no-p + (format "File %s already exists; rename to it anyway? " + newname)))))) + (signal 'file-already-exists (list "File already exists" newname))) + + ;; Honor the overwrite flag... + (if overwrite (push '("Overwrite" . "T") headers)) + + ;; Have to tell them where to copy it to! + (push (cons "Destination" newname) headers) + + ;; Always send a depth of -1 in case we are moving a collection. + (setq props (url-dav-request oldname "MOVE" nil nil (if directory-p -1 0) + headers)) + + (mapc (lambda (result) + (setq status (plist-get (cdr result) 'DAV:status)) + + (if (not (url-dav-http-success-p status)) + (signal 'file-error (list "Renaming" oldname newname status)))) + props) + t)) + +;;;###autoload +(defun url-dav-file-name-all-completions (file url) + "Return a list of all completions of file name FILE in directory DIRECTORY. +These are all file names in directory DIRECTORY which begin with FILE." + (url-dav-directory-files url nil (concat "^" file ".*"))) + +;;;###autoload +(defun url-dav-file-name-completion (file url) + "Complete file name FILE in directory DIRECTORY. +Returns the longest string +common to all file names in DIRECTORY that start with FILE. +If there is only one and FILE matches it exactly, returns t. +Returns nil if DIR contains no name starting with FILE." + (let ((matches (url-dav-file-name-all-completions file url)) + (result nil)) + (cond + ((null matches) + ;; No matches + nil) + ((and (= (length matches) 1) + (string= file (car matches))) + ;; Only one file and FILE matches it exactly... + t) + (t + ;; Need to figure out the longest string that they have in commmon + (setq matches (sort matches (lambda (a b) (> (length a) (length b))))) + (let ((n (length file)) + (searching t) + (regexp nil) + (failed nil)) + (while (and searching + (< n (length (car matches)))) + (setq regexp (concat "^" (substring (car matches) 0 (1+ n))) + failed nil) + (dolist (potential matches) + (if (not (string-match regexp potential)) + (setq failed t))) + (if failed + (setq searching nil) + (incf n))) + (substring (car matches) 0 n)))))) + +(defun url-dav-register-handler (op) + (put op 'url-file-handlers (intern-soft (format "url-dav-%s" op)))) + +(mapcar 'url-dav-register-handler + '(file-name-all-completions + file-name-completion + rename-file + make-directory + file-directory-p + directory-files + delete-file + delete-directory + file-attributes)) + + +;;; Version Control backend cruft + +;(put 'vc-registered 'url-file-handlers 'url-dav-vc-registered) + +;;;###autoload +(defun url-dav-vc-registered (url) + (if (and (string-match "\\`https?" url) + (plist-get (url-http-options url) 'dav)) + (progn + (vc-file-setprop url 'vc-backend 'dav) + t))) + + +;;; Miscellaneous stuff. + +(provide 'url-dav) + +;; arch-tag: 2b14b7b3-888a-49b8-a490-17276a40e78e +;;; url-dav.el ends here diff --git a/lisp/url/url-file.el b/lisp/url/url-file.el new file mode 100644 index 00000000000..77c2e74555f --- /dev/null +++ b/lisp/url/url-file.el @@ -0,0 +1,245 @@ +;;; url-file.el --- File retrieval code + +;; Copyright (c) 1996 - 1999,2004 Free Software Foundation, Inc. +;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu> + +;; Keywords: comm, data, processes + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; Code: + +(eval-when-compile (require 'cl)) +(require 'mailcap) +(require 'url-vars) +(require 'url-parse) +(require 'url-dired) + +(defconst url-file-default-port 21 "Default FTP port.") +(defconst url-file-asynchronous-p t "FTP transfers are asynchronous.") +(defalias 'url-file-expand-file-name 'url-default-expander) + +(defun url-file-find-possibly-compressed-file (fname &rest args) + "Find the exact file referenced by `fname'. +This tries the common compression extensions, because things like +ange-ftp and efs are not quite smart enough to realize when a server +can do automatic decompression for them, and won't find 'foo' if +'foo.gz' exists, even though the ftp server would happily serve it up +to them." + (let ((scratch nil) + (compressed-extensions '("" ".gz" ".z" ".Z" ".bz2")) + (found nil)) + (while (and compressed-extensions (not found)) + (if (file-exists-p (setq scratch (concat fname (pop compressed-extensions)))) + (setq found scratch))) + found)) + +(defun url-file-host-is-local-p (host) + "Return t iff HOST references our local machine." + (let ((case-fold-search t)) + (or + (null host) + (string= "" host) + (equal (downcase host) (downcase (system-name))) + (and (string-match "^localhost$" host) t) + (and (not (string-match (regexp-quote ".") host)) + (equal (downcase host) (if (string-match (regexp-quote ".") + (system-name)) + (substring (system-name) 0 + (match-beginning 0)) + (system-name))))))) + +(defun url-file-asynch-callback (x y name buff func args &optional efs) + (if (not (featurep 'ange-ftp)) + ;; EFS passes us an extra argument + (setq name buff + buff func + func args + args efs)) + (let ((size (nth 7 (file-attributes name)))) + (save-excursion + (set-buffer buff) + (goto-char (point-max)) + (if (/= -1 size) + (insert (format "Content-length: %d\n" size))) + (insert "\n") + (insert-file-contents-literally name) + (if (not (url-file-host-is-local-p (url-host url-current-object))) + (condition-case () + (delete-file name) + (error nil))) + (apply func args)))) + +(defun url-file-build-filename (url) + (if (not (vectorp url)) + (setq url (url-generic-parse-url url))) + (let* ((user (url-user url)) + (pass (url-password url)) + (port (url-port url)) + (host (url-host url)) + (site (if (and port (/= port 21)) + (if (featurep 'ange-ftp) + (format "%s %d" host port) + ;; This works in Emacs 21's ange-ftp too. + (format "%s#%d" host port)) + host)) + (file (url-unhex-string (url-filename url))) + (filename (if (or user (not (url-file-host-is-local-p host))) + (concat "/" (or user "anonymous") "@" site ":" file) + (if (and (memq system-type + '(emx ms-dos windows-nt ms-windows)) + (string-match "^/[a-zA-Z]:/" file)) + (substring file 1) + file))) + pos-index) + + (and user pass + (cond + ((featurep 'ange-ftp) + (ange-ftp-set-passwd host user pass)) + ((or (featurep 'efs) (featurep 'efs-auto)) + (efs-set-passwd host user pass)) + (t + nil))) + + ;; This makes sure that directories have a trailing directory + ;; separator on them so URL expansion works right. + ;; + ;; FIXME? What happens if the remote system doesn't use our local + ;; directory-sep-char as its separator? Would it be safer to just + ;; use '/' unconditionally and rely on the FTP server to + ;; straighten it out for us? + ;; (if (and (file-directory-p filename) + ;; (not (string-match (format "%c$" directory-sep-char) filename))) + ;; (url-set-filename url (format "%s%c" filename directory-sep-char))) + (if (and (file-directory-p filename) + (not (string-match "/\\'" filename))) + (url-set-filename url (format "%s/" filename))) + + + ;; If it is a directory, look for an index file first. + (if (and (file-directory-p filename) + url-directory-index-file + (setq pos-index (expand-file-name url-directory-index-file filename)) + (file-exists-p pos-index) + (file-readable-p pos-index)) + (setq filename pos-index)) + + ;; Find the (possibly compressed) file + (setq filename (url-file-find-possibly-compressed-file filename)) + filename)) + +;;;###autoload +(defun url-file (url callback cbargs) + "Handle file: and ftp: URLs." + (let* ((buffer nil) + (uncompressed-filename nil) + (content-type nil) + (content-encoding nil) + (coding-system-for-read 'binary)) + + (setq filename (url-file-build-filename url)) + + (if (not filename) + (error "File does not exist: %s" (url-recreate-url url))) + + ;; Need to figure out the content-type from the real extension, + ;; not the compressed one. + (setq uncompressed-filename (if (string-match "\\.\\(gz\\|Z\\|z\\)$" filename) + (substring filename 0 (match-beginning 0)) + filename)) + (setq content-type (mailcap-extension-to-mime + (url-file-extension uncompressed-filename)) + content-encoding (case (intern (url-file-extension filename)) + ((\.z \.gz) "gzip") + (\.Z "compress") + (\.uue "x-uuencoded") + (\.hqx "x-hqx") + (\.bz2 "x-bzip2") + (otherwise nil))) + + (if (file-directory-p filename) + ;; A directory is done the same whether we are local or remote + (url-find-file-dired filename) + (save-excursion + (setq buffer (generate-new-buffer " *url-file*")) + (set-buffer buffer) + (mm-disable-multibyte) + (setq url-current-object url) + (insert "Content-type: " (or content-type "application/octet-stream") "\n") + (if content-encoding + (insert "Content-transfer-encoding: " content-encoding "\n")) + (if (url-file-host-is-local-p (url-host url)) + ;; Local files are handled slightly oddly + (if (featurep 'ange-ftp) + (url-file-asynch-callback nil nil + filename + (current-buffer) + callback cbargs) + (url-file-asynch-callback nil nil nil + filename + (current-buffer) + callback cbargs)) + ;; FTP handling + (let* ((extension (url-file-extension filename)) + (new (url-generate-unique-filename + (and (> (length extension) 0) + (concat "%s." extension))))) + (if (featurep 'ange-ftp) + (ange-ftp-copy-file-internal filename (expand-file-name new) t + nil t + (list 'url-file-asynch-callback + new (current-buffer) + callback cbargs) + t) + (autoload 'efs-copy-file-internal "efs") + (efs-copy-file-internal filename (efs-ftp-path filename) + new (efs-ftp-path new) + t nil 0 + (list 'url-file-asynch-callback + new (current-buffer) + callback cbargs) + 0 nil)))))) + buffer)) + +(defmacro url-file-create-wrapper (method args) + `(defalias ',(intern (format "url-ftp-%s" method)) + (defun ,(intern (format "url-file-%s" method)) ,args + ,(format "FTP/FILE URL wrapper around `%s' call." method) + (setq url (url-file-build-filename url)) + (and url (,method ,@(remove '&rest (remove '&optional args))))))) + +(url-file-create-wrapper file-exists-p (url)) +(url-file-create-wrapper file-attributes (url &optional id-format)) +(url-file-create-wrapper file-symlink-p (url)) +(url-file-create-wrapper file-readable-p (url)) +(url-file-create-wrapper file-writable-p (url)) +(url-file-create-wrapper file-executable-p (url)) +(if (featurep 'xemacs) + (progn + (url-file-create-wrapper directory-files (url &optional full match nosort files-only)) + (url-file-create-wrapper file-truename (url &optional default))) + (url-file-create-wrapper directory-files (url &optional full match nosort)) + (url-file-create-wrapper file-truename (url &optional counter prev-dirs))) + +(provide 'url-file) + +;; arch-tag: 010e914a-7313-494b-8a8c-6495a862157d +;;; url-file.el ends here diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el new file mode 100644 index 00000000000..6c540e8d61b --- /dev/null +++ b/lisp/url/url-handlers.el @@ -0,0 +1,258 @@ +;;; url-handlers.el --- file-name-handler stuff for URL loading + +;; Copyright (c) 1996,97,98,1999,2004 Free Software Foundation, Inc. +;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu> + +;; Keywords: comm, data, processes, hypermedia + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; Code: + +(require 'url) +(require 'url-parse) +(require 'url-util) +(require 'mm-decode) +(require 'mailcap) + +(eval-when-compile + (require 'cl)) + +;; Implementation status +;; --------------------- +;; Function Status +;; ------------------------------------------------------------ +;; add-name-to-file Needs DAV Bindings +;; copy-file Broken (assumes 1st item is URL) +;; delete-directory Finished (DAV) +;; delete-file Finished (DAV) +;; diff-latest-backup-file +;; directory-file-name unnecessary (what about VMS)? +;; directory-files Finished (DAV) +;; dired-call-process +;; dired-compress-file +;; dired-uncache +;; expand-file-name Finished +;; file-accessible-directory-p +;; file-attributes Finished, better with DAV +;; file-directory-p Needs DAV, finished +;; file-executable-p Finished +;; file-exists-p Finished +;; file-local-copy +;; file-modes +;; file-name-all-completions Finished (DAV) +;; file-name-as-directory +;; file-name-completion Finished (DAV) +;; file-name-directory +;; file-name-nondirectory +;; file-name-sans-versions why? +;; file-newer-than-file-p +;; file-ownership-preserved-p No way to know +;; file-readable-p Finished +;; file-regular-p !directory_p +;; file-symlink-p Needs DAV bindings +;; file-truename Needs DAV bindings +;; file-writable-p Check for LOCK? +;; find-backup-file-name why? +;; get-file-buffer why? +;; insert-directory Use DAV +;; insert-file-contents Finished +;; load +;; make-directory Finished (DAV) +;; make-symbolic-link Needs DAV bindings +;; rename-file Finished (DAV) +;; set-file-modes Use mod_dav specific executable flag? +;; set-visited-file-modtime Impossible? +;; shell-command Impossible? +;; unhandled-file-name-directory +;; vc-registered Finished (DAV) +;; verify-visited-file-modtime +;; write-region + +(defvar url-handler-regexp + "\\`\\(https?\\|ftp\\|file\\|nfs\\)://" + "*A regular expression for matching URLs handled by file-name-handler-alist. +Some valid URL protocols just do not make sense to visit interactively +\(about, data, info, irc, mailto, etc\). This regular expression +avoids conflicts with local files that look like URLs \(Gnus is +particularly bad at this\).") + +;;;###autoload +(define-minor-mode url-handler-mode + "Use URL to handle URL-like file names." + :global t + (if (not (boundp 'file-name-handler-alist)) + ;; Can't be turned ON anyway. + (setq url-handler-mode nil) + ;; Remove old entry, if any. + (setq file-name-handler-alist + (delq (rassq 'url-file-handler file-name-handler-alist) + file-name-handler-alist)) + (if url-handler-mode + (push (cons url-handler-regexp 'url-file-handler) + file-name-handler-alist)))) + +(defun url-run-real-handler (operation args) + (let ((inhibit-file-name-handlers (cons 'url-file-handler + (if (eq operation inhibit-file-name-operation) + inhibit-file-name-handlers))) + (inhibit-file-name-operation operation)) + (apply operation args))) + +(defun url-file-handler (operation &rest args) + "Function called from the `file-name-handler-alist' routines. +OPERATION is what needs to be done (`file-exists-p', etc). ARGS are +the arguments that would have been passed to OPERATION." + (let ((fn (or (get operation 'url-file-handlers) + (intern-soft (format "url-%s" operation)))) + (val nil) + (hooked nil)) + (if (and fn (fboundp fn)) + (setq hooked t + val (apply fn args)) + (setq hooked nil + val (url-run-real-handler operation args))) + (url-debug 'handlers "%s %S%S => %S" (if hooked "Hooked" "Real") + operation args val) + val)) + +(defun url-file-handler-identity (&rest args) + ;; Identity function + (car args)) + +;; These are operations that we can fully support +(put 'file-readable-p 'url-file-handlers 'url-file-exists-p) +(put 'substitute-in-file-name 'url-file-handlers 'url-file-handler-identity) +(put 'file-name-absolute-p 'url-file-handlers (lambda (&rest ignored) t)) +(put 'expand-file-name 'url-file-handlers 'url-handler-expand-file-name) + +;; These are operations that we do not support yet (DAV!!!) +(put 'file-writable-p 'url-file-handlers 'ignore) +(put 'file-symlink-p 'url-file-handlers 'ignore) + +(defun url-handler-expand-file-name (file &optional base) + (if (file-name-absolute-p file) + (expand-file-name file "/") + (url-expand-file-name file base))) + +;; The actual implementation +;;;###autoload +(defun url-copy-file (url newname &optional ok-if-already-exists keep-time) + "Copy URL to NEWNAME. Both args must be strings. +Signals a `file-already-exists' error if file NEWNAME already exists, +unless a third argument OK-IF-ALREADY-EXISTS is supplied and non-nil. +A number as third arg means request confirmation if NEWNAME already exists. +This is what happens in interactive use with M-x. +Fourth arg KEEP-TIME non-nil means give the new file the same +last-modified time as the old one. (This works on only some systems.) +A prefix arg makes KEEP-TIME non-nil." + (if (and (file-exists-p newname) + (not ok-if-already-exists)) + (error "Opening output file: File already exists, %s" newname)) + (let ((buffer (url-retrieve-synchronously url)) + (handle nil)) + (if (not buffer) + (error "Opening input file: No such file or directory, %s" url)) + (save-excursion + (set-buffer buffer) + (setq handle (mm-dissect-buffer t))) + (mm-save-part-to-file handle newname) + (kill-buffer buffer) + (mm-destroy-parts handle))) + +;;;###autoload +(defun url-file-local-copy (url &rest ignored) + "Copy URL into a temporary file on this machine. +Returns the name of the local copy, or nil, if FILE is directly +accessible." + (let ((filename (make-temp-name "url"))) + (url-copy-file url filename) + filename)) + +;;;###autoload +(defun url-insert-file-contents (url &optional visit beg end replace) + (let ((buffer (url-retrieve-synchronously url)) + (handle nil) + (data nil)) + (if (not buffer) + (error "Opening input file: No such file or directory, %s" url)) + (if visit (setq buffer-file-name url)) + (save-excursion + (set-buffer buffer) + (setq handle (mm-dissect-buffer t)) + (set-buffer (mm-handle-buffer handle)) + (if beg + (setq data (buffer-substring beg end)) + (setq data (buffer-string)))) + (kill-buffer buffer) + (mm-destroy-parts handle) + (if replace (delete-region (point-min) (point-max))) + (save-excursion + (insert data)) + (list url (length data)))) + +(defun url-file-name-completion (url directory) + (error "Unimplemented")) + +(defun url-file-name-all-completions (file directory) + (error "Unimplemented")) + +;; All other handlers map onto their respective backends. +(defmacro url-handlers-create-wrapper (method args) + `(defun ,(intern (format "url-%s" method)) ,args + ,(format "URL file-name-handler wrapper for `%s' call.\n---\n%s" method + (or (documentation method t) "No original documentation.")) + (setq url (url-generic-parse-url url)) + (when (url-type url) + (funcall (url-scheme-get-property (url-type url) (quote ,method)) + ,@(remove '&rest (remove '&optional args)))))) + +(url-handlers-create-wrapper file-exists-p (url)) +(url-handlers-create-wrapper file-attributes (url &optional id-format)) +(url-handlers-create-wrapper file-symlink-p (url)) +(url-handlers-create-wrapper file-writable-p (url)) +(url-handlers-create-wrapper file-directory-p (url)) +(url-handlers-create-wrapper file-executable-p (url)) + +(if (featurep 'xemacs) + (progn + ;; XEmacs specific prototypes + (url-handlers-create-wrapper + directory-files (url &optional full match nosort files-only)) + (url-handlers-create-wrapper + file-truename (url &optional default))) + ;; Emacs specific prototypes + (url-handlers-create-wrapper + directory-files (url &optional full match nosort)) + (url-handlers-create-wrapper + file-truename (url &optional counter prev-dirs))) + +(add-hook 'find-file-hook 'url-handlers-set-buffer-mode) + +(defun url-handlers-set-buffer-mode () + "Set correct modes for the current buffer if visiting a remote file." + (and (stringp buffer-file-name) + (string-match url-handler-regexp buffer-file-name) + (auto-save-mode 0))) + +(provide 'url-handlers) + +;; arch-tag: 7300b99c-cc83-42ff-9147-79b2723c62ac +;;; url-handlers.el ends here diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el new file mode 100644 index 00000000000..200025c3804 --- /dev/null +++ b/lisp/url/url-http.el @@ -0,0 +1,1224 @@ +;;; url-http.el --- HTTP retrieval routines + +;; Copyright (c) 1999, 2001, 2004 Free Software Foundation, Inc. + +;; Author: Bill Perry <wmperry@gnu.org> +;; Keywords: comm, data, processes + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; Code: + +(eval-when-compile + (require 'cl) + (defvar url-http-extra-headers)) +(require 'url-gw) +(require 'url-util) +(require 'url-parse) +(require 'url-cookie) +(require 'mail-parse) +(require 'url-auth) +(autoload 'url-retrieve-synchronously "url") +(autoload 'url-retrieve "url") +(autoload 'url-cache-create-filename "url-cache") +(autoload 'url-mark-buffer-as-dead "url") + +(defconst url-http-default-port 80 "Default HTTP port.") +(defconst url-http-asynchronous-p t "HTTP retrievals are asynchronous.") +(defalias 'url-http-expand-file-name 'url-default-expander) + +(defvar url-http-real-basic-auth-storage nil) +(defvar url-http-proxy-basic-auth-storage nil) + +(defvar url-http-open-connections (make-hash-table :test 'equal + :size 17) + "A hash table of all open network connections.") + +(defvar url-http-version "1.1" + "What version of HTTP we advertise, as a string. +Valid values are 1.1 and 1.0. +This is only useful when debugging the HTTP subsystem. + +Setting this to 1.0 will tell servers not to send chunked encoding, +and other HTTP/1.1 specific features. +") + +(defvar url-http-attempt-keepalives t + "Whether to use a single TCP connection multiple times in HTTP. +This is only useful when debugging the HTTP subsystem. Setting to +`nil' will explicitly close the connection to the server after every +request. +") + +;(eval-when-compile +;; These are all macros so that they are hidden from external sight +;; when the file is byte-compiled. +;; +;; This allows us to expose just the entry points we want. + +;; These routines will allow us to implement persistent HTTP +;; connections. +(defsubst url-http-debug (&rest args) + (if quit-flag + (let ((proc (get-buffer-process (current-buffer)))) + ;; The user hit C-g, honor it! Some things can get in an + ;; incredibly tight loop (chunked encoding) + (if proc + (progn + (set-process-sentinel proc nil) + (set-process-filter proc nil))) + (error "Transfer interrupted!"))) + (apply 'url-debug 'http args)) + +(defun url-http-mark-connection-as-busy (host port proc) + (url-http-debug "Marking connection as busy: %s:%d %S" host port proc) + (puthash (cons host port) + (delq proc (gethash (cons host port) url-http-open-connections)) + url-http-open-connections) + proc) + +(defun url-http-mark-connection-as-free (host port proc) + (url-http-debug "Marking connection as free: %s:%d %S" host port proc) + (set-process-buffer proc nil) + (set-process-sentinel proc 'url-http-idle-sentinel) + (puthash (cons host port) + (cons proc (gethash (cons host port) url-http-open-connections)) + url-http-open-connections) + nil) + +(defun url-http-find-free-connection (host port) + (let ((conns (gethash (cons host port) url-http-open-connections)) + (found nil)) + (while (and conns (not found)) + (if (not (memq (process-status (car conns)) '(run open))) + (progn + (url-http-debug "Cleaning up dead process: %s:%d %S" + host port (car conns)) + (url-http-idle-sentinel (car conns) nil)) + (setq found (car conns)) + (url-http-debug "Found existing connection: %s:%d %S" host port found)) + (pop conns)) + (if found + (url-http-debug "Reusing existing connection: %s:%d" host port) + (url-http-debug "Contacting host: %s:%d" host port)) + (url-lazy-message "Contacting host: %s:%d" host port) + (url-http-mark-connection-as-busy host port + (or found + (url-open-stream host nil host + port))))) + +;; Building an HTTP request +(defun url-http-user-agent-string () + (if (or (eq url-privacy-level 'paranoid) + (and (listp url-privacy-level) + (memq 'agent url-privacy-level))) + "" + (format "User-Agent: %sURL/%s%s\r\n" + (if url-package-name + (concat url-package-name "/" url-package-version " ") + "") + url-version + (cond + ((and url-os-type url-system-type) + (concat " (" url-os-type "; " url-system-type ")")) + ((or url-os-type url-system-type) + (concat " (" (or url-system-type url-os-type) ")")) + (t ""))))) + +(defun url-http-create-request (url &optional ref-url) + "Create an HTTP request for URL, referred to by REF-URL." + (declare (special proxy-object proxy-info)) + (let* ((extra-headers) + (request nil) + (no-cache (cdr-safe (assoc "Pragma" url-request-extra-headers))) + (proxy-obj (and (boundp 'proxy-object) proxy-object)) + (proxy-auth (if (or (cdr-safe (assoc "Proxy-Authorization" + url-request-extra-headers)) + (not proxy-obj)) + nil + (let ((url-basic-auth-storage + 'url-http-proxy-basic-auth-storage)) + (url-get-authentication url nil 'any nil)))) + (real-fname (if proxy-obj (url-recreate-url proxy-obj) + (url-filename url))) + (host (url-host (or proxy-obj url))) + (auth (if (cdr-safe (assoc "Authorization" url-request-extra-headers)) + nil + (url-get-authentication (or + (and (boundp 'proxy-info) + proxy-info) + url) nil 'any nil)))) + (if (equal "" real-fname) + (setq real-fname "/")) + (setq no-cache (and no-cache (string-match "no-cache" no-cache))) + (if auth + (setq auth (concat "Authorization: " auth "\r\n"))) + (if proxy-auth + (setq proxy-auth (concat "Proxy-Authorization: " proxy-auth "\r\n"))) + + ;; Protection against stupid values in the referer + (if (and ref-url (stringp ref-url) (or (string= ref-url "file:nil") + (string= ref-url ""))) + (setq ref-url nil)) + + ;; We do not want to expose the referer if the user is paranoid. + (if (or (memq url-privacy-level '(low high paranoid)) + (and (listp url-privacy-level) + (memq 'lastloc url-privacy-level))) + (setq ref-url nil)) + + ;; url-request-extra-headers contains an assoc-list of + ;; header/value pairs that we need to put into the request. + (setq extra-headers (mapconcat + (lambda (x) + (concat (car x) ": " (cdr x))) + url-request-extra-headers "\r\n")) + (if (not (equal extra-headers "")) + (setq extra-headers (concat extra-headers "\r\n"))) + + ;; This was done with a call to `format'. Concatting parts has + ;; the advantage of keeping the parts of each header togther and + ;; allows us to elide null lines directly, at the cost of making + ;; the layout less clear. + (setq request + (concat + ;; The request + (or url-request-method "GET") " " real-fname " HTTP/" url-http-version "\r\n" + ;; Version of MIME we speak + "MIME-Version: 1.0\r\n" + ;; (maybe) Try to keep the connection open + "Connection: " (if (or proxy-obj + (not url-http-attempt-keepalives)) + "close" "keep-alive") "\r\n" + ;; HTTP extensions we support + (if url-extensions-header + (format + "Extension: %s\r\n" url-extensions-header)) + ;; Who we want to talk to + (if (/= (url-port (or proxy-obj url)) + (url-scheme-get-property + (url-type (or proxy-obj url)) 'default-port)) + (format + "Host: %s:%d\r\n" host (url-port (or proxy-obj url))) + (format "Host: %s\r\n" host)) + ;; Who its from + (if url-personal-mail-address + (concat + "From: " url-personal-mail-address "\r\n")) + ;; Encodings we understand + (if url-mime-encoding-string + (concat + "Accept-encoding: " url-mime-encoding-string "\r\n")) + (if url-mime-charset-string + (concat + "Accept-charset: " url-mime-charset-string "\r\n")) + ;; Languages we understand + (if url-mime-language-string + (concat + "Accept-language: " url-mime-language-string "\r\n")) + ;; Types we understand + "Accept: " (or url-mime-accept-string "*/*") "\r\n" + ;; User agent + (url-http-user-agent-string) + ;; Proxy Authorization + proxy-auth + ;; Authorization + auth + ;; Cookies + (url-cookie-generate-header-lines host real-fname + (equal "https" (url-type url))) + ;; If-modified-since + (if (and (not no-cache) + (member url-request-method '("GET" nil))) + (let ((tm (url-is-cached (or proxy-obj url)))) + (if tm + (concat "If-modified-since: " + (url-get-normalized-date tm) "\r\n")))) + ;; Whence we came + (if ref-url (concat + "Referer: " ref-url "\r\n")) + extra-headers + ;; Any data + (if url-request-data + (concat + "Content-length: " (number-to-string + (length url-request-data)) + "\r\n\r\n" + url-request-data)) + ;; End request + "\r\n")) + (url-http-debug "Request is: \n%s" request) + request)) + +;; Parsing routines +(defun url-http-clean-headers () + "Remove trailing \r from header lines. +This allows us to use `mail-fetch-field', etc." + (declare (special url-http-end-of-headers)) + (goto-char (point-min)) + (while (re-search-forward "\r$" url-http-end-of-headers t) + (replace-match ""))) + +(defun url-http-handle-authentication (proxy) + (declare (special status success url-http-method url-http-data + url-callback-function url-callback-arguments)) + (url-http-debug "Handling %s authentication" (if proxy "proxy" "normal")) + (let ((auth (or (mail-fetch-field (if proxy "proxy-authenticate" "www-authenticate")) + "basic")) + (type nil) + (url (url-recreate-url url-current-object)) + (url-basic-auth-storage 'url-http-real-basic-auth-storage) + ) + + ;; Cheating, but who cares? :) + (if proxy + (setq url-basic-auth-storage 'url-http-proxy-basic-auth-storage)) + + (setq auth (url-eat-trailing-space (url-strip-leading-spaces auth))) + (if (string-match "[ \t]" auth) + (setq type (downcase (substring auth 0 (match-beginning 0)))) + (setq type (downcase auth))) + + (if (not (url-auth-registered type)) + (progn + (widen) + (goto-char (point-max)) + (insert "<hr>Sorry, but I do not know how to handle " type + " authentication. If you'd like to write it," + " send it to " url-bug-address ".<hr>") + (setq status t)) + (let* ((args auth) + (ctr (1- (length args))) + auth) + (while (/= 0 ctr) + (if (char-equal ?, (aref args ctr)) + (aset args ctr ?\;)) + (setq ctr (1- ctr))) + (setq args (url-parse-args args) + auth (url-get-authentication url (cdr-safe (assoc "realm" args)) + type t args)) + (if (not auth) + (setq success t) + (push (cons (if proxy "Proxy-Authorization" "Authorization") auth) + url-http-extra-headers) + (let ((url-request-method url-http-method) + (url-request-data url-http-data) + (url-request-extra-headers url-http-extra-headers)) + (url-retrieve url url-callback-function url-callback-arguments)))) + (kill-buffer (current-buffer))))) + +(defun url-http-parse-response () + "Parse just the response code." + (declare (special url-http-end-of-headers url-http-response-status)) + (if (not url-http-end-of-headers) + (error "Trying to parse HTTP response code in odd buffer: %s" (buffer-name))) + (url-http-debug "url-http-parse-response called in (%s)" (buffer-name)) + (goto-char (point-min)) + (skip-chars-forward " \t\n") ; Skip any blank crap + (skip-chars-forward "HTTP/") ; Skip HTTP Version + (read (current-buffer)) + (setq url-http-response-status (read (current-buffer)))) + +(defun url-http-handle-cookies () + "Handle all set-cookie / set-cookie2 headers in an HTTP response. +The buffer must already be narrowed to the headers, so mail-fetch-field will +work correctly." + (let ((cookies (mail-fetch-field "Set-Cookie" nil nil t)) + (cookies2 (mail-fetch-field "Set-Cookie2" nil nil t))) + (and cookies (url-http-debug "Found %d Set-Cookie headers" (length cookies))) + (and cookies2 (url-http-debug "Found %d Set-Cookie2 headers" (length cookies2))) + (while cookies + (url-cookie-handle-set-cookie (pop cookies))) +;;; (while cookies2 +;;; (url-cookie-handle-set-cookie2 (pop cookies))) + ) + ) + +(defun url-http-parse-headers () + "Parse and handle HTTP specific headers. +Return t if and only if the current buffer is still active and +should be shown to the user." + ;; The comments after each status code handled are taken from RFC + ;; 2616 (HTTP/1.1) + (declare (special url-http-end-of-headers url-http-response-status + url-http-method url-http-data url-http-process + url-callback-function url-callback-arguments)) + + (url-http-mark-connection-as-free (url-host url-current-object) + (url-port url-current-object) + url-http-process) + + (if (or (not (boundp 'url-http-end-of-headers)) + (not url-http-end-of-headers)) + (error "Trying to parse headers in odd buffer: %s" (buffer-name))) + (goto-char (point-min)) + (url-http-debug "url-http-parse-headers called in (%s)" (buffer-name)) + (url-http-parse-response) + (mail-narrow-to-head) + ;;(narrow-to-region (point-min) url-http-end-of-headers) + (let ((class nil) + (success nil)) + (setq class (/ url-http-response-status 100)) + (url-http-debug "Parsed HTTP headers: class=%d status=%d" class url-http-response-status) + (url-http-handle-cookies) + + (case class + ;; Classes of response codes + ;; + ;; 5xx = Server Error + ;; 4xx = Client Error + ;; 3xx = Redirection + ;; 2xx = Successful + ;; 1xx = Informational + (1 ; Information messages + ;; 100 = Continue with request + ;; 101 = Switching protocols + ;; 102 = Processing (Added by DAV) + (url-mark-buffer-as-dead (current-buffer)) + (error "HTTP responses in class 1xx not supported (%d)" url-http-response-status)) + (2 ; Success + ;; 200 Ok + ;; 201 Created + ;; 202 Accepted + ;; 203 Non-authoritative information + ;; 204 No content + ;; 205 Reset content + ;; 206 Partial content + ;; 207 Multi-status (Added by DAV) + (case url-http-response-status + ((204 205) + ;; No new data, just stay at the same document + (url-mark-buffer-as-dead (current-buffer)) + (setq success t)) + (otherwise + ;; Generic success for all others. Store in the cache, and + ;; mark it as successful. + (widen) + (if (equal url-http-method "GET") + (url-store-in-cache (current-buffer))) + (setq success t)))) + (3 ; Redirection + ;; 300 Multiple choices + ;; 301 Moved permanently + ;; 302 Found + ;; 303 See other + ;; 304 Not modified + ;; 305 Use proxy + ;; 307 Temporary redirect + (let ((redirect-uri (or (mail-fetch-field "Location") + (mail-fetch-field "URI")))) + (case url-http-response-status + (300 + ;; Quoth the spec (section 10.3.1) + ;; ------------------------------- + ;; The requested resource corresponds to any one of a set of + ;; representations, each with its own specific location and + ;; agent-driven negotiation information is being provided so + ;; that the user can select a preferred representation and + ;; redirect its request to that location. + ;; [...] + ;; If the server has a preferred choice of representation, it + ;; SHOULD include the specific URI for that representation in + ;; the Location field; user agents MAY use the Location field + ;; value for automatic redirection. + ;; ------------------------------- + ;; We do not support agent-driven negotiation, so we just + ;; redirect to the preferred URI if one is provided. + nil) + ((301 302 307) + ;; If the 301|302 status code is received in response to a + ;; request other than GET or HEAD, the user agent MUST NOT + ;; automatically redirect the request unless it can be + ;; confirmed by the user, since this might change the + ;; conditions under which the request was issued. + (if (member url-http-method '("HEAD" "GET")) + ;; Automatic redirection is ok + nil + ;; It is just too big of a pain in the ass to get this + ;; prompt all the time. We will just silently lose our + ;; data and convert to a GET method. + (url-http-debug "Converting `%s' request to `GET' because of REDIRECT(%d)" + url-http-method url-http-response-status) + (setq url-http-method "GET" + url-request-data nil))) + (303 + ;; The response to the request can be found under a different + ;; URI and SHOULD be retrieved using a GET method on that + ;; resource. + (setq url-http-method "GET" + url-http-data nil)) + (304 + ;; The 304 response MUST NOT contain a message-body. + (url-http-debug "Extracting document from cache... (%s)" + (url-cache-create-filename (url-view-url t))) + (url-cache-extract (url-cache-create-filename (url-view-url t))) + (setq redirect-uri nil + success t)) + (305 + ;; The requested resource MUST be accessed through the + ;; proxy given by the Location field. The Location field + ;; gives the URI of the proxy. The recipient is expected + ;; to repeat this single request via the proxy. 305 + ;; responses MUST only be generated by origin servers. + (error "Redirection thru a proxy server not supported: %s" + redirect-uri)) + (otherwise + ;; Treat everything like '300' + nil)) + (when redirect-uri + ;; Clean off any whitespace and/or <...> cruft. + (if (string-match "\\([^ \t]+\\)[ \t]" redirect-uri) + (setq redirect-uri (match-string 1 redirect-uri))) + (if (string-match "^<\\(.*\\)>$" redirect-uri) + (setq redirect-uri (match-string 1 redirect-uri))) + + ;; Some stupid sites (like sourceforge) send a + ;; non-fully-qualified URL (ie: /), which royally confuses + ;; the URL library. + (if (not (string-match url-nonrelative-link redirect-uri)) + (setq redirect-uri (url-expand-file-name redirect-uri))) + (let ((url-request-method url-http-method) + (url-request-data url-http-data) + (url-request-extra-headers url-http-extra-headers)) + (url-retrieve redirect-uri url-callback-function + url-callback-arguments) + (url-mark-buffer-as-dead (current-buffer)))))) + (4 ; Client error + ;; 400 Bad Request + ;; 401 Unauthorized + ;; 402 Payment required + ;; 403 Forbidden + ;; 404 Not found + ;; 405 Method not allowed + ;; 406 Not acceptable + ;; 407 Proxy authentication required + ;; 408 Request time-out + ;; 409 Conflict + ;; 410 Gone + ;; 411 Length required + ;; 412 Precondition failed + ;; 413 Request entity too large + ;; 414 Request-URI too large + ;; 415 Unsupported media type + ;; 416 Requested range not satisfiable + ;; 417 Expectation failed + ;; 422 Unprocessable Entity (Added by DAV) + ;; 423 Locked + ;; 424 Failed Dependency + (case url-http-response-status + (401 + ;; The request requires user authentication. The response + ;; MUST include a WWW-Authenticate header field containing a + ;; challenge applicable to the requested resource. The + ;; client MAY repeat the request with a suitable + ;; Authorization header field. + (url-http-handle-authentication nil)) + (402 + ;; This code is reserved for future use + (url-mark-buffer-as-dead (current-buffer)) + (error "Somebody wants you to give them money")) + (403 + ;; The server understood the request, but is refusing to + ;; fulfill it. Authorization will not help and the request + ;; SHOULD NOT be repeated. + (setq success t)) + (404 + ;; Not found + (setq success t)) + (405 + ;; The method specified in the Request-Line is not allowed + ;; for the resource identified by the Request-URI. The + ;; response MUST include an Allow header containing a list of + ;; valid methods for the requested resource. + (setq success t)) + (406 + ;; The resource identified by the request is only capable of + ;; generating response entities which have content + ;; characteristics nota cceptable according to the accept + ;; headers sent in the request. + (setq success t)) + (407 + ;; This code is similar to 401 (Unauthorized), but indicates + ;; that the client must first authenticate itself with the + ;; proxy. The proxy MUST return a Proxy-Authenticate header + ;; field containing a challenge applicable to the proxy for + ;; the requested resource. + (url-http-handle-authentication t)) + (408 + ;; The client did not produce a request within the time that + ;; the server was prepared to wait. The client MAY repeat + ;; the request without modifications at any later time. + (setq success t)) + (409 + ;; The request could not be completed due to a conflict with + ;; the current state of the resource. This code is only + ;; allowed in situations where it is expected that the user + ;; mioght be able to resolve the conflict and resubmit the + ;; request. The response body SHOULD include enough + ;; information for the user to recognize the source of the + ;; conflict. + (setq success t)) + (410 + ;; The requested resource is no longer available at the + ;; server and no forwarding address is known. + (setq success t)) + (411 + ;; The server refuses to accept the request without a defined + ;; Content-Length. The client MAY repeat the request if it + ;; adds a valid Content-Length header field containing the + ;; length of the message-body in the request message. + ;; + ;; NOTE - this will never happen because + ;; `url-http-create-request' automatically calculates the + ;; content-length. + (setq success t)) + (412 + ;; The precondition given in one or more of the + ;; request-header fields evaluated to false when it was + ;; tested on the server. + (setq success t)) + ((413 414) + ;; The server is refusing to process a request because the + ;; request entity|URI is larger than the server is willing or + ;; able to process. + (setq success t)) + (415 + ;; The server is refusing to service the request because the + ;; entity of the request is in a format not supported by the + ;; requested resource for the requested method. + (setq success t)) + (416 + ;; A server SHOULD return a response with this status code if + ;; a request included a Range request-header field, and none + ;; of the range-specifier values in this field overlap the + ;; current extent of the selected resource, and the request + ;; did not include an If-Range request-header field. + (setq success t)) + (417 + ;; The expectation given in an Expect request-header field + ;; could not be met by this server, or, if the server is a + ;; proxy, the server has unambiguous evidence that the + ;; request could not be met by the next-hop server. + (setq success t)) + (otherwise + ;; The request could not be understood by the server due to + ;; malformed syntax. The client SHOULD NOT repeat the + ;; request without modifications. + (setq success t)))) + (5 + ;; 500 Internal server error + ;; 501 Not implemented + ;; 502 Bad gateway + ;; 503 Service unavailable + ;; 504 Gateway time-out + ;; 505 HTTP version not supported + ;; 507 Insufficient storage + (setq success t) + (case url-http-response-status + (501 + ;; The server does not support the functionality required to + ;; fulfill the request. + nil) + (502 + ;; The server, while acting as a gateway or proxy, received + ;; an invalid response from the upstream server it accessed + ;; in attempting to fulfill the request. + nil) + (503 + ;; The server is currently unable to handle the request due + ;; to a temporary overloading or maintenance of the server. + ;; The implication is that this is a temporary condition + ;; which will be alleviated after some delay. If known, the + ;; length of the delay MAY be indicated in a Retry-After + ;; header. If no Retry-After is given, the client SHOULD + ;; handle the response as it would for a 500 response. + nil) + (504 + ;; The server, while acting as a gateway or proxy, did not + ;; receive a timely response from the upstream server + ;; specified by the URI (e.g. HTTP, FTP, LDAP) or some other + ;; auxiliary server (e.g. DNS) it needed to access in + ;; attempting to complete the request. + nil) + (505 + ;; The server does not support, or refuses to support, the + ;; HTTP protocol version that was used in the request + ;; message. + nil) + (507 ; DAV + ;; The method could not be performed on the resource + ;; because the server is unable to store the representation + ;; needed to successfully complete the request. This + ;; condition is considered to be temporary. If the request + ;; which received this status code was the result of a user + ;; action, the request MUST NOT be repeated until it is + ;; requested by a separate user action. + nil))) + (otherwise + (error "Unknown class of HTTP response code: %d (%d)" + class url-http-response-status))) + (if (not success) + (url-mark-buffer-as-dead (current-buffer))) + (url-http-debug "Finished parsing HTTP headers: %S" success) + (widen) + success)) + +;; Miscellaneous +(defun url-http-activate-callback () + "Activate callback specified when this buffer was created." + (declare (special url-http-process + url-callback-function + url-callback-arguments)) + (url-http-mark-connection-as-free (url-host url-current-object) + (url-port url-current-object) + url-http-process) + (url-http-debug "Activating callback in buffer (%s)" (buffer-name)) + (apply url-callback-function url-callback-arguments)) + +;; ) + +;; These unfortunately cannot be macros... please ignore them! +(defun url-http-idle-sentinel (proc why) + "Remove this (now defunct) process PROC from the list of open connections." + (maphash (lambda (key val) + (if (memq proc val) + (puthash key (delq proc val) url-http-open-connections))) + url-http-open-connections)) + +(defun url-http-end-of-document-sentinel (proc why) + ;; Sentinel used for old HTTP/0.9 or connections we know are going + ;; to die as the 'end of document' notifier. + (url-http-debug "url-http-end-of-document-sentinel in buffer (%s)" + (process-buffer proc)) + (url-http-idle-sentinel proc why) + (save-excursion + (set-buffer (process-buffer proc)) + (goto-char (point-min)) + (if (not (looking-at "HTTP/")) + ;; HTTP/0.9 just gets passed back no matter what + (url-http-activate-callback) + (if (url-http-parse-headers) + (url-http-activate-callback))))) + +(defun url-http-simple-after-change-function (st nd length) + ;; Function used when we do NOT know how long the document is going to be + ;; Just _very_ simple 'downloaded %d' type of info. + (declare (special url-http-end-of-headers)) + (url-lazy-message "Reading %s..." (url-pretty-length nd))) + +(defun url-http-content-length-after-change-function (st nd length) + "Function used when we DO know how long the document is going to be. +More sophisticated percentage downloaded, etc. +Also does minimal parsing of HTTP headers and will actually cause +the callback to be triggered." + (declare (special url-current-object + url-http-end-of-headers + url-http-content-length + url-http-content-type + url-http-process)) + (if url-http-content-type + (url-display-percentage + "Reading [%s]... %s of %s (%d%%)" + (url-percentage (- nd url-http-end-of-headers) + url-http-content-length) + url-http-content-type + (url-pretty-length (- nd url-http-end-of-headers)) + (url-pretty-length url-http-content-length) + (url-percentage (- nd url-http-end-of-headers) + url-http-content-length)) + (url-display-percentage + "Reading... %s of %s (%d%%)" + (url-percentage (- nd url-http-end-of-headers) + url-http-content-length) + (url-pretty-length (- nd url-http-end-of-headers)) + (url-pretty-length url-http-content-length) + (url-percentage (- nd url-http-end-of-headers) + url-http-content-length))) + + (if (> (- nd url-http-end-of-headers) url-http-content-length) + (progn + ;; Found the end of the document! Wheee! + (url-display-percentage nil nil) + (message "Reading... done.") + (if (url-http-parse-headers) + (url-http-activate-callback))))) + +(defun url-http-chunked-encoding-after-change-function (st nd length) + "Function used when dealing with 'chunked' encoding. +Cannot give a sophisticated percentage, but we need a different +function to look for the special 0-length chunk that signifies +the end of the document." + (declare (special url-current-object + url-http-end-of-headers + url-http-content-type + url-http-chunked-length + url-http-chunked-counter + url-http-process url-http-chunked-start)) + (save-excursion + (goto-char st) + (let ((read-next-chunk t) + (case-fold-search t) + (regexp nil) + (no-initial-crlf nil)) + ;; We need to loop thru looking for more chunks even within + ;; one after-change-function call. + (while read-next-chunk + (setq no-initial-crlf (= 0 url-http-chunked-counter)) + (if url-http-content-type + (url-display-percentage nil + "Reading [%s]... chunk #%d" + url-http-content-type url-http-chunked-counter) + (url-display-percentage nil + "Reading... chunk #%d" + url-http-chunked-counter)) + (url-http-debug "Reading chunk %d (%d %d %d)" + url-http-chunked-counter st nd length) + (setq regexp (if no-initial-crlf + "\\([0-9a-z]+\\).*\r?\n" + "\r?\n\\([0-9a-z]+\\).*\r?\n")) + + (if url-http-chunked-start + ;; We know how long the chunk is supposed to be, skip over + ;; leading crap if possible. + (if (> nd (+ url-http-chunked-start url-http-chunked-length)) + (progn + (url-http-debug "Got to the end of chunk #%d!" + url-http-chunked-counter) + (goto-char (+ url-http-chunked-start + url-http-chunked-length))) + (url-http-debug "Still need %d bytes to hit end of chunk" + (- (+ url-http-chunked-start + url-http-chunked-length) + nd)) + (setq read-next-chunk nil))) + (if (not read-next-chunk) + (url-http-debug "Still spinning for next chunk...") + (if no-initial-crlf (skip-chars-forward "\r\n")) + (if (not (looking-at regexp)) + (progn + ;; Must not have received the entirety of the chunk header, + ;; need to spin some more. + (url-http-debug "Did not see start of chunk @ %d!" (point)) + (setq read-next-chunk nil)) + (add-text-properties (match-beginning 0) (match-end 0) + (list 'start-open t + 'end-open t + 'chunked-encoding t + 'face (if (featurep 'xemacs) + 'text-cursor + 'cursor) + 'invisible t)) + (setq url-http-chunked-length (string-to-int (buffer-substring + (match-beginning 1) + (match-end 1)) + 16) + url-http-chunked-counter (1+ url-http-chunked-counter) + url-http-chunked-start (set-marker + (or url-http-chunked-start + (make-marker)) + (match-end 0))) +; (if (not url-http-debug) + (delete-region (match-beginning 0) (match-end 0));) + (url-http-debug "Saw start of chunk %d (length=%d, start=%d" + url-http-chunked-counter url-http-chunked-length + (marker-position url-http-chunked-start)) + (if (= 0 url-http-chunked-length) + (progn + ;; Found the end of the document! Wheee! + (url-http-debug "Saw end of stream chunk!") + (setq read-next-chunk nil) + (url-display-percentage nil nil) + (goto-char (match-end 1)) + (if (re-search-forward "^\r*$" nil t) + (message "Saw end of trailers...")) + (if (url-http-parse-headers) + (url-http-activate-callback)))))))))) + +(defun url-http-wait-for-headers-change-function (st nd length) + ;; This will wait for the headers to arrive and then splice in the + ;; next appropriate after-change-function, etc. + (declare (special url-current-object + url-http-end-of-headers + url-http-content-type + url-http-content-length + url-http-transfer-encoding + url-callback-function + url-callback-arguments + url-http-process + url-http-method + url-http-after-change-function + url-http-response-status)) + (url-http-debug "url-http-wait-for-headers-change-function (%s)" + (buffer-name)) + (if (not (bobp)) + (let ((end-of-headers nil) + (old-http nil) + (content-length nil)) + (goto-char (point-min)) + (if (not (looking-at "^HTTP/[1-9]\\.[0-9]")) + ;; Not HTTP/x.y data, must be 0.9 + ;; God, I wish this could die. + (setq end-of-headers t + url-http-end-of-headers 0 + old-http t) + (if (re-search-forward "^\r*$" nil t) + ;; Saw the end of the headers + (progn + (url-http-debug "Saw end of headers... (%s)" (buffer-name)) + (setq url-http-end-of-headers (set-marker (make-marker) + (point)) + end-of-headers t) + (url-http-clean-headers)))) + + (if (not end-of-headers) + ;; Haven't seen the end of the headers yet, need to wait + ;; for more data to arrive. + nil + (if old-http + (message "HTTP/0.9 How I hate thee!") + (progn + (url-http-parse-response) + (mail-narrow-to-head) + ;;(narrow-to-region (point-min) url-http-end-of-headers) + (setq url-http-transfer-encoding (mail-fetch-field + "transfer-encoding") + url-http-content-type (mail-fetch-field "content-type")) + (if (mail-fetch-field "content-length") + (setq url-http-content-length + (string-to-int (mail-fetch-field "content-length")))) + (widen))) + (if url-http-transfer-encoding + (setq url-http-transfer-encoding + (downcase url-http-transfer-encoding))) + + (cond + ((or (= url-http-response-status 204) + (= url-http-response-status 205)) + (url-http-debug "%d response must have headers only (%s)." + url-http-response-status (buffer-name)) + (if (url-http-parse-headers) + (url-http-activate-callback))) + ((string= "HEAD" url-http-method) + ;; A HEAD request is _ALWAYS_ terminated by the header + ;; information, regardless of any entity headers, + ;; according to section 4.4 of the HTTP/1.1 draft. + (url-http-debug "HEAD request must have headers only (%s)." + (buffer-name)) + (if (url-http-parse-headers) + (url-http-activate-callback))) + ((string= "CONNECT" url-http-method) + ;; A CONNECT request is finished, but we cannot stick this + ;; back on the free connectin list + (url-http-debug "CONNECT request must have headers only.") + (if (url-http-parse-headers) + (url-http-activate-callback))) + ((equal url-http-response-status 304) + ;; Only allowed to have a header section. We have to handle + ;; this here instead of in url-http-parse-headers because if + ;; you have a cached copy of something without a known + ;; content-length, and try to retrieve it from the cache, we'd + ;; fall into the 'being dumb' section and wait for the + ;; connection to terminate, which means we'd wait for 10 + ;; seconds for the keep-alives to time out on some servers. + (if (url-http-parse-headers) + (url-http-activate-callback))) + (old-http + ;; HTTP/0.9 always signaled end-of-connection by closing the + ;; connection. + (url-http-debug + "Saw HTTP/0.9 response, connection closed means end of document.") + (setq url-http-after-change-function + 'url-http-simple-after-change-function)) + ((equal url-http-transfer-encoding "chunked") + (url-http-debug "Saw chunked encoding.") + (setq url-http-after-change-function + 'url-http-chunked-encoding-after-change-function) + (if (> nd url-http-end-of-headers) + (progn + (url-http-debug + "Calling initial chunked-encoding for extra data at end of headers") + (url-http-chunked-encoding-after-change-function + (marker-position url-http-end-of-headers) nd + (- nd url-http-end-of-headers))))) + ((integerp url-http-content-length) + (url-http-debug + "Got a content-length, being smart about document end.") + (setq url-http-after-change-function + 'url-http-content-length-after-change-function) + (cond + ((= 0 url-http-content-length) + ;; We got a NULL body! Activate the callback + ;; immediately! + (url-http-debug + "Got 0-length content-length, activating callback immediately.") + (if (url-http-parse-headers) + (url-http-activate-callback))) + ((> nd url-http-end-of-headers) + ;; Have some leftover data + (url-http-debug "Calling initial content-length for extra data at end of headers") + (url-http-content-length-after-change-function + (marker-position url-http-end-of-headers) + nd + (- nd url-http-end-of-headers))) + (t + nil))) + (t + (url-http-debug "No content-length, being dumb.") + (setq url-http-after-change-function + 'url-http-simple-after-change-function))))) + ;; We are still at the beginning of the buffer... must just be + ;; waiting for a response. + (url-http-debug "Spinning waiting for headers...")) + (goto-char (point-max))) + +;;;###autoload +(defun url-http (url callback cbargs) + "Retrieve URL via HTTP asynchronously. +URL must be a parsed URL. See `url-generic-parse-url' for details. +When retrieval is completed, the function CALLBACK is executed with +CBARGS as the arguments." + (check-type url vector "Need a pre-parsed URL.") + (declare (special url-current-object + url-http-end-of-headers + url-http-content-type + url-http-content-length + url-http-transfer-encoding + url-http-after-change-function + url-callback-function + url-callback-arguments + url-http-method + url-http-extra-headers + url-http-data + url-http-chunked-length + url-http-chunked-start + url-http-chunked-counter + url-http-process)) + (let ((connection (url-http-find-free-connection (url-host url) + (url-port url))) + (buffer (generate-new-buffer (format " *http %s:%d*" + (url-host url) + (url-port url))))) + (if (not connection) + ;; Failed to open the connection for some reason + (progn + (kill-buffer buffer) + (setq buffer nil) + (error "Could not create connection to %s:%d" (url-host url) + (url-port url))) + (save-excursion + (set-buffer buffer) + (mm-disable-multibyte) + (setq url-current-object url + mode-line-format "%b [%s]") + + (dolist (var '(url-http-end-of-headers + url-http-content-type + url-http-content-length + url-http-transfer-encoding + url-http-after-change-function + url-http-response-status + url-http-chunked-length + url-http-chunked-counter + url-http-chunked-start + url-callback-function + url-callback-arguments + url-http-process + url-http-method + url-http-extra-headers + url-http-data)) + (set (make-local-variable var) nil)) + + (setq url-http-method (or url-request-method "GET") + url-http-extra-headers url-request-extra-headers + url-http-data url-request-data + url-http-process connection + url-http-chunked-length nil + url-http-chunked-start nil + url-http-chunked-counter 0 + url-callback-function callback + url-callback-arguments cbargs + url-http-after-change-function 'url-http-wait-for-headers-change-function) + + (set-process-buffer connection buffer) + (set-process-sentinel connection 'url-http-end-of-document-sentinel) + (set-process-filter connection 'url-http-generic-filter) + (process-send-string connection (url-http-create-request url)))) + buffer)) + +;; Since Emacs 19/20 does not allow you to change the +;; `after-change-functions' hook in the midst of running them, we fake +;; an after change by hooking into the process filter and inserting +;; the data ourselves. This is slightly less efficient, but there +;; were tons of weird ways the after-change code was biting us in the +;; shorts. +(defun url-http-generic-filter (proc data) + ;; Sometimes we get a zero-length data chunk after the process has + ;; been changed to 'free', which means it has no buffer associated + ;; with it. Do nothing if there is no buffer, or 0 length data. + (declare (special url-http-after-change-function)) + (and (process-buffer proc) + (/= (length data) 0) + (save-excursion + (set-buffer (process-buffer proc)) + (url-http-debug "Calling after change function `%s' for `%S'" url-http-after-change-function proc) + (funcall url-http-after-change-function + (point-max) + (progn + (goto-char (point-max)) + (insert data) + (point-max)) + (length data))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; file-name-handler stuff from here on out +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(if (not (fboundp 'symbol-value-in-buffer)) + (defun url-http-symbol-value-in-buffer (symbol buffer + &optional unbound-value) + "Return the value of SYMBOL in BUFFER, or UNBOUND-VALUE if it is unbound." + (save-excursion + (set-buffer buffer) + (if (not (boundp symbol)) + unbound-value + (symbol-value symbol)))) + (defalias 'url-http-symbol-value-in-buffer 'symbol-value-in-buffer)) + +(defun url-http-head (url) + (let ((url-request-method "HEAD") + (url-request-data nil)) + (url-retrieve-synchronously url))) + +;;;###autoload +(defun url-http-file-exists-p (url) + (let ((status nil) + (exists nil) + (buffer (url-http-head url))) + (if (not buffer) + (setq exists nil) + (setq status (url-http-symbol-value-in-buffer 'url-http-response-status + buffer 500) + exists (and (>= status 200) (< status 300))) + (kill-buffer buffer)) + exists)) + +;;;###autoload +(defalias 'url-http-file-readable-p 'url-http-file-exists-p) + +(defun url-http-head-file-attributes (url &optional id-format) + (let ((buffer (url-http-head url)) + (attributes nil)) + (when buffer + (setq attributes (make-list 11 nil)) + (setf (nth 1 attributes) 1) ; Number of links to file + (setf (nth 2 attributes) 0) ; file uid + (setf (nth 3 attributes) 0) ; file gid + (setf (nth 7 attributes) ; file size + (url-http-symbol-value-in-buffer 'url-http-content-length + buffer -1)) + (setf (nth 8 attributes) (eval-when-compile (make-string 10 ?-))) + (kill-buffer buffer)) + attributes)) + +;;;###autoload +(defun url-http-file-attributes (url &optional id-format) + (if (url-dav-supported-p url) + (url-dav-file-attributes url id-format) + (url-http-head-file-attributes url id-format))) + +;;;###autoload +(defun url-http-options (url) + "Returns a property list describing options available for URL. +This list is retrieved using the `OPTIONS' HTTP method. + +Property list members: + +methods + A list of symbols specifying what HTTP methods the resource + supports. + +dav + A list of numbers specifying what DAV protocol/schema versions are + supported. + +dasl + A list of supported DASL search types supported (string form) + +ranges + A list of the units available for use in partial document fetches. + +p3p + The `Platform For Privacy Protection' description for the resource. + Currently this is just the raw header contents. This is likely to + change once P3P is formally supported by the URL package or + Emacs/W3. +" + (let* ((url-request-method "OPTIONS") + (url-request-data nil) + (buffer (url-retrieve-synchronously url)) + (header nil) + (options nil)) + (when (and buffer (= 2 (/ (url-http-symbol-value-in-buffer + 'url-http-response-status buffer 0) 100))) + ;; Only parse the options if we got a 2xx response code! + (save-excursion + (save-restriction + (save-match-data + (set-buffer buffer) + (mail-narrow-to-head) + + ;; Figure out what methods are supported. + (when (setq header (mail-fetch-field "allow")) + (setq options (plist-put + options 'methods + (mapcar 'intern (split-string header "[ ,]+"))))) + + ;; Check for DAV + (when (setq header (mail-fetch-field "dav")) + (setq options (plist-put + options 'dav + (delq 0 + (mapcar 'string-to-number + (split-string header "[, ]+")))))) + + ;; Now for DASL + (when (setq header (mail-fetch-field "dasl")) + (setq options (plist-put + options 'dasl + (split-string header "[, ]+")))) + + ;; P3P - should get more detailed here. FIXME + (when (setq header (mail-fetch-field "p3p")) + (setq options (plist-put options 'p3p header))) + + ;; Check for whether they accept byte-range requests. + (when (setq header (mail-fetch-field "accept-ranges")) + (setq options (plist-put + options 'ranges + (delq 'none + (mapcar 'intern + (split-string header "[, ]+")))))) + )))) + (if buffer (kill-buffer buffer)) + options)) + +(provide 'url-http) + +;; arch-tag: ba7c59ae-c0f4-4a31-9617-d85f221732ee +;;; url-http.el ends here diff --git a/lisp/url/url-https.el b/lisp/url/url-https.el new file mode 100644 index 00000000000..11b2593ea80 --- /dev/null +++ b/lisp/url/url-https.el @@ -0,0 +1,56 @@ +;;; url-https.el --- HTTP over SSL routines + +;; Copyright (c) 1999, 2004 Free Software Foundation, Inc. + +;; Keywords: comm, data, processes + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; Code: + +(require 'url-gw) +(require 'url-util) +(require 'url-parse) +(require 'url-cookie) +(require 'url-http) + +(defconst url-https-default-port 443 "Default HTTPS port.") +(defconst url-https-asynchronous-p t "HTTPS retrievals are asynchronous.") +(defalias 'url-https-expand-file-name 'url-http-expand-file-name) + +(defmacro url-https-create-secure-wrapper (method args) + `(defun ,(intern (format (if method "url-https-%s" "url-https") method)) ,args + ,(format "HTTPS wrapper around `%s' call." (or method "url-http")) + (condition-case () + (require 'ssl) + (error + (error "HTTPS support could not find `ssl' library"))) + (let ((url-gateway-method 'ssl)) + ( ,(intern (format (if method "url-http-%s" "url-http") method)) ,@(remove '&rest (remove '&optional args)))))) + +(url-https-create-secure-wrapper nil (url callback cbargs)) +(url-https-create-secure-wrapper file-exists-p (url)) +(url-https-create-secure-wrapper file-readable-p (url)) +(url-https-create-secure-wrapper file-attributes (url &optional id-format)) + +(provide 'url-https) + +;; arch-tag: c3645ac5-c248-4d12-ad41-7c4b6f7b6d19 +;;; url-https.el ends here diff --git a/lisp/url/url-nfs.el b/lisp/url/url-nfs.el new file mode 100644 index 00000000000..d068341b1c2 --- /dev/null +++ b/lisp/url/url-nfs.el @@ -0,0 +1,100 @@ +;;; url-nfs.el --- NFS URL interface + +;; Copyright (c) 1996,97,98,1999,2004 Free Software Foundation, Inc. +;; Copyright (c) 1996 by William M. Perry <wmperry@cs.indiana.edu> + +;; Keywords: comm, data, processes + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; Code: + +(eval-when-compile (require 'cl)) +(require 'url-parse) +(require 'url-file) + +(defvar url-nfs-automounter-directory-spec + "file:/net/%h%f" + "*How to invoke the NFS automounter. Certain % sequences are recognized. + +%h -- the hostname of the NFS server +%n -- the port # of the NFS server +%u -- the username to use to authenticate +%p -- the password to use to authenticate +%f -- the filename on the remote server +%% -- a literal % + +Each can be used any number of times.") + +(defun url-nfs-unescape (format host port user pass file) + (save-excursion + (set-buffer (get-buffer-create " *nfs-parse*")) + (erase-buffer) + (insert format) + (goto-char (point-min)) + (while (re-search-forward "%\\(.\\)" nil t) + (let ((escape (aref (match-string 1) 0))) + (replace-match "" t t) + (case escape + (?% (insert "%")) + (?h (insert host)) + (?n (insert (or port ""))) + (?u (insert (or user ""))) + (?p (insert (or pass ""))) + (?f (insert (or file "/")))))) + (buffer-string))) + +(defun url-nfs-build-filename (url) + (let* ((host (url-host url)) + (port (string-to-int (url-port url))) + (pass (url-password url)) + (user (url-user url)) + (file (url-filename url))) + (url-generic-parse-url + (url-nfs-unescape url-nfs-automounter-directory-spec + host port user pass file)))) + +(defun url-nfs (url callback cbargs) + (url-file (url-nfs-build-filename url) callback cbargs)) + +(defmacro url-nfs-create-wrapper (method args) + `(defun ,(intern (format "url-nfs-%s" method)) ,args + ,(format "NFS URL wrapper around `%s' call." method) + (setq url (url-nfs-build-filename url)) + (and url (,(intern (format "url-file-%s" method)) + ,@(remove '&rest (remove '&optional args)))))) + +(url-nfs-create-wrapper file-exists-p (url)) +(url-nfs-create-wrapper file-attributes (url &optional id-format)) +(url-nfs-create-wrapper file-symlink-p (url)) +(url-nfs-create-wrapper file-readable-p (url)) +(url-nfs-create-wrapper file-writable-p (url)) +(url-nfs-create-wrapper file-executable-p (url)) +(if (featurep 'xemacs) + (progn + (url-nfs-create-wrapper directory-files (url &optional full match nosort files-only)) + (url-nfs-create-wrapper file-truename (url &optional default))) + (url-nfs-create-wrapper directory-files (url &optional full match nosort)) + (url-nfs-create-wrapper file-truename (url &optional counter prev-dirs))) + +(provide 'url-nfs) + +;; arch-tag: cdf9c9ba-b7d2-4c29-8b48-7ae9bbc0d437 +;;; url-nfs.el ends here diff --git a/lisp/url/url-util.el b/lisp/url/url-util.el new file mode 100644 index 00000000000..d4a3733eab5 --- /dev/null +++ b/lisp/url/url-util.el @@ -0,0 +1,508 @@ +;;; url-util.el --- Miscellaneous helper routines for URL library + +;; Copyright (c) 1996,97,98,99,2001,2004 Free Software Foundation, Inc. +;; Copyright (c) 1993 - 1996 by William M. Perry <wmperry@cs.indiana.edu> + +;; Author: Bill Perry <wmperry@gnu.org> +;; Keywords: comm, data, processes + +;; This file is part of GNU Emacs. +;; +;; GNU Emacs is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. +;; +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. +;; +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;;; Code: + +(require 'url-parse) +(autoload 'timezone-parse-date "timezone") +(autoload 'timezone-make-date-arpa-standard "timezone") +(autoload 'mail-header-extract "mailheader") + +(defvar url-parse-args-syntax-table + (copy-syntax-table emacs-lisp-mode-syntax-table) + "A syntax table for parsing sgml attributes.") + +(modify-syntax-entry ?' "\"" url-parse-args-syntax-table) +(modify-syntax-entry ?` "\"" url-parse-args-syntax-table) +(modify-syntax-entry ?{ "(" url-parse-args-syntax-table) +(modify-syntax-entry ?} ")" url-parse-args-syntax-table) + +;;;###autoload +(defcustom url-debug nil + "*What types of debug messages from the URL library to show. +Debug messages are logged to the *URL-DEBUG* buffer. + +If t, all messages will be logged. +If a number, all messages will be logged, as well shown via `message'. +If a list, it is a list of the types of messages to be logged." + :type '(choice (const :tag "none" nil) + (const :tag "all" t) + (checklist :tag "custom" + (const :tag "HTTP" :value http) + (const :tag "DAV" :value dav) + (const :tag "General" :value retrieval) + (const :tag "Filename handlers" :value handlers) + (symbol :tag "Other"))) + :group 'url-hairy) + +;;;###autoload +(defun url-debug (tag &rest args) + (if quit-flag + (error "Interrupted!")) + (if (or (eq url-debug t) + (numberp url-debug) + (and (listp url-debug) (memq tag url-debug))) + (with-current-buffer (get-buffer-create "*URL-DEBUG*") + (goto-char (point-max)) + (insert (symbol-name tag) " -> " (apply 'format args) "\n") + (if (numberp url-debug) + (apply 'message args))))) + +;;;###autoload +(defun url-parse-args (str &optional nodowncase) + ;; Return an assoc list of attribute/value pairs from an RFC822-type string + (let ( + name ; From name= + value ; its value + results ; Assoc list of results + name-pos ; Start of XXXX= position + val-pos ; Start of value position + st + nd + ) + (save-excursion + (save-restriction + (set-buffer (get-buffer-create " *urlparse-temp*")) + (set-syntax-table url-parse-args-syntax-table) + (erase-buffer) + (insert str) + (setq st (point-min) + nd (point-max)) + (set-syntax-table url-parse-args-syntax-table) + (narrow-to-region st nd) + (goto-char (point-min)) + (while (not (eobp)) + (skip-chars-forward "; \n\t") + (setq name-pos (point)) + (skip-chars-forward "^ \n\t=;") + (if (not nodowncase) + (downcase-region name-pos (point))) + (setq name (buffer-substring name-pos (point))) + (skip-chars-forward " \t\n") + (if (/= (or (char-after (point)) 0) ?=) ; There is no value + (setq value nil) + (skip-chars-forward " \t\n=") + (setq val-pos (point) + value + (cond + ((or (= (or (char-after val-pos) 0) ?\") + (= (or (char-after val-pos) 0) ?')) + (buffer-substring (1+ val-pos) + (condition-case () + (prog2 + (forward-sexp 1) + (1- (point)) + (skip-chars-forward "\"")) + (error + (skip-chars-forward "^ \t\n") + (point))))) + (t + (buffer-substring val-pos + (progn + (skip-chars-forward "^;") + (skip-chars-backward " \t") + (point))))))) + (setq results (cons (cons name value) results)) + (skip-chars-forward "; \n\t")) + results)))) + +;;;###autoload +(defun url-insert-entities-in-string (string) + "Convert HTML markup-start characters to entity references in STRING. +Also replaces the \" character, so that the result may be safely used as + an attribute value in a tag. Returns a new string with the result of the + conversion. Replaces these characters as follows: + & ==> & + < ==> < + > ==> > + \" ==> "" + (if (string-match "[&<>\"]" string) + (save-excursion + (set-buffer (get-buffer-create " *entity*")) + (erase-buffer) + (buffer-disable-undo (current-buffer)) + (insert string) + (goto-char (point-min)) + (while (progn + (skip-chars-forward "^&<>\"") + (not (eobp))) + (insert (cdr (assq (char-after (point)) + '((?\" . """) + (?& . "&") + (?< . "<") + (?> . ">"))))) + (delete-char 1)) + (buffer-string)) + string)) + +;;;###autoload +(defun url-normalize-url (url) + "Return a 'normalized' version of URL. +Strips out default port numbers, etc." + (let (type data grok retval) + (setq data (url-generic-parse-url url) + type (url-type data)) + (if (member type '("www" "about" "mailto" "info")) + (setq retval url) + (url-set-target data nil) + (setq retval (url-recreate-url data))) + retval)) + +;;;###autoload +(defun url-lazy-message (&rest args) + "Just like `message', but is a no-op if called more than once a second. +Will not do anything if `url-show-status' is nil." + (if (or (null url-show-status) + (active-minibuffer-window) + (= url-lazy-message-time + (setq url-lazy-message-time (nth 1 (current-time))))) + nil + (apply 'message args))) + +;;;###autoload +(defun url-get-normalized-date (&optional specified-time) + "Return a 'real' date string that most HTTP servers can understand." + (require 'timezone) + (let* ((raw (if specified-time (current-time-string specified-time) + (current-time-string))) + (gmt (timezone-make-date-arpa-standard raw + (nth 1 (current-time-zone)) + "GMT")) + (parsed (timezone-parse-date gmt)) + (day (cdr-safe (assoc (substring raw 0 3) weekday-alist))) + (year nil) + (month (car + (rassoc + (string-to-int (aref parsed 1)) monthabbrev-alist))) + ) + (setq day (or (car-safe (rassoc day weekday-alist)) + (substring raw 0 3)) + year (aref parsed 0)) + ;; This is needed for plexus servers, or the server will hang trying to + ;; parse the if-modified-since header. Hopefully, I can take this out + ;; soon. + (if (and year (> (length year) 2)) + (setq year (substring year -2 nil))) + + (concat day ", " (aref parsed 2) "-" month "-" year " " + (aref parsed 3) " " (or (aref parsed 4) + (concat "[" (nth 1 (current-time-zone)) + "]"))))) + +;;;###autoload +(defun url-eat-trailing-space (x) + "Remove spaces/tabs at the end of a string." + (let ((y (1- (length x))) + (skip-chars (list ? ?\t ?\n))) + (while (and (>= y 0) (memq (aref x y) skip-chars)) + (setq y (1- y))) + (substring x 0 (1+ y)))) + +;;;###autoload +(defun url-strip-leading-spaces (x) + "Remove spaces at the front of a string." + (let ((y (1- (length x))) + (z 0) + (skip-chars (list ? ?\t ?\n))) + (while (and (<= z y) (memq (aref x z) skip-chars)) + (setq z (1+ z))) + (substring x z nil))) + +;;;###autoload +(defun url-pretty-length (n) + (cond + ((< n 1024) + (format "%d bytes" n)) + ((< n (* 1024 1024)) + (format "%dk" (/ n 1024.0))) + (t + (format "%2.2fM" (/ n (* 1024 1024.0)))))) + +;;;###autoload +(defun url-display-percentage (fmt perc &rest args) + (if (null fmt) + (if (fboundp 'clear-progress-display) + (clear-progress-display)) + (if (and (fboundp 'progress-display) perc) + (apply 'progress-display fmt perc args) + (apply 'message fmt args)))) + +;;;###autoload +(defun url-percentage (x y) + (if (fboundp 'float) + (round (* 100 (/ x (float y)))) + (/ (* x 100) y))) + +;;;###autoload +(defun url-basepath (file &optional x) + "Return the base pathname of FILE, or the actual filename if X is true." + (cond + ((null file) "") + ((string-match (eval-when-compile (regexp-quote "?")) file) + (if x + (file-name-nondirectory (substring file 0 (match-beginning 0))) + (file-name-directory (substring file 0 (match-beginning 0))))) + (x (file-name-nondirectory file)) + (t (file-name-directory file)))) + +;;;###autoload +(defun url-parse-query-string (query &optional downcase) + (let (retval pairs cur key val) + (setq pairs (split-string query "&")) + (while pairs + (setq cur (car pairs) + pairs (cdr pairs)) + (if (not (string-match "=" cur)) + nil ; Grace + (setq key (url-unhex-string (substring cur 0 (match-beginning 0))) + val (url-unhex-string (substring cur (match-end 0) nil))) + (if downcase + (setq key (downcase key))) + (setq cur (assoc key retval)) + (if cur + (setcdr cur (cons val (cdr cur))) + (setq retval (cons (list key val) retval))))) + retval)) + +(defun url-unhex (x) + (if (> x ?9) + (if (>= x ?a) + (+ 10 (- x ?a)) + (+ 10 (- x ?A))) + (- x ?0))) + +;; Fixme: Is this definition better, and does it ever matter? + +;; (defun url-unhex-string (str &optional allow-newlines) +;; "Remove %XX, embedded spaces, etc in a url. +;; If optional second argument ALLOW-NEWLINES is non-nil, then allow the +;; decoding of carriage returns and line feeds in the string, which is normally +;; forbidden in URL encoding." +;; (setq str (or str "")) +;; (setq str (replace-regexp-in-string "%[[:xdigit:]]\\{2\\}" +;; (lambda (match) +;; (string (string-to-number +;; (substring match 1) 16))) +;; str t t)) +;; (if allow-newlines +;; (replace-regexp-in-string "[\n\r]" (lambda (match) +;; (format "%%%.2X" (aref match 0))) +;; str t t) +;; str)) + +;;;###autoload +(defun url-unhex-string (str &optional allow-newlines) + "Remove %XX embedded spaces, etc in a url. +If optional second argument ALLOW-NEWLINES is non-nil, then allow the +decoding of carriage returns and line feeds in the string, which is normally +forbidden in URL encoding." + (setq str (or str "")) + (let ((tmp "") + (case-fold-search t)) + (while (string-match "%[0-9a-f][0-9a-f]" str) + (let* ((start (match-beginning 0)) + (ch1 (url-unhex (elt str (+ start 1)))) + (code (+ (* 16 ch1) + (url-unhex (elt str (+ start 2)))))) + (setq tmp (concat + tmp (substring str 0 start) + (cond + (allow-newlines + (char-to-string code)) + ((or (= code ?\n) (= code ?\r)) + " ") + (t (char-to-string code)))) + str (substring str (match-end 0))))) + (setq tmp (concat tmp str)) + tmp)) + +(defconst url-unreserved-chars + '( + ?a ?b ?c ?d ?e ?f ?g ?h ?i ?j ?k ?l ?m ?n ?o ?p ?q ?r ?s ?t ?u ?v ?w ?x ?y ?z + ?A ?B ?C ?D ?E ?F ?G ?H ?I ?J ?K ?L ?M ?N ?O ?P ?Q ?R ?S ?T ?U ?V ?W ?X ?Y ?Z + ?0 ?1 ?2 ?3 ?4 ?5 ?6 ?7 ?8 ?9 + ?- ?_ ?. ?! ?~ ?* ?' ?\( ?\)) + "A list of characters that are _NOT_ reserved in the URL spec. +This is taken from RFC 2396.") + +;;;###autoload +(defun url-hexify-string (str) + "Escape characters in a string." + (mapconcat + (lambda (char) + ;; Fixme: use a char table instead. + (if (not (memq char url-unreserved-chars)) + (if (> char 255) + (error "Hexifying multibyte character %s" str) + (format "%%%02X" char)) + (char-to-string char))) + str "")) + +;;;###autoload +(defun url-file-extension (fname &optional x) + "Return the filename extension of FNAME. +If optional variable X is t, +then return the basename of the file with the extension stripped off." + (if (and fname + (setq fname (url-basepath fname t)) + (string-match "\\.[^./]+$" fname)) + (if x (substring fname 0 (match-beginning 0)) + (substring fname (match-beginning 0) nil)) + ;; + ;; If fname has no extension, and x then return fname itself instead of + ;; nothing. When caching it allows the correct .hdr file to be produced + ;; for filenames without extension. + ;; + (if x + fname + ""))) + +;;;###autoload +(defun url-truncate-url-for-viewing (url &optional width) + "Return a shortened version of URL that is WIDTH characters or less wide. +WIDTH defaults to the current frame width." + (let* ((fr-width (or width (frame-width))) + (str-width (length url)) + (tail (file-name-nondirectory url)) + (fname nil) + (modified 0) + (urlobj nil)) + ;; The first thing that can go are the search strings + (if (and (>= str-width fr-width) + (string-match "?" url)) + (setq url (concat (substring url 0 (match-beginning 0)) "?...") + str-width (length url) + tail (file-name-nondirectory url))) + (if (< str-width fr-width) + nil ; Hey, we are done! + (setq urlobj (url-generic-parse-url url) + fname (url-filename urlobj) + fr-width (- fr-width 4)) + (while (and (>= str-width fr-width) + (string-match "/" fname)) + (setq fname (substring fname (match-end 0) nil) + modified (1+ modified)) + (url-set-filename urlobj fname) + (setq url (url-recreate-url urlobj) + str-width (length url))) + (if (> modified 1) + (setq fname (concat "/.../" fname)) + (setq fname (concat "/" fname))) + (url-set-filename urlobj fname) + (setq url (url-recreate-url urlobj))) + url)) + +;;;###autoload +(defun url-view-url (&optional no-show) + "View the current document's URL. +Optional argument NO-SHOW means just return the URL, don't show it in +the minibuffer. + +This uses `url-current-object', set locally to the buffer." + (interactive) + (if (not url-current-object) + nil + (if no-show + (url-recreate-url url-current-object) + (message "%s" (url-recreate-url url-current-object))))) + +(eval-and-compile + (defvar url-get-url-filename-chars "-%.?@a-zA-Z0-9()_/:~=&" + "Valid characters in a URL") + ) + +(defun url-get-url-at-point (&optional pt) + "Get the URL closest to point, but don't change position. +Has a preference for looking backward when not directly on a symbol." + ;; Not at all perfect - point must be right in the name. + (save-excursion + (if pt (goto-char pt)) + (let (start url) + (save-excursion + ;; first see if you're just past a filename + (if (not (eobp)) + (if (looking-at "[] \t\n[{}()]") ; whitespace or some parens + (progn + (skip-chars-backward " \n\t\r({[]})") + (if (not (bobp)) + (backward-char 1))))) + (if (and (char-after (point)) + (string-match (eval-when-compile + (concat "[" url-get-url-filename-chars "]")) + (char-to-string (char-after (point))))) + (progn + (skip-chars-backward url-get-url-filename-chars) + (setq start (point)) + (skip-chars-forward url-get-url-filename-chars)) + (setq start (point))) + (setq url (buffer-substring-no-properties start (point)))) + (if (and url (string-match "^(.*)\\.?$" url)) + (setq url (match-string 1 url))) + (if (and url (string-match "^URL:" url)) + (setq url (substring url 4 nil))) + (if (and url (string-match "\\.$" url)) + (setq url (substring url 0 -1))) + (if (and url (string-match "^www\\." url)) + (setq url (concat "http://" url))) + (if (and url (not (string-match url-nonrelative-link url))) + (setq url nil)) + url))) + +(defun url-generate-unique-filename (&optional fmt) + "Generate a unique filename in `url-temporary-directory'." + (if (not fmt) + (let ((base (format "url-tmp.%d" (user-real-uid))) + (fname "") + (x 0)) + (setq fname (format "%s%d" base x)) + (while (file-exists-p + (expand-file-name fname url-temporary-directory)) + (setq x (1+ x) + fname (concat base (int-to-string x)))) + (expand-file-name fname url-temporary-directory)) + (let ((base (concat "url" (int-to-string (user-real-uid)))) + (fname "") + (x 0)) + (setq fname (format fmt (concat base (int-to-string x)))) + (while (file-exists-p + (expand-file-name fname url-temporary-directory)) + (setq x (1+ x) + fname (format fmt (concat base (int-to-string x))))) + (expand-file-name fname url-temporary-directory)))) + +(defun url-extract-mime-headers () + "Set `url-current-mime-headers' in current buffer." + (save-excursion + (goto-char (point-min)) + (unless url-current-mime-headers + (set (make-local-variable 'url-current-mime-headers) + (mail-header-extract))))) + +(provide 'url-util) + +;; arch-tag: 24352abc-5a5a-412e-90cd-313b26bed5c9 +;;; url-util.el ends here diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el index c8efca02832..a439174556e 100644 --- a/lisp/vc-arch.el +++ b/lisp/vc-arch.el @@ -272,7 +272,7 @@ Return non-nil if FILE is unchanged." ;; Buh? Unexpected format. 'edited (let ((ats (file-attributes file))) - (if (and (= (nth 7 ats) (string-to-number (match-string 2))) + (if (and (eq (nth 7 ats) (string-to-number (match-string 2))) (equal (format-time-string "%s" (nth 5 ats)) (match-string 1))) 'up-to-date @@ -375,7 +375,7 @@ Return non-nil if FILE is unchanged." (vc-arch-command nil 0 file "commit" "-s" summary "-L" comment "--" (vc-switches 'Arch 'checkin)))) -(defun vc-arch-diff (file &optional oldvers newvers) +(defun vc-arch-diff (file &optional oldvers newvers buffer) "Get a difference report using Arch between two versions of FILE." (if (and newvers (vc-up-to-date-p file) @@ -390,7 +390,7 @@ Return non-nil if FILE is unchanged." (default-directory (vc-arch-root file)) (status (vc-arch-command - "*vc-diff*" + (or buffer "*vc-diff*") (if async 'async 1) nil "file-diffs" ;; Arch does not support the typical flags. diff --git a/lisp/vc-hooks.el b/lisp/vc-hooks.el index 80b9766caa0..3f5a46c5bea 100644 --- a/lisp/vc-hooks.el +++ b/lisp/vc-hooks.el @@ -6,7 +6,7 @@ ;; Author: FSF (see vc.el for full credits) ;; Maintainer: Andre Spiegel <spiegel@gnu.org> -;; $Id: vc-hooks.el,v 1.165 2004/03/28 17:38:03 monnier Exp $ +;; $Id$ ;; This file is part of GNU Emacs. @@ -44,8 +44,8 @@ "set `vc-handled-backends' to nil to disable VC.") (defvar vc-master-templates ()) -(make-obsolete-variable 'vc-master-templates - "to define master templates for a given BACKEND, use +(make-obsolete-variable 'vc-master-templates + "to define master templates for a given BACKEND, use vc-BACKEND-master-templates. To enable or disable VC for a given BACKEND, use `vc-handled-backends'.") @@ -474,8 +474,8 @@ Return non-nil if FILE is unchanged." (indirect-function (vc-find-backend-function (vc-backend file) 'diff)))) - (not (eq (caddr err) 5))) - (signal wrong-number-of-arguments err) + (not (eq (caddr err) 4))) + (signal (car err) (cdr err)) (vc-call diff file)))))) (defun vc-workfile-version (file) diff --git a/lisp/vc-mcvs.el b/lisp/vc-mcvs.el index 94beb7eb093..5c0bac48b3a 100644 --- a/lisp/vc-mcvs.el +++ b/lisp/vc-mcvs.el @@ -438,17 +438,17 @@ The changes are between FIRST-VERSION and SECOND-VERSION." ;;; History functions ;;; -(defun vc-mcvs-print-log (file) +(defun vc-mcvs-print-log (file &optional buffer) "Get change log associated with FILE." (let ((default-directory (vc-mcvs-root file))) ;; Run the command from the root dir so that `mcvs filt' returns ;; valid relative names. (vc-mcvs-command - nil + buffer (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) file "log"))) -(defun vc-mcvs-diff (file &optional oldvers newvers) +(defun vc-mcvs-diff (file &optional oldvers newvers buffer) "Get a difference report using Meta-CVS between two versions of FILE." (if (string= (vc-workfile-version file) "0") ;; This file is added but not yet committed; there is no master file. @@ -457,7 +457,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." ;; We regard this as "changed". ;; Diff it against /dev/null. ;; Note: this is NOT a "mcvs diff". - (apply 'vc-do-command "*vc-diff*" + (apply 'vc-do-command (or buffer "*vc-diff*") 1 "diff" file (append (vc-switches nil 'diff) '("/dev/null"))) ;; Even if it's empty, it's locally modified. @@ -467,7 +467,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." ;; valid relative names. (default-directory (vc-mcvs-root file)) (status - (apply 'vc-mcvs-command "*vc-diff*" + (apply 'vc-mcvs-command (or buffer "*vc-diff*") (if async 'async 1) file "diff" (and oldvers (concat "-r" oldvers)) diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index 08af8f01977..82c09cbd435 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el @@ -195,8 +195,9 @@ This is only possible if SVN is responsible for FILE's directory.") (defun vc-svn-checkin (file rev comment) "SVN-specific version of `vc-backend-checkin'." - (let ((status (apply 'vc-svn-command nil 1 file - "ci" (list* "-m" comment (vc-switches 'SVN 'checkin))))) + (let ((status (apply + 'vc-svn-command nil 1 file "ci" + (nconc (list "-m" comment) (vc-switches 'SVN 'checkin))))) (set-buffer "*vc*") (goto-char (point-min)) (unless (equal status 0) @@ -334,21 +335,22 @@ The changes are between FIRST-VERSION and SECOND-VERSION." ;;; History functions ;;; -(defun vc-svn-print-log (file) +(defun vc-svn-print-log (file &optional buffer) "Get change log associated with FILE." (save-current-buffer - (vc-setup-buffer nil) + (vc-setup-buffer buffer) (let ((inhibit-read-only t)) (goto-char (point-min)) ;; Add a line to tell log-view-mode what file this is. (insert "Working file: " (file-relative-name file) "\n")) (vc-svn-command - t + buffer (if (and (vc-stay-local-p file) (fboundp 'start-process)) 'async 0) file "log"))) -(defun vc-svn-diff (file &optional oldvers newvers) +(defun vc-svn-diff (file &optional oldvers newvers buffer) "Get a difference report using SVN between two versions of FILE." + (unless buffer (setq buffer "*vc-diff*")) (if (string= (vc-workfile-version file) "0") ;; This file is added but not yet committed; there is no master file. (if (or oldvers newvers) @@ -356,7 +358,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." ;; We regard this as "changed". ;; Diff it against /dev/null. ;; Note: this is NOT a "svn diff". - (apply 'vc-do-command "*vc-diff*" + (apply 'vc-do-command buffer 1 "diff" file (append (vc-switches nil 'diff) '("/dev/null"))) ;; Even if it's empty, it's locally modified. @@ -365,7 +367,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (async (and (vc-stay-local-p file) (or oldvers newvers) ; Svn diffs those locally. (fboundp 'start-process)))) - (apply 'vc-svn-command "*vc-diff*" + (apply 'vc-svn-command buffer (if async 'async 0) file "diff" (append @@ -377,7 +379,7 @@ The changes are between FIRST-VERSION and SECOND-VERSION." (if async 1 ; async diff => pessimistic assumption ;; For some reason `svn diff' does not return a useful ;; status w.r.t whether the diff was empty or not. - (buffer-size (get-buffer "*vc-diff*")))))) + (buffer-size (get-buffer buffer)))))) (defun vc-svn-diff-tree (dir &optional rev1 rev2) "Diff all files at and below DIR." diff --git a/lisp/vc.el b/lisp/vc.el index 801cf6d5759..1b4e2409550 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -7,7 +7,7 @@ ;; Maintainer: Andre Spiegel <spiegel@gnu.org> ;; Keywords: tools -;; $Id: vc.el,v 1.374 2004/03/28 22:00:19 monnier Exp $ +;; $Id$ ;; This file is part of GNU Emacs. @@ -2357,11 +2357,11 @@ If FOCUS-REV is non-nil, leave the point at that revision." ;; without the optional buffer argument (for backward compatibility). ;; Otherwise, resignal. (if (or (not (eq (cadr err) - (indirect-function - (vc-find-backend-function (vc-backend file) + (indirect-function + (vc-find-backend-function (vc-backend file) 'print-log)))) (not (eq (caddr err) 2))) - (signal wrong-number-of-arguments err) + (signal (car err) (cdr err)) ;; for backward compatibility (vc-call print-log file) (set-buffer "*vc*")))) diff --git a/lisp/version.el b/lisp/version.el index ef6a40f540d..dbd6142641e 100644 --- a/lisp/version.el +++ b/lisp/version.el @@ -61,9 +61,9 @@ to the system configuration; look at `system-configuration' instead." system-configuration (cond ((featurep 'motif) (concat ", " (substring motif-version-string 4))) - ((featurep 'x-toolkit) ", X toolkit") ((featurep 'gtk) (concat ", GTK+ Version " gtk-version-string)) + ((featurep 'x-toolkit) ", X toolkit") (t "")) (if (and (boundp 'x-toolkit-scroll-bars) (memq x-toolkit-scroll-bars '(xaw xaw3d))) diff --git a/lisp/view.el b/lisp/view.el index 1ee6014c73a..b17cd52ae35 100644 --- a/lisp/view.el +++ b/lisp/view.el @@ -137,6 +137,7 @@ subtracted from by `view-mode-exit' when finished viewing the buffer. See RETURN-TO-ALIST argument of function `view-mode-exit' for the format of `view-return-to-alist'.") (make-variable-buffer-local 'view-return-to-alist) +(put 'view-return-to-alist 'permanent-local t) (defvar view-exit-action nil "nil or a function with one argument (a buffer) called when finished viewing. diff --git a/lisp/w32-fns.el b/lisp/w32-fns.el index 54f051ef5e6..815f4d5382f 100644 --- a/lisp/w32-fns.el +++ b/lisp/w32-fns.el @@ -1,6 +1,6 @@ ;;; w32-fns.el --- Lisp routines for Windows NT -;; Copyright (C) 1994, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1994, 2001, 2004 Free Software Foundation, Inc. ;; Author: Geoff Voelker <voelker@cs.washington.edu> ;; Keywords: internal @@ -54,7 +54,8 @@ numbers, and the build number." (x-server-version)) (defun w32-using-nt () - "Return non-nil if literally running on Windows NT (i.e., not Windows 9X)." + "Return non-nil if running on a 32-bit Windows system. +That includes all Windows systems except for 9X/Me." (and (eq system-type 'windows-nt) (getenv "SystemRoot"))) (defun w32-shell-name () @@ -71,7 +72,7 @@ numbers, and the build number." w32-system-shells))) (defun w32-shell-dos-semantics () - "Return t if the interactive shell being used expects msdos shell semantics." + "Return non-nil if the interactive shell being used expects MSDOS shell semantics." (or (w32-system-shell-p (w32-shell-name)) (and (member (downcase (file-name-nondirectory (w32-shell-name))) '("cmdproxy" "cmdproxy.exe")) @@ -229,9 +230,13 @@ You should set this to t when using a non-system shell.\n\n")))) (defun convert-standard-filename (filename) "Convert a standard file's name to something suitable for the current OS. -This function's standard definition is trivial; it just returns the argument. -However, on some systems, the function is redefined -with a definition that really does change some file names." +This means to guarantee valid names and perhaps to canonicalize +certain patterns. + +On Windows and DOS, replace invalid characters. On DOS, make +sure to obey the 8.3 limitations. On Windows, turn Cygwin names +into native names, and also turn slashes into backslashes if the +shell requires it (see `w32-shell-dos-semantics')." (let ((name (save-match-data (if (string-match "\\`/cygdrive/\\([a-zA-Z]\\)/" filename) @@ -265,13 +270,13 @@ with a definition that really does change some file names." (get 'x-selections type)) (defun set-w32-system-coding-system (coding-system) - "Set the coding system used by the Windows System to CODING-SYSTEM. + "Set the coding system used by the Windows system to CODING-SYSTEM. This is used for things like passing font names with non-ASCII characters in them to the system. For a list of possible values of CODING-SYSTEM, use \\[list-coding-systems]. This function is provided for backward compatibility, since -w32-system-coding-system is now an alias for `locale-coding-system'." +`w32-system-coding-system' is now an alias for `locale-coding-system'." (interactive (list (let ((default locale-coding-system)) (read-coding-system diff --git a/lisp/wdired.el b/lisp/wdired.el new file mode 100644 index 00000000000..30ba2a3cd45 --- /dev/null +++ b/lisp/wdired.el @@ -0,0 +1,873 @@ +;;; wdired.el --- Rename files editing their names in dired buffers + +;; Copyright (C) 2001, 2004 Free Software Foundation, Inc. + +;; Filename: wdired.el +;; Author: Juan León Lahoz GarcÃa <juan-leon.lahoz@tecsidel.es> +;; Version: 1.91 +;; Keywords: dired, environment, files, renaming + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software; you can redistribute it and/or +;; modify it under the terms of the GNU General Public License as +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to the +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; wdired.el (the "w" is for writable) provides an alternative way of +;; renaming files. +;; +;; Have you ever wished to use C-x r t (string-rectangle), M-% +;; (query-replace), M-c (capitalize-word), etc. to change the name of +;; the files in a "dired" buffer? Now you can do this. All the power +;; of emacs commands are available to renaming files! +;; +;; This package provides a function that makes the filenames of a a +;; dired buffer editable, by changing the buffer mode (which inhibits +;; all of the commands of dired mode). Here you can edit the names of +;; one or more files and directories, and when you press C-c C-c, the +;; renaming takes effect and you are back to dired mode. +;; +;; Another things you can do with wdired: +;; +;; - To move files to another directory (by typing their path, +;; absolute or relative, as a part of the new filename). +;; +;; - To change the target of symbolic links. +;; +;; - To change the permission bits of the filenames (in systems with a +;; working unix-alike `dired-chmod-program'). See and customize the +;; variable `wdired-allow-to-change-permissions'. To change a single +;; char (toggling between its two more usual values) you can press +;; the space bar over it or left-click the mouse. To set any char to +;; an specific value (this includes the SUID, SGID and STI bits) you +;; can use the key labeled as the letter you want. Please note that +;; permissions of the links cannot be changed in that way, because +;; the change would affect to their targets, and this would not be +;; WYSIWYG :-). +;; +;; - To mark files for deletion, by deleting their whole filename. +;; +;; I do not have a URL to hang wdired, but you can use the one below +;; to find the latest version: +;; +;; http://groups.google.com/groups?as_ugroup=gnu.emacs.sources&as_q=wdired + +;;; Installation: + +;; Add this file (byte-compiling it is recommended) to your load-path. +;; Then add one of these set of lines (or similar ones) to your config: +;; +;; This is the easy way: +;; +;; (require 'wdired) +;; (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode) +;; +;; This is recommended way for faster emacs startup time and lower +;; memory consumption, but remind to add these lines before dired.el +;; gets loaded (i.e., near the beginning of your .emacs file): +;; +;; (autoload 'wdired-change-to-wdired-mode "wdired") +;; (add-hook 'dired-load-hook +;; '(lambda () +;; (define-key dired-mode-map "r" 'wdired-change-to-wdired-mode) +;; (define-key dired-mode-map +;; [menu-bar immediate wdired-change-to-wdired-mode] +;; '("Edit File Names" . wdired-change-to-wdired-mode)))) +;; +;; +;; Type "M-x customize-group RET wdired" if you want make changes to +;; the default behavior. + +;;; Usage: + +;; Then, you can start editing the names of the files by typing "r" +;; (or whatever key you choose, or M-x wdired-change-to-wdired-mode). +;; Use C-c C-c when finished or C-c C-k to abort. You can use also the +;; menu options: in dired mode, "Edit File Names" under "Immediate". +;; While editing the names, a new submenu "WDired" is available at top +;; level. You can customize the behavior of this package from this +;; menu. + +;;; Change Log: + +;; From 1.9 to 1.91 +;; +;; - Fixed a bug (introduced in 1.9) so now files can be marked for +;; deletion again, by deleting their whole filename. + +;; From 1.8 to 1.9 +;; +;; - Another alternative way of editing permissions allowed, see +;; `wdired-allow-to-change-permissions' for details. +;; +;; - Now wdired doesn't rely on regexp so much. As a consequence of +;; this, you can add newlines to filenames and symlinks targets +;; (although this is not very usual, IMHO). Please note that dired +;; (at least in Emacs 21.1 and previous) does not work very well +;; with filenames with newlines in them, so RET is deactivated in +;; wdired mode. But you can activate it if you want. +;; +;; - Now `upcase-word' `capitalize-word' and `downcase-word' are not +;; advised to work better with wdired mode, but the keys bound to +;; them use wdired versions of those commands. +;; +;; - Now "undo" actions are not inherited from wdired mode when +;; changing to dired mode. +;; +;; - Code and documentation cleanups. +;; +;; - Fixed a bug that was making wdired to fail on users with +;; `dired-backup-overwrite' set to t. +;; +;; - C-c C-[ now abort changes. + +;; From 1.7 to 1.8 +;; +;; - Now permission (access-control) bits of the files can be changed. +;; Please see the commentary section and the custom variable +;; `wdired-allow-to-change-permissions' for details. +;; +;; - Added another possible value for the variable +;; `wdired-always-move-to-filename-beginning', useful to change +;; permission bits of several files without the cursor jumping to +;; filenames when changing lines. + +;; From 0.1 to 1.7 + +;; - I've moved the list of changes to another file, because it was +;; huge. Ask me for it or search older versions in google. + +;;; TODO: + +;; - Make it to work in XEmacs. Any volunteer? + +;;; Code: + +(eval-when-compile + (require 'advice) + (defvar dired-backup-overwrite) ; Only in emacs 20.x this is a custom var + (set (make-local-variable 'byte-compile-dynamic) t)) + +(eval-and-compile + (require 'dired) + (autoload 'dired-do-create-files-regexp "dired-aux") + (autoload 'dired-call-process "dired-aux")) + +(defgroup wdired nil + "Mode to rename files by editing their names in dired buffers." + :group 'dired) + +(defcustom wdired-use-interactive-rename nil + "*If t, confirmation is required before actually rename the files. +Confirmation is required also for overwriting files. If nil, no +confirmation is required for change the file names, and the variable +`wdired-is-ok-overwrite' is used to see if it is ok to overwrite files +without asking." + :type 'boolean + :group 'wdired) + +(defcustom wdired-is-ok-overwrite nil + "*If non-nil the renames can overwrite files without asking. +This variable is used only if `wdired-use-interactive-rename' is nil." + :type 'boolean + :group 'wdired) + +(defcustom wdired-always-move-to-filename-beginning nil + "*If t the \"up\" and \"down\" movement is done as in dired mode. +That is, always move the point to the beginning of the filename at line. + +If `sometimes, only move to the beginning of filename if the point is +before it, and `track-eol' is honored. This behavior is very handy +when editing several filenames. + +If nil, \"up\" and \"down\" movement is done as in any other buffer." + :type '(choice (const :tag "As in any other mode" nil) + (const :tag "Smart cursor placement" sometimes) + (other :tag "As in dired mode" t)) + :group 'wdired) + +(defcustom wdired-advise-functions t + "*If t some editing commands are advised when wdired is loaded. +The advice only has effect in wdired mode. These commands are +`query-replace' `query-replace-regexp' `replace-string', and the +advice makes them to ignore read-only regions, so no attempts to +modify these regions are done by them, and so they don't end +prematurely. + +Setting this to nil does not unadvise the functions, if they are +already advised, but new Emacs will not advise them." + :type 'boolean + :group 'wdired) + +(defcustom wdired-allow-to-redirect-links t + "*If non-nil, the target of the symbolic links can be changed also. +In systems without symbolic links support, this variable has no effect +at all." + :type 'boolean + :group 'wdired) + +(defcustom wdired-allow-to-change-permissions nil + "*If non-nil, the permissions bits of the files can be changed also. + +If t, to change a single bit, put the cursor over it and press the +space bar, or left click over it. You can also hit the letter you want +to set: if this value is allowed, the character in the buffer will be +changed. Anyway, the point is advanced one position, so, for example, +you can keep the \"x\" key pressed to give execution permissions to +everybody to that file. + +If `advanced, the bits are freely editable. You can use +`string-rectangle', `query-replace', etc. You can put any value (even +newlines), but if you want your changes to be useful, you better put a +intelligible value. + +Anyway, the real change of the permissions is done with the external +program `dired-chmod-program', which must exist." + :type '(choice (const :tag "Not allowed" nil) + (const :tag "Toggle/set bits" t) + (other :tag "Bits freely editable" advanced)) + :group 'wdired) + +(defvar wdired-mode-map + (let ((map (make-sparse-keymap))) + (define-key map "\C-x\C-s" 'wdired-finish-edit) + (define-key map "\C-c\C-c" 'wdired-finish-edit) + (define-key map "\C-c\C-k" 'wdired-abort-changes) + (define-key map "\C-c\C-[" 'wdired-abort-changes) + (define-key map "\C-m" 'wdired-newline) + (define-key map "\C-j" 'wdired-newline) + (define-key map "\C-o" 'wdired-newline) + (define-key map [up] 'wdired-previous-line) + (define-key map "\C-p" 'wdired-previous-line) + (define-key map [down] 'wdired-next-line) + (define-key map "\C-n" 'wdired-next-line) + + (define-key map [menu-bar wdired] + (cons "WDired" (make-sparse-keymap "WDired"))) + (define-key map [menu-bar wdired wdired-customize] + '("Options" . wdired-customize)) + (define-key map [menu-bar wdired dashes] + '("--")) + (define-key map [menu-bar wdired wdired-abort-changes] + '("Abort Changes" . wdired-abort-changes)) + (define-key map [menu-bar wdired wdired-finish-edit] + '("Commit Changes" . wdired-finish-edit)) + ;; FIXME: Use the new remap trick. + (substitute-key-definition 'upcase-word 'wdired-upcase-word + map global-map) + (substitute-key-definition 'capitalize-word 'wdired-capitalize-word + map global-map) + (substitute-key-definition 'downcase-word 'wdired-downcase-word + map global-map) + map)) + +(defvar wdired-mode-hook nil + "Hook run when changing to wdired mode.") + +;; Local variables (put here to avoid compilation gripes) +(defvar wdired-col-perm) ;; Column where the permission bits start +(defvar wdired-old-content) + + +(defun wdired-mode () + "\\<wdired-mode-map>File Names Editing mode. + +Press \\[wdired-finish-edit] to make the changes to take effect and +exit. To abort the edit, use \\[wdired-abort-changes]. + +In this mode you can edit the names of the files, the target of the +links and the permission bits of the files. You can `customize-group' +wdired. + +Editing things out of the filenames, or adding or deleting lines is +not allowed, because the rest of the buffer is read-only." + (interactive) + (error "This mode can be enabled only by `wdired-change-to-wdired-mode'")) +(put 'wdired-mode 'mode-class 'special) + + +;;;###autoload +(defun wdired-change-to-wdired-mode () + "Put a dired buffer in a mode in which filenames are editable. +In this mode the names of the files can be changed, and after +typing C-c C-c the files and directories in disk are renamed. + +See `wdired-mode'." + (interactive) + (set (make-local-variable 'wdired-old-content) + (buffer-substring (point-min) (point-max))) + (use-local-map wdired-mode-map) + (force-mode-line-update) + (setq buffer-read-only nil) + (dired-unadvertise default-directory) + (add-hook 'kill-buffer-hook 'wdired-check-kill-buffer nil t) + (setq major-mode 'wdired-mode) + (setq mode-name "Edit filenames") + (setq revert-buffer-function 'wdired-revert) + ;; I temp disable undo for performance: since I'm going to clear the + ;; undo list, it can save more than a 9% of time with big + ;; directories because setting properties modify the undo-list. + (buffer-disable-undo) + (wdired-preprocess-files) + (if wdired-allow-to-change-permissions + (wdired-preprocess-perms)) + (if (and wdired-allow-to-redirect-links (fboundp 'make-symbolic-link)) + (wdired-preprocess-symlinks)) + (buffer-enable-undo) ; Performance hack. See above. + (set-buffer-modified-p nil) + (setq buffer-undo-list nil) + (run-hooks 'wdired-mode-hook) + (message (substitute-command-keys "Press \\[wdired-finish-edit] when finished"))) + + +;; Protect the buffer so only the filenames can be changed, and put +;; properties so filenames (old and new) can be easily found. +(defun wdired-preprocess-files () + (put-text-property 1 2 'front-sticky t) + (save-excursion + (goto-char (point-min)) + (let ((b-protection (point)) + filename) + (while (not (eobp)) + (setq filename (dired-get-filename nil t)) + (when (and filename + (not (member (file-name-nondirectory filename) '("." "..")))) + (dired-move-to-filename) + (put-text-property (- (point) 2) (1- (point)) 'old-name filename) + (put-text-property b-protection (1- (point)) 'read-only t) + (setq b-protection (dired-move-to-end-of-filename t))) + (put-text-property (point) (1+ (point)) 'end-name t) + (forward-line)) + (put-text-property b-protection (point-max) 'read-only t)))) + +;; This code is a copy of some dired-get-filename lines. +(defsubst wdired-normalize-filename (file) + (setq file + ;; FIXME: shouldn't we check for a `b' argument or somesuch before + ;; doing such unquoting? --Stef + (read (concat + "\"" (replace-regexp-in-string + "\\([^\\]\\|\\`\\)\"" "\\1\\\\\"" file) + "\""))) + (and file buffer-file-coding-system + (not file-name-coding-system) + (not default-file-name-coding-system) + (setq file (encode-coding-string file buffer-file-coding-system))) + file) + +(defun wdired-get-filename (&optional no-dir old) + "Return the filename at line. +Similar to `dired-get-filename' but it doesn't rely on regexps. It +relies on wdired buffer's properties. Optional arg NO-DIR with value +non-nil means don't include directory. Optional arg OLD with value +non-nil means return old filename." + ;; FIXME: Use dired-get-filename's new properties. + (let (beg end file) + (save-excursion + (setq end (progn (end-of-line) (point))) + (beginning-of-line) + (setq beg (next-single-property-change (point) 'old-name nil end)) + (unless (eq beg end) + (if old + (setq file (get-text-property beg 'old-name)) + (setq end (next-single-property-change (1+ beg) 'end-name)) + (setq file (buffer-substring-no-properties (+ 2 beg) end))) + (and file (setq file (wdired-normalize-filename file)))) + (if (or no-dir old) + file + (and file (> (length file) 0) + (concat (dired-current-directory) file)))))) + + +(defun wdired-change-to-dired-mode () + "Change the mode back to dired." + (let ((inhibit-read-only t)) + (remove-text-properties (point-min) (point-max) + '(read-only nil local-map nil))) + (put-text-property 1 2 'front-sticky nil) + (use-local-map dired-mode-map) + (force-mode-line-update) + (setq buffer-read-only t) + (setq major-mode 'dired-mode) + (setq mode-name "Dired") + (dired-advertise) + (remove-hook 'kill-buffer-hook 'wdired-check-kill-buffer t) + (setq revert-buffer-function 'dired-revert)) + + +(defun wdired-abort-changes () + "Abort changes and return to dired mode." + (interactive) + (let ((inhibit-read-only t)) + (erase-buffer) + (insert wdired-old-content)) + (wdired-change-to-dired-mode) + (set-buffer-modified-p nil) + (setq buffer-undo-list nil) + (message "Changes aborted")) + +(defun wdired-finish-edit () + "Actually rename files based on your editing in the Dired buffer." + (interactive) + (wdired-change-to-dired-mode) + (let ((overwrite (or wdired-is-ok-overwrite 1)) + (changes nil) + (files-deleted nil) + (errors 0) + file-ori file-new tmp-value) + (save-excursion + (if (and wdired-allow-to-redirect-links + (fboundp 'make-symbolic-link)) + (progn + (setq tmp-value (wdired-do-symlink-changes)) + (setq errors (cdr tmp-value)) + (setq changes (car tmp-value)))) + (if (and wdired-allow-to-change-permissions + (boundp 'wdired-col-perm)) ; could have been changed + (progn + (setq tmp-value (wdired-do-perm-changes)) + (setq errors (+ errors (cdr tmp-value))) + (setq changes (or changes (car tmp-value))))) + (goto-char (point-max)) + (while (not (bobp)) + (setq file-ori (wdired-get-filename nil t)) + (if file-ori + (setq file-new (wdired-get-filename))) + (if (and file-ori (not (equal file-new file-ori))) + (progn + (setq changes t) + (if (not file-new) ;empty filename! + (setq files-deleted (cons file-ori files-deleted)) + (progn + (setq file-new (substitute-in-file-name file-new)) + (if wdired-use-interactive-rename + (wdired-search-and-rename file-ori file-new) + (condition-case err + (let ((dired-backup-overwrite nil)) + (dired-rename-file file-ori file-new + overwrite)) + (error + (setq errors (1+ errors)) + (dired-log (concat "Rename `" file-ori "' to `" + file-new "' failed:\n%s\n") + err)))))))) + (forward-line -1))) + (if changes + (revert-buffer) ;The "revert" is necessary to re-sort the buffer + (let ((buffer-read-only nil)) + (remove-text-properties (point-min) (point-max) + '(old-name nil end-name nil old-link nil + end-link nil end-perm nil + old-perm nil perm-changed nil)) + (message "(No changes to be performed)"))) + (if files-deleted + (wdired-flag-for-deletion files-deleted)) + (if (> errors 0) + (dired-log-summary (format "%d rename actions failed" errors) nil))) + (set-buffer-modified-p nil) + (setq buffer-undo-list nil)) + +;; Renames a file, searching it in a modified dired buffer, in order +;; to be able to use `dired-do-create-files-regexp' and get its +;; "benefits" +(defun wdired-search-and-rename (filename-ori filename-new) + (save-excursion + (goto-char (point-max)) + (forward-line -1) + (let ((exit-while nil) + curr-filename) + (while (not exit-while) + (setq curr-filename (wdired-get-filename)) + (if (and curr-filename + (equal (substitute-in-file-name curr-filename) filename-new)) + (progn + (setq exit-while t) + (let ((inhibit-read-only t)) + (dired-move-to-filename) + (search-forward (wdired-get-filename t) nil t) + (replace-match (file-name-nondirectory filename-ori) t t)) + (dired-do-create-files-regexp + (function dired-rename-file) + "Move" 1 ".*" filename-new nil t)) + (progn + (forward-line -1) + (beginning-of-line) + (setq exit-while (= 1 (point))))))))) + +;; marks a list of files for deletion +(defun wdired-flag-for-deletion (filenames-ori) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (if (member (dired-get-filename nil t) filenames-ori) + (dired-flag-file-deletion 1) + (forward-line))))) + +(defun wdired-customize () + "Customize wdired options." + (interactive) + (customize-apropos "wdired" 'groups)) + +(defun wdired-revert (&optional arg noconfirm) + "Discard changes in the buffer and update the changes in the disk." + (wdired-change-to-dired-mode) + (revert-buffer) + (wdired-change-to-wdired-mode)) + +(defun wdired-check-kill-buffer () + ;; FIXME: Can't we use the normal mechanism for that? --Stef + (if (and + (buffer-modified-p) + (not (y-or-n-p "Buffer changed. Discard changes and kill buffer? "))) + (error nil))) + +(defun wdired-next-line (arg) + "Move down lines then position at filename or the current column. +See `wdired-always-move-to-filename-beginning'. Optional prefix ARG +says how many lines to move; default is one line." + (interactive "p") + (next-line arg) + (if (or (eq wdired-always-move-to-filename-beginning t) + (and wdired-always-move-to-filename-beginning + (< (current-column) + (save-excursion (dired-move-to-filename) + (current-column))))) + (dired-move-to-filename))) + +(defun wdired-previous-line (arg) + "Move up lines then position at filename or the current column. +See `wdired-always-move-to-filename-beginning'. Optional prefix ARG +says how many lines to move; default is one line." + (interactive "p") + (previous-line arg) + (if (or (eq wdired-always-move-to-filename-beginning t) + (and wdired-always-move-to-filename-beginning + (< (current-column) + (save-excursion (dired-move-to-filename) + (current-column))))) + (dired-move-to-filename))) + +;; dired doesn't works well with newlines, so ... +(defun wdired-newline () + "Do nothing." + (interactive)) + +;; Put the needed properties to allow the user to change links' targets +(defun wdired-preprocess-symlinks () + (let ((inhibit-read-only t)) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (if (looking-at dired-re-sym) + (progn + (re-search-forward " -> \\(.*\\)$") + (put-text-property (- (match-beginning 1) 2) + (1- (match-beginning 1)) 'old-link + (match-string-no-properties 1)) + (put-text-property (match-end 1) (1+ (match-end 1)) 'end-link t) + (put-text-property (1- (match-beginning 1)) + (match-end 1) 'read-only nil))) + (forward-line) + (beginning-of-line))))) + + +(defun wdired-get-previous-link (&optional old move) + "Return the next symlink target. +If OLD, return the old target. If MOVE, move point before it." + (let (beg end target) + (setq beg (previous-single-property-change (point) 'old-link nil)) + (if beg + (progn + (if old + (setq target (get-text-property (1- beg) 'old-link)) + (setq end (next-single-property-change beg 'end-link)) + (setq target (buffer-substring-no-properties (1+ beg) end))) + (if move (goto-char (1- beg))))) + (and target (wdired-normalize-filename target)))) + + + +;; Perform the changes in the target of the changed links. +(defun wdired-do-symlink-changes() + (let ((changes nil) + (errors 0) + link-to-ori link-to-new link-from) + (goto-char (point-max)) + (while (setq link-to-new (wdired-get-previous-link)) + (setq link-to-ori (wdired-get-previous-link t t)) + (setq link-from (wdired-get-filename nil t)) + (if (not (equal link-to-new link-to-ori)) + (progn + (setq changes t) + (if (equal link-to-new "") ;empty filename! + (setq link-to-new "/dev/null")) + (condition-case err + (progn + (delete-file link-from) + (make-symbolic-link + (substitute-in-file-name link-to-new) link-from)) + (error + (setq errors (1+ errors)) + (dired-log (concat "Link `" link-from "' to `" + link-to-new "' failed:\n%s\n") + err)))))) + (cons changes errors))) + +;; Perform a "case command" skipping read-only words. +(defun wdired-xcase-word (command arg) + (if (< arg 0) + (funcall command arg) + (progn + (while (> arg 0) + (condition-case err + (progn + (funcall command 1) + (setq arg (1- arg))) + (error + (if (not (forward-word 1)) + (setq arg 0)))))))) + +(defun wdired-downcase-word (arg) + "Wdired version of `downcase-word'. +Like original function but it skips read-only words." + (interactive "p") + (wdired-xcase-word 'downcase-word arg)) + +(defun wdired-upcase-word (arg) + "Wdired version of `upcase-word'. +Like original function but it skips read-only words." + (interactive "p") + (wdired-xcase-word 'upcase-word arg)) + +(defun wdired-capitalize-word (arg) + "Wdired version of `capitalize-word'. +Like original function but it skips read-only words." + (interactive "p") + (wdired-xcase-word 'capitalize-word arg)) + +;; The following code is related to advice some interactive functions +;; to make some editing commands in wdired mode not to fail trying to +;; change read-only text. Notice that some advises advice and unadvise +;; them-self to another functions: search-forward and +;; re-search-forward. This is to keep these functions advised only +;; when is necessary. Since they are built-in commands used heavily in +;; lots of places, to have it permanently advised would cause some +;; performance loss. + + +(defun wdired-add-skip-in-replace (command) + "Advice COMMAND to skip matches while they have read-only properties. +This is useful to avoid \"read-only\" errors in search and replace +commands. This advice only has effect in wdired mode." + (eval + `(defadvice ,command (around wdired-discard-read-only activate) + ,(format "Make %s to work better with wdired,\n%s." command + "skipping read-only matches when invoked without argument") + ad-do-it + (if (eq major-mode 'wdired-mode) + (while (and ad-return-value + (text-property-any + (max 1 (1- (match-beginning 0))) (match-end 0) + 'read-only t)) + ad-do-it)) + ad-return-value))) + + +(defun wdired-add-replace-advice (command) + "Advice COMMAND to skip matches while they have read-only properties. +This is useful to avoid \"read-only\" errors in search and replace +commands. This advice only has effect in wdired mode." + (eval + `(defadvice ,command (around wdired-grok-read-only activate) + ,(format "Make %s to work better with wdired,\n%s." command + "skipping read-only matches when invoked without argument") + (if (eq major-mode 'wdired-mode) + (progn + (wdired-add-skip-in-replace 'search-forward) + (wdired-add-skip-in-replace 're-search-forward) + (unwind-protect + ad-do-it + (progn + (ad-remove-advice 'search-forward + 'around 'wdired-discard-read-only) + (ad-remove-advice 're-search-forward + 'around 'wdired-discard-read-only) + (ad-update 'search-forward) + (ad-update 're-search-forward)))) + ad-do-it) + ad-return-value))) + + +(if wdired-advise-functions + (progn + (mapcar 'wdired-add-replace-advice + '(query-replace query-replace-regexp replace-string)))) + + +;; The following code deals with changing the access bits (or +;; permissions) of the files. + +(defvar wdired-perm-mode-map nil) +(unless wdired-perm-mode-map + (setq wdired-perm-mode-map (copy-keymap wdired-mode-map)) + (define-key wdired-perm-mode-map " " 'wdired-toggle-bit) + (define-key wdired-perm-mode-map "r" 'wdired-set-bit) + (define-key wdired-perm-mode-map "w" 'wdired-set-bit) + (define-key wdired-perm-mode-map "x" 'wdired-set-bit) + (define-key wdired-perm-mode-map "-" 'wdired-set-bit) + (define-key wdired-perm-mode-map "S" 'wdired-set-bit) + (define-key wdired-perm-mode-map "s" 'wdired-set-bit) + (define-key wdired-perm-mode-map "T" 'wdired-set-bit) + (define-key wdired-perm-mode-map "t" 'wdired-set-bit) + (define-key wdired-perm-mode-map "s" 'wdired-set-bit) + (define-key wdired-perm-mode-map "l" 'wdired-set-bit) + (define-key wdired-perm-mode-map [down-mouse-1] 'wdired-mouse-toggle-bit)) + +;; Put a local-map to the permission bits of the files, and store the +;; original name and permissions as a property +(defun wdired-preprocess-perms() + (let ((inhibit-read-only t) + filename) + (set (make-local-variable 'wdired-col-perm) nil) + (save-excursion + (goto-char (point-min)) + (while (not (eobp)) + (if (and (not (looking-at dired-re-sym)) + (setq filename (wdired-get-filename))) + (progn + (re-search-forward dired-re-perms) + (or wdired-col-perm + (setq wdired-col-perm (- (current-column) 9))) + (if (eq wdired-allow-to-change-permissions 'advanced) + (put-text-property (match-beginning 0) (match-end 0) + 'read-only nil) + (put-text-property (1+ (match-beginning 0)) (match-end 0) + 'local-map wdired-perm-mode-map)) + (put-text-property (match-end 0) (1+ (match-end 0)) 'end-perm t) + (put-text-property (match-beginning 0) (1+ (match-beginning 0)) + 'old-perm (match-string-no-properties 0)))) + (forward-line) + (beginning-of-line))))) + +(defun wdired-perm-allowed-in-pos (char pos) + (cond + ((= char ?-) t) + ((= char ?r) (= (% pos 3) 0)) + ((= char ?w) (= (% pos 3) 1)) + ((= char ?x) (= (% pos 3) 2)) + ((memq char '(?s ?S)) (memq pos '(2 5))) + ((memq char '(?t ?T)) (= pos 8)) + ((= char ?l) (= pos 5)))) + +(defun wdired-set-bit () + "Set a permission bit character." + (interactive) + (if (wdired-perm-allowed-in-pos last-command-char + (- (current-column) wdired-col-perm)) + (let ((new-bit (char-to-string last-command-char)) + (inhibit-read-only t) + (pos-prop (- (point) (- (current-column) wdired-col-perm)))) + (put-text-property 0 1 'local-map wdired-perm-mode-map new-bit) + (put-text-property 0 1 'read-only t new-bit) + (insert new-bit) + (delete-char 1) + (put-text-property pos-prop (1- pos-prop) 'perm-changed t)) + (forward-char 1))) + +(defun wdired-toggle-bit() + "Toggle the permission bit at point." + (interactive) + (let ((inhibit-read-only t) + (new-bit "-") + (pos-prop (- (point) (- (current-column) wdired-col-perm)))) + (if (eq (char-after (point)) ?-) + (setq new-bit + (if (= (% (- (current-column) wdired-col-perm) 3) 0) "r" + (if (= (% (- (current-column) wdired-col-perm) 3) 1) "w" + "x")))) + (put-text-property 0 1 'local-map wdired-perm-mode-map new-bit) + (put-text-property 0 1 'read-only t new-bit) + (insert new-bit) + (delete-char 1) + (put-text-property pos-prop (1- pos-prop) 'perm-changed t))) + +(defun wdired-mouse-toggle-bit (event) + "Toggle the permission bit that was left clicked." + (interactive "e") + (mouse-set-point event) + (wdired-toggle-bit)) + +;; Allowed chars for 4000 bit are Ss in position 3 +;; Allowed chars for 2000 bit are Ssl in position 6 +;; Allowed chars for 1000 bit are Tt in position 9 +(defun wdired-perms-to-number (perms) + (let ((nperm 0777)) + (if (= (elt perms 1) ?-) (setq nperm (- nperm 400))) + (if (= (elt perms 2) ?-) (setq nperm (- nperm 200))) + (let ((p-bit (elt perms 3))) + (if (memq p-bit '(?- ?S)) (setq nperm (- nperm 100))) + (if (memq p-bit '(?s ?S)) (setq nperm (+ nperm 4000)))) + (if (= (elt perms 4) ?-) (setq nperm (- nperm 40))) + (if (= (elt perms 5) ?-) (setq nperm (- nperm 20))) + (let ((p-bit (elt perms 6))) + (if (memq p-bit '(?- ?S ?l)) (setq nperm (- nperm 10))) + (if (memq p-bit '(?s ?S ?l)) (setq nperm (+ nperm 2000)))) + (if (= (elt perms 7) ?-) (setq nperm (- nperm 4))) + (if (= (elt perms 8) ?-) (setq nperm (- nperm 2))) + (let ((p-bit (elt perms 9))) + (if (memq p-bit '(?- ?T)) (setq nperm (- nperm 1))) + (if (memq p-bit '(?t ?T)) (setq nperm (+ nperm 1000)))) + nperm)) + +;; Perform the changes in the permissions of the files that have +;; changed. +(defun wdired-do-perm-changes () + (let ((changes nil) + (errors 0) + (prop-wanted (if (eq wdired-allow-to-change-permissions 'advanced) + 'old-perm 'perm-changed)) + filename perms-ori perms-new perm-tmp) + (goto-char (next-single-property-change (point-min) prop-wanted + nil (point-max))) + (while (not (eobp)) + (setq perms-ori (get-text-property (point) 'old-perm)) + (setq perms-new (buffer-substring-no-properties + (point) (next-single-property-change (point) 'end-perm))) + (if (not (equal perms-ori perms-new)) + (progn + (setq changes t) + (setq filename (wdired-get-filename nil t)) + (if (= (length perms-new) 10) + (progn + (setq perm-tmp + (int-to-string (wdired-perms-to-number perms-new))) + (if (not (equal 0 (dired-call-process dired-chmod-program + t perm-tmp filename))) + (progn + (setq errors (1+ errors)) + (dired-log (concat dired-chmod-program " " perm-tmp + " `" filename "' failed\n\n"))))) + (setq errors (1+ errors)) + (dired-log (concat "Cannot parse permission `" perms-new + "' for file `" filename "'\n\n"))))) + (goto-char (next-single-property-change (1+ (point)) prop-wanted + nil (point-max)))) + (cons changes errors))) + +(provide 'wdired) + +;; arch-tag: bc00902e-526f-4305-bc7f-8862a559184f +;;; wdired.el ends here diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index dd55b35caac..e6ce5ae71db 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -382,10 +382,11 @@ new value.") (setq help-echo 'widget-mouse-help)) (overlay-put overlay 'button widget) (overlay-put overlay 'keymap (widget-get widget :keymap)) + (overlay-put overlay 'evaporate t) ;; We want to avoid the face with image buttons. (unless (widget-get widget :suppress-face) - (overlay-put overlay 'face (widget-apply widget :button-face-get)) - (overlay-put overlay 'mouse-face widget-mouse-face)) + (overlay-put overlay 'face (widget-apply widget :button-face-get))) + (overlay-put overlay 'pointer 'hand) (overlay-put overlay 'help-echo help-echo))) (defun widget-mouse-help (window overlay point) @@ -401,6 +402,7 @@ new value.") "Specify sample for WIDGET between FROM and TO." (let ((overlay (make-overlay from to nil t nil))) (overlay-put overlay 'face (widget-apply widget :sample-face-get)) + (overlay-put overlay 'evaporate t) (widget-put widget :sample-overlay overlay))) (defun widget-specify-doc (widget from to) @@ -408,6 +410,7 @@ new value.") (let ((overlay (make-overlay from to nil t nil))) (overlay-put overlay 'widget-doc widget) (overlay-put overlay 'face widget-documentation-face) + (overlay-put overlay 'evaporate t) (widget-put widget :doc-overlay overlay))) (defmacro widget-specify-insert (&rest form) @@ -1286,8 +1289,8 @@ Store the newly created widget in the :children attribute. The value of the :type attribute should be an unconverted widget type." (let ((value (widget-get widget :value)) (type (widget-get widget :type))) - (widget-put widget :children - (list (widget-create-child-value widget + (widget-put widget :children + (list (widget-create-child-value widget (widget-convert type) value))))) @@ -3343,8 +3346,8 @@ Here we attempt to define my-list as a choice of either the constant nil, or a cons-cell containing a sexp and my-lisp. This will not work because the `choice' widget does not allow recursion. -Using the `lazy' widget you can overcome this problem, as in this -example: +Using the `lazy' widget you can overcome this problem, as in this +example: (define-widget 'sexp-list 'lazy \"A list of sexps.\" @@ -3353,7 +3356,7 @@ example: :format "%{%t%}: %v" ;; We don't convert :type because we want to allow recursive ;; datastructures. This is slow, so we should not create speed - ;; critical widgets by deriving from this. + ;; critical widgets by deriving from this. :convert-widget 'widget-value-convert-widget :value-create 'widget-type-value-create :value-get 'widget-child-value-get diff --git a/lisp/window.el b/lisp/window.el index 91b91cfb158..188b3acf311 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -36,6 +36,9 @@ of this construct. However, if a window has become dead, don't get an error, just refrain from reselecting it." `(let ((save-selected-window-window (selected-window)) + ;; It is necessary to save all of these, because calling + ;; select-window changes frame-selected-window for whatever + ;; frame that window is in. (save-selected-window-alist (mapcar (lambda (frame) (list frame (frame-selected-window frame))) (frame-list)))) @@ -327,8 +330,9 @@ new mode line." (with-current-buffer (window-buffer) (if view-mode (let ((old-info (assq old-w view-return-to-alist))) - (push (cons new-w (cons (and old-info (car (cdr old-info))) t)) - view-return-to-alist))) + (if old-info + (push (cons new-w (cons (car (cdr old-info)) t)) + view-return-to-alist)))) new-w)) (defun split-window-horizontally (&optional arg) diff --git a/lisp/winner.el b/lisp/winner.el index aaca331e7b3..e5b48889156 100644 --- a/lisp/winner.el +++ b/lisp/winner.el @@ -1,6 +1,6 @@ ;;; winner.el --- Restore old window configurations -;; Copyright (C) 1997, 1998, 2001 Free Software Foundation. Inc. +;; Copyright (C) 1997, 1998, 2001, 2004 Free Software Foundation. Inc. ;; Author: Ivar Rummelhoff <ivarru@math.uio.no> ;; Created: 27 Feb 1997 @@ -30,8 +30,8 @@ ;; window configuration (i.e. how the frames are partitioned into ;; windows) so that the changes can be "undone" using the command ;; `winner-undo'. By default this one is bound to the key sequence -;; ctrl-x left. If you change your mind (while undoing), you can -;; press ctrl-x right (calling `winner-redo'). Even though it uses +;; ctrl-c left. If you change your mind (while undoing), you can +;; press ctrl-c right (calling `winner-redo'). Even though it uses ;; some features of Emacs20.3, winner.el should also work with ;; Emacs19.34 and XEmacs20, provided that the installed version of ;; custom is not obsolete. @@ -474,8 +474,8 @@ In other words, \"undo\" changes in window configuration." (unless winner-mode-map (setq winner-mode-map (make-sparse-keymap)) - (define-key winner-mode-map [(control x) left] 'winner-undo) - (define-key winner-mode-map [(control x) right] 'winner-redo)) + (define-key winner-mode-map [(control c) left] 'winner-undo) + (define-key winner-mode-map [(control c) right] 'winner-redo)) (unless (or (assq 'winner-mode minor-mode-map-alist) winner-dont-bind-my-keys) diff --git a/lisp/woman.el b/lisp/woman.el index d69c631f27b..ba511bca1ae 100644 --- a/lisp/woman.el +++ b/lisp/woman.el @@ -1,6 +1,6 @@ ;;; woman.el --- browse UN*X manual pages `wo (without) man' -;; Copyright (C) 2000, 2002 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. ;; Author: Francis J. Wright <F.J.Wright@qmul.ac.uk> ;; Maintainer: Francis J. Wright <F.J.Wright@qmul.ac.uk> @@ -402,6 +402,7 @@ ;; Alexander Hinds <ahinds@thegrid.net> ;; Stefan Hornburg <sth@hacon.de> ;; Theodore Jump <tjump@cais.com> +;; David Kastrup <dak@gnu.org> ;; Paul Kinnucan <paulk@mathworks.com> ;; Jonas Linde <jonas@init.se> ;; Andrew McRae <andrewm@optimation.co.nz> @@ -438,7 +439,8 @@ "Return concatenated list of FN applied to successive `car' elements of X. FN must return a list, cons or nil. Useful for splicing into a list." ;; Based on the Standard Lisp function MAPCAN but with args swapped! - (and x (nconc (funcall fn (car x)) (woman-mapcan fn (cdr x))))) + ;; More concise implementation than the recursive one. -- dak + (apply #'nconc (mapcar fn x))) (defun woman-parse-colon-path (paths) "Explode search path string PATHS into a list of directory names. @@ -1367,15 +1369,16 @@ The cdr of each alist element is the path-index / filename." ;; is re-processed by `woman-topic-all-completions-merge'. (let (dir files (path-index 0)) ; indexing starts at zero (while path - (setq dir (car path) - path (cdr path)) + (setq dir (pop path)) (if (woman-not-member dir path) ; use each directory only once! - (setq files - (nconc files - (woman-topic-all-completions-1 dir path-index)))) + (push (woman-topic-all-completions-1 dir path-index) + files)) (setq path-index (1+ path-index))) ;; Uniquefy topics: - (woman-topic-all-completions-merge files))) + ;; Concate all lists with a single nconc call to + ;; avoid retraversing the first lists repeatedly -- dak + (woman-topic-all-completions-merge + (apply #'nconc files)))) (defun woman-topic-all-completions-1 (dir path-index) "Return an alist of the man topics in directory DIR with index PATH-INDEX. @@ -1388,55 +1391,54 @@ of the first `woman-cache-level' elements from the following list: ;; unnecessary. So let us assume that `woman-file-regexp' will ;; filter out any directories, which probably should not be there ;; anyway, i.e. it is a user error! - (mapcar - (lambda (file) - (cons - (file-name-sans-extension - (if (string-match woman-file-compression-regexp file) - (file-name-sans-extension file) - file)) - (if (> woman-cache-level 1) - (cons - path-index - (if (> woman-cache-level 2) - (cons file nil)))))) - (directory-files dir nil woman-file-regexp))) + ;; + ;; Don't sort files: we do that when merging, anyway. -- dak + (let (newlst (lst (directory-files dir nil woman-file-regexp t)) + ;; Make an explicit regexp for stripping extension and + ;; compression extension: file-name-sans-extension is a + ;; far too costly function. -- dak + (ext (format "\\(\\.[^.\\/]*\\)?\\(%s\\)?\\'" + woman-file-compression-regexp))) + ;; Use a loop instead of mapcar in order to avoid the speed + ;; penalty of binding function arguments. -- dak + (dolist (file lst newlst) + (push + (cons + (if (string-match ext file) + (substring file 0 (match-beginning 0)) + file) + (and (> woman-cache-level 1) + (cons + path-index + (and (> woman-cache-level 2) + (list file))))) + newlst)))) (defun woman-topic-all-completions-merge (alist) "Merge the alist ALIST so that the keys are unique. Also make each path-info component into a list. \(Note that this function changes the value of ALIST.)" - ;; Intended to be fast by avoiding recursion and list copying. - (if (> woman-cache-level 1) - (let ((newalist alist)) - (while newalist - (let ((tail newalist) (topic (car (car newalist)))) - ;; Make the path-info into a list: - (setcdr (car newalist) (list (cdr (car newalist)))) - (while tail - (while (and tail (not (string= topic (car (car (cdr tail)))))) - (setq tail (cdr tail))) - (if tail ; merge path-info into (car newalist) - (let ((path-info (cdr (car (cdr tail))))) - (if (member path-info (cdr (car newalist))) - () - ;; Make the path-info into a list: - (nconc (car newalist) (list path-info))) - (setcdr tail (cdr (cdr tail)))) - )) - (setq newalist (cdr newalist)))) - alist) + ;; Replaces unreadably "optimized" O(n^2) implementation. + ;; Instead we use sorting to merge stuff efficiently. -- dak + (let (elt newalist) + ;; Sort list into reverse order + (setq alist (sort alist (lambda(x y) (string< (car y) (car x))))) + ;; merge duplicate keys. + (if (> woman-cache-level 1) + (while alist + (setq elt (pop alist)) + (if (equal (car elt) (caar newalist)) + (unless (member (cdr elt) (cdar newalist)) + (setcdr (car newalist) (cons (cdr elt) + (cdar newalist)))) + (setcdr elt (list (cdr elt))) + (push elt newalist))) ;; woman-cache-level = 1 => elements are single-element lists ... - (while (and alist (member (car alist) (cdr alist))) - (setq alist (cdr alist))) - (if alist - (let ((newalist alist) cdr_alist) - (while (setq cdr_alist (cdr alist)) - (if (not (member (car cdr_alist) (cdr cdr_alist))) - (setq alist cdr_alist) - (setcdr alist (cdr cdr_alist))) - ) - newalist)))) + (while alist + (setq elt (pop alist)) + (unless (equal (car elt) (caar newalist)) + (push elt newalist)))) + newalist)) (defun woman-file-name-all-completions (topic) "Return an alist of the files in all man directories that match TOPIC." diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el index cdb0a63ace6..7d43a10556e 100644 --- a/lisp/x-dnd.el +++ b/lisp/x-dnd.el @@ -308,14 +308,13 @@ and must have the format file:file-name or file:///file-name. The last / in file:/// is part of the file name. ACTION is ignored." (let* ((f (x-dnd-get-local-file-name uri t))) - (when f - (if (file-readable-p f) - (progn - (if x-dnd-open-file-other-window - (find-file-other-window f) - (find-file f)) - 'private) - (error "Can not read %s (%s)" f uri))))) + (if (and f (file-readable-p f)) + (progn + (if x-dnd-open-file-other-window + (find-file-other-window f) + (find-file f)) + 'private) + (error "Can not read %s" uri)))) (defun x-dnd-open-file (uri action) "Open a local or remote file. @@ -327,7 +326,8 @@ The last / in file://hostname/ is part of the file name." ;; The hostname may be our hostname, in that case, convert to a local ;; file. Otherwise return nil. (let ((local-file (x-dnd-get-local-file-uri uri))) - (when local-file (x-dnd-open-local-file local-file action)))) + (if local-file (x-dnd-open-local-file local-file action) + (error "Remote files not supported")))) (defun x-dnd-handle-moz-url (window action data) diff --git a/lisp/xml.el b/lisp/xml.el index 408c13ab39b..03ef6346c70 100644 --- a/lisp/xml.el +++ b/lisp/xml.el @@ -27,13 +27,13 @@ ;; This file contains a somewhat incomplete non-validating XML parser. It ;; parses a file, and returns a list that can be used internally by -;; any other lisp libraries. +;; any other Lisp libraries. ;;; FILE FORMAT ;; The document type declaration may either be ignored or (optionally) ;; parsed, but currently the parsing will only accept element -;; declarations. The XML file is assumed to be well-formed. In case +;; declarations. The XML file is assumed to be well-formed. In case ;; of error, the parsing stops and the XML file is shown where the ;; parsing stopped. ;; @@ -44,7 +44,7 @@ ;; <node2 attr3="name3" attr4="name4">value2</node2> ;; <node3 attr5="name5" attr6="name6">value3</node3> ;; </node1> -;; Of course, the name of the nodes and attributes can be anything. There can +;; Of course, the name of the nodes and attributes can be anything. There can ;; be any number of attributes (or none), as well as any number of children ;; below the nodes. ;; @@ -86,7 +86,18 @@ (defsubst xml-node-name (node) "Return the tag associated with NODE. -The tag is a lower-case symbol." +Without namespace-aware parsing, the tag is a symbol. + +With namespace-aware parsing, the tag is a cons of a string +representing the uri of the namespace with the local name of the +tag. For example, + + <foo> + +would be represented by + + '(\"\" . \"foo\")." + (car node)) (defsubst xml-node-attributes (node) @@ -101,17 +112,17 @@ This is a list of nodes, and it can be nil." (defun xml-get-children (node child-name) "Return the children of NODE whose tag is CHILD-NAME. -CHILD-NAME should be a lower case symbol." +CHILD-NAME should match the value returned by `xml-node-name'." (let ((match ())) (dolist (child (xml-node-children node)) - (if child - (if (equal (xml-node-name child) child-name) - (push child match)))) + (if (and (listp child) + (equal (xml-node-name child) child-name)) + (push child match))) (nreverse match))) (defun xml-get-attribute-or-nil (node attribute) "Get from NODE the value of ATTRIBUTE. -Return `nil' if the attribute was not found. +Return nil if the attribute was not found. See also `xml-get-attribute'." (cdr (assoc attribute (xml-node-attributes node)))) @@ -236,7 +247,8 @@ If PARSE-NS is non-nil, then QNAMES are expanded." (nreverse xml))))))) (defun xml-maybe-do-ns (name default xml-ns) - "Perform any namespace expansion. NAME is the name to perform the expansion on. + "Perform any namespace expansion. +NAME is the name to perform the expansion on. DEFAULT is the default namespace. XML-NS is a cons of namespace names to uris. When namespace-aware parsing is off, then XML-NS is nil. @@ -325,10 +337,8 @@ Returns one of: (push (cons (cdar attr) (intern (concat ":" (cdr attr)))) xml-ns)))) - ;; expand element names - (setq node-name (list (xml-maybe-do-ns node-name "" xml-ns))) + (setq children (list attrs (xml-maybe-do-ns node-name "" xml-ns))) - (setq children (list attrs node-name)) ;; is this an empty element ? (if (looking-at "/>") (progn @@ -383,8 +393,8 @@ Returns one of: (error "XML: Invalid character"))))) (defun xml-parse-attlist (&optional xml-ns) - "Return the attribute-list after point. Leave point at the -first non-blank character after the tag." + "Return the attribute-list after point. +Leave point at the first non-blank character after the tag." (let ((attlist ()) end-pos name) (skip-syntax-forward " ") @@ -575,7 +585,7 @@ This follows the rule [28] in the XML specifications." ;; Fixme: Take declared entities from the DTD when they're available. (defun xml-substitute-entity (match) - "Subroutine of xml-substitute-special." + "Subroutine of `xml-substitute-special'." (save-match-data (let ((match1 (match-string 1 str))) (cond ((string= match1 "lt") "<") @@ -612,9 +622,15 @@ This follows the rule [28] in the XML specifications." ;;** ;;******************************************************************* -(defun xml-debug-print (xml) +(defun xml-debug-print (xml &optional indent-string) + "Outputs the XML in the current buffer. +XML can be a tree or a list of nodes. +The first line is indented with the optional INDENT-STRING." + (setq indent-string (or indent-string "")) (dolist (node xml) - (xml-debug-print-internal node ""))) + (xml-debug-print-internal node indent-string))) + +(defalias 'xml-print 'xml-debug-print) (defun xml-debug-print-internal (xml indent-string) "Outputs the XML tree in the current buffer. @@ -629,24 +645,28 @@ The first line is indented with INDENT-STRING." (insert ?\ (symbol-name (caar attlist)) "=\"" (cdar attlist) ?\") (setq attlist (cdr attlist))) - (insert ?>) - (setq tree (xml-node-children tree)) - ;; output the children - (dolist (node tree) - (cond - ((listp node) - (insert ?\n) - (xml-debug-print-internal node (concat indent-string " "))) - ((stringp node) (insert node)) - (t - (error "Invalid XML tree")))) - - (insert ?\n indent-string - ?< ?/ (symbol-name (xml-node-name xml)) ?>))) + (if (null tree) + (insert ?/ ?>) + (insert ?>) + + ;; output the children + (dolist (node tree) + (cond + ((listp node) + (insert ?\n) + (xml-debug-print-internal node (concat indent-string " "))) + ((stringp node) (insert node)) + (t + (error "Invalid XML tree")))) + + (when (not (and (null (cdr tree)) + (stringp (car tree)))) + (insert ?\n indent-string)) + (insert ?< ?/ (symbol-name (xml-node-name xml)) ?>)))) (provide 'xml) -;;; arch-tag: 5864b283-5a68-4b59-a20d-36a72b353b9b +;; arch-tag: 5864b283-5a68-4b59-a20d-36a72b353b9b ;;; xml.el ends here diff --git a/lispintro/ChangeLog b/lispintro/ChangeLog index 159bf98259e..728b4a3bb99 100644 --- a/lispintro/ChangeLog +++ b/lispintro/ChangeLog @@ -1,3 +1,7 @@ +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + 2004-02-29 Juanma Barranquero <lektu@terra.es> * makefile.w32-in (mostlyclean, clean, maintainer-clean): Use diff --git a/lispintro/Makefile.in b/lispintro/Makefile.in index 14c1b1c9ab9..88ac4975010 100644 --- a/lispintro/Makefile.in +++ b/lispintro/Makefile.in @@ -69,5 +69,3 @@ maintainer-clean: distclean # 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: - -# arch-tag: eb660994-cd29-4ab8-8043-5042e2dbde84 diff --git a/lispintro/makefile.w32-in b/lispintro/makefile.w32-in index 7af64075bc2..87a8597ccad 100644 --- a/lispintro/makefile.w32-in +++ b/lispintro/makefile.w32-in @@ -1,6 +1,6 @@ -#### Makefile for the Emacs Lisp Introduction manual +#### -*- Makefile -*- for the Emacs Lisp Introduction manual. -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -69,5 +69,3 @@ maintainer-clean: distclean # 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: - -# arch-tag: d713164a-e683-4ce3-a39e-3bf82f2f82f4 diff --git a/lispref/.arch-inventory b/lispref/.arch-inventory new file mode 100644 index 00000000000..2f5e6b9eea0 --- /dev/null +++ b/lispref/.arch-inventory @@ -0,0 +1,4 @@ +# Generated files +precious ^(config\.status|config\.cache)$ + +# arch-tag: dde817a2-94ff-4c6e-838c-bb5b33e7f0df diff --git a/lispref/ChangeLog b/lispref/ChangeLog index 6637064af48..c4c6b81e8ba 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog @@ -1,3 +1,93 @@ +2004-06-14 Juanma Barranquero <lektu@terra.es> + + * display.texi (Images): Document new delayed library loading, + variable `image-library-alist' and (existing but undocumented) + function `image-type-available-p'. + +2004-06-05 Richard M. Stallman <rms@gnu.org> + + * minibuf.texi (Minibuffer Completion): For INITIAL arg, + refer the user to the Initial Input node. + (Text from Minibuffer): Likewise. + (Initial Input): New node. Document this feature + and say it is mostly deprecated. + +2004-05-30 Richard M. Stallman <rms@gnu.org> + + * loading.texi (Named Features): Clarify return value + and meaning of NOERROR. + + * variables.texi (File Local Variables): Minor cleanup. + +2004-05-30 Michael Albinus <michael.albinus@gmx.de> + + * files.texi (Magic File Names): Add `file-remote-p' as operation + of file name handlers. + +2004-05-29 Richard M. Stallman <rms@gnu.org> + + * modes.texi (Minor Mode Conventions): (-) has no special meaning + as arg to a minor mode command. + +2004-05-22 Richard M. Stallman <rms@gnu.org> + + * syntax.texi (Syntax Class Table): Word syntax not just for English. + + * streams.texi (Output Variables): Doc float-output-format. + + * searching.texi (Regexp Special): Nested repetition can be infloop. + + * eval.texi (Eval): Increasing max-lisp-eval-depth can cause + real stack overflow. + + * compile.texi: Minor cleanups. + +2004-05-22 Luc Teirlinck <teirllm@dms.auburn.edu> + + * lists.texi (Cons Cells): Explain dotted lists, true lists, + circular lists. + (List Elements): Explain handling of circular and dotted lists. + +2004-05-19 Thien-Thi Nguyen <ttn@gnu.org> + + * modes.texi (Search-based Fontification): Fix typo. + +2004-05-10 Juanma Barranquero <lektu@terra.es> + + * modes.texi (Mode Line Variables): Fix description of + global-mode-string, which is now after which-func-mode, not the + buffer name. + +2004-05-07 Lars Hansen <larsh@math.ku.dk> + + * modes.texi (Desktop Save Mode): Add. + (Modes): Add menu entry Desktop Save Mode. + + * hooks.texi: Add desktop-after-read-hook, + desktop-no-desktop-file-hook and desktop-save-hook. + + * locals.texi: Add desktop-save-buffer. + +2004-04-30 Jesper Harder <harder@ifa.au.dk> + + * display.texi: emacs -> Emacs. + +2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> + + * files.texi (Changing Files): Document set-file-times. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-04-18 Jesper Harder <harder@ifa.au.dk> + + * tips.texi (Coding Conventions): defopt -> defcustom. + +2004-04-16 Luc Teirlinck <teirllm@auburn.edu> + + * sequences.texi: Various clarifications. + 2004-04-14 Luc Teirlinck <teirllm@auburn.edu> * buffers.texi (Read Only Buffers): Mention optional ARG to diff --git a/lispref/Makefile.in b/lispref/Makefile.in index 79be5fc39af..e9d99de7d6a 100644 --- a/lispref/Makefile.in +++ b/lispref/Makefile.in @@ -1,6 +1,6 @@ # Makefile for the GNU Emacs Lisp Reference Manual. -# Copyright (C) 1990,1991,1992,1993,1994,1995,1996,1998,1999,2000,2001,2003 +# Copyright (C) 1990,1991,1992,1993,1994,1995,1996,1998,1999,2000,2001,2003,2004 # Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -135,5 +135,3 @@ dist: elisp elisp.dvi (cd temp/$(manual); rm -f *~) (cd temp; tar chf - $(manual)) | gzip > $(manual).tar.gz -rm -rf temp - -# arch-tag: f5a1a94d-62e1-4460-a2d1-f02e538ab554 diff --git a/lispref/backups.texi b/lispref/backups.texi index 89edc6d99cf..d4ef8032ad9 100644 --- a/lispref/backups.texi +++ b/lispref/backups.texi @@ -712,6 +712,7 @@ reverts the file without asking the user for confirmation. Some major modes customize @code{revert-buffer} by making buffer-local bindings for these variables: +@anchor{Definition of revert-buffer-function} @defvar revert-buffer-function The value of this variable is the function to use to revert this buffer. If non-@code{nil}, it should be a function with two optional diff --git a/lispref/compile.texi b/lispref/compile.texi index a201a225379..6c28708bdf1 100644 --- a/lispref/compile.texi +++ b/lispref/compile.texi @@ -171,6 +171,10 @@ the actual byte-code; each character in it is an instruction or an operand of an instruction. The vector contains all the constants, variable names and function names used by the function, except for certain primitives that are coded as special instructions. + +If the argument to @code{byte-compile} is a @code{lambda} expression, +it returns the corresponding compiled code, but does not store +it anywhere. @end defun @deffn Command compile-defun &optional arg @@ -232,7 +236,8 @@ recompilation if a @samp{.elc} file exists but is older than the When a @samp{.el} file has no corresponding @samp{.elc} file, @var{flag} says what to do. If it is @code{nil}, this command ignores these files. If @var{flag} is 0, it compiles them. If it is neither -@code{nil} nor 0, it asks the user whether to compile each such file. +@code{nil} nor 0, it asks the user whether to compile each such file, +and asks about each subdirectory as well. Interactively, @code{byte-recompile-directory} prompts for @var{directory} and @var{flag} is the prefix argument. @@ -293,8 +298,8 @@ in the file. @item If you alter the compiled file (such as by compiling a new version), -then further access to documentation strings in this file will give -nonsense results. +then further access to documentation strings in this file will +probably give nonsense results. @end itemize If your site installs Emacs following the usual procedures, these @@ -365,8 +370,8 @@ longer load the remaining function definitions not already loaded. @item If you alter the compiled file (such as by compiling a new version), -then trying to load any function not already loaded will yield nonsense -results. +then trying to load any function not already loaded will usually yield +nonsense results. @end itemize These problems will never happen in normal circumstances with @@ -391,9 +396,10 @@ that are set up for dynamic function loading. @end defvar @defun fetch-bytecode function -This immediately finishes loading the definition of @var{function} from -its byte-compiled file, if it is not fully loaded already. The argument -@var{function} may be a byte-code function object or a function name. +If @var{function} is a byte-code function object, this immediately +finishes loading the byte code of @var{function} from its +byte-compiled file, if it is not fully loaded already. Otherwise, +it does nothing. It always returns @var{function}. @end defun @node Eval During Compile @@ -440,7 +446,7 @@ commands won't find the places they are really used. To do that, you must search for the function names. You can suppress the compiler warning for calling an undefined -function @var{func} by conditionalizing the function call on a +function @var{func} by conditionalizing the function call on an @code{fboundp} test, like this: @example @@ -468,14 +474,17 @@ The reference to @var{variable} must be in the @var{then-form} of the You can suppress any compiler warnings using the construct @code{with-no-warnings}: -@defmac with-no-warnings body... +@c This is implemented with a defun, but conceptually it is +@c a special form. + +@defspec with-no-warnings body... In execution, this is equivalent to @code{(progn @var{body}...)}, but the compiler does not issue warnings for anything that occurs inside @var{body}. We recommend that you use this construct around the smallest possible piece of code. -@end defmac +@end defspec @node Byte-Code Objects @section Byte-Code Function Objects @@ -578,7 +587,8 @@ name of an existing buffer. Then the output goes there, at point, and point is left before the output. The argument @var{object} can be a function name, a lambda expression -or a byte-code object. +or a byte-code object. If it is a lambda expression, @code{disassemble} +compiles it and disassembles the resulting compiled code. @end deffn Here are two examples of using the @code{disassemble} function. We diff --git a/lispref/display.texi b/lispref/display.texi index 87ab5aabb2c..1f8868981b7 100644 --- a/lispref/display.texi +++ b/lispref/display.texi @@ -2288,10 +2288,8 @@ same attributes for display. @end defun @defun face-differs-from-default-p face &optional frame -This returns @code{t} if the face @var{face} displays differently from -the default face. A face is considered to be ``the same'' as the -default face if each attribute is either the same as that of the default -face, or unspecified (meaning to inherit from the default). +This returns non-@code{nil} if the face @var{face} displays +differently from the default face. @end defun @node Auto Faces @@ -2877,8 +2875,13 @@ property of text that is displayed (@pxref{Display Property}). Like the @code{display} property, this feature is available starting in Emacs 21. Emacs can display a number of different image formats; some of them -are supported only if particular support libraries are installed on your -machine. The supported image formats include XBM, XPM (needing the +are supported only if particular support libraries are installed on +your machine. In some environments, Emacs allows loading image +libraries on demand; if so, the variable @code{image-library-alist} +can be used to modify the set of known names for these dynamic +libraries (though it is not posible to add new image formats). + + The supported image formats include XBM, XPM (needing the libraries @code{libXpm} version 3.4k and @code{libz}), GIF (needing @code{libungif} 4.1.0), Postscript, PBM, JPEG (needing the @code{libjpeg} library version v6a), TIFF (needing @code{libtiff} v3.4), @@ -2889,10 +2892,48 @@ type symbols are @code{xbm}, @code{xpm}, @code{gif}, @code{postscript}, @code{pbm}, @code{jpeg}, @code{tiff}, and @code{png}. @defvar image-types +@vindex image-types This variable contains a list of those image type symbols that are -supported in the current configuration. +potentially supported in the current configuration. +@emph{Potentially} here means that Emacs knows about the image types, +not necessarily that they can be loaded (they could depend on +unavailable dynamic libraries, for example). + +To know which image types are really available, use +@code{image-type-available-p}. @end defvar +@defvar image-library-alist +@vindex image-library-alist +This in an alist of image types vs external libraries needed to +display them. + +Each element is a list @code{(@var{IMAGE-TYPE} @var{LIBRARY}...)}, +where the car is a supported image format from @code{image-types}, and +the rest are strings giving alternate filenames for the corresponding +external libraries to load. + +They are tried in the order they appear on the list; if none of them +can be loaded, the running session of Emacs won't support the image +type. No entries are needed for @code{pbm} and @code{xbm} images; +they're always supported. + +This variable is ignored if the image libraries are statically linked +into Emacs. +@end defvar + +@defun image-type-available-p type +@findex image-type-available-p + +This function returns non-nil if image type TYPE is available, i.e., +if images of this type can be loaded and displayed in Emacs. TYPE +should be one of the types contained in @code{image-types}. + +For image types whose support libraries are statically linked, this +function always returns @code{t}; for other image types, it returns +@code{t} if the dynamic library could be loaded, @code{nil} otherwise. +@end defun + @menu * Image Descriptors:: How to specify an image for use in @code{:display}. * XBM Images:: Special features for XBM format. @@ -3156,7 +3197,7 @@ specifies the actual color to use for displaying that name. For GIF images, specify image type @code{gif}. Because of the patents in the US covering the LZW algorithm, the continued use of GIF format is a problem for the whole Internet; to end this problem, it is a good idea -for everyone, even outside the US, to stop using GIFS right away +for everyone, even outside the US, to stop using GIFs right away (@uref{http://www.burnallgifs.org/}). But if you still want to use them, Emacs can display them. @@ -3433,7 +3474,7 @@ buttons in Emacs buffers, such as might be used for help hyper-links, etc. Emacs uses buttons for the hyper-links in help text and the like. A button is essentially a set of properties attached (via text -properties or overlays) to a region of text in an emacs buffer, which +properties or overlays) to a region of text in an Emacs buffer, which are called its button properties. @xref{Button Properties}. One of the these properties (@code{action}) is a function, which will @@ -3441,7 +3482,7 @@ be called when the user invokes it using the keyboard or the mouse. The invoked function may then examine the button and use its other properties as desired. -In some ways the emacs button package duplicates functionality offered +In some ways the Emacs button package duplicates functionality offered by the widget package (@pxref{Top, , Introduction, widget, The Emacs Widget Library}), but the button package has the advantage that it is much faster, much smaller, and much simpler to use (for elisp @@ -3454,7 +3495,7 @@ entries). @menu * Button Properties:: Button properties with special meanings. * Button Types:: Defining common properties for classes of buttons. -* Making Buttons:: Adding buttons to emacs buffers. +* Making Buttons:: Adding buttons to Emacs buffers. * Manipulating Buttons:: Getting and setting properties of buttons. * Button Buffer Commands:: Buffer-wide commands and bindings for buttons. * Manipulating Button Types:: @@ -3488,14 +3529,14 @@ present, mouse-clicks use @code{action} instead. @item face @kindex face @r{(button property)} -This is an emacs face controlling how buttons of this type are +This is an Emacs face controlling how buttons of this type are displayed; by default this is the @code{button} face. @item mouse-face @kindex mouse-face @r{(button property)} This is an additional face which controls appearance during mouse-overs (merged with the usual button face); by default this is -the usual emacs @code{highlight} face. +the usual Emacs @code{highlight} face. @item keymap @kindex keymap @r{(button property)} @@ -3512,7 +3553,7 @@ usually specified using the @code{:type} keyword argument. @item help-echo @kindex help-index @r{(button property)} -A string displayed by the emacs tool-tip help system; by default, +A string displayed by the Emacs tool-tip help system; by default, @code{"mouse-2, RET: Push this button"}. @item button @@ -3562,7 +3603,7 @@ doing so usually makes the resulting code clearer and more efficient. Buttons are associated with a region of text, using an overlay or text-properties to hold button-specific information, all of which are initialized from the button's type (which defaults to the built-in -button type @code{button}). Like all emacs text, the appearance of +button type @code{button}). Like all Emacs text, the appearance of the button is governed by the @code{face} property; by default (via the @code{face} property inherited from the @code{button} button-type) this is a simple underline, like a typical web-page link. @@ -3594,7 +3635,7 @@ Make a button from @var{beg} to @var{end} in the current buffer. Insert a button with the label @var{label}. @end defun -The following functions are similar, but use emacs text-properties +The following functions are similar, but use Emacs text-properties (@pxref{Text Properties}) to hold the button properties, making the button actually part of the text instead of being a property of the buffer (using text-properties is usually faster than using overlays, @@ -3683,7 +3724,7 @@ Return the button at position @var{pos} in the current buffer, or @code{nil}. @cindex button buffer commands These are commands and functions for locating and operating on -buttons in an emacs buffer. +buttons in an Emacs buffer. @code{push-button} is the command that a user uses to actually `push' a button, and is bound by default in the button itself to @key{RET} diff --git a/lispref/elisp-covers.texi b/lispref/elisp-covers.texi deleted file mode 100644 index 66c3a3b3e6b..00000000000 --- a/lispref/elisp-covers.texi +++ /dev/null @@ -1,252 +0,0 @@ -\input texinfo @c -*-texinfo-*- -@comment %**start of header -@setfilename covers.info -@settitle GNU Emacs Lisp Reference Manual -@comment %**end of header - -@titlepage -@c ================ Volume 1 ================ -@w{ } -@sp 2 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 1} -@sp 2 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - -@page -@c ================ Volume 2 ================ -@w{ } -@sp 5 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 2} -@sp 2 -@center by Bil Lewis, -@center Dan LaLiberte, and -@center the GNU Manual Group - -@page -@c ================ Volume 1 with baseline skip 16pt ================ - -@tex -\global\baselineskip = 16pt -@end tex - -16 pts baseline skip: - -@w{ } -@sp 2 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 1} -@sp 2 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - -@page -@c ================ Volume 1 with baseline skip 18pt ================ - -@tex -\global\baselineskip = 18pt -@end tex - -18 pts baseline skip, with 15pts between sections - -@w{ } -@sp 2 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@tex -\global\baselineskip = 15pt -@end tex - -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 1} -@sp 2 -@center by Bil Lewis, -@center Dan LaLiberte, and -@center the GNU Manual Group - -@page -@c ================ Volume 1 with more baseline skip 24 pts ================ - -@tex -\global\baselineskip = 24pt -@end tex - -24 pts baseline skip: - -@w{ } -@sp 2 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 1} -@sp 2 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - -@page -@c ================ Volume 2 with more baseline skip 18 pts ================ - -@tex -\global\baselineskip = 18pt -@end tex - -18 pts baseline skip: - -@w{ } -@sp 5 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 2} -@sp 2 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - -@page -@c ================ Volume 2 with more baseline skip 24 pts ================ - -@tex -\global\baselineskip = 24pt -@end tex - -24 pts baseline skip: - -@w{ } -@sp 5 -@center @titlefont{The} -@sp 1 -@center @titlefont{GNU} -@sp 1 -@center @titlefont{Emacs Lisp} -@sp 1 -@center @titlefont{Reference} -@sp 1 -@center @titlefont{Manual} -@sp 2 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 2 -@center @titlefont{Volume 2} -@sp 2 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - - -@page -@c ================ Spine 1 ================ - -@w{@titlefont{The GNU Emacs Lisp Reference Manual --- Vol. 1}} -@sp 4 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 4 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - -@sp 4 -@author The GNU Emacs Lisp Reference Manual --- Vol. 1 -@sp 3 -@author FSF - -@author - -@page -@c ================ Spine 2 ================ - -@w{@titlefont{The GNU Emacs Lisp Reference Manual --- Vol. 2}} -@sp 4 -@center GNU Emacs Version 19 -@center for Unix Users -@center Edition 2.3, June 1994 -@sp 4 -@center by Bil Lewis, Dan LaLiberte, -@center and the GNU Manual Group - - -@sp 4 -@author The GNU Emacs Lisp Reference Manual --- Vol. 2 -@sp 3 -@author FSF - -@end titlepage -@bye - -@ignore - arch-tag: 02d65d63-3b64-49bc-a5c0-bfd5eabb6c98 -@end ignore diff --git a/lispref/eval.texi b/lispref/eval.texi index 7d1ebb9d307..3c8a7a5e8a3 100644 --- a/lispref/eval.texi +++ b/lispref/eval.texi @@ -678,9 +678,12 @@ output of the output functions is printed in the echo area. @defvar max-lisp-eval-depth This variable defines the maximum depth allowed in calls to @code{eval}, @code{apply}, and @code{funcall} before an error is signaled (with error -message @code{"Lisp nesting exceeds max-lisp-eval-depth"}). This limit, -with the associated error when it is exceeded, is one way that Lisp -avoids infinite recursion on an ill-defined function. +message @code{"Lisp nesting exceeds max-lisp-eval-depth"}). + +This limit, with the associated error when it is exceeded, is one way +Emacs Lisp avoids infinite recursion on an ill-defined function. If +you increase the value of @code{max-lisp-eval-depth} too much, such +code can cause stack overflow instead. @cindex Lisp nesting error The depth limit counts internal uses of @code{eval}, @code{apply}, and diff --git a/lispref/files.texi b/lispref/files.texi index 045b5741108..aa5b0c397b1 100644 --- a/lispref/files.texi +++ b/lispref/files.texi @@ -1445,6 +1445,14 @@ the default file protection has no effect. This function returns the current default protection value. @end defun +@defun set-file-times filename &optional time +This function sets the access and modification times of @var{filename} +to @var{time}. The return value is @code{t} if the times are successfully +set, otherwise it is @code{nil}. @var{time} defaults to the current +time and must be in the format returned by @code{current-time} +(@pxref{Time of Day}). +@end defun + @cindex MS-DOS and file modes @cindex file modes and MS-DOS On MS-DOS, there is no such thing as an ``executable'' file mode bit. @@ -2485,7 +2493,7 @@ Here are the operations that a magic file name handler gets to handle: @code{file-attributes}, @code{file-directory-p}, @code{file-executable-p}, @code{file-exists-p}, -@code{file-local-copy}, +@code{file-local-copy}, @code{file-remote-p}, @code{file-modes}, @code{file-name-all-completions}, @code{file-name-as-directory}, @code{file-name-completion}, @@ -2503,7 +2511,7 @@ Here are the operations that a magic file name handler gets to handle: @code{load}, @code{make-directory}, @code{make-directory-internal}, @code{make-symbolic-link},@* -@code{rename-file}, @code{set-file-modes}, +@code{rename-file}, @code{set-file-modes}, @code{set-file-times}, @code{set-visited-file-modtime}, @code{shell-command}, @code{substitute-in-file-name},@* @code{unhandled-file-name-directory}, @@ -2529,7 +2537,7 @@ Here are the operations that a magic file name handler gets to handle: @code{file-attributes}, @code{file-direct@discretionary{}{}{}ory-p}, @code{file-executable-p}, @code{file-exists-p}, -@code{file-local-copy}, +@code{file-local-copy}, @code{file-remote-p}, @code{file-modes}, @code{file-name-all-completions}, @code{file-name-as-directory}, @code{file-name-completion}, @@ -2637,8 +2645,7 @@ of the local copy file. @end defun @defun file-remote-p filename -This function returns @code{t} if @var{filename} is a remote file---that is, -a magic file name that handles @code{file-local-copy}. +This function returns @code{t} if @var{filename} is a remote file. @end defun @defun unhandled-file-name-directory filename diff --git a/lispref/hooks.texi b/lispref/hooks.texi index bc90c8773c2..5c424bd8de2 100644 --- a/lispref/hooks.texi +++ b/lispref/hooks.texi @@ -58,6 +58,9 @@ however, we have renamed all of those.) @item comment-indent-function @item custom-define-hook @item deactivate-mark-hook +@item desktop-after-read-hook +@item desktop-no-desktop-file-hook +@item desktop-save-hook @item diary-display-hook @item diary-hook @item dired-mode-hook diff --git a/lispref/keymaps.texi b/lispref/keymaps.texi index 9b2df2b2045..ee50855bef3 100644 --- a/lispref/keymaps.texi +++ b/lispref/keymaps.texi @@ -1864,7 +1864,7 @@ function should return the binding to use instead. @cindex menu separators A menu separator is a kind of menu item that doesn't display any -text--instead, it divides the menu into subparts with a horizontal line. +text---instead, it divides the menu into subparts with a horizontal line. A separator looks like this in the menu keymap: @example diff --git a/lispref/lists.texi b/lispref/lists.texi index 41b3918de06..2aa3c40b0e5 100644 --- a/lispref/lists.texi +++ b/lispref/lists.texi @@ -51,16 +51,37 @@ the @sc{car} and the @sc{cdr} is entirely a matter of convention; at the level of cons cells, the @sc{car} and @sc{cdr} slots have the same characteristics. +@cindex true list + Since @code{nil} is the conventional value to put in the @sc{cdr} of +the last cons cell in the list, we call that case a @dfn{true list}. + + In Lisp, we consider the symbol @code{nil} a list as well as a +symbol; it is the list with no elements. For convenience, the symbol +@code{nil} is considered to have @code{nil} as its @sc{cdr} (and also +as its @sc{car}). Therefore, the @sc{cdr} of a true list is always a +true list. + +@cindex dotted list +@cindex circular list + If the @sc{cdr} of a list's last cons cell is some other value, +neither @code{nil} nor another cons cell, we call the structure a +@dfn{dotted list}, since its printed representation would use +@samp{.}. There is one other possibility: some cons cell's @sc{cdr} +could point to one of the previous cons cells in the list. We call +that structure a @dfn{circular list}. + + For some purposes, it does not matter whether a list is true, +circular or dotted. If the program doesn't look far enough down the +list to see the @sc{cdr} of the final cons cell, it won't care. +However, some functions that operate on lists demand true lists and +signal errors if given a dotted list. Most functions that try to find +the end of a list enter infinite loops if given a circular list. + @cindex list structure Because most cons cells are used as part of lists, the phrase @dfn{list structure} has come to mean any structure made out of cons cells. - The symbol @code{nil} is considered a list as well as a symbol; it is -the list with no elements. For convenience, the symbol @code{nil} is -considered to have @code{nil} as its @sc{cdr} (and also as its -@sc{car}). - The @sc{cdr} of any nonempty list @var{l} is a list containing all the elements of @var{l} except the first. @@ -327,6 +348,7 @@ x @end example @end defmac +@anchor{Definition of nth} @defun nth n list This function returns the @var{n}th element of @var{list}. Elements are numbered starting with zero, so the @sc{car} of @var{list} is @@ -391,13 +413,15 @@ this link is the list's last element. If @var{list} is null, if @var{n} is bigger than @var{list}'s length. @end defun +@anchor{Definition of safe-length} @defun safe-length list -This function returns the length of @var{list}, with no risk -of either an error or an infinite loop. +This function returns the length of @var{list}, with no risk of either +an error or an infinite loop. It generally returns the number of +distinct cons cells in the list. However, for circular lists, +the value is just an upper bound; it is often too large. -If @var{list} is not really a list, @code{safe-length} returns 0. If -@var{list} is circular, it returns a finite value which is at least the -number of distinct elements. +If @var{list} is not @code{nil} or a cons cell, @code{safe-length} +returns 0. @end defun The most common way to compute the length of a list, when you are not @@ -565,7 +589,7 @@ object. The final argument is not copied or converted; it becomes the @sc{cdr} of the last cons cell in the new list. If the final argument is itself a list, then its elements become in effect elements of the result list. If the final element is not a list, the result is a -``dotted list'' since its final @sc{cdr} is not @code{nil} as required +dotted list since its final @sc{cdr} is not @code{nil} as required in a true list. In Emacs 20 and before, the @code{append} function also allowed @@ -708,7 +732,7 @@ x @end defun @defun copy-tree tree &optional vecp -This function returns a copy the tree @code{tree}. If @var{tree} is a +This function returns a copy of the tree @code{tree}. If @var{tree} is a cons cell, this makes a new cons cell with the same @sc{car} and @sc{cdr}, then recursively copies the @sc{car} and @sc{cdr} in the same way. @@ -732,7 +756,7 @@ All arguments can be integers or floating point numbers. However, floating point arguments can be tricky, because floating point arithmetic is inexact. For instance, depending on the machine, it may quite well happen that @code{(number-sequence 0.4 0.6 0.2)} returns -the one element list @code{(0.4)}, whereas +the one element list @code{(0.4)}, whereas @code{(number-sequence 0.4 0.8 0.2)} returns a list with three elements. The @var{n}th element of the list is computed by the exact formula @code{(+ @var{from} (* @var{n} @var{separation}))}. Thus, if diff --git a/lispref/loading.texi b/lispref/loading.texi index 893b41d2e51..4d13e48def5 100644 --- a/lispref/loading.texi +++ b/lispref/loading.texi @@ -687,9 +687,14 @@ However, in this case, @code{require} insists on finding @var{feature} with an added suffix; a file whose name is just @var{feature} won't be used. -If loading the file fails to provide @var{feature}, @code{require} -signals an error, @samp{Required feature @var{feature} was not -provided}, unless @var{noerror} is non-@code{nil}. +If @var{noerror} is non-@code{nil}, that suppresses errors from actual +loading of the file. In that case, @code{require} returns @code{nil} +if loading the file fails. Normally, @code{require} returns +@var{feature}. + +If loading the file succeeds but does not provide @var{feature}, +@code{require} signals an error, @samp{Required feature @var{feature} +was not provided}. @end defun @defun featurep feature &optional subfeature diff --git a/lispref/locals.texi b/lispref/locals.texi index 8c9034007bd..a6c7f04301e 100644 --- a/lispref/locals.texi +++ b/lispref/locals.texi @@ -84,6 +84,9 @@ use, but we don't try to list them all here. @item defun-prompt-regexp @xref{List Motion}. +@item desktop-save-buffer +@xref{Desktop Save Mode}. + @item enable-multibyte-characters @ref{Non-ASCII Characters}. diff --git a/lispref/makefile.w32-in b/lispref/makefile.w32-in new file mode 100644 index 00000000000..31be34100cc --- /dev/null +++ b/lispref/makefile.w32-in @@ -0,0 +1,121 @@ +# -*- Makefile -*- for the GNU Emacs Lisp Reference Manual. + +# Copyright (C) 2003, 2004 +# Free Software Foundation, Inc. + +# This file is part of GNU Emacs. + +# GNU Emacs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Standard configure variables. +srcdir = . + +infodir = $(srcdir)/../info + +# Redefine `TEX' if `tex' does not invoke plain TeX. For example: +# TEX=platex +TEX=tex +INSTALL_INFO = install-info +MAKEINFO = makeinfo + +# The environment variable and its value to add $(srcdir) to the path +# searched for TeX input files. +texinputdir = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" /C + +# The name of the manual: +VERSION=2.9 +manual = elisp-manual-21-$(VERSION) + +# List of all the texinfo files in the manual: + +srcs = \ + $(srcdir)/abbrevs.texi \ + $(srcdir)/advice.texi \ + $(srcdir)/anti.texi \ + $(srcdir)/back.texi \ + $(srcdir)/backups.texi \ + $(srcdir)/buffers.texi \ + $(srcdir)/calendar.texi \ + $(srcdir)/commands.texi \ + $(srcdir)/compile.texi \ + $(srcdir)/control.texi \ + $(srcdir)/customize.texi \ + $(srcdir)/debugging.texi \ + $(srcdir)/display.texi \ + $(srcdir)/edebug.texi \ + $(srcdir)/elisp.texi \ + $(srcdir)/errors.texi \ + $(srcdir)/eval.texi \ + $(srcdir)/files.texi \ + $(srcdir)/frames.texi \ + $(srcdir)/functions.texi \ + $(srcdir)/hash.texi \ + $(srcdir)/help.texi \ + $(srcdir)/hooks.texi \ + $(srcdir)/internals.texi \ + $(srcdir)/intro.texi \ + $(srcdir)/keymaps.texi \ + $(srcdir)/lists.texi \ + $(srcdir)/loading.texi \ + $(srcdir)/locals.texi \ + $(srcdir)/macros.texi \ + $(srcdir)/maps.texi \ + $(srcdir)/markers.texi \ + $(srcdir)/minibuf.texi \ + $(srcdir)/modes.texi \ + $(srcdir)/nonascii.texi \ + $(srcdir)/numbers.texi \ + $(srcdir)/objects.texi \ + $(srcdir)/os.texi \ + $(srcdir)/positions.texi \ + $(srcdir)/processes.texi \ + $(srcdir)/searching.texi \ + $(srcdir)/sequences.texi \ + $(srcdir)/streams.texi \ + $(srcdir)/strings.texi \ + $(srcdir)/symbols.texi \ + $(srcdir)/syntax.texi \ + $(srcdir)/text.texi \ + $(srcdir)/tips.texi \ + $(srcdir)/variables.texi \ + $(srcdir)/windows.texi \ + $(srcdir)/index.texi \ + $(srcdir)/gpl.texi \ + $(srcdir)/doclicense.texi + + +.PHONY: clean + +# The info file is named `elisp'. +info: $(infodir)/elisp + $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/elisp + +$(infodir)/elisp: $(srcs) + $(MAKEINFO) -I. -I$(srcdir) $(srcdir)/elisp.texi -o $(infodir)/elisp + +elisp.dvi: $(srcs) + $(texinputdir) $(TEX) $(srcdir)/elisp.texi + +clean: + - $(DEL) *.toc *.aux *.log *.cp *.cps *.fn *.fns *.tp *.tps \ + *.vr *.vrs *.pg *.pgs *.ky *.kys + - $(DEL) make.out core + - $(DEL) $(infodir)/elisp* + +distclean: clean + +maintainer-clean: clean + - $(DEL) elisp elisp-* elisp.dvi elisp.oaux diff --git a/lispref/minibuf.texi b/lispref/minibuf.texi index 0c56f9d4622..a2695eab6b9 100644 --- a/lispref/minibuf.texi +++ b/lispref/minibuf.texi @@ -23,6 +23,7 @@ for reading an argument. * Object from Minibuffer:: How to read a Lisp object or expression. * Minibuffer History:: Recording previous minibuffer inputs so the user can reuse them. +* Initial Input:: Specifying initial contents for the minibuffer. * Completion:: How to invoke and customize completion. * Yes-or-No Queries:: Asking a question with a simple answer. * Multiple Queries:: Asking a series of similar questions. @@ -168,25 +169,9 @@ the setting of @code{enable-multibyte-characters} (@pxref{Text Representations}) from whichever buffer was current before entering the minibuffer. -If @var{initial-contents} is a string, @code{read-from-minibuffer} -inserts it into the minibuffer, leaving point at the end, before the -user starts to edit the text. The minibuffer appears with this text as -its initial contents. - -Alternatively, @var{initial-contents} can be a cons cell of the form -@code{(@var{string} . @var{position})}. This means to insert -@var{string} in the minibuffer but put point at @emph{one-indexed} -@var{position} in the minibuffer, rather than at the end. Any integer -value less or equal to one puts point at the beginning of the string. - -@strong{Usage note:} The @var{initial-contents} argument and the -@var{default} argument are two alternative features for more or less the -same job. It does not make sense to use both features in a single call -to @code{read-from-minibuffer}. In general, we recommend using -@var{default}, since this permits the user to insert the default value -when it is wanted, but does not burden the user with deleting it from -the minibuffer on other occasions. For an exception to this rule, -see @ref{Minibuffer History}. +Use of @var{initial-contents} is mostly deprecated; we recommend using +a non-@code{nil} value only in conjunction with specifying a cons cell +for @var{hist}. @xref{Initial Input}. @end defun @defun read-string prompt &optional initial history default inherit-input-method @@ -440,9 +425,11 @@ symbol @var{variable}. @code{previous-history-element} will display the most recent element of the history list in the minibuffer. If you specify a positive @var{startpos}, the minibuffer history functions behave as if @code{(elt @var{variable} (1- @var{STARTPOS}))} were the -history element currently shown in the minibuffer. For consistency, -you should also specify that element of the history as the initial -minibuffer contents. +history element currently shown in the minibuffer. + +For consistency, you should also specify that element of the history +as the initial minibuffer contents, using the @var{initial} argument +to the minibuffer input function (@pxref{Initial Input}). @end table If you don't specify @var{hist}, then the default history list @@ -506,6 +493,45 @@ A history list for arguments that are shell commands. A history list for arguments that are Lisp expressions to evaluate. @end defvar +@node Initial Input +@section Initial Input + +Several of the functions for minibuffer input have an argument called +@var{initial} or @var{initial-contents}. This is a mostly-deprecated +feature for specifiying that the minibuffer should start out with +certain text, instead of empty as usual. + +If @var{initial} is a string, the minibuffer starts out containing the +text of the string, with point at the end, when the user starts to +edit the text. If the user simply types @key{RET} to exit the +minibuffer, it will use the initial input string to determine the +value to return. + +@strong{We discourage use of a non-@code{nil} value for +@var{initial}}, because initial input is an intrusive interface. +History lists and default values provide a much more convenient method +to offer useful default inputs to the user. + +There is just one situation where you should specify a string for an +@var{initial} argument. This is when you specify a cons cell for the +@var{hist} or @var{history} argument. @xref{Minibuffer History}. + +@var{initial} can also be a cons cell of the form @code{(@var{string} +. @var{position})}. This means to insert @var{string} in the +minibuffer but put point at @var{position} within the string's text. + +As a historical accident, @var{position} was implemented +inconsistently in different functions. In @code{completing-read}, +@var{position}'s value is interpreted as origin-zero; that is, a value +of 0 means the beginning of the string, 1 means after the first +character, etc. In @code{read-minibuffer}, and the other +non-completion minibuffer input functions that support this argument, +1 means the beginning of the string 2 means after the first character, +etc. + +Use of a cons cell as the value for @var{initial} arguments is +deprecated in user code. + @node Completion @section Completion @cindex completion @@ -797,22 +823,10 @@ The argument @var{hist} specifies which history list variable to use for saving the input and for minibuffer history commands. It defaults to @code{minibuffer-history}. @xref{Minibuffer History}. -If @var{initial} is non-@code{nil}, @code{completing-read} inserts it -into the minibuffer as part of the input, with point at the end. Then -it allows the user to edit the input, providing several commands to -attempt completion. @var{initial} can also be a cons cell of the form -@code{(@var{string} . @var{position})}. In that case, point is put at -@emph{zero-indexed} position @var{position} in @var{string}. Note -that this is different from @code{read-from-minibuffer} and related -functions, which use a one-indexed position. In most cases, we -recommend using @var{default}, and not @var{initial}. - -@strong{We discourage use of a non-@code{nil} value for -@var{initial}}, because it is an intrusive interface. The history -list feature (which did not exist when we introduced @var{initial}) -offers a far more convenient and general way for the user to get the -default and edit it, and it is always available. For an exception to -this rule, see @ref{Minibuffer History}. +The argument @var{initial} is mostly deprecated; we recommend using a +non-@code{nil} value only in conjunction with specifying a cons cell +for @var{hist}. @xref{Initial Input}. For default input, use +@var{default} instead. If the argument @var{inherit-input-method} is non-@code{nil}, then the minibuffer inherits the current input method (@pxref{Input diff --git a/lispref/modes.texi b/lispref/modes.texi index 4b879cf476a..040c229bb00 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -26,6 +26,8 @@ user. For related topics such as keymaps and syntax tables, see * Imenu:: How a mode can provide a menu of definitions in the buffer. * Font Lock Mode:: How modes can highlight text according to syntax. +* Desktop Save Mode:: How modes can have buffer state saved between + Emacs sessions. * Hooks:: How to use hooks; how to write code that provides hooks. @end menu @@ -877,8 +879,9 @@ The command should accept one optional argument. If the argument is off if it is on). It should turn the mode on if the argument is a positive integer, the symbol @code{t}, or a list whose @sc{car} is one of those. It should turn the mode off if the argument is a negative -integer or zero, the symbol @code{-}, or a list whose @sc{car} is one -of those. The meaning of other arguments is not specified. +integer or zero, the symbol @code{-}, or a list whose @sc{car} is a +negative integer or zero. The meaning of other arguments is not +specified. Here is an example taken from the definition of @code{transient-mark-mode}. It shows the use of @code{transient-mark-mode} as a variable that enables or @@ -1452,11 +1455,12 @@ enabled separately in each buffer. @end defvar @defvar global-mode-string -This variable holds a mode-line spec that appears in the mode line by -default, just after the buffer name. The command @code{display-time} +This variable holds a mode-line spec that, by default, appears in the +mode line just after the @code{which-func-mode} minor mode if set, +else after @code{mode-line-modes}. The command @code{display-time} sets @code{global-mode-string} to refer to the variable -@code{display-time-string}, which holds a string containing the time and -load information. +@code{display-time-string}, which holds a string containing the time +and load information. The @samp{%M} construct substitutes the value of @code{global-mode-string}, but that is obsolete, since the variable is @@ -1998,7 +2002,7 @@ Find text by calling @var{function}, and highlight the matches it finds using @code{font-lock-keyword-face}. When @var{function} is called, it receives one argument, the limit of -the search; it should searching at point, and not search beyond the +the search; it should begin searching at point, and not search beyond the limit. It should return non-@code{nil} if it succeeds, and set the match data to describe the match that was found. Returning @code{nil} indicates failure of the search. @@ -2426,6 +2430,59 @@ strings. @end defvar +@node Desktop Save Mode +@section Desktop Save Mode +@cindex desktop save mode + +@dfn{Desktop Save Mode} is a feature to save the state of Emacs from +one session to another. The user-level commands for using Desktop +Save Mode are described in the GNU Emacs Manual (@pxref{Saving Emacs +Sessions,,, emacs, the GNU Emacs Manual}). Modes whose buffers visit +a file, don't have to do anything to use this feature. + +For buffers not visiting a file to have their state saved, the major +mode must bind the buffer local variable @code{desktop-save-buffer} to +a non-nil value. + +@defvar desktop-save-buffer +If this buffer-local variable is non-@code{nil}, the buffer will have +its state saved in the desktop file at desktop save. If the value is +a function, it is called at desktop save with argument +@var{desktop-dirname}, and its value is saved in the desktop file along +with the state of the buffer for which it was called. When file names +are returned as part of the auxiliary information, they should be +formatted using the call + +@example +(desktop-file-name @var{file-name} @var{desktop-dirname}) +@end example + +@end defvar + +For buffers not visiting a file to be restored, the major mode must +define a function to do the job, and that function must be listed in +the alist @code{desktop-buffer-mode-handlers}. + +@defvar desktop-buffer-mode-handlers +Alist with elements + +@example +(@var{major-mode} . @var{restore-buffer-function}) +@end example + +The function @var{restore-buffer-function} will be called with +argument list + +@example +(@var{buffer-file-name} @var{buffer-name} @var{desktop-buffer-misc}) +@end example + +and it should return the restored buffer. +Here @var{desktop-buffer-misc} is the value returned by the function +optionally bound to @code{desktop-save-buffer}. + +@end defvar + @node Hooks @section Hooks @cindex hooks diff --git a/lispref/processes.texi b/lispref/processes.texi index 27721efee45..a4166ee29a0 100644 --- a/lispref/processes.texi +++ b/lispref/processes.texi @@ -933,7 +933,7 @@ primitive that waits. streams of the subprocess, because Emacs normally spawns the subprocess inside a pseudo-TTY, and a pseudo-TTY has only one output channel. If you want to keep the output to those streams separate, you should -redirect one of them to a file--for example, by using an appropriate +redirect one of them to a file---for example, by using an appropriate shell command. @menu diff --git a/lispref/searching.texi b/lispref/searching.texi index 9e26363a43a..d18587ccecb 100644 --- a/lispref/searching.texi +++ b/lispref/searching.texi @@ -244,13 +244,15 @@ first tries to match all three @samp{a}s; but the rest of the pattern is The next alternative is for @samp{a*} to match only two @samp{a}s. With this choice, the rest of the regexp matches successfully.@refill -Nested repetition operators can be extremely slow if they specify -backtracking loops. For example, it could take hours for the regular -expression @samp{\(x+y*\)*a} to try to match the sequence -@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, before it ultimately fails. -The slowness is because Emacs must try each imaginable way of grouping -the 35 @samp{x}s before concluding that none of them can work. To make -sure your regular expressions run fast, check nested repetitions +Nested repetition operators can be extremely slow or loop infinitely +if they use repetition operators inside repetition operators. For +example, it could take hours for the regular expression +@samp{\(x+y*\)*a} to try to match the sequence +@samp{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxz}, before it ultimately +fails. Emacs must try each way of grouping the 35 @samp{x}s before +concluding that none of them can work. Even worse, @samp{\(x*\)*} can +match the null string in infinitely many ways, so it causes an +infinite loop. To avoid these problems, check nested repetitions carefully. @item @samp{+} diff --git a/lispref/sequences.texi b/lispref/sequences.texi index 06ac8c5f569..a9f997a5b2c 100644 --- a/lispref/sequences.texi +++ b/lispref/sequences.texi @@ -69,8 +69,8 @@ elements. This section describes functions that accept any kind of sequence. @defun sequencep object -Returns @code{t} if @var{object} is a list, vector, -string, bool-vector, or char-table, @code{nil} otherwise. +Returns @code{t} if @var{object} is a list, vector, string, +bool-vector, or char-table, @code{nil} otherwise. @end defun @defun length sequence @@ -80,12 +80,12 @@ string, bool-vector, or char-table, @code{nil} otherwise. @cindex sequence length @cindex char-table length This function returns the number of elements in @var{sequence}. If -@var{sequence} is a cons cell that is not a list (because the final -@sc{cdr} is not @code{nil}), a @code{wrong-type-argument} error is -signaled. For a char-table, the value returned is always one more -than the maximum Emacs character code. +@var{sequence} is a dotted list, a @code{wrong-type-argument} error is +signaled. Circular lists may cause an infinite loop. For a +char-table, the value returned is always one more than the maximum +Emacs character code. -@xref{List Elements}, for the related function @code{safe-length}. +@xref{Definition of safe-length}, for the related function @code{safe-length}. @example @group @@ -121,10 +121,11 @@ If @var{string} is a multibyte string, this is greater than @defun elt sequence index @cindex elements of sequences This function returns the element of @var{sequence} indexed by -@var{index}. Legitimate values of @var{index} are integers ranging from -0 up to one less than the length of @var{sequence}. If @var{sequence} -is a list, then out-of-range values of @var{index} return @code{nil}; -otherwise, they trigger an @code{args-out-of-range} error. +@var{index}. Legitimate values of @var{index} are integers ranging +from 0 up to one less than the length of @var{sequence}. If +@var{sequence} is a list, out-of-range values behave as for +@code{nth}. @xref{Definition of nth}. Otherwise, out-of-range values +trigger an @code{args-out-of-range} error. @example @group @@ -151,7 +152,7 @@ otherwise, they trigger an @code{args-out-of-range} error. @end example This function generalizes @code{aref} (@pxref{Array Functions}) and -@code{nth} (@pxref{List Elements}). +@code{nth} (@pxref{Definition of nth}). @end defun @defun copy-sequence sequence @@ -171,6 +172,9 @@ the copy is itself a copy, not shared with the original's property list. However, the actual values of the properties are shared. @xref{Text Properties}. +This function does not work for dotted lists. Trying to copy a +circular list may cause an infinite loop. + See also @code{append} in @ref{Building Lists}, @code{concat} in @ref{Creating Strings}, and @code{vconcat} in @ref{Vector Functions}, for other ways to copy sequences. @@ -472,9 +476,9 @@ each initialized to @var{object}. @defun vconcat &rest sequences @cindex copying vectors This function returns a new vector containing all the elements of the -@var{sequences}. The arguments @var{sequences} may be any kind of -arrays, including lists, vectors, or strings. If no @var{sequences} are -given, an empty vector is returned. +@var{sequences}. The arguments @var{sequences} may be true lists, +vectors, strings or bool-vectors. If no @var{sequences} are given, an +empty vector is returned. The value is a newly constructed vector that is not @code{eq} to any existing vector. diff --git a/lispref/streams.texi b/lispref/streams.texi index a4e88b82f2e..fd9b13e84ef 100644 --- a/lispref/streams.texi +++ b/lispref/streams.texi @@ -821,6 +821,17 @@ the @code{print-circle} feature. You should not use it except to bind it to @code{nil} when you bind @code{print-continuous-numbering}. @end defvar +@defvar float-output-format +This variable specifies how to print floating point numbers. Its +default value is @code{nil}, meaning use the shortest output +that represents the number without losing information. + +To control output format more precisely, you can put a string in this +variable. The string should hold a @samp{%}-specification to be used +in the C function @code{sprintf}. For further restrictions on what +you can use, see the variable's documentation string. +@end defvar + @ignore arch-tag: 07636b8c-c4e3-4735-9e06-2e864320b434 @end ignore diff --git a/lispref/syntax.texi b/lispref/syntax.texi index 2628b42812e..8c95e78d00c 100644 --- a/lispref/syntax.texi +++ b/lispref/syntax.texi @@ -135,10 +135,10 @@ modes. @end deffn @deffn {Syntax class} @w{word constituent} -@dfn{Word constituents} (designated by @samp{w}) are parts of normal -English words and are typically used in variable and command names in -programs. All upper- and lower-case letters, and the digits, are typically -word constituents. +@dfn{Word constituents} (designated by @samp{w}) are parts of words in +human languages, and are typically used in variable and command names +in programs. All upper- and lower-case letters, and the digits, are +typically word constituents. @end deffn @deffn {Syntax class} @w{symbol constituent} diff --git a/lispref/text.texi b/lispref/text.texi index bb57da746bf..c6e5aa34d05 100644 --- a/lispref/text.texi +++ b/lispref/text.texi @@ -3875,7 +3875,7 @@ changes, like this: If an error (or other nonlocal exit) occurs inside the body of @code{atomic-change-group}, it unmakes all the changes in that buffer that were during the execution of the body. This kind of change group -has no effect on any other buffers--any such changes remain. +has no effect on any other buffers---any such changes remain. If you need something more sophisticated, such as to make changes in various buffers constitute one atomic group, you must directly call diff --git a/lispref/tips.texi b/lispref/tips.texi index 18d62e9f458..a85147f1d8f 100644 --- a/lispref/tips.texi +++ b/lispref/tips.texi @@ -254,7 +254,7 @@ Avoid using macros that define functions and variables with names that are constructed. It is best for maintenance when the name of the function or variable being defined is given explicitly in the source code, as the second element of the list---as it is when you use -@code{defun}, @code{defalias}, @code{defvar} and @code{defopt}. +@code{defun}, @code{defalias}, @code{defvar} and @code{defcustom}. @item Please keep the names of your Emacs Lisp source files to 13 characters diff --git a/lispref/variables.texi b/lispref/variables.texi index f4c56ede4d9..c395702a40a 100644 --- a/lispref/variables.texi +++ b/lispref/variables.texi @@ -1769,8 +1769,8 @@ nor any other file local variable. It does not check whether a mode is specified in the local variables list at the end of the file. @end defun - If a file local variable list could specify a function that will -be called later, or an expression that will be executed later, simply + If a file local variable list could specify a function that would +be called later, or an expression that would be executed later, simply visiting a file could take over your Emacs. To prevent this, Emacs takes care not to allow local variable lists to set such variables. diff --git a/lwlib/Makefile.in b/lwlib/Makefile.in index 1e545949ea2..11368819f4a 100644 --- a/lwlib/Makefile.in +++ b/lwlib/Makefile.in @@ -67,5 +67,3 @@ TAGS: ../lib-src/etags $(srcdir)/*.[ch] tags: TAGS .PHONY: tags - -# arch-tag: a881fa74-b56a-44c6-80b4-28a4c65d88ff diff --git a/mac/ChangeLog b/mac/ChangeLog index aa6e9844fee..7283b3e2aed 100644 --- a/mac/ChangeLog +++ b/mac/ChangeLog @@ -1,3 +1,9 @@ +2004-05-29 Steven Tamm <steventamm@mac.com> + + * INSTALL: Fixing typos + * README: Updating list of TODOs to remove image support and + environment variable problem. + 2004-01-14 Stefan Monnier <monnier@iro.umontreal.ca> * src/Emacs.r: Update TOO_MUCH_RAM error message. diff --git a/mac/Emacs.app/Contents/.cvsignore b/mac/Emacs.app/Contents/.cvsignore index 0d7f092d290..a502976befb 100644 --- a/mac/Emacs.app/Contents/.cvsignore +++ b/mac/Emacs.app/Contents/.cvsignore @@ -1 +1,2 @@ MacOS +Resources Disabled diff --git a/mac/INSTALL b/mac/INSTALL index def7913f83a..88306ae0573 100644 --- a/mac/INSTALL +++ b/mac/INSTALL @@ -165,7 +165,7 @@ to build Emacs. MPW-GM can be downloaded free of charge from Apple. In either case, you will need MPW-GM to build the make-docfile utility and to generate the doc string file DOC. -### IMPORTANT ### You can use StuffIf Expander to decompress and untar +### IMPORTANT ### You can use StuffIt Expander to decompress and untar the distribution. However, you *must* set the radio button in the Preferences->Cross Platform->Convert text files to Macintosh format to "Never". Otherwise the compiled Lisp files will be corrupted. @@ -200,7 +200,7 @@ dialog and include the Profiler PPC.Lib library. * NOTES -Emacs should build and run on a PowerMac running Mac OS 8.6 - 10.2. +Emacs should build and run on a PowerMac running Mac OS 8.6 - 10.3. You will need around 100 MB of disk space for the source files and intermediate files. diff --git a/mac/README b/mac/README index 1e0a71006db..2163ea191c3 100644 --- a/mac/README +++ b/mac/README @@ -1,6 +1,6 @@ Emacs for Mac OS 8/9 and Mac OS X -Copyright (c) 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 2001-4 Free Software Foundation, Inc. Permission is granted to anyone to make or distribute verbatim copies of this document as received, in any medium, provided that @@ -45,18 +45,18 @@ use Emacs on the Mac. A number of things do not work yet: -+ On Mac OS X, environment variables are not set up correctly when - Emacs is started from the Finder. ++ Emacs does not respond correctly to C-g under certain circumstances. + Sending the Emacs process a SIGINT externally will cause it + to interrupt. This is due to the architecture of OSX's + Window Manager. -+ Emacs does not respond correctly to C-g when it is not reading - input. - -+ No image support yet. ++ Support for certain image types (such as XPM) is not as extensive as + on other plaforms. If your Mac is connected to the Internet, report bugs by typing `M-x report-emacs-bug' or by choosing the entry `Send Bug Report...' in the `Help' menu. This will send the bug report to the address emacs-pretest-bug@gnu.org. -Andrew. -<akochoi@mac.com> +Steven +<steven.tamm@mac.com> diff --git a/man/ChangeLog b/man/ChangeLog index 66ff49e2ced..16044ff1114 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,200 @@ +2004-06-20 Jesper Harder <harder@ifa.au.dk> + + * msdog.texi (Text and Binary, MS-DOS Printing): Use m-dash. + * custom.texi (Customization): do. + * anti.texi (Antinews): do. + * abbrevs.texi (Defining Abbrevs): do. + + * programs.texi (Info Lookup): Fix keybinding for + info-lookup-symbol. + +2004-06-16 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, EMACSSOURCES): + Add emacs-xtra. + ($(infodir)/emacs-xtra, emacs-xtra.dvi): New dependencies. + (clean): Add emacs-xtra and flymake. Remove redundancies. + +2004-06-15 Luc Teirlinck <teirllm@auburn.edu> + + * Makefile.in (INFO_TARGETS, DVI_TARGETS, ../info/emacs-xtra): + Add emacs-xtra. + * emacs-xtra.texi: New file. + +2004-06-14 Luc Teirlinck <teirllm@auburn.edu> + + * dired.texi (Dired Enter): Mention conditions on `ls' switches. + (Dired and Find): Mention differences with ordinary Dired buffers. + +2004-06-13 Luc Teirlinck <teirllm@auburn.edu> + + * autotype.texi (Copyrights, Timestamps): Recommend + `before-save-hook' instead of `write-file-functions'. + +2004-06-13 Richard M. Stallman <rms@gnu.org> + + * custom.texi (Init Syntax): Explain about vars that do special + things when set with setq or with Custom. + (Init Examples): Add line-number-mode example. + +2004-06-13 Lars Hansen <larsh@math.ku.dk> + + * dired-x.texi (dired-mark-omitted): Update keybinding. + +2004-06-12 Juri Linkov <juri@jurta.org> + + * dired.texi (Operating on Files): Add dired-do-touch. + +2004-06-10 Kim F. Storm <storm@cua.dk> + + * pcl-cvs.texi (Viewing differences): Add 'd y'. + +2004-06-10 Juri Linkov <juri@jurta.org> + + * building.texi (Lisp Eval): Add C-M-x on defface. + +2004-06-08 Luc Teirlinck <teirllm@auburn.edu> + + * files.texi (Reverting): Auto-Revert mode and + Global Auto-Revert mode no longer revert remote files. + +2004-06-05 Lars Hansen <larsh@math.ku.dk> + + * dired-x.texi (variable dired-omit-mode): Rename from + dired-omit-files-p. + (function dired-omit-mode): Rename from dired-omit-toggle. + Call dired-omit-mode rather than set dired-omit-files-p. + (dired-mark-omitted): Describe command. + +2004-05-29 Michael Albinus <michael.albinus@gmx.de> + + Version 2.0.41 of Tramp released. + +2004-05-29 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in (../info/flymake, flymake.dvi): New targets. + (INFO_TARGETS, DVI_TARGETS): Add Flymake. + +2004-05-29 Richard M. Stallman <rms@gnu.org> + + * custom.texi (Init File): Two dashes start --no-site-file. + + * cl.texi (Top): Call this chapter `Introduction'. + (Overview): In TeX, no section heading here. + + * cc-mode.texi: Put commas after i.e. and e.g. Minor cleanups. + +2004-05-29 Alan Mackenzie <acm@muc.de> + + * programs.texi: Update for CC Mode 5.30 and incidental amendments. + ("AWK"): Is consistently thus spelt throughout. + (AWK, Pike): Document as "C-like modes". + (@kbd{M-j}): Document as alternative to @kbd{C-M-j}. + (M-x man): Supersedes M-x manual-entry. + Add numerous index entries. Correct "ESC a/e" to "M-a/e". + + ("Comments in C"): Delete node; the info is in CC Mode manual. + (c-comment-only-line-offset): Remove description. + + (C-c ., C-c C-c): Describe new C Mode bindings. + + (C-u TAB, indent-code-rigidly, c-indent-exp, c-tab-always-indent) + (@dfn{Style}, c-default-style, comment-column, comment-padding) + (c-up-conditional, c-beginning-of-statement, c-end-of-statement): + Amend definitions. + + (c-beginning-of-defun, c-end-of-defun, c-context-line-break): + Describe functions. + + (c-comment-start-regexp, c-hanging-comment-ender-p) + (c-hanging-comment-starter-p): Remove obsolete definitions. + + * emacs.texi: Remove the menu entry "Comments in C". + +2004-05-29 Eli Zaretskii <eliz@gnu.org> + + * Makefile.in (../info/flymake, flymake.dvi): New targets. + (INFO_TARGETS, DVI_TARGETS): Add Flymake. + +2004-05-29 Pavel Kobiakov <pk_at_work@yahoo.com> + + * flymake.texi: New file. + +2004-05-28 Simon Josefsson <jas@extundo.com> + + * smtpmail.texi (Authentication): Improve STARTTLS discussion. + +2004-05-27 Luc Teirlinck <teirllm@auburn.edu> + + * dired.texi (Dired and Find): `find-ls-option' does not apply to + `M-x locate'. + +2004-05-16 Karl Berry <karl@gnu.org> + + * emacs.texi (ack.texi) [@ifnottex]: Change condition; with @ifinfo, + makeinfo --html fails. + * help.texi (Help Summary) [@ifnottex]: Likewise. + +2004-05-13 Nick Roberts <nickrob@gnu.org> + + * building.texi (GDB Graphical Interface): Update and describe + layout first. + +2004-05-07 Kai Grossjohann <kai@emptydomain.de> + + Version 2.0.40 of Tramp released. + +2004-04-25 Michael Albinus <Michael.Albinus@alcatel.de> + + Complete rework, based on review by Karl Berry <karl@gnu.org>. + + * tramp.texi (Auto-save and Backup): Explain exploitation of new + variables `tramp-backup-directory-alist' and + `tramp-bkup-backup-directory-info'. + (Overview, Connection types) + (External transfer methods, Default Method) + (Windows setup hints): Remove restriction of password entering + with external methods. + (Auto-save and Backup): Make file name example + (X)Emacs neutral. In case of XEmacs, `bkup-backup-directory-info' + and `auto-save-directory' must be used. + (Frequently Asked Questions): Use "MS Windows NT/2000/XP" (not + only "NT"). Remove doubled entry "What kinds of systems does + @tramp{} work on". + (tramp): Macro removed. + (Obtaining Tramp): Flag removed from title. + (all): "tramp-" and "-" removed from flag names. Flags `tramp' + and `trampver' used properly. Flag `tramp-inst' replaced by + `installchapter'. Installation related text adapted. + +2004-05-04 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in: Revert last change. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.w32-in (MULTI_INSTALL_INFO, ENVADD): Use forward slashes. + +2004-04-28 Masatake YAMATO <jet@gyve.org> + + * widget.texi (Programming Example): Remove overlays. + +2004-04-27 Jesper Harder <harder@ifa.au.dk> + + * faq.texi, viper.texi, dired-x.texi, autotype.texi: lisp -> Lisp. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-04-18 Juri Linkov <juri@jurta.org> + + * fixit.texi (Spelling): Remove file extension from ispell xref. + +2004-04-15 Kim F. Storm <storm@cua.dk> + + * cmdargs.texi (Initial Options): Add -Q. + 2004-04-05 Kim F. Storm <storm@cua.dk> * custom.texi (File Variables): Add safe-local-eval-forms. @@ -97,13 +294,11 @@ * cmdargs.texi (Action Arguments): Add alias --find-file. Add --directory, --help, --version. Move text about command-line-args to Command Arguments. - (Initial Options): Remove alias -batch. Add @cindex for --script. - Fix @cindex for -q. Add --no-desktop. Add alias --no-multibyte, - --no-unibyte. + (Initial Options): Add @cindex for --script. Fix @cindex for -q. + Add --no-desktop. Add alias --no-multibyte, --no-unibyte. (Window Size X): Join -g and --geometry. Add @cindex. (Borders X): Fix @cindex for -ib. Add @cindex for -bw. (Title X): Remove alias -title. - (Icons X): Remove alias -iconic. (Misc X): New node. 2004-02-17 Karl Berry <karl@gnu.org> @@ -119,7 +314,7 @@ * ses.texi (Advanced Features): New functionality for ses-set-header-row (defaults to current row unless C-u used). - (Acknowledgements): Added Stefan Monnier. + (Acknowledgements): Add Stefan Monnier. 2004-02-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> @@ -181,7 +376,7 @@ 2003-11-29 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - * frames.texi (Dialog Boxes): Added use-file-dialog. + * frames.texi (Dialog Boxes): Add use-file-dialog. 2003-11-26 Thien-Thi Nguyen <ttn@gnu.org> @@ -194,7 +389,7 @@ 2003-11-22 Martin Stjernholm <bug-cc-mode@gnu.org> - * cc-mode.texi: Updated for CC Mode 5.30. + * cc-mode.texi: Update for CC Mode 5.30. Note: Please refrain from doing purely cosmetic changes like removing trailing whitespace in this manual; it clobbers cvs @@ -247,8 +442,8 @@ 2003-10-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> - * xresources.texi (GTK resources): Added a note that some themes - disallow customizations. Added scroll theme example. + * xresources.texi (GTK resources): Add a note that some themes + disallow customizations. Add scroll theme example. 2003-10-08 Nick Roberts <nick@nick.uklinux.net> @@ -306,7 +501,7 @@ 2003-09-21 Karl Berry <karl@gnu.org> - * info.texi (] and [ commands): no period at end of section title. + * info.texi (] and [ commands): No period at end of section title. 2003-09-08 Lute Kamstra <lute@gnu.org> @@ -319,7 +514,7 @@ 2003-09-07 Luc Teirlinck <teirllm@mail.auburn.edu> * xresources.texi (Resources): Refer to `editres' man page. - (Lucid Resources): Update defaults. Expand desciption of + (Lucid Resources): Update defaults. Expand description of `shadowThickness'. 2003-09-04 Miles Bader <miles@gnu.org> @@ -359,7 +554,7 @@ section. * emacs.texi (Intro): Include kmacro.texi after custom.texi. (Suggested by Kim Storm.) - * Makefile (EMACSSOURCES): Add kmacro.texi. (Suggested by Kim + * Makefile (EMACSSOURCES): Add kmacro.texi. (Suggested by Kim Storm.) 2003-08-18 Kim F. Storm <storm@cua.dk> @@ -399,7 +594,7 @@ 2003-08-03 Karl Berry <karl@gnu.org> - * info.texi: need @contents. + * info.texi: Need @contents. 2003-08-03 Glenn Morris <gmorris@ast.cam.ac.uk> @@ -537,7 +732,7 @@ 2003-03-29 Richard M. Stallman <rms@gnu.org> * tramp.texi (Top): Undo the previous renaming. - (emacs-other-name, emacs-other-dir, emacs-other-file-name): Deleted. + (emacs-other-name, emacs-other-dir, emacs-other-file-name): Delete. 2003-03-29 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> @@ -641,7 +836,7 @@ 2003-01-09 Francesco Potort,Al(B <pot@gnu.org> - * maintaining.texi (Create Tags Table): Added reference to the new + * maintaining.texi (Create Tags Table): Add reference to the new `etags --help --lang=LANG' option. 2002-12-26 Kai Gro,A_(Bjohann <kai.grossjohann@uni-duisburg.de> @@ -651,7 +846,7 @@ 2002-11-05 Karl Berry <karl@gnu.org> - * info.texi (Info-fontify): reorder face list to avoid bad line + * info.texi (Info-fontify): Reorder face list to avoid bad line breaks. 2002-10-06 Kai Gro,A_(Bjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> @@ -669,8 +864,8 @@ Per rms, update all manuals to use @copying instead of @ifinfo. Also use @ifnottex instead of @ifinfo around the top node, where needed for the sake of the HTML output. - (The gnus manual is not fixed since it's not clear to me how it - works; and the tramp manual already uses @copying, although in an + (The Gnus manual is not fixed since it's not clear to me how it + works; and the Tramp manual already uses @copying, although in an unusual way. All others were changed.) 2002-09-10 Jonathan Yavner <jyavner@engineer.com> @@ -681,7 +876,7 @@ 2002-09-06 Pavel Jan,Bm(Bk <Pavel@Janik.cz> - * texinfo.tex: Updated to texinfo 4.2. + * texinfo.tex: Update to texinfo 4.2. 2002-08-27 Carsten Dominik <dominik@sand.science.uva.nl> @@ -739,11 +934,11 @@ 2000-10-19 Eric M. Ludlam <zappo@ultranet.com> - * Makefile.in (Speedbar): Added build targets for speedbar.texi. + * Makefile.in (Speedbar): Add build targets for speedbar.texi. 2000-10-13 John Wiegley <johnw@gnu.org> - * Makefile.in: Added build targets for eshell.texi. + * Makefile.in: Add build targets for eshell.texi. 2000-09-25 Gerd Moellmann <gerd@gnu.org> @@ -775,14 +970,14 @@ 2000-01-13 Gerd Moellmann <gerd@gnu.org> * Makefile.in (INFO_TARGETS): Add eudc. - (DVI_TARGETS): Add eudc.dvi + (DVI_TARGETS): Add eudc.dvi. (../info/eudc, eudc.dvi): New targets. 2000-01-05 Eli Zaretskii <eliz@is.elta.co.il> * Makefile.in (INFO_TARGETS): Rename emacs-faq to efaq (for compatibility with 8+3 filesystems). - (../info/efaq): Renamed from emacs-faq. + (../info/efaq): Rename from emacs-faq. 2000-01-03 Eli Zaretskii <eliz@is.elta.co.il> @@ -795,7 +990,7 @@ 1999-10-12 Stefan Monnier <monnier@cs.yale.edu> - * Makefile.in (faq): use ../info/emacs-faq.info (as specified in the + * Makefile.in (faq): Use ../info/emacs-faq.info (as specified in the faq.texi file) rather than ../info/faq. 1999-10-07 Gerd Moellmann <gerd@gnu.org> @@ -834,7 +1029,7 @@ 1998-03-11 Carsten Dominik <cd@delysid.gnu.org> - * reftex.texi Updated for RefTeX version 3.22. + * reftex.texi: Update for RefTeX version 3.22. 1998-02-08 Richard Stallman <rms@psilocin.gnu.org> @@ -845,7 +1040,7 @@ * Makefile.in: Merge changes mistakenly made to `Makefile'. (INFO_TARGETS): Change ../info/custom to ../info/customize. - (../info/customize): Renamed from ../info/custom. + (../info/customize): Rename from ../info/custom. (../info/viper, viper.dvi): Remove dependency on viper-cmd.texi. 1997-09-19 Richard Stallman <rms@psilocin.gnu.ai.mit.edu> @@ -900,7 +1095,7 @@ 1996-01-07 Richard Stallman <rms@whiz-bang.gnu.ai.mit.edu> - * Makefile.in (../info/ccmode): Renamed from ../info/cc-mode. + * Makefile.in (../info/ccmode): Rename from ../info/cc-mode. (INFO_TARGETS): Use new name. This avoids name conflict on MSDOS. 1995-11-29 Richard Stallman <rms@mole.gnu.ai.mit.edu> @@ -949,7 +1144,7 @@ 1995-02-07 Richard Stallman <rms@pogo.gnu.ai.mit.edu> - * Makefile.in (maintainer-clean): Renamed from realclean. + * Makefile.in (maintainer-clean): Rename from realclean. 1994-11-23 Richard Stallman <rms@mole.gnu.ai.mit.edu> @@ -1000,7 +1195,7 @@ 1994-01-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) - * Makefile (../info/sc): Renamed frin sc.info. + * Makefile (../info/sc): Rename frin sc.info. (../info/cl): Likewise. (INFO_TARGETS): Use new names. @@ -1015,7 +1210,7 @@ 1993-12-03 Richard Stallman (rms@srarc2) - * Makefile (../info/sc.info): Renamed from ../info/sc. + * Makefile (../info/sc.info): Rename from ../info/sc. (TEXI2DVI): New variable. (emacs.dvi, cl.dvi forms.dvi, sc.dvi, vip.dvi, gnus.dvi, info.dvi): Add explicit commands. @@ -1035,7 +1230,7 @@ 1993-11-15 Paul Eggert (eggert@twinsun.com) - * man/Makefile (../info/cl.info): Renamed from ../info/cl. + * man/Makefile (../info/cl.info): Rename from ../info/cl. 1993-11-15 Richard Stallman (rms@mole.gnu.ai.mit.edu) @@ -1049,7 +1244,7 @@ 1993-10-25 Brian Fox (bfox@albert.gnu.ai.mit.edu) * forms.texi: Fix forms.texi so that it will format correctly. - Added missing `@end iftex', fixed bad reference. + Add missing `@end iftex', fix bad reference. * info.texi, info-stn.texi: New files implement texinfo version of `info' file. @@ -1062,7 +1257,7 @@ * Makefile: Fix targets for texindex, new info.texi files. * info-stnd.texi: New file implements info for standalone info reader. - * info.texi: Updated to include recent changes to "../info/info". + * info.texi: Update to include recent changes to "../info/info". New source file for ../info/info; includes info-stnd.texi. * texindex.c: Include "../src/config.h" if building in emacs. @@ -1082,8 +1277,8 @@ * sc.texinfo: Fix info file name. - * Makefile (info): Added gnus and sc. - (dvi): Added gnus.dvi and sc.dvi. + * Makefile (info): Add gnus and sc. + (dvi): Add gnus.dvi and sc.dvi. (../info/sc, sc.dvi): New targets. 1993-08-08 Richard Stallman (rms@mole.gnu.ai.mit.edu) @@ -1155,42 +1350,42 @@ 1993-04-25 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) - * basic.texi: Documented next-line-add-lines variable used to + * basic.texi: Document next-line-add-lines variable used to implement down-arrow. - * killing.texi: Documented kill-whole-line. + * killing.texi: Document kill-whole-line. 1993-04-18 Noah Friedman (friedman@nutrimat.gnu.ai.mit.edu) - * text.texi: Updated unix TeX ordering information. + * text.texi: Update unix TeX ordering information. 1993-03-26 Eric S. Raymond (eric@geech.gnu.ai.mit.edu) - * news.texi: Mentioned fill-rectangle in keybinding list. + * news.texi: Mention fill-rectangle in keybinding list. - * killing.texi: Documented fill-rectangle. + * killing.texi: Document fill-rectangle. 1993-03-17 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) - * vc.texi: Brought the docs up to date with VC 5.2. + * vc.texi: Bring the docs up to date with VC 5.2. 1992-01-10 Eric S. Raymond (eric@mole.gnu.ai.mit.edu) - * emacs.tex: Mentioned blackbox and gomoku under Amusements. - Assembler mode is now mentioned and appropriately - indexed under Programming Modes. + * emacs.tex: Mention blackbox and gomoku under Amusements. + Assembler mode is now mentioned and appropriately indexed + under Programming Modes. 1991-02-15 Robert J. Chassell (bob@wookumz.ai.mit.edu) - * emacs.tex: Updated TeX ordering information. + * emacs.tex: Update TeX ordering information. 1990-08-30 David Lawrence (tale@pogo.ai.mit.edu) - * gnus.texinfo: New file. Removed installation instructions. + * gnus.texinfo: New file. Removed installation instructions. 1990-06-26 David Lawrence (tale@geech) - * emacs.tex: Noted that completion-ignored-extensions is not used + * emacs.tex: Note that completion-ignored-extensions is not used to filter out names when all completions are displayed in *Completions*. @@ -1204,22 +1399,22 @@ 1989-01-17 Robert J. Chassell (bob@rice-chex.ai.mit.edu) - * texinfo.tex: Changed spelling of `\sc' font to `\smallcaps' and - then defined `\sc' as the command for smallcaps in Texinfo. This - measns that the @sc command will produce small caps. bfox has + * texinfo.tex: Change spelling of `\sc' font to `\smallcaps' and + then define `\sc' as the command for smallcaps in Texinfo. This + means that the @sc command will produce small caps. bfox has made the corresponding change to makeinfo and texinfm.el. 1988-08-16 Robert J. Chassell (bob@frosted-flakes.ai.mit.edu) - * emacs.tex: Corrected two typos. No other changes before + * emacs.tex: Correct two typos. No other changes before Version 19 will be made. - * vip.texinfo: Removed menu entry Adding Lisp Code in node + * vip.texinfo: Remove menu entry Adding Lisp Code in node Customization since the menu entry did not point to anything. - Also added an @finalout command to remove overfull hboxes from the + Also add an @finalout command to remove overfull hboxes from the printed output. - * cl.texinfo: Added @bye, \input line and @settitle to file. + * cl.texinfo: Add @bye, \input line and @settitle to file. This file is clearly intended to be a chapter of some other work, but the other work does not yet exist. diff --git a/man/Makefile.in b/man/Makefile.in index e1b971010b0..468adf54844 100644 --- a/man/Makefile.in +++ b/man/Makefile.in @@ -1,6 +1,6 @@ #### Makefile for the Emacs Manual and other documentation. -# Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003 +# Copyright (C) 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 # Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -33,20 +33,22 @@ VPATH=@srcdir@ # The makeinfo program is part of the Texinfo distribution. MAKEINFO = makeinfo -INFO_TARGETS = ../info/emacs ../info/ccmode ../info/cl \ +INFO_TARGETS = ../info/emacs ../info/emacs-xtra ../info/ccmode ../info/cl \ ../info/dired-x ../info/ediff ../info/forms ../info/gnus \ ../info/info ../info/message ../info/mh-e ../info/reftex \ ../info/sc ../info/vip ../info/viper ../info/widget \ ../info/efaq ../info/ada-mode ../info/autotype ../info/calc \ ../info/idlwave ../info/eudc ../info/ebrowse ../info/pcl-cvs \ ../info/woman ../info/emacs-mime ../info/eshell \ - ../info/speedbar ../info/tramp ../info/ses ../info/smtpmail + ../info/speedbar ../info/tramp ../info/ses ../info/smtpmail \ + ../info/flymake DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ - speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi + speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ + emacs-xtra.dvi INFOSOURCES = info.texi # The following rule does not work with all versions of `make'. @@ -173,6 +175,11 @@ dired-x.dvi: dired-x.texi ediff.dvi: ediff.texi $(ENVADD) $(TEXI2DVI) ${srcdir}/ediff.texi +../info/emacs-xtra: emacs-xtra.texi + cd $(srcdir); $(MAKEINFO) emacs-xtra.texi +emacs-xtra.dvi: emacs-xtra.texi + $(ENVADD) $(TEXI2DVI) ${srcdir}/emacs-xtra.texi + ../info/forms: forms.texi cd $(srcdir); $(MAKEINFO) forms.texi forms.dvi: forms.texi @@ -287,6 +294,11 @@ ses.dvi: ses.texi smtpmail.dvi: smtpmail.texi $(ENVADD) $(TEXI2DVI) ${srcdir}/smtpmail.texi +../info/flymake: flymake.texi + cd $(srcdir); $(MAKEINFO) flymake.texi +flymake.dvi: flymake.texi + $(ENVADD) $(TEXI2DVI) ${srcdir}/flymake.texi + mostlyclean: rm -f *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* @@ -306,5 +318,3 @@ maintainer-clean: distclean # That caused trouble because this is run entirely in the source directory. # Since we expect to get texi2dvi from elsewhere, # it is ok to expect texindex from elsewhere also. - -# arch-tag: 19cdb89e-4acb-448e-b0cc-2ddc05948ee2 diff --git a/man/abbrevs.texi b/man/abbrevs.texi index ce6465564f5..e8cf2dc9c49 100644 --- a/man/abbrevs.texi +++ b/man/abbrevs.texi @@ -129,7 +129,7 @@ read with the minibuffer). @findex define-global-abbrev You can define an abbrev without inserting either the abbrev or its expansion in the buffer using the command @code{define-global-abbrev}. -It reads two arguments--the abbrev, and its expansion. The command +It reads two arguments---the abbrev, and its expansion. The command @code{define-mode-abbrev} does likewise for a mode-specific abbrev. To change the definition of an abbrev, just define a new definition. diff --git a/man/anti.texi b/man/anti.texi index edf0031ee8c..242a4301712 100644 --- a/man/anti.texi +++ b/man/anti.texi @@ -108,7 +108,7 @@ If you want some other value, you must set it yourself. SGML mode does not handle XML syntax, and does not have indentation support. @item -The @kbd{C-h} subcommands have been rearranged--especially those that +The @kbd{C-h} subcommands have been rearranged---especially those that display specific files. Type @kbd{C-h C-h} to see a list of these commands; that will show you what is different. diff --git a/man/autotype.texi b/man/autotype.texi index e7df280f524..16e88851c4b 100644 --- a/man/autotype.texi +++ b/man/autotype.texi @@ -196,7 +196,7 @@ define an abbreviation (@pxref{(emacs)Defining Abbrevs}) that will expand Say you want @samp{ifst} to be an abbreviation for the C language if statement. You will tell Emacs that @samp{ifst} expands to the empty string -and then calls the skeleton command. In Emacs-lisp you can say something like +and then calls the skeleton command. In Emacs Lisp you can say something like @code{(define-abbrev c-mode-abbrev-table "ifst" "" 'c-if)}. Or you can edit the output from @kbd{M-x list-abbrevs} to make it look like this: @@ -263,7 +263,7 @@ copy of this variable. @item @code{v1}, @code{v2} Skeleton-local user variables. @item @code{'@var{expression}} -Evaluate following lisp expression for its side-effect, but prevent it from +Evaluate following Lisp expression for its side-effect, but prevent it from being interpreted as a skeleton element. @item @var{skeleton} Subskeletons are inserted recursively, not once, but as often as the user @@ -456,16 +456,19 @@ wrong version of the GNU General Public License (@pxref{(emacs)Copying}) is foun that is updated too. An interesting application for this function is to have it be called -automatically every time a file is saved. This is accomplished by putting -@code{(add-hook 'write-file-functions 'copyright-update)} into your @file{~/.emacs} -file (@pxref{(emacs)Init File}). +automatically every time a file is saved. This is accomplished by +putting @code{(add-hook 'before-save-hook 'copyright-update)} into +your @file{~/.emacs} file (@pxref{(emacs)Init File}). Alternative, +you can do @kbd{M-x customize-variable @key{RET} before-save-hook +@key{RET}}. @code{copyright-update} is conveniently listed as an +option in the customization buffer. @vindex copyright-query The variable @code{copyright-query} controls whether to update the copyright or whether to ask about it. When this is @code{nil} updating is only done with @kbd{M-x copyright-update}. When this is @code{function} you are queried whenever @code{copyright-update} is called as a function, -such as in the @code{write-file-functions} feature mentioned above. Otherwise +such as in the @code{before-save-hook} feature mentioned above. Otherwise you are always queried. @@ -522,11 +525,13 @@ The ``interpreter'' used is @code{executable-self-display} with argument @cindex timestamps @findex time-stamp -@vindex write-file-functions +@vindex before-save-hook The @code{time-stamp} command can be used to update automatically a template in a file with a new time stamp every time you save the file. -Customize the hook @code{write-file-functions} to add the function -@code{time-stamp} to arrange this. +Customize the hook @code{before-save-hook} to add the function +@code{time-stamp} to arrange this. It you use Custom to do this, +then @code{time-stamp} is conveniently listed as an option in the +customization buffer. @vindex time-stamp-active @vindex time-stamp-format @@ -605,9 +610,9 @@ formatting or define special points of interest in the inserted text. @kbd{M-x tempo-backward-mark} and @kbd{M-x tempo-forward-mark} can be used to jump between such points. -More flexible templates can be created by including lisp symbols, which +More flexible templates can be created by including Lisp symbols, which will be evaluated as variables, or lists, which will be evaluated -as lisp expressions. Automatic completion of specified tags to expanded +as Lisp expressions. Automatic completion of specified tags to expanded templates can be provided. @findex tempo-define-template diff --git a/man/building.texi b/man/building.texi index 2985a04895c..f7c1883e0d3 100644 --- a/man/building.texi +++ b/man/building.texi @@ -286,7 +286,7 @@ Emacs. @xref{MS-DOS}. The GUD (Grand Unified Debugger) library provides an interface to various symbolic debuggers from within Emacs. We recommend the debugger GDB, which is free software, but you can also run DBX, SDB or XDB if you -have them. GUD can also serve as an interface to the Perl's debugging +have them. GUD can also serve as an interface to Perl's debugging mode, the Python debugger PDB, and to JDB, the Java Debugger. @xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference Manual}, for information on debugging Emacs Lisp programs. @@ -311,9 +311,13 @@ to a particular debugger program. @table @kbd @item M-x gdb @key{RET} @var{file} @key{RET} @findex gdb -Run GDB as a subprocess of Emacs. This command creates a buffer -for input and output to GDB, and switches to it. If a GDB buffer -already exists, it just switches to that buffer. +Run GDB as a subprocess of Emacs. If the variable +@code{gud-gdb-command-name} is ``gdb --annotate=3'' (the default +value) then GDB starts as for @kbd{M-x gdba} below. If you want to +GDB to start as in Emacs 21.3 and earlier then set +@code{gud-gdb-command-name} to ``gdb --fullname''. In this case, the +command creates a buffer for input and output to GDB, and switches to +it. If a GDB buffer already exists, it just switches to that buffer. @item M-x gdba @key{RET} @var{file} @key{RET} Run GDB as a subprocess of Emacs, providing a graphical interface @@ -638,13 +642,59 @@ mode is that you can do it through menus and clicks, without needing to know GDB commands. @menu +* Layout:: Control the number of displayed buffers. * Breakpoints Buffer:: A breakpoint control panel. * Stack Buffer:: Select a frame from the call stack. * Watch Expressions:: Monitor variable values in the speedbar. * Other Buffers:: Input/output, locals, registers and assembler buffers. -* Layout:: Control the number of displayed buffers. @end menu +@node Layout +@subsubsection Layout +@cindex GDB User Interface layout + +@findex gdb-many-windows +@vindex gdb-many-windows + +If the variable @code{gdb-many-windows} is @code{nil} (the default +value) then gdb just pops up the GUD buffer unless the variable +@code{gdb-show-main} is non-@code{nil}. In this case it starts with +two windows: one displaying the GUD buffer and the other with the +source file with the main routine of the inferior. + +If @code{gdb-many-windows} is non-@code{nil}, regardless of the value of +@code{gdb-show-main}, the layout below will appear unless +@code{gdb-use-inferior-io-buffer} is @code{nil}. In this case the +source buffer occupies the full width of the frame. + +@multitable @columnfractions .5 .5 +@item GUD buffer (I/O of GDB) +@tab Locals buffer +@item +@tab +@item Source buffer +@tab Input/Output (of inferior) buffer +@item +@tab +@item Stack buffer +@tab Breakpoints buffer +@end multitable + +To toggle this layout, do @kbd{M-x gdb-many-windows}. + +@findex gdb-restore-windows +If you change the window layout, for example, while editing and +re-compiling your program, then you can restore it with the command +@code{gdb-restore-windows}. + +You may also choose which additional buffers you want to display, +either in the same frame or a different one. Select GDB-windows or +GDB-Frames from the menu-bar under the heading GUD. If the menu-bar +is unavailable, type @code{M-x +gdb-display-@var{buffertype}-buffer} or @code{M-x +gdb-frame-@var{buffertype}-buffer} respectively, where @var{buffertype} +is the relevant buffer type e.g breakpoints. + @node Breakpoints Buffer @subsubsection Breakpoints Buffer @@ -705,7 +755,7 @@ on the tag to the left of the expression. @kindex RET @r{(GDB speedbar)} @findex gdb-var-delete With the cursor over the root expression of a complex data type, type -@key{D} to delete it from the speedbar +@kbd{D} to delete it from the speedbar (@code{gdb-var-delete}). @findex gdb-edit-value @@ -730,7 +780,8 @@ the default value is @code{nil}. @table @asis @item Input/Output Buffer -The executable program that is being debugged takes its input and +If the variable @code{gdb-use-inferior-io-buffer} is non-@code{nil}, +the executable program that is being debugged takes its input and displays its output here. Some of the commands from shell mode are available here. @xref{Shell Mode}. @@ -763,44 +814,6 @@ make the selected thread become the current one. @end table -@node Layout -@subsubsection Layout -@cindex GDB User Interface layout - -@findex gdb-many-windows -@vindex gdb-many-windows -If @code{gdb-many-windows} is @code{nil} (the default value), then GDB starts -with just two windows: the GUD and the source buffer. If it is @code{t}, then -six windows with the following layout will appear: - -@multitable @columnfractions .5 .5 -@item GUD buffer (I/O of GDB) -@tab Locals buffer -@item -@tab -@item Source buffer -@tab Input/Output (of debuggee) buffer -@item -@tab -@item Stack buffer -@tab Breakpoints buffer -@end multitable - -To toggle this layout, do @kbd{M-x gdb-many-windows}. - -@findex gdb-restore-windows -If you change the window layout, for example, while editing and -re-compiling your program, then you can restore it with -@code{gdb-restore-windows}. - -You may also choose which additional buffers you want to display, -either in the same frame or a different one. Select GDB-windows or -GDB-Frames from the menu-bar under the heading GUD. If the menu-bar -is unavailable, type @code{M-x -gdb-display-@var{buffertype}-buffer} or @code{M-x -gdb-frame-@var{buffertype}-buffer} respectively, where @var{buffertype} -is the relevant buffer type e.g breakpoints. - @node Executing Lisp @section Executing Lisp Expressions @@ -976,6 +989,8 @@ defines already has a value. But @kbd{C-M-x} unconditionally resets the variable to the initial value specified in the @code{defvar} expression. @code{defcustom} expressions are treated similarly. This special feature is convenient for debugging Lisp programs. +Typing @kbd{C-M-x} on a @code{defface} expression reinitializes +the face according to the @code{defface} specification. @kindex C-x C-e @findex eval-last-sexp diff --git a/man/cc-mode.texi b/man/cc-mode.texi index 0f1e65051d8..c3b7dd4833f 100644 --- a/man/cc-mode.texi +++ b/man/cc-mode.texi @@ -354,7 +354,7 @@ Syntactic analysis for indentation is done when this is non-@code{nil} indented to the same level as the previous one, and @kbd{TAB} (@code{c-indent-command}) adjusts the indentation in steps of @code{c-basic-offset}. The indentation style has no effect, nor any of -the indentation associated variables, e.g. @code{c-special-indent-hook}. +the indentation associated variables, e.g., @code{c-special-indent-hook}. @end defopt @menu @@ -381,7 +381,7 @@ elements (in lisp parlance, a @emph{cons cell}), the first being a @dfn{syntactic symbol}, the second being a @dfn{relative buffer position}. Syntactic symbols describe elements of C code @footnote{Unless otherwise noted, the term ``C code'' refers to all -the C-like languages.}, e.g. @code{statement}, @code{substatement}, +the C-like languages.}, e.g., @code{statement}, @code{substatement}, @code{class-open}, @code{class-close}, etc. @xref{Syntactic Symbols}, for a complete list of currently recognized syntactic symbols and their semantics. The style variable @code{c-offsets-alist} also contains the @@ -411,7 +411,7 @@ We can use the command @kbd{C-c C-s} (bound to @code{c-show-syntactic-information}) to simply report what the syntactic analysis is for the current line. Running this command on line 4 of this example, we'd see in the echo area@footnote{With a -universal argument (i.e. @kbd{C-u C-c C-s}) the analysis is inserted +universal argument (i.e., @kbd{C-u C-c C-s}) the analysis is inserted into the buffer as a comment on the current line.}: @example @@ -677,7 +677,7 @@ definition. These constructs are also known as @dfn{syntactic whitespace} since they are usually ignored when scanning C code.}. @item -No numeric argument was supplied to the command (i.e. it was typed as +No numeric argument was supplied to the command (i.e., it was typed as normal, with no @kbd{C-u} prefix). @end itemize @@ -702,7 +702,7 @@ normal, with no @kbd{C-u} prefix). @kindex @{ @kindex @} -When you type either an open or close brace (i.e. @kbd{@{} or @kbd{@}}), +When you type either an open or close brace (i.e., @kbd{@{} or @kbd{@}}), the electric command @code{c-electric-brace} gets run. This command has two electric formatting behaviors. First, it will perform some reindentation of the line the brace was typed on, and second, it will @@ -973,7 +973,7 @@ modes except IDL mode, since CORBA IDL doesn't have any statements. @dfn{Clean-ups} are mechanisms complementary to colon and brace hanging. On the surface, it would seem that clean-ups overlap the functionality provided by the @code{c-hanging-*-alist} variables. Clean-ups are -however used to adjust code ``after-the-fact,'' i.e. to adjust the +however used to adjust code ``after-the-fact,'' i.e., to adjust the whitespace in constructs after they are typed. Most of the clean-ups are only applicable to counteract automatically @@ -1146,7 +1146,7 @@ minor mode: @item space-before-funcall Insert a space between the function name and the opening parenthesis of a function call. This produces function calls in the style mandated by -the GNU coding standards, e.g. @samp{signal (SIGINT, SIG_IGN)} and +the GNU coding standards, e.g., @samp{signal (SIGINT, SIG_IGN)} and @samp{abort ()}. Clean up occurs when the opening parenthesis is typed. @item compact-empty-funcall @@ -1154,7 +1154,7 @@ Clean up any space between the function name and the opening parenthesis of a function call that has no arguments. This is typically used together with @code{space-before-funcall} if you prefer the GNU function call style for functions with arguments but think it looks ugly when -it's only an empty parenthesis pair. I.e. you will get @samp{signal +it's only an empty parenthesis pair. I.e., you will get @samp{signal (SIGINT, SIG_IGN)}, but @samp{abort()}. Clean up occurs when the closing parenthesis is typed. @end table @@ -1278,7 +1278,7 @@ whether hungry-delete mode is enabled or not). Since there's a lot of normal text in comments and string literals, @ccmode{} provides features to edit these like in text mode. The goal -is to do it as seamlessly as possible, i.e. you can use auto fill mode, +is to do it as seamlessly as possible, i.e., you can use auto fill mode, sentence and paragraph movement, paragraph filling, adaptive filling etc wherever there's a piece of normal text without having to think much about it. @ccmode{} should keep the indentation, fix the comment line @@ -1333,7 +1333,7 @@ like @noindent with zero or more stars at the beginning of every line. If you change this variable, please make sure it still matches the comment starter -(i.e. @code{//}) of line comments @emph{and} the line prefix inside +(i.e., @code{//}) of line comments @emph{and} the line prefix inside block comments. @findex c-setup-paragraph-variables @@ -1352,7 +1352,7 @@ mode hook, since @ccmode{} sets up all variables before calling them. @cindex paragraph filling Line breaks are by default handled (almost) the same regardless whether they are made by auto fill mode (@pxref{Auto Fill,,, emacs, The Emacs -Editor}), paragraph filling (e.g. with @kbd{M-q}), or explicitly with +Editor}), paragraph filling (e.g., with @kbd{M-q}), or explicitly with @kbd{M-j} or similar methods. In string literals, the new line gets the same indentation as the previous nonempty line (may be changed with the @code{string} syntactic symbol). In comments, @ccmode{} uses @@ -1364,7 +1364,7 @@ lines in the comment. @ccmode{} uses adaptive fill mode (@pxref{Adaptive Fill,,, emacs, The Emacs Editor}) to make Emacs correctly keep the line prefix when filling paragraphs. That also makes Emacs preserve the text indentation -@emph{inside} the comment line prefix. E.g. in the following comment, +@emph{inside} the comment line prefix. e.g., in the following comment, both paragraphs will be filled with the left margins of the texts kept intact: @@ -1394,7 +1394,7 @@ by default). A patch for that is available from @uref{http://cc-mode.sourceforge.net/,, the CC Mode web site}.}, which handles things like bulleted lists nicely. There's a convenience function @code{c-setup-filladapt} that tunes the relevant variables in -Filladapt for use in @ccmode{}. Call it from a mode hook, e.g. with +Filladapt for use in @ccmode{}. Call it from a mode hook, e.g., with something like this in your @file{.emacs}: @example @@ -1443,7 +1443,7 @@ most common comment styles, see @ref{Indentation Functions}. @defopt c-ignore-auto-fill @vindex ignore-auto-fill (c-) When auto fill mode is enabled, @ccmode{} can selectively ignore it -depending on the context the line break would occur in, e.g. to never +depending on the context the line break would occur in, e.g., to never break a line automatically inside a string literal. This variable takes a list of symbols for the different contexts where auto-filling never should occur: @@ -1458,7 +1458,7 @@ Inside a C++ style line comment. @item cpp Inside a preprocessor directive. @item code -Anywhere else, i.e. in normal code. +Anywhere else, i.e., in normal code. @end table By default, @code{c-ignore-auto-fill} is set to @code{'(string cpp @@ -1514,7 +1514,7 @@ Note that @ccmode{} sets @code{comment-multi-line} to @code{t} at startup. The reason is that @kbd{M-j} could otherwise produce sequences of single line block comments for texts that should logically be treated as one comment, and the rest of the paragraph handling code -(e.g. @kbd{M-q} and @kbd{M-a}) can't cope with that, which would lead to +(e.g., @kbd{M-q} and @kbd{M-a}) can't cope with that, which would lead to inconsistent behavior. @item @kbd{M-x c-context-line-break} @@ -1523,7 +1523,7 @@ inconsistent behavior. This is a function that works like @code{indent-new-comment-line} in comments and @code{newline-and-indent} elsewhere, thus combining those two in a way that uses each one in the context it's best suited for. -I.e. in comments the comment line prefix and indentation is kept for +I.e., in comments the comment line prefix and indentation is kept for the new line, and in normal code it's indented according to context by the indentation engine. @@ -1540,7 +1540,7 @@ It's not bound to a key by default, but it's intended to be used on the @findex c-context-open-line @findex context-open-line (c-) This is to @kbd{C-o} (@kbd{M-x open-line}) as -@code{c-context-line-break} is to @kbd{RET}. I.e. it works just like +@code{c-context-line-break} is to @kbd{RET}. I.e., it works just like @code{c-context-line-break} but leaves the point before the inserted line break. @end table @@ -1555,13 +1555,13 @@ line break. @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Preprocessor directives are handled as syntactic whitespace from other -code, i.e. they can be interspersed anywhere without affecting the +code, i.e., they can be interspersed anywhere without affecting the syntactic analysis, just like comments. The code inside macro definitions is still analyzed syntactically so that you get relative indentation there just as you'd get if the same code was outside a macro. However, since there is no hint about the -syntactic context, i.e. whether the macro expands to an expression, to some +syntactic context, i.e., whether the macro expands to an expression, to some statements, or perhaps to whole functions, the syntactic recognition can be wrong. @ccmode{} manages to figure it out correctly most of the time, though. @xref{Syntactic Symbols}, for details about the indentation. @@ -1601,7 +1601,7 @@ the region ends at the start of a line, it always deletes the backslash These variables control the alignment columns for line continuation backslashes in multiline macros. They are used by the functions that automatically insert or align such backslashes, -e.g. @code{c-backslash-region} and @code{c-context-line-break}. +e.g., @code{c-backslash-region} and @code{c-context-line-break}. @code{c-backslash-column} specifies the minimum column for the backslashes. If any line in the macro exceeds it then the next tab @@ -1616,7 +1616,7 @@ lines which are too long ``stick out'' instead. @vindex auto-align-backslashes (c-) Align automatically inserted line continuation backslashes if non-@code{nil}. When line continuation backslashes are inserted -automatically for line breaks in multiline macros, e.g. by +automatically for line breaks in multiline macros, e.g., by @code{c-context-line-break}, they are aligned with the other backslashes in the same macro if this flag is set. Otherwise the inserted backslashes are preceded by a single space. @@ -1738,7 +1738,7 @@ additional regexps to match those you use: For each language there's a variable @code{*-font-lock-extra-types}, where @samp{*} stands for the language in question. It contains a list of regexps that matches identifiers that should be recognized as types, -e.g. @samp{\\sw+_t} to recognize all identifiers ending with @samp{_t} +e.g., @samp{\\sw+_t} to recognize all identifiers ending with @samp{_t} as is customary in C code. Each regexp should not match more than a single identifier. @@ -1835,7 +1835,7 @@ labels. @vindex font-lock-builtin-face @vindex font-lock-reference-face Preprocessor directives get @code{font-lock-preprocessor-face} if it -exists (i.e. XEmacs). In Emacs they get @code{font-lock-builtin-face} +exists (i.e., XEmacs). In Emacs they get @code{font-lock-builtin-face} or @code{font-lock-reference-face}, for lack of a closer equivalent. @item @@ -1861,14 +1861,14 @@ since those aren't syntactic errors in themselves. @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! There are various tools to supply documentation in the source as -specially structured comments, e.g. the standard Javadoc tool in Java. +specially structured comments, e.g., the standard Javadoc tool in Java. @ccmode{} provides an extensible mechanism to fontify such comments and the special markup inside them. @defopt c-doc-comment-style @vindex doc-comment-style (c-) This is a style variable that specifies which documentation comment -style to recognize, e.g. @code{javadoc} for Javadoc comments. +style to recognize, e.g., @code{javadoc} for Javadoc comments. The value may also be a list of styles, in which case all of them are recognized simultaneously (presumably with markup cues that don't @@ -1883,7 +1883,7 @@ and its value is used instead. Note that @ccmode{} uses this variable to set other variables that handle fontification etc. That's done at mode initialization or when you switch to a style which sets this variable. Thus, if you change it -in some other way, e.g. interactively in a CC Mode buffer, you will need +in some other way, e.g., interactively in a CC Mode buffer, you will need to do @kbd{M-x java-mode} (or whatever mode you're currently using) to reinitialize. @@ -1993,7 +1993,7 @@ Indents the entire top-level function, class or macro definition encompassing point. It leaves point unchanged. This function can't be used to reindent a nested brace construct, such as a nested class or function, or a Java method. The top-level construct being reindented -must be complete, i.e. it must have both a beginning brace and an ending +must be complete, i.e., it must have both a beginning brace and an ending brace. @item @kbd{C-M-\} (@code{indent-region}) @@ -2239,7 +2239,7 @@ whether to do sentence motion in or near comments and multiline strings. A popular programming style, especially for object-oriented languages such as C++ is to write symbols in a mixed case format, where the first letter of each word is capitalized, and not separated by underscores. -E.g. @samp{SymbolsWithMixedCaseAndNoUnderlines}. +e.g., @samp{SymbolsWithMixedCaseAndNoUnderlines}. This command moves point forward to next capitalized word. With prefix argument @var{n}, move @var{n} times. @@ -2295,7 +2295,7 @@ styles. Only syntactic symbols not already bound on @code{c-offsets-alist} will be set from styles. This means that any association you set on it, be it before or after mode initialization, will not be changed. The -@code{c-offsets-alist} variable may therefore be used from e.g. the +@code{c-offsets-alist} variable may therefore be used from e.g., the Customization interface@footnote{Available in Emacs 20 and later, and XEmacs 19.15 and later.} to easily change indentation offsets without having to bother about styles. Initially @code{c-offsets-alist} is @@ -2563,7 +2563,7 @@ this manual does not cover how that works. Variables set like this at the top level in @file{.emacs} take effect in all @ccmode{} buffers, regardless of language. The indentation style -related variables, e.g. @code{c-offsets-alist}, that you don't set this +related variables, e.g., @code{c-offsets-alist}, that you don't set this way get their value from the style system (@pxref{Styles}), and they therefore depend on the setting of @code{c-default-style}. Note that if you use Customize, this means that the greyed-out default values @@ -2571,7 +2571,7 @@ presented there might not be the ones you actually get, since the actual values depend on the style, which may very well be different for different languages. -If you want to make more advanced configurations, e.g. language-specific +If you want to make more advanced configurations, e.g., language-specific customization, setting global variables isn't enough. For that you can use the language hooks, see @ref{Hooks}, and/or the style system, see @ref{Styles}. @@ -2940,8 +2940,8 @@ This variable takes an association list similar to what is allowed in automatically institute these offsets using @code{c-set-offset}. @end defvar -Note that file style settings (i.e. @code{c-file-style}) are applied -before file offset settings (i.e. @code{c-file-offsets}). Also, if +Note that file style settings (i.e., @code{c-file-style}) are applied +before file offset settings (i.e., @code{c-file-offsets}). Also, if either of these are set in a file's local variable section, all the style variable values are made local to that buffer. @@ -3086,7 +3086,7 @@ These @var{action} functions are called with two arguments: the syntactic symbol for the brace, and the buffer position at which the brace was inserted. The @var{action} function is expected to return a list containing some combination of @code{before} and @code{after}, -including neither of them (i.e. @code{nil}). This return value has the +including neither of them (i.e., @code{nil}). This return value has the normal brace hanging semantics. As an example, @ccmode{} itself uses this feature to dynamically @@ -3181,7 +3181,7 @@ No determination is made, and the next function in the list is called. If every function in the list is called without a determination being made, then no newline is added. The default value for this variable is a list containing a single function which inserts newlines only after -semicolons which do not appear inside parenthesis lists (i.e. those +semicolons which do not appear inside parenthesis lists (i.e., those that separate @code{for}-clause statements). @end defopt @@ -3215,7 +3215,7 @@ statements. In addition to @ccmode{} also comes with the criteria function @code{c-semi&comma-no-newlines-for-oneline-inliners}, which suppresses newlines after semicolons inside one-line inline method definitions -(e.g. in C++ or Java). +(e.g., in C++ or Java). @end defun @@ -3242,7 +3242,7 @@ every line is indented by @ccmode{}. You can use it to do any special indentation or line adjustments your style dictates, such as adding extra indentation to constructors or destructor declarations in a class definition, etc. Note that you should not change point or mark -inside your @code{c-special-indent-hook} functions, i.e. you'll +inside your @code{c-special-indent-hook} functions, i.e., you'll probably want to wrap your function in a @code{save-excursion}. Setting @code{c-special-indent-hook} in your style definition is @@ -3388,7 +3388,7 @@ Lines continuing an Objective-C method definition. @item objc-method-call-cont Lines continuing an Objective-C method call. @item extern-lang-open -Brace that opens an @code{extern} block (e.g. @code{extern "C" @{...@}}). +Brace that opens an @code{extern} block (e.g., @code{extern "C" @{...@}}). @item extern-lang-close Brace that closes an @code{extern} block. @item inextern-lang @@ -3411,9 +3411,9 @@ Analogous to the above, but for CORBA CIDL @code{composition} blocks. C++ template argument list continuations. @item inlambda Analogous to @code{inclass} syntactic symbol, but used inside lambda -(i.e. anonymous) functions. Only used in Pike mode. +(i.e., anonymous) functions. Only used in Pike mode. @item lambda-intro-cont -Lines continuing the header of a lambda function, i.e. between the +Lines continuing the header of a lambda function, i.e., between the @code{lambda} keyword and the function body. Only used in Pike mode. @item inexpr-statement A statement block inside an expression. The gcc C extension of this is @@ -3468,7 +3468,7 @@ top-level construct introduction so it has the syntax the brace that opens a top-level function definition. Line 9 is the corresponding @code{defun-close} since it contains the brace that closes the top-level -function definition. Line 4 is a @code{defun-block-intro}, i.e. it is +function definition. Line 4 is a @code{defun-block-intro}, i.e., it is the first line of a brace-block, enclosed in a top-level function definition. @@ -3793,7 +3793,7 @@ where @code{inextern-lang} is a modifier similar in purpose to There are various other top level blocks like @code{extern}, and they are all treated in the same way except that the symbols are named after -the keyword that introduces the block. E.g. C++ namespace blocks get +the keyword that introduces the block. e.g., C++ namespace blocks get the three symbols @code{namespace-open}, @code{namespace-close} and @code{innamespace}. The currently recognized top level blocks are: @@ -3950,9 +3950,9 @@ Line 17 is assigned @code{stream-op} syntax. @cindex syntactic whitespace @ssindex cpp-define-intro Multiline preprocessor macro definitions are normally handled just like -other code, i.e. the lines inside them are indented according to the +other code, i.e., the lines inside them are indented according to the syntactic analysis of the preceding lines inside the macro. The first -line inside a macro definition (i.e. the line after the starting line of +line inside a macro definition (i.e., the line after the starting line of the cpp directive itself) gets @code{cpp-define-intro}. In this example: @example @@ -3968,7 +3968,7 @@ line 1 is given the syntactic symbol @code{cpp-macro}. The first line of a cpp directive is always given that symbol. Line 2 is given @code{cpp-define-intro}, so that you can give the macro body as a whole some extra indentation. Lines 3 through 5 are then analyzed as normal -code, i.e. @code{substatement} on lines 3 and 4, and @code{else-clause} +code, i.e., @code{substatement} on lines 3 and 4, and @code{else-clause} on line 5. The syntactic analysis inside macros can be turned off with @@ -4094,7 +4094,7 @@ code @footnote{a.k.a. K&R C, or Kernighan & Ritchie C}: Here, line 2 is the first line in an argument declaration list and so is given the @code{knr-argdecl-intro} syntactic symbol. Subsequent lines -(i.e. lines 3 and 4 in this example), are given @code{knr-argdecl} +(i.e., lines 3 and 4 in this example), are given @code{knr-argdecl} syntax. @@ -4322,7 +4322,7 @@ if ( x < 10 Since this function doesn't do anything for lines without an infix operator you typically want to use it together with some other lineup -settings, e.g. as follows (the @code{arglist-close} setting is just a +settings, e.g., as follows (the @code{arglist-close} setting is just a suggestion to get a consistent style): @example @@ -4383,7 +4383,7 @@ to handle most of the common comment styles. Some examples: @end example The style variable @code{c-comment-prefix-regexp} is used to recognize -the comment line prefix, e.g. the @samp{*} that usually starts every +the comment line prefix, e.g., the @samp{*} that usually starts every line inside a comment. @workswith The @code{c} syntactic symbol. @@ -4512,7 +4512,7 @@ int dribble() @{ If @code{c-syntactic-indentation-in-macros} is non-@code{nil}, the function returns the relative indentation to the macro start line to -allow accumulation with other offsets. E.g. in the following cases, +allow accumulation with other offsets. e.g., in the following cases, @code{cpp-define-intro} is combined with the @code{statement-block-intro} that comes from the @samp{do @{} that hangs on the @samp{#define} line: @@ -4611,7 +4611,7 @@ arglist lineups, e.g. @defun c-lineup-inexpr-block @findex lineup-inexpr-block (c-) This can be used with the in-expression block symbols to indent the -whole block to the column where the construct is started. E.g. for Java +whole block to the column where the construct is started. e.g., for Java anonymous classes, this lines up the class under the @samp{new} keyword, and in Pike it lines up the lambda function body under the @samp{lambda} keyword. Returns @code{nil} if the block isn't part of such a @@ -4828,7 +4828,7 @@ expressions. @defun c-lineup-streamop @findex lineup-streamop (c-) -Line up C++ stream operators (i.e. @samp{<<} and @samp{>>}). +Line up C++ stream operators (i.e., @samp{<<} and @samp{>>}). @workswith @code{stream-op}. @end defun @@ -4956,7 +4956,7 @@ In the first case the indentation is kept unchanged, in the second @workswith @code{defun-close}, @code{defun-block-intro}, @code{block-close}, @code{brace-list-close}, @code{brace-list-intro}, @code{statement-block-intro} and all @code{in*} symbols, -e.g. @code{inclass} and @code{inextern-lang}. +e.g., @code{inclass} and @code{inextern-lang}. @end defun @@ -5050,7 +5050,7 @@ pairs. See @ref{AWK Mode Defuns} for a description of commands which work on AWK ``defuns''. Since there is no preprocessor in AWK, the commands which move to -preprocessor directives (e.g. @code{c-up-conditional}) are meaningless +preprocessor directives (e.g., @code{c-up-conditional}) are meaningless in AWK mode and are not bound in the AWK mode keymap. @item Auto-newline Insertion and Clean-ups @@ -5230,7 +5230,7 @@ present on the association list, CC Mode won't set The default is to set @code{require-final-newline} to @code{t} in the languages that mandates that source files should end with newlines, -i.e. C, C++ and Objective-C. +i.e., C, C++ and Objective-C. @end defopt @defopt c-echo-syntactic-information-p @@ -5271,9 +5271,9 @@ pathological code can cause @ccmode{} to perform fairly badly. This section gives some insight in how @ccmode{} operates, how that interacts with some coding styles, and what you can use to improve performance. -The overall goal is that @ccmode{} shouldn't be overly slow (i.e. take +The overall goal is that @ccmode{} shouldn't be overly slow (i.e., take more than a fraction of a second) in any interactive operation. -I.e. it's tuned to limit the maximum response time in single operations, +i.e., it's tuned to limit the maximum response time in single operations, which sometimes is at the expense of batch-like operations like reindenting whole blocks. If you find that @ccmode{} gradually gets slower and slower in certain situations, perhaps as the file grows in @@ -5292,7 +5292,7 @@ gets. @findex beginning-of-defun @findex defun-prompt-regexp One of the simplest things you can do to reduce scan time, is make sure -any brace that opens a top-level construct@footnote{E.g. a function in +any brace that opens a top-level construct@footnote{e.g., a function in C, or outermost class definition in C++ or Java.} always appears in the leftmost column. This is actually an Emacs constraint, as embodied in the @code{beginning-of-defun} function which @ccmode{} uses heavily. If @@ -5334,7 +5334,7 @@ XEmacs users can set the variable tells @ccmode{} to use XEmacs-specific built-in functions which, in some circumstances, can locate the top-most opening brace much more quickly than @code{beginning-of-defun}. Preliminary testing has shown that for -styles where these braces are hung (e.g. most JDK-derived Java styles), +styles where these braces are hung (e.g., most JDK-derived Java styles), this hack can improve performance of the core syntax parsing routines from 3 to 60 times. However, for styles which @emph{do} conform to Emacs' recommended style of putting top-level braces in column zero, @@ -5345,7 +5345,7 @@ in Emacs since the necessary built-in functions don't exist (in Emacs 21.3 as of this writing in May 2003). Text properties are used to speed up skipping over syntactic whitespace, -i.e. comments and preprocessor directives. Indenting a line after a +i.e., comments and preprocessor directives. Indenting a line after a huge macro definition can be slow the first time, but after that the text properties are in place and it should be fast (even after you've edited other parts of the file and then moved back). @@ -5353,7 +5353,7 @@ edited other parts of the file and then moved back). Font locking can be a CPU hog, especially the font locking done on decoration level 3 which tries to be very accurate. Note that that level is designed to be used with a font lock support mode that only -fontifies the text that's actually shown, i.e. Lazy Lock or Just-in-time +fontifies the text that's actually shown, i.e., Lazy Lock or Just-in-time Lock mode, so make sure you use one of them. Fontification of a whole buffer with some thousand lines can often take over a minute. That is a known weakness; the idea is that it never should happen. @@ -5386,7 +5386,7 @@ geared to be used interactively to edit new code. There's currently no intention to change this goal. If you want to reformat old code, you're probably better off using some -other tool instead, e.g. @ref{Top, , GNU indent, indent, The `indent' +other tool instead, e.g., @ref{Top, , GNU indent, indent, The `indent' Manual}, which has more powerful reformatting capabilities than @ccmode{}. @@ -5526,7 +5526,7 @@ to include any code that appears @emph{before} your bug example, if you think it might affect our ability to reproduce it. Please try to produce the problem in an Emacs instance without any -customizations loaded (i.e. start it with the @code{-q -no-site-file} +customizations loaded (i.e., start it with the @samp{-q --no-site-file} arguments). If it works correctly there, the problem might be caused by faulty customizations in either your own or your site configuration. In that case, we'd appreciate if you isolate the Emacs Lisp code that trigs diff --git a/man/cl.texi b/man/cl.texi index bc4db1cb927..455465a27a3 100644 --- a/man/cl.texi +++ b/man/cl.texi @@ -50,7 +50,7 @@ license to the document, as described in section 6 of the license. @end titlepage @node Top, Overview, (dir), (dir) -@chapter Overview +@chapter Introduction @noindent This document describes a set of Emacs Lisp facilities borrowed from @@ -82,12 +82,9 @@ does assume a basic familiarity with Emacs Lisp. @end menu @node Overview, Program Structure, Top, Top -@ifinfo +@ifnottex @chapter Overview -@end ifinfo -@iftex -@section Overview -@end iftex +@end ifnottex @noindent Common Lisp is a huge language, and Common Lisp systems tend to be diff --git a/man/cmdargs.texi b/man/cmdargs.texi index 3daf96f0d00..f528b804c72 100644 --- a/man/cmdargs.texi +++ b/man/cmdargs.texi @@ -259,6 +259,13 @@ Do not load @file{site-start.el}. The options @samp{-q}, @samp{-u} and @samp{--batch} have no effect on the loading of this file---this is the only option that blocks it. +@item -Q +@opindex -Q +Start emacs with minimum customizations and window decorations. +This is like using @samp{-q} and @samp{--no-site-file}, but in +addition it also disables the menu-bar, the tool-bar, the scroll-bars, +tool tips, the blinking cursor, and the fancy startup screen. + @item --no-splash @opindex --no-splash @vindex inhibit-startup-message diff --git a/man/custom.texi b/man/custom.texi index ab29bd83e09..ce52431f3c6 100644 --- a/man/custom.texi +++ b/man/custom.texi @@ -12,7 +12,7 @@ Manual} for how to make more far-reaching changes. @xref{X Resources}, for information on using X resources to customize Emacs. Customization that you do within Emacs normally affects only the -particular Emacs session that you do it in--it does not persist +particular Emacs session that you do it in---it does not persist between sessions unless you save the customization in a file such as @file{.emacs} or @file{.Xdefaults} that will affect future sessions. @xref{Init File}. In the customization buffer, when you save @@ -1946,7 +1946,7 @@ loaded. @file{site-start.el}, if it exists. Like @file{default.el}, Emacs finds this file via the standard search path for Lisp libraries. Emacs loads this library before it loads your init file. To inhibit -loading of this library, use the option @samp{-no-site-file}. +loading of this library, use the option @samp{--no-site-file}. @xref{Initial Options}. You can place @file{default.el} and @file{site-start.el} in any of @@ -1984,9 +1984,20 @@ arguments, all surrounded by parentheses. For example, @code{(setq fill-column 60)} calls the function @code{setq} to set the variable @code{fill-column} (@pxref{Filling}) to 60. - The second argument to @code{setq} is an expression for the new value of -the variable. This can be a constant, a variable, or a function call -expression. In @file{.emacs}, constants are used most of the time. They can be: + You can set any Lisp variable with @code{setq}, but with certain +variables @code{setq} won't do what you probably want in the +@file{.emacs} file. Some variables automatically become buffer-local +when set with @code{setq}; what you want in @file{.emacs} is to set +the default value, using @code{setq-default}. Some customizable minor +mode variables do special things to enable the mode when you set them +with Customize, but ordinary @code{setq} won't do that; to enable the +mode in your @file{.emacs} file, call the minor mode command. The +following section has examples of both of these methods. + + The second argument to @code{setq} is an expression for the new +value of the variable. This can be a constant, a variable, or a +function call expression. In @file{.emacs}, constants are used most +of the time. They can be: @table @asis @item Numbers: @@ -2108,6 +2119,14 @@ which supports most of the languages of Western Europe. @need 1500 @item +Turn off Line Number mode, a global minor mode. + +@example +(line-number-mode 0) +@end example + +@need 1500 +@item Turn on Auto Fill mode automatically in Text mode and related modes. @example diff --git a/man/dired-x.texi b/man/dired-x.texi index ad7711d10ae..d51fda342df 100644 --- a/man/dired-x.texi +++ b/man/dired-x.texi @@ -270,7 +270,7 @@ initialization file @file{default.el} in the @file{site-lisp} directory, put (add-hook 'dired-mode-hook (lambda () ;; Set dired-x buffer-local variables here. For example: - ;; (setq dired-omit-files-p t) + ;; (dired-omit-mode 1) )) @end example @@ -394,16 +394,19 @@ Marked files are never omitted. @table @kbd @item M-o @kindex M-o -@findex dired-omit-toggle -(@code{dired-omit-toggle}) Toggle between displaying and omitting -``uninteresting'' files. With a prefix argument, just mark -the files, but don't actually omit them. +@findex dired-omit-mode +(@code{dired-omit-mode}) Toggle between displaying and omitting +``uninteresting'' files. +@item * O +@kindex * O +@findex dired-mark-omitted +(@code{dired-mark-omitted}) Mark ``uninteresting'' files. @end table @noindent In order to make Dired Omit work you first need to load @file{dired-x.el} -inside @code{dired-load-hook} (@pxref{Installation}) and then set -@code{dired-omit-files-p} in some way (@pxref{Omitting Variables}). +inside @code{dired-load-hook} (@pxref{Installation}) and then evaluate +@code{(dired-omit-mode 1)} in some way (@pxref{Omitting Variables}). @ifinfo @menu @@ -423,8 +426,8 @@ The following variables can be used to customize omitting. @table @code -@vindex dired-omit-files-p -@item dired-omit-files-p +@vindex dired-omit-mode +@item dired-omit-mode Default: @code{nil} @@ -432,11 +435,11 @@ Default: @code{nil} If non-@code{nil}, ``uninteresting'' files are not listed. Uninteresting files are those whose files whose names match regexp @code{dired-omit-files}, plus those ending with extensions in -@code{dired-omit-extensions}. @kbd{M-o} (@code{dired-omit-toggle}) +@code{dired-omit-extensions}. @kbd{M-o} (@code{dired-omit-mode}) toggles its value, which is buffer-local. Put @example -(setq dired-omit-files-p t) +(dired-omit-mode 1) @end example @noindent @@ -449,7 +452,7 @@ Local Variables and put @example Local Variables: -dired-omit-files-p: t +dired-omit-mode: t End: @end example @@ -473,7 +476,7 @@ the directory listing (@pxref{Local Variables}). Default: @code{"^#\\|\\.$"} Files whose names match this buffer-local regexp will not be displayed. -This only has effect when @code{dired-omit-files-p}'s value is @code{t}. +This only has effect when @code{dired-omit-mode}'s value is @code{t}. The default value omits the special directories @file{.} and @file{..} and autosave files (plus other files ending in @file{.}) (@pxref{Omitting Examples}). @@ -604,7 +607,7 @@ For example, if the user puts @example Local Variables: dired-actual-switches: "-lat" -dired-omit-files-p: t +dired-omit-mode: t End: @end example @@ -696,7 +699,7 @@ Each element of the alist looks like @end example @noindent -where each @var{command} can either be a string or a lisp expression +where each @var{command} can either be a string or a Lisp expression that evaluates to a string. If several commands are given, all of them will temporarily be pushed onto the history. @@ -927,11 +930,11 @@ List of extensions of dispensable files created by Bib@TeX{}. @kindex M-( @findex dired-mark-sexp @cindex Lisp expression, marking files with in Dired -@cindex Mark file by lisp expression +@cindex Mark file by Lisp expression (@code{dired-mark-sexp}) Mark files for which @var{predicate} returns non-@code{nil}. With a prefix argument, unflag those files instead. -The @var{predicate} is a lisp expression that can refer to the following +The @var{predicate} is a Lisp expression that can refer to the following symbols: @table @code @item inode @@ -965,7 +968,7 @@ For example, use @end example to mark all zero length files. -To find out all not yet compiled Emacs lisp files in a directory, Dired +To find out all not yet compiled Emacs Lisp files in a directory, Dired all @file{.el} files in the lisp directory using the wildcard @samp{*.el}. Then use @kbd{M-(} with @example @@ -998,7 +1001,7 @@ directory in special major modes: Default: @code{((dired-mode . (dired-current-directory)))} Alist of major modes and their notion of @code{default-directory}, as a -lisp expression to evaluate. A resulting value of @code{nil} is ignored +Lisp expression to evaluate. A resulting value of @code{nil} is ignored in favor of @code{default-directory}. @item default-directory diff --git a/man/dired.texi b/man/dired.texi index 88e994ed027..9d2c5f096d5 100644 --- a/man/dired.texi +++ b/man/dired.texi @@ -58,7 +58,9 @@ the special commands of Dired are available. give to @code{ls} for listing directory; this string @emph{must} contain @samp{-l}. If you use a numeric prefix argument with the @code{dired} command, you can specify the @code{ls} switches with the minibuffer -before you enter the directory specification. +before you enter the directory specification. No matter how they are +specified, the @code{ls} switches should all be short options (that +is, single characters) requiring no arguments. @findex dired-other-window @kindex C-x 4 d @@ -589,6 +591,12 @@ The variable @code{dired-chown-program} specifies the name of the program to use to do the work (different systems put @code{chown} in different places). +@findex dired-do-touch +@kindex T @r{(Dired)} +@cindex changing file time (in Dired) +@item T @var{timestamp} @key{RET} +Change the time of the specified files (@code{dired-do-touch}). + @findex dired-do-print @kindex P @r{(Dired)} @cindex printing files (in Dired) @@ -1079,6 +1087,12 @@ minibuffer arguments, @var{directory} and @var{find-args}; it runs @code{find} what condition to test. To use this command, you need to know how to use @code{find}. +@vindex find-ls-option + The format of listing produced by these commands is controlled by the +variable @code{find-ls-option}, whose default value specifies using +options @samp{-ld} for @code{ls}. If your listings are corrupted, you +may need to change the value of this variable. + @findex locate @findex locate-with-filter @cindex file database (locate) @@ -1087,11 +1101,10 @@ know how to use @code{find}. program. @kbd{M-x locate-with-filter} is similar, but keeps only lines matching a given regular expression. -@vindex find-ls-option - The format of listing produced by these commands is controlled by the -variable @code{find-ls-option}, whose default value specifies using -options @samp{-ld} for @code{ls}. If your listings are corrupted, you -may need to change the value of this variable. +These buffers don't work entirely like ordinary Dired buffers. File +operations work, but do not always automatically update the buffer. +Reverting the buffer with @kbd{g} deletes all inserted subdirectories, +and erases all flags and marks. @node Misc Dired Commands @section Other Dired Commands diff --git a/man/emacs-xtra.texi b/man/emacs-xtra.texi new file mode 100644 index 00000000000..0d5633d71ca --- /dev/null +++ b/man/emacs-xtra.texi @@ -0,0 +1,313 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header +@setfilename ../info/emacs-xtra +@settitle Specialized Emacs Features +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@comment %**end of header + +@copying +This manual describes specialized features of Emacs. + +Copyright (C) 2004 +Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover texts being ``A GNU +Manual'', and with the Back-Cover Texts as in (a) below. A copy of the +license is included in the section entitled ``GNU Free Documentation +License'' in the Emacs manual. + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' + +This document is part of a collection distributed under the GNU Free +Documentation License. If you want to distribute this document +separately from the collection, you can do so by adding a copy of the +license to the document, as described in section 6 of the license. +@end quotation +@end copying + +@dircategory Emacs +@direntry +* Emacs-Xtra: (emacs-xtra). Specialized Emacs features. +@end direntry + +@titlepage +@title Specialized Emacs Features +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@contents + +@ifnottex +@node Top +@top Specialized Emacs Features + +@insertcopying + +@end ifnottex + +@menu +* Introduction:: What documentation belongs here? +* Autorevert:: Auto Reverting non-file buffers. +* Subdir switches:: Subdirectory switches in Dired. +* Index:: +@end menu + +@node Introduction +@unnumbered Introduction + +This manual contains detailed information about various features that +are too specialized to be included in the Emacs manual. It is +intended to be readable by anyone having a basic knowledge of Emacs. +However, certain sections may be intended for a more specialized +audience, such as Elisp authors. This should be clearly pointed out +at the beginning of these sections. + +This manual is intended as a complement, rather than an alternative, +to other ways to gain a more detailed knowledge of Emacs than the +Emacs manual can provide, such as browsing packages using @kbd{C-h p}, +accessing mode documentation using @kbd{C-h m} and browsing user +options using Custom. Also, certain packages, or collections of +related features, have their own manuals. The present manual is +mainly intended to be a collection of smaller specialized features, +too small to get their own manual. + +Sections intended specifically for Elisp programmers can follow the +style of the Elisp manual. Other sections should follow the style of +the Emacs manual. + +@node Autorevert +@chapter Auto Reverting non-file Buffers + +Normally Global Auto Revert Mode only reverts file buffers. There are +two ways to auto-revert certain non-file buffers: enabling Auto Revert +Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting +@code{global-auto-revert-non-file-buffers} to @code{t}. The latter +enables Auto Reverting for all types of buffers for which it is +implemented, that is, for the types of buffers listed in the menu +below. + +Like file buffers, non-file buffers should normally not revert while +you are working on them, or while they contain information that might +get lost after reverting. Therefore, they do not revert if they are +``modified''. This can get tricky, because deciding when a non-file +buffer should be marked modified is usually more difficult than for +file buffers. + +Another tricky detail is that, for efficiency reasons, Auto Revert +often does not try to detect all possible changes in the buffer, only +changes that are ``major'' or easy to detect. Hence, enabling +auto-reverting for a non-file buffer does not always guarantee that +all information in the buffer is up to date and does not necessarily +make manual reverts useless. + +At the other extreme, certain buffers automatically auto-revert every +@code{auto-revert-interval} seconds. (This currently only applies to +the Buffer Menu.) In this case, Auto Revert does not print any +messages while reverting, even when @code{auto-revert-verbose} is +non-@code{nil}. + +The details depend on the particular types of buffers and are +explained in the corresponding sections. + +@menu +* Auto Reverting the Buffer Menu:: +* Auto Reverting Dired:: +* Supporting additional buffers:: +@end menu + +@node Auto Reverting the Buffer Menu +@section Auto Reverting the Buffer Menu + +If auto-reverting of non-file buffers is enabled, the Buffer Menu +automatically reverts every @code{auto-revert-interval} seconds, +whether there is a need for it or not. (It would probably take longer +to check whether there is a need than to actually revert.) + +If the Buffer Menu inappropriately gets marked modified, just revert +it manually using @kbd{g} and auto-reverting will resume. However, if +you marked certain buffers to get deleted or to be displayed, you have +to be careful, because reverting erases all marks. The fact that +adding marks sets the buffer's modified flag prevents Auto Revert from +automatically erasing the marks. + +@node Auto Reverting Dired +@section Auto Reverting Dired buffers + +Auto-reverting Dired buffers currently works on GNU or Unix style +operating systems. It may not work satisfactorily on some other +systems. + +Dired buffers only auto-revert when the file list of the buffer's main +directory changes. They do not auto-revert when information about a +particular file changes or when inserted subdirectories change. To be +sure that @emph{all} listed information is up to date, you have to +manually revert using @kbd{g}, @emph{even} if auto-reverting is +enabled in the Dired buffer. Sometimes, you might get the impression +that modifying or saving files listed in the main directory actually +does cause auto-reverting. This is because making changes to a file, +or saving it, very often causes changes in the directory itself, for +instance, through backup files or auto-save files. However, this is +not guaranteed. + +If the Dired buffer is marked modified and there are no changes you +want to protect, then most of the time you can make auto-reverting +resume by manually reverting the buffer using @kbd{g}. There is one +exception. If you flag or mark files, you can safely revert the +buffer. This will not erase the flags or marks (unless the marked +file has been deleted, of course). However, the buffer will stay +modified, even after reverting, and auto-reverting will not resume. +This is because, if you flag or mark files, you may be working on the +buffer and you might not want the buffer to change without warning. +If you want auto-reverting to resume in the presence of marks and +flags, mark the buffer non-modified using @kbd{M-~}. However, adding, +deleting or changing marks or flags will mark it modified again. + +Remote Dired buffers are not auto-reverted. Neither are Dired buffers +for which you used shell wildcards or file arguments to list only some +of the files. @samp{*Find*} and @samp{*Locate*} buffers do not +auto-revert either. + +@node Supporting additional buffers +@section Adding Support for Auto-Reverting additional Buffers. + +This section is intended for Elisp programmers who would like to add +support for auto-reverting new types of buffers. + +To support auto-reverting the buffer must first of all have a +@code{revert-buffer-function}. @xref{Definition of +revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}. + +In addition, it @emph{must} have a @code{buffer-stale-function}. + +@defvar buffer-stale-function +The value of this variable is a function to check whether a non-file +buffer needs reverting. This should be a function with one optional +argument @var{noconfirm}. The function should return non-@code{nil} +if the buffer should be reverted. The buffer is current when this +function is called. + +While this function is mainly intended for use in auto-reverting, it +could be used for other purposes as well. For instance, if +auto-reverting is not enabled, it could be used to warn the user that +the buffer needs reverting. The idea behind the @var{noconfirm} +argument is that it should be @code{t} if the buffer is going to be +reverted without asking the user and @code{nil} if the function is +just going to be used to warn the user that the buffer is out of date. +In particular, for use in auto-reverting, @var{noconfirm} is @code{t}. +If the function is only going to be used for auto-reverting, you can +ignore the @var{noconfirm} argument. + +If you just want to automatically auto-revert every +@code{auto-revert-interval} seconds, use: + +@example +(set (make-local-variable 'buffer-stale-function) + #'(lambda (&optional noconfirm) 'fast)) +@end example + +@noindent +in the buffer's mode function. + +The special return value @samp{fast} tells the caller that the need +for reverting was not checked, but that reverting the buffer is fast. +It also tells Auto Revert not to print any revert messages, even if +@code{auto-revert-verbose} is non-@code{nil}. This is important, as +getting revert messages every @code{auto-revert-interval} seconds can +be very annoying. The information provided by this return value could +also be useful if the function is consulted for purposes other than +auto-reverting. +@end defvar + +Once the buffer has a @code{revert-buffer-function} and a +@code{buffer-stale-function}, several problems usually remain. + +The buffer will only auto-revert if it is marked unmodified. Hence, +you will have to make sure that various functions mark the buffer +modified if and only if either the buffer contains information that +might be lost by reverting or there is reason to believe that the user +might be inconvenienced by auto-reverting, because he is actively +working on the buffer. The user can always override this by manually +adjusting the modified status of the buffer. To support this, calling +the @code{revert-buffer-function} on a buffer that is marked +unmodified should always keep the buffer marked unmodified. + +It is important to assure that point does not continuously jump around +as a consequence of auto-reverting. Of course, moving point might be +inevitable if the buffer radically changes. + +You should make sure that the @code{revert-buffer-function} does not +print messages that unnecessarily duplicate Auto Revert's own messages +if @code{auto-revert-verbose} is @code{t} and effectively override a +@code{nil} value for @code{auto-revert-verbose}. Hence, adapting a +mode for auto-reverting often involves getting rid of such messages. +This is especially important for buffers that automatically +auto-revert every @code{auto-revert-interval} seconds. + +Also, you may want to update the documentation string of +@code{global-auto-revert-non-file-buffers}. + +@ifinfo +Finally, you should add a node to this chapter's menu. This node +@end ifinfo +@ifnotinfo +Finally, you should add a section to this chapter. This section +@end ifnotinfo +should at the very least make clear whether enabling auto-reverting +for the buffer reliably assures that all information in the buffer is +completely up to date (or will be after @code{auto-revert-interval} +seconds). + +@node Subdir switches +@chapter Subdirectory Switches in Dired + +You can insert subdirectories with specified @code{ls} switches in +Dired buffers, using @kbd{C-u i}. You can change the @code{ls} +switches of an already inserted subdirectory using @kbd{C-u l}. + +In Emacs versions 21.4 and later, Dired remembers the switches, so +that reverting the buffer will not change them back to the main +directory's switches. Deleting a subdirectory forgets about its +switches. + +Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u}) +to reinsert or delete subdirectories, that were inserted with explicit +switches, can bypass Dired's machinery for remembering (or forgetting) +switches. Deleting a subdirectory using @code{dired-undo} does not +forget its switches. When later reinserted using @kbd{i}, it will be +reinserted using its old switches. Using @code{dired-undo} to +reinsert a subdirectory that was deleted using the regular +Dired commands (not @code{dired-undo}) will originally insert it with +its old switches. However, reverting the buffer will relist it using +the buffer's default switches. If any of this yields problems, you +can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}. + +The buffer's default switches do not affect subdirectories that were +inserted using explicitly specified switches. In particular, +commands such as @kbd{s}, that change the buffer's switches do not +affect such subdirectories. (They do affect subdirectories without +explicitly assigned switches, however.) + +You can make Dired forget about all subdirectory switches and relist +all subdirectories with the buffer's default switches using +@kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer. + +@node Index +@unnumbered Index + +@printindex cp + +@bye + +@ignore + arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49 +@end ignore diff --git a/man/emacs.texi b/man/emacs.texi index 3162cd1e167..893f01e3baf 100644 --- a/man/emacs.texi +++ b/man/emacs.texi @@ -12,7 +12,7 @@ This is the @value{EDITION} edition of the @cite{GNU Emacs Manual}, updated for Emacs version @value{EMACSVER}. Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, -1999, 2000, 2001, 2002 Free Software Foundation, Inc. +1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -541,7 +541,6 @@ C and Related Modes * Hungry Delete:: A more powerful DEL command. * Other C Commands:: Filling comments, viewing expansion of macros, and other neat features. -* Comments in C:: Options for customizing comment style. Fortran Mode @@ -1500,9 +1499,9 @@ edit files while running shell commands. @include msdog.texi @include gnu.texi @include glossary.texi -@ifinfo +@ifnottex @include ack.texi -@end ifinfo +@end ifnottex @c The Option Index is produced only in the on-line version, @c because the index entries related to command-line options diff --git a/man/faq.texi b/man/faq.texi index 6894918079e..7c13dc16e7b 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -3542,7 +3542,7 @@ see @ref{Packages that do not come with Emacs}. @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen}, aims to provide one compact list with links to all of the current Emacs -lisp files on the internet. The ELL can be browsed over the web, or +Lisp files on the internet. The ELL can be browsed over the web, or from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el, the @file{ell} package}. diff --git a/man/files.texi b/man/files.texi index f73d1370eba..476c3c7b461 100644 --- a/man/files.texi +++ b/man/files.texi @@ -894,8 +894,9 @@ they change. Two minor modes are available to do this. In Global Auto-Revert mode, Emacs periodically checks all file buffers and reverts any when the corresponding file has changed. The local variant, Auto-Revert mode, applies only to buffers in which it was -activated. Checking the files is done at intervals determined by the -variable @code{auto-revert-interval}. +activated. The variable @code{auto-revert-interval} controls how +often to check for a changed file. Since checking a remote file is +too slow, these modes do not check or revert remote files. @node Auto Save @section Auto-Saving: Protection Against Disasters diff --git a/man/fixit.texi b/man/fixit.texi index 75dde658680..c7078c30b03 100644 --- a/man/fixit.texi +++ b/man/fixit.texi @@ -153,7 +153,7 @@ case-convert it and go on typing. @xref{Case}.@refill word or of a portion of a buffer. These commands work with the spelling checker program Ispell, which is not part of Emacs. @ifinfo -@xref{Top, Ispell, Overview ispell, ispell.info, The Ispell Manual}. +@xref{Top, Ispell, Overview ispell, ispell, The Ispell Manual}. @end ifinfo @table @kbd diff --git a/man/flymake.texi b/man/flymake.texi new file mode 100644 index 00000000000..e710b903361 --- /dev/null +++ b/man/flymake.texi @@ -0,0 +1,771 @@ +\input texinfo @c -*-texinfo-*- +@comment %**start of header +@setfilename ../info/flymake +@set VERSION 0.3 +@set UPDATED April 2004 +@settitle GNU Flymake @value{VERSION} +@syncodeindex pg cp +@comment %**end of header + +@copying +This manual is for GNU Flymake (version @value{VERSION}, @value{UPDATED}), +which is a universal on-the-fly syntax checker for GNU Emacs. + +Copyright @copyright{} 2004 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with no +Invariant Sections, with the Front-Cover texts being ``A GNU Manual'', +and with the Back-Cover Texts as in (a) below. A copy of the license +is included in the section entitled ``GNU Free Documentation License'' +in the Emacs manual. + +(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify +this GNU Manual, like GNU software. Copies published by the Free +Software Foundation raise funds for GNU development.'' + +This document is part of a collection distributed under the GNU Free +Documentation License. If you want to distribute this document +separately from the collection, you can do so by adding a copy of the +license to the document, as described in section 6 of the license. +@end quotation +@end copying + +@dircategory Emacs +@direntry +* Flymake: (flymake). A universal on-the-fly syntax checker. +@end direntry + +@titlepage +@title GNU Flymake +@subtitle for version @value{VERSION}, @value{UPDATED} +@author Pavel Kobiakov(@email{pk_at_work@@yahoo.com}) +@page +@vskip 0pt plus 1filll +@end titlepage + +@contents + +@ifnottex +@node Top +@top GNU Flymake +@end ifnottex + +@menu +* Overview of Flymake:: +* Obtaining Flymake:: +* Installing Flymake:: +* Using Flymake:: +* Configuring Flymake:: +* Flymake Implementation:: +* Index:: +@end menu + +@node Overview of Flymake +@chapter Overview +@cindex Overview of Flymake + +Flymake is a universal on-the-fly syntax checker implemented as an +Emacs minor mode. Flymake runs the pre-configured syntax check tool +(compiler for C++ files, @code{perl} for perl files, etc.) in the +background, passing it a temporary copy of the current buffer, and +parses the output for known error/warning message patterns. Flymake +then highlights erroneous lines (i.e. lines for which at least one +error or warning has been reported by the syntax check tool), and +displays an overall buffer status in the mode line. Status information +displayed by Flymake contains total number of errors and warnings +reported for the buffer during the last syntax check. + +@code{flymake-goto-next-error} and @code{flymake-goto-prev-error} +functions allow for easy navigation to the next/previous erroneous +line, respectively. + +Calling @code{flymake-display-err-menu-for-current-line} will popup a +menu containing error messages reported by the syntax check tool for +the current line. Errors/warnings belonging to another file, such as a +@code{.h} header file included by a @code{.c} file, are shown in the +current buffer as belonging to the first line. Menu items for such +messages also contain a filename and a line number. Selecting such a +menu item will automatically open the file and jump to the line with +error. + +Syntax check is done 'on-the-fly'. It is started whenever + +@itemize @bullet +@item buffer is loaded +@item a newline character is added to the buffer +@item some changes were made to the buffer more than @code{0.5} seconds ago (the +delay is configurable). +@end itemize + +Flymake is a universal syntax checker in the sense that it's easily +extended to support new syntax check tools and error message +patterns. @xref{Configuring Flymake}. + +@node Obtaining Flymake +@chapter Obtaining Flymake +@cindex Getting Flymake + +Release versions of Flymake can be downloaded from +@* @url{https://sourceforge.net/project/showfiles.php?group_id=77501}. +You can also try current version available via CVS at @url{https://}. + +Flymake's homepage is at @url{http://flymake.sourceforge.net}. + +@node Installing Flymake +@chapter Installing +@cindex Installing Flymake + + +Flymake is packaged in a single file, @code{flymake.el}. + +To install/update Flymake, place @code{flymake.el} to a directory +somewhere on Emacs load path. You might also want to byte-compile +@code{flymake.el} to improve performance. + +Also, place the following line in the @code{.emacs} file. + +@lisp +(require 'flymake) +@end lisp + +You might also map the most frequently used Flymake functions, such as +@code{flymake-goto-next-error}, to some keyboard shortcuts: + +@lisp +(global-set-key [f3] 'flymake-display-err-menu-for-current-line) +(global-set-key [f4] 'flymake-goto-next-error) +@end lisp + +@node Using Flymake +@chapter Using Flymake +@cindex Using Flymake + +@menu +* Flymake mode:: +* Running the syntax check:: +* Navigating to error lines:: +* Viewing error messages:: +* Syntax check statuses:: +* Troubleshooting:: +@end menu + +@node Flymake mode +@section Flymake mode +@cindex flymake-mode + +Flymake is an Emacs minor mode. To use Flymake, you +must first activate @code{flymake-mode} by using the +@code{flymake-mode} function. + +Instead of manually activating @code{flymake-mode}, you can configure +Flymake to automatically enable @code{flymake-mode} upon opening any +file for which syntax check is possible. To do so, place the following +line in @code{.emacs}: + +@lisp +(add-hook 'find-file-hooks 'flymake-find-file-hook) +@end lisp + +@node Running the syntax check +@section Running the syntax check +@cindex Manually starting the syntax check + +When @code{flymake-mode} is active, syntax check is started +automatically on any of the three conditions mentioned above. Syntax +check can also be started manually by using the +@code{flymake-start-syntax-check-for-current-buffer} function. This +can be used, for example, when changes were made to some other buffer +affecting the current buffer. + +@node Navigating to error lines +@section Navigating to error lines +@cindex Navigating to error lines + +After syntax check is completed, lines for which at least one error or +warning has been reported are highlighted, and total number of errors +and warning is shown in the mode line. Use the following functions to +navigate the highlighted lines. + +@multitable @columnfractions 0.25 0.75 + +@item @code{flymake-goto-next-error} +@tab Moves point to the next erroneous line, if any. + +@item @code{flymake-goto-prev-error} +@tab Moves point to the previous erroneous line. + +@end multitable + +These functions treat erroneous lines as a linked list. Therefore, +@code{flymake-goto-next-error} will go to the first erroneous line +when invoked in the end of the buffer. + +@node Viewing error messages +@section Viewing error messages +@cindex Viewing error messages + +To view error messages belonging to the current line, use the +@code{flymake-display-err-menu-for-current-line} function. If there's +at least one error or warning reported for the current line, this +function will display a popup menu with error/warning texts. +Selecting the menu item whose error belongs to another file brings +forward that file with the help of the +@code{flymake-goto-file-and-line} function. + +@node Syntax check statuses +@section Syntax check statuses +@cindex Syntax check statuses + +After syntax check is finished, its status is displayed in the mode line. +The following statuses are defined. + +@multitable @columnfractions 0.25 0.75 +@item Flymake* or Flymake:E/W* +@tab Flymake is currently running. For the second case, E/W contains the + error and warning count for the previous run. + +@item Flymake +@tab Syntax check is not running. Usually this means syntax check was + successfully passed (no errors, no warnings). Other possibilities are: + syntax check was killed as a result of executing + @code{flymake-compile}, or syntax check cannot start as compilation + is currently in progress. + +@item Flymake:E/W +@tab Number of errors/warnings found by the syntax check process. + +@item Flymake:! +@tab Flymake was unable to find master file for the current buffer. +@end multitable + +The following errors cause a warning message and switch flymake mode +OFF for the buffer. + +@multitable @columnfractions 0.25 0.75 +@item CFGERR +@tab Syntax check process returned nonzero exit code, but no + errors/warnings were reported. This indicates a possible configuration + error (for example, no suitable error message patterns for the + syntax check tool). + +@item NOMASTER +@tab Flymake was unable to find master file for the current buffer. + +@item NOMK +@tab Flymake was unable to find a suitable buildfile for the current buffer. + +@item PROCERR +@tab Flymake was unable to launch a syntax check process. +@end multitable + + +@node Troubleshooting +@section Troubleshooting +@cindex Logging +@cindex Troubleshooting + +Flymake uses a simple logging facility for indicating important points +in the control flow. The logging facility sends logging messages to +the @code{*Messages*} buffer. The information logged can be used for +resolving various problems related to Flymake. + +Logging output is controlled by the @code{flymake-log-level} +variable. @code{3} is the most verbose level, and @code{-1} switches +logging off. + +@node Configuring Flymake +@chapter Configuring and Extending Flymake +@cindex Configuring and Extending Flymake + +@menu +* Customizable variables:: +* Adding support for a new syntax check tool:: +@end menu + +Flymake was designed to be easily extended for supporting new syntax +check tools and error message patterns. + +@node Customizable variables +@section Customizable variables +@cindex Customizable variables + +This section summarises variables used for Flymake +configuration. + +@table @code +@item flymake-log-level +Controls logging output, see @ref{Troubleshooting}. + +@item flymake-allowed-file-name-masks +A list of @code{(filename-regexp, init-function, cleanup-function +getfname-function)} for configuring syntax check tools. @xref{Adding +support for a new syntax check tool}. + +@item flymake-buildfile-dirs +A list of directories (relative paths) for searching a +buildfile. @xref{Locating the buildfile}. + +@item flymake-master-file-dirs +A list of directories for searching a master file. @xref{Locating a +master file}. + +@item flymake-get-project-include-dirs-function +A function used for obtaining a list of project include dirs (C/C++ +specific). @xref{Getting the include directories}. + +@item flymake-master-file-count-limit +@itemx flymake-check-file-limit +Used when looking for a master file. @xref{Locating a master file}. + +@item flymake-err-line-patterns +Patterns for error/warning messages in the form @code{(regexp file-idx +line-idx err-text-idx)}. @xref{Parsing the output}. + +@item flymake-compilation-prevents-syntax-check +A flag indicating whether compilation and syntax check of the same +file cannot be run simultaneously. + +@item flymake-no-changes-timeout +If any changes are made to the buffer, syntax check is automatically +started after @code{flymake-no-changes-timeout} seconds. + +@item flymake-gui-warnings-enabled +A boolean flag indicating whether Flymake will show message boxes for +non-recoverable errors. If @code{flymake-gui-warnings-enabled} is +@code{nil}, these errors will only be logged to the @code{*Messages*} +buffer. + +@item flymake-start-syntax-check-on-newline +A boolean flag indicating whether to start syntax check after a +newline character is added to the buffer. + +@item flymake-errline-face +A custom face for highlighting lines for which at least one error has +been reported. + +@item flymake-warnline-face +A custom face for highlighting lines for which at least one warning +and no errors have been reported. + +@end table + +@node Adding support for a new syntax check tool +@section Adding support for a new syntax check tool +@cindex Adding support for a new syntax check tool + +@menu +* Example -- Configuring a tool called directly:: +* Example -- Configuring a tool called via make:: +@end menu + +Syntax check tools are configured using the +@code{flymake-allowed-file-name-masks} list. Each item of this list +has the following format: + +@lisp +(filename-regexp, init-function, cleanup-function, getfname-function) +@end lisp + +@table @code +@item filename-regexp +This field is used as a key for locating init/cleanup/getfname +functions for the buffer. Items in +@code{flymake-allowed-file-name-masks} are searched sequentially. The +first item with @code{filename-regexp} matching buffer filename is +selected. If no match is found, @code{flymake-mode} is switched off. + +@item init-function +@code{init-function} is required to initialise the syntax check, +usually by creating a temporary copy of the buffer contents. The +function must return @code{(list cmd-name arg-list)}. If +@code{init-function} returns null, syntax check is aborted, by +@code{flymake-mode} is not switched off. + +@item cleanup-function +@code{cleanup-function} is called after the syntax check process is +complete and should take care of proper deinitialization, which is +usually deleting a temporary copy created by the @code{init-function}. + +@item getfname-function +This function is used for translating filenames reported by the syntax +check tool into ``real'' filenames. Filenames reported by the tool +will be different from the real ones, as actually the tool works with +the temporary copy. In most cases, the default implementation +provided by Flymake, @code{flymake-get-real-file-name}, can be used as +@code{getfname-function}. + +@end table + +To add support for a new syntax check tool, write corresponding +@code{init-function}, and, optionally @code{cleanup-function} and +@code{getfname-function}. If the format of error messages reported by +the new tool is not yet supported by Flymake, add a new entry to +the @code{flymake-err-line-patterns} list. + +The following sections contain some examples of configuring Flymake +support for various syntax check tools. + +@node Example -- Configuring a tool called directly +@subsection Example -- Configuring a tool called directly +@cindex Adding support for perl + +In this example, we will add support for @code{perl} as a syntax check +tool. @code{perl} supports the @code{-c} option which does syntax +checking. + +First, we write the @code{init-function}: + +@lisp +(defun flymake-perl-init(buffer) + (let* ((temp-file (flymake-init-create-temp-buffer-copy + buffer + 'flymake-create-temp-inplace)) + (local-file (concat (flymake-build-relative-path + (file-name-directory + (buffer-file-name + (current-buffer))) + (file-name-directory temp-file)) + (file-name-nondirectory temp-file)))) + (list "perl" (list "-wc " local-file)) + ) +) +@end lisp + +@code{flymake-perl-init} creates a temporary copy of the buffer +contents with the help of +@code{flymake-init-create-temp-buffer-copy}, and builds an appropriate +command line. + +Next, we add a new entry to the +@code{flymake-allowed-file-name-masks}: + +@lisp +(setq flymake-allowed-file-name-masks + (cons '(".+\\.pl$" + flymake-perl-init + flymake-simple-cleanup + flymake-get-real-file-name) + flymake-allowed-file-name-masks)) +@end lisp + +Note that we use standard @code{cleanup-function} and +@code{getfname-function}. + +Finally, we add an entry to @code{flymake-err-line-patterns}: + +@lisp +(setq flymake-err-line-patterns + (cons '("\\(.*\\) at \\([^ \n]+\\) line \\([0-9]+\\)[,.\n]" 2 3 nil 1) + flymake-err-line-patterns)) +@end lisp + +@node Example -- Configuring a tool called via make +@subsection Example -- Configuring a tool called via make +@cindex Adding support for C (gcc+make) + +In this example we will add support for C files syntax checked by +@code{gcc} called via @code{make}. + +We're not required to write any new functions, as Flymake already has +functions for @code{make}. We just add a new entry to the +@code{flymake-allowed-file-name-masks}: + +@lisp +(setq flymake-allowed-file-name-masks + (cons '(".+\\.c$" + flymake-simple-make-init + flymake-simple-cleanup + flymake-get-real-file-name) + flymake-allowed-file-name-masks)) +@end lisp + +@code{flymake-simple-make-init} builds the following @code{make} +command line: + +@lisp +(list "make" + (list "-s" + "-C" + base-dir + (concat "CHK_SOURCES=" source) + "SYNTAX_CHECK_MODE=1" + "check-syntax")) +@end lisp + +@code{base-dir} is a directory containing @code{Makefile}, see @ref{Locating the buildfile}. + +Thus, @code{Makefile} must contain the @code{check-syntax} target. In +our case this target might look like this: + +@verbatim +check-syntax: + gcc -o nul -S ${CHK_SOURCES} +@end verbatim + +The format of error messages reported by @code{gcc} is already +supported by Flymake, so we don't have to add a new entry to +@code{flymake-err-line-patterns}. + +@node Flymake Implementation +@chapter Flymake Implementation +@cindex Implementation details + +@menu +* Determining whether syntax check is possible:: +* Making a temporary copy:: +* Locating a master file:: +* Getting the include directories:: +* Locating the buildfile:: +* Starting the syntax check process:: +* Parsing the output:: +* Highlighting erroneous lines:: +* Interaction with other modes:: +@end menu + +Syntax check is started by calling @code{flymake-start-syntax-check-for-current-buffer}. +Flymake first determines whether it is able to do syntax +check. It then saves a copy of the buffer in a temporary file in the +buffer's directory (or in the system temp directory -- for java +files), creates a syntax check command and launches a process with +this command. The output is parsed using a list of error message patterns, +and error information (file name, line number, type and text) is +saved. After the process has finished, Flymake highlights erroneous +lines in the buffer using the accumulated error information. + +@node Determining whether syntax check is possible +@section Determining whether syntax check is possible +@cindex Syntax check models +@cindex Master file + +Syntax check is considered possible if there's an entry in +@code{flymake-allowed-file-name-masks} matching buffer's filename and +its @code{init-function} returns non-nil value. + +Two syntax check modes are distinguished: + +@enumerate + +@item +Buffer can be syntax checked in a standalone fashion, that is, the +file (its temporary copy, in fact) can be passed over to the compiler to +do the syntax check. Examples are C/C++ (.c, .cpp) and Java (.java) +sources. + +@item +Buffer can be syntax checked, but additional file, called master file, +is required to perform this operation. A master file is a file that +includes the current file, so that running a syntax check tool on it +will also check syntax in the current file. Examples are C/C++ (.h, +.hpp) headers. + +@end enumerate + +These modes are handled inside init/cleanup/getfname functions, see +@ref{Adding support for a new syntax check tool}. + +Flymake contains implementations of all functionality required to +support different syntax check modes described above (making +temporary copies, finding master files, etc.), as well as some +tool-specific (routines for @code{make}, @code{Ant}, etc.) code. + + +@node Making a temporary copy +@section Making a temporary copy +@cindex Temporary copy of the buffer +@cindex Master file + +After the possibility of the syntax check has been determined, a +temporary copy of the current buffer is made so that the most recent +unsaved changes could be seen by the syntax check tool. Making a copy +is quite straightforward in a standalone case (mode @code{1}), as it's +just saving buffer contents to a temporary file. + +Things get trickier, however, when master file is involved, as it +requires to + +@itemize @bullet +@item locate a master file +@item patch it to include the current file using its new (temporary) +name. +@end itemize + +Locating a master file is discussed in the following section. + +Patching just changes all appropriate lines of the master file so that they +use the new (temporary) name of the current file. For example, suppose current +file name is @code{file.h}, the master file is @code{file.cpp}, and +it includes current file via @code{#include "file.h"}. Current file's copy +is saved to file @code{file_flymake.h}, so the include line must be +changed to @code{#include "file_flymake.h"}. Finally, patched master file +is saved to @code{file_flymake_master.cpp}, and the last one is passed to +the syntax check tool. + +@node Locating a master file +@section Locating a master file +@cindex Master file + +Master file is located in two steps. + +First, a list of possible master files is built. A simple name +matching is used to find the files. For a C++ header @code{file.h}, +Flymake searches for all @code{.cpp} files in the directories whose relative paths are +stored in a customizable variable @code{flymake-master-file-dirs}, which +usually contains something like @code{("." "./src")}. No more than +@code{flymake-master-file-count-limit} entries is added to the master file +list. The list is then sorted to move files with names @code{file.cpp} to +the top. + +Next, each master file in a list is checked to contain the appropriate +include directives. No more than @code{flymake-check-file-limit} of each +file are parsed. + +For @code{file.h}, the include directives to look for are +@code{#include "file.h"}, @code{#include "../file.h"}, etc. Each +include is checked against a list of include directories +(see @ref{Getting the include directories}) to be sure it points to the +correct @code{file.h}. + +First matching master file found stops the search. The master file is then +patched and saved to disk. In case no master file is found, syntax check is +aborted, and corresponding status (!) is reported in the mode line. + +@node Getting the include directories +@section Getting the include directories +@cindex Include directories (C/C++ specific) + +Two sets of include directories are distinguished: system include directories +and project include directories. The former is just the contents of the +@code{INCLUDE} environment variable. The latter is not so easy to obtain, +and the way it can be obtained can vary greatly for different projects. +Therefore, a customizable variable +@code{flymake-get-project-include-dirs-function} is used to provide the +way to implement the desired behaviour. + +The default implementation, @code{flymake-get-project-include-dirs-imp}, +uses a @code{make} call. This requires a correct base directory, that is, a +directory containing a correct @code{Makefile}, to be determined. + +As obtaining the project include directories might be a costly operation, its +return value is cached in the hash table. The cache is cleared in the beginning +of every syntax check attempt. + +@node Locating the buildfile +@section Locating the buildfile +@cindex Locating the buildfile +@cindex buildfile, locating +@cindex Makefile, locating + +Flymake can be configured to use different tools for performing syntax +checks. For example, it can use direct compiler call to syntax check a perl +script or a call to @code{make} for a more complicated case of a +@code{C/C++} source. The general idea is that simple files, like perl +scripts and html pages, can be checked by directly invoking a +corresponding tool. Files that are usually more complex and generally +used as part of larger projects, might require non-trivial options to +be passed to the syntax check tool, like include directories for +C++. The latter files are syntax checked using some build tool, like +@code{make} or @code{Ant}. + +All @code{make} configuration data is usually stored in a file called +@code{Makefile}. To allow for future extensions, flymake uses a notion of +buildfile to reference the 'project configuration' file. + +Special function, @code{flymake-find-buildfile} is provided for locating buildfiles. +Searching for a buildfile is done in a manner similar to that of searching +for possible master files. A customizable variable +@code{flymake-buildfile-dirs} holds a list of relative paths to the +buildfile. They are checked sequentially until a buildfile is found. In case +there's no build file, syntax check is aborted. + +Buildfile values are also cached. + +@node Starting the syntax check process +@section Starting the syntax check process +@cindex Syntax check process + +The command line (command name and the list of arguments) for launching a process is returned by the +initialization function. Flymake then just calls @code{start-process} +to start an asynchronous process and configures process filter and +sentinel which is used for processing the output of the syntax check +tool. + +@node Parsing the output +@section Parsing the output +@cindex Parsing the output + +The output generated by the syntax check tool is parsed in the process +filter/sentinel using the error message patterns stored in the +@code{flymake-err-line-patterns} variable. This variable contains a +list of items of the form @code{(regexp file-idx line-idx +err-text-idx)}, used to determine whether a particular line is an +error message and extract file name, line number and error text, +respectively. Error type (error/warning) is also guessed by matching +error text with the '@code{^[wW]arning}' pattern. Anything that was not +classified as a warning is considered an error. Type is then used to +sort error menu items, which shows error messages first. + +Flymake is also able to interpret error message patterns missing err-text-idx +information. This is done by merely taking the rest of the matched line +(@code{(substring line (match-end 0))}) as error text. This trick allows +to make use of a huge collection of error message line patterns from +@code{compile.el}. All these error patterns are appended to +the end of @code{flymake-err-line-patterns}. + +The error information obtained is saved in a buffer local +variable. The buffer for which the process output belongs is +determined from the process-id@w{}->@w{}buffer mapping updated +after every process launch/exit. + +@node Highlighting erroneous lines +@section Highlighting erroneous lines +@cindex Erroneous lines, faces + +Highlighting is implemented with overlays and happens in the process +sentinel, after calling the cleanup function. Two customizable faces +are used: @code{flymake-errline-face} and +@code{flymake-warnline-face}. Errors belonging outside the current +buffer are considered to belong to line 1 of the current buffer. + +@node Interaction with other modes +@section Interaction with other modes +@cindex Interaction with other modes +@cindex Interaction with compile mode + +The only mode flymake currently knows about is @code{compile}. + +Flymake can be configured to not start syntax check if it thinks the +compilation is in progress. The check is made by the +@code{flymake-compilation-is-running}, which tests the +@code{compilation-in-progress} variable. The reason why this might be +useful is saving CPU time in case both syntax check and compilation +are very CPU intensive. The original reason for adding this feature, +though, was working around a locking problem with MS Visual C++ compiler. + +Flymake also provides an alternative command for starting compilation, +@code{flymake-compile}: + +@lisp +(defun flymake-compile() + "kill all flymake syntax checks, start compilation" + (interactive) + (flymake-stop-all-syntax-checks) + (call-interactively 'compile) +) +@end lisp + +It just kills all the active syntax check processes before calling +@code{compile}. + +@node Index +@unnumbered Index + +@printindex cp + +@bye + +@ignore + arch-tag: 9f0db077-5598-49ab-90b9-8df9248a63ec +@end ignore diff --git a/man/help.texi b/man/help.texi index 56fb9f542d4..050e600759b 100644 --- a/man/help.texi +++ b/man/help.texi @@ -1,5 +1,5 @@ @c This is part of the Emacs manual. -@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001 +@c Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 2000, 2001, 2004 @c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @node Help, Mark, M-x, Top @@ -103,10 +103,10 @@ command. @iftex @node Help Summary @end iftex -@ifinfo +@ifnottex @node Help Summary @section Help Summary -@end ifinfo +@end ifnottex Here is a summary of the Emacs interactive help commands. @xref{Help Files}, for other help commands that just display a diff --git a/man/makefile.w32-in b/man/makefile.w32-in index c0f1a82abc1..45f890fd07a 100644 --- a/man/makefile.w32-in +++ b/man/makefile.w32-in @@ -1,6 +1,6 @@ -#### Makefile for the Emacs Manual and other documentation. +#### -*- Makefile -*- for the Emacs Manual and other documentation. -# Copyright (C) 2003 +# Copyright (C) 2003, 2004 # Free Software Foundation, Inc. # This file is part of GNU Emacs. @@ -45,13 +45,15 @@ INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \ $(infodir)/pcl-cvs $(infodir)/woman \ $(infodir)/emacs-mime $(infodir)/eshell \ $(infodir)/speedbar $(infodir)/tramp \ - $(infodir)/ses $(infodir)/smtpmail + $(infodir)/ses $(infodir)/smtpmail \ + $(infodir)/flymake $(infodir)/emacs-xtra DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ - speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi + speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ + emacs-xtra.dvi INFOSOURCES = info.texi # The following rule does not work with all versions of `make'. @@ -65,6 +67,7 @@ ENVADD = $(srcdir)\..\nt\envadd.bat "TEXINPUTS=$(srcdir);$(TEXINPUTS)" \ EMACSSOURCES= \ $(srcdir)/emacs.texi \ + $(srcdir)/emacs-xtra.texi \ $(srcdir)/doclicense.texi \ $(srcdir)/screen.texi \ $(srcdir)/commands.texi \ @@ -177,6 +180,11 @@ $(infodir)/ediff: ediff.texi ediff.dvi: ediff.texi $(ENVADD) $(TEXI2DVI) $(srcdir)/ediff.texi +$(infodir)/flymake: flymake.texi + $(MAKEINFO) flymake.texi +flymake.dvi: flymake.texi + $(ENVADD) $(TEXI2DVI) $(srcdir)/flymake.texi + $(infodir)/forms: forms.texi $(MAKEINFO) forms.texi forms.dvi: forms.texi @@ -185,7 +193,7 @@ forms.dvi: forms.texi $(infodir)/gnus: gnus.texi $(MAKEINFO) gnus.texi gnus.dvi: gnus.texi - sed -e '/@iflatex/,/@end iflatex/d' $(srcdir)/gnus.texi > gnustmp.texi + sed -e '/@iflatex/,/@end iflatex/d' $(srcdir)/gnus.texi > gnustmp.texi $(ENVADD) $(TEXI2DVI) gnustmp.texi cp gnustmp.dvi $*.dvi rm gnustmp.* @@ -291,6 +299,12 @@ $(infodir)/smtpmail: smtpmail.texi smtpmail.dvi: smtpmail.texi $(ENVADD) $(TEXI2DVI) $(srcdir)/smtpmail.texi +$(infodir)/emacs-xtra: emacs-xtra.texi + $(MAKEINFO) emacs-xtra.texi + +emacs-xtra.dvi: emacs-xtra.texi + $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi + mostlyclean: - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* @@ -302,15 +316,15 @@ clean: mostlyclean $(infodir)/gnus* $(infodir)/info* \ $(infodir)/message* $(infodir)/mh-e* \ $(infodir)/reftex* $(infodir)/sc* \ - $(infodir)/vip* $(infodir)/viper* \ - $(infodir)/widget* $(infodir)/efaq* \ - $(infodir)/ada-mode* $(infodir)/autotype* \ - $(infodir)/calc* $(infodir)/idlwave* \ - $(infodir)/eudc* $(infodir)/ebrowse* \ - $(infodir)/pcl-cvs* $(infodir)/woman* \ - $(infodir)/emacs-mime* $(infodir)/eshell* \ + $(infodir)/vip* $(infodir)/widget* \ + $(infodir)/efaq* $(infodir)/ada-mode* \ + $(infodir)/autotype* $(infodir)/calc* \ + $(infodir)/idlwave* $(infodir)/eudc* \ + $(infodir)/ebrowse* $(infodir)/pcl-cvs* \ + $(infodir)/woman* $(infodir)/eshell* \ $(infodir)/speedbar* $(infodir)/tramp* \ - $(infodir)/ses* $(infodir)/smtpmail* + $(infodir)/ses* $(infodir)/smtpmail* \ + $(infodir)/flymake* distclean: clean @@ -325,5 +339,3 @@ maintainer-clean: distclean # That caused trouble because this is run entirely in the source directory. # Since we expect to get texi2dvi from elsewhere, # it is ok to expect texindex from elsewhere also. - -# arch-tag: 6e99da59-ad27-4816-82a0-cde9a101efae diff --git a/man/msdog.texi b/man/msdog.texi index e701ba9fc75..157eba28844 100644 --- a/man/msdog.texi +++ b/man/msdog.texi @@ -352,7 +352,7 @@ effectively converts the file to Unix EOL style, like @code{dos2unix}. @findex add-untranslated-filesystem When you use NFS or Samba to access file systems that reside on computers using GNU or Unix systems, Emacs should not perform -end-of-line translation on any files in these file systems--not even +end-of-line translation on any files in these file systems---not even when you create a new file. To request this, designate these file systems as @dfn{untranslated} file systems by calling the function @code{add-untranslated-filesystem}. It takes one argument: the file @@ -436,7 +436,7 @@ discarded (sent to the system null device). On MS-Windows, when the Windows network software is installed, you can also use a printer shared by another machine by setting -@code{printer-name} to the UNC share name for that printer--for example, +@code{printer-name} to the UNC share name for that printer---for example, @code{"//joes_pc/hp4si"}. (It doesn't matter whether you use forward slashes or backslashes here.) To find out the names of shared printers, run the command @samp{net view} at a DOS command prompt to obtain a list diff --git a/man/pcl-cvs.texi b/man/pcl-cvs.texi index 427707fe4b5..2bd6703dac6 100644 --- a/man/pcl-cvs.texi +++ b/man/pcl-cvs.texi @@ -1057,6 +1057,11 @@ branch) (@code{cvs-mode-diff-head}).@refill Display a @samp{cvs diff} between the selected files and the head revision of the vendor branch in the repository. (@code{cvs-mode-diff-vendor}).@refill + +@item d y +Display a @samp{cvs diff} between the selected files and yesterday's +head revision in the repository. +(@code{cvs-mode-diff-yesterday}).@refill @end table By default, @samp{diff} commands ignore the marks. This can be changed diff --git a/man/programs.texi b/man/programs.texi index 84f3e6f14f8..e19c8364f2b 100644 --- a/man/programs.texi +++ b/man/programs.texi @@ -65,7 +65,6 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. @cindex Perl mode @cindex Icon mode -@cindex Awk mode @cindex Makefile mode @cindex Tcl mode @cindex CPerl mode @@ -82,7 +81,7 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}. @cindex PostScript mode The existing programming language major modes include Lisp, Scheme (a variant of Lisp) and the Scheme-based DSSSL expression language, Ada, -Awk, C, C++, Delphi (Object Pascal), Fortran (free format and fixed +AWK, C, C++, Delphi (Object Pascal), Fortran (free format and fixed format), Icon, IDL (CORBA), IDLWAVE, Java, Metafont (@TeX{}'s companion for font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Simula, Tcl, and VHDL. There is @@ -104,7 +103,7 @@ whitespace consists of spaces or tabs. Use @kbd{C-b C-d} to delete a tab character before point, in these modes. Separate manuals are available for the modes for Ada (@pxref{Top, , Ada -Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL +Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes (@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). @@ -446,15 +445,16 @@ modes and C and related modes.) @key{TAB} with a numeric argument reindents the current line as usual, then reindents by the same amount all the lines in the parenthetical grouping starting on the current line. It is clever, though, and does not alter lines that start -inside strings, or C preprocessor lines when in C mode. +inside strings. Neither does it alter C preprocessor lines when in C +mode, but it does reindent any continuation lines that may be attached +to them. @findex indent-code-rigidly You can also perform this operation on the region, using the command @kbd{M-x indent-code-rigidly}. It rigidly shifts all the lines in the region sideways, like @code{indent-rigidly} does (@pxref{Indentation Commands}). It doesn't alter the indentation of lines that start -inside a comment or a string, unless the region starts inside that -comment or string. +inside a string, unless the region also starts inside that string. @node Lisp Indent @subsection Customizing Lisp Indentation @@ -507,14 +507,15 @@ declaration (@code{c-indent-defun}). @kindex C-M-q @r{(C mode)} @findex c-indent-exp Reindent each line in the balanced expression that follows point -(@code{c-indent-exp}). A prefix argument inhibits error checking and -warning messages about invalid syntax. +(@code{c-indent-exp}). A prefix argument inhibits warning messages +about invalid syntax. @item @key{TAB} @findex c-indent-command Reindent the current line, and/or in some cases insert a tab character (@code{c-indent-command}). +@vindex c-tab-always-indent If @code{c-tab-always-indent} is @code{t}, this command always reindents the current line and does nothing else. This is the default. @@ -524,8 +525,7 @@ otherwise, it inserts a tab (or the equivalent number of spaces, if @code{indent-tabs-mode} is @code{nil}). Any other value (not @code{nil} or @code{t}) means always reindent the -line, and also insert a tab if within a comment, a string, or a -preprocessor directive. +line, and also insert a tab if within a comment or a string. @end table To reindent the whole current buffer, type @kbd{C-x h C-M-\}. This @@ -539,18 +539,19 @@ to the front of the block and then reindents it all. @subsection Customizing C Indentation @cindex style (for indentation) - C mode and related modes use a simple yet flexible mechanism for -customizing indentation. The mechanism works in two steps: first it -classifies the line syntactically according to its contents and context; -second, it associates each kind of syntactic construct with an -indentation offset based on your selected @dfn{style}. + C mode and related modes use a flexible mechanism for customizing +indentation. C mode indents a source line in two steps: first it +classifies the line syntactically according to its contents and +context; second, it determines the indentation offset associated by +your selected @dfn{style} with the syntactic construct and adds this +onto the indentation of the @dfn{anchor statement}. @table @kbd -@item M-x c-set-style @key{RET} @var{style} @key{RET} -Select predefined indentation style @var{style}. +@item C-c . @key{RET} @var{style} @key{RET} +Select a predefined style @var{style} (@code{c-set-style}). @end table - A style is a named collection of indentation customizations that can + A @dfn{style} is a named collection of customizations that can be used in C mode and the related modes. Emacs comes with several predefined styles, including @code{gnu}, @code{k&r}, @code{bsd}, @code{stroustrup}, @code{linux}, @code{python}, @code{java}, @@ -561,19 +562,21 @@ modes. To find out what a style looks like, select it and reindent some code, e.g., by typing @key{C-M-q} at the start of a function definition. +@kindex C-c . @r{(C mode)} @findex c-set-style - To choose a style for the current buffer, use the command @kbd{M-x -c-set-style}. Specify a style name as an argument (case is not -significant). This command affects the current buffer only, and it -affects only future invocations of the indentation commands; it does -not reindent the code in the buffer. To reindent the whole buffer in -the new style, you can type @kbd{C-x h C-M-\}. + To choose a style for the current buffer, use the command @kbd{C-c +.}. Specify a style name as an argument (case is not significant). +This command affects the current buffer only, and it affects only +future invocations of the indentation commands; it does not reindent +the code in the buffer. To reindent the whole buffer in the new +style, you can type @kbd{C-x h C-M-\}. @vindex c-default-style You can also set the variable @code{c-default-style} to specify the -default style for various major modes. Its value should be an alist, -in which each element specifies one major mode and which indentation -style to use for it. For example, +default style for various major modes. Its value should be either the +style's name (a string) or an alist, in which each element specifies +one major mode and which indentation style to use for it. For +example, @example (setq c-default-style @@ -848,18 +851,20 @@ also do spell checking on comments with Flyspell Prog mode The comment commands in this table insert, kill and align comments. They are described in this section and following sections. -@table @kbd -@item M-; +@table @asis +@item @kbd{M-;} Insert or realign comment on current line; alternatively, comment or uncomment the region (@code{comment-dwim}). -@item C-u M-; +@item @kbd{C-u M-;} Kill comment on current line (@code{comment-kill}). -@item C-x ; +@item @kbd{C-x ;} Set comment column (@code{comment-set-column}). -@item C-M-j +@item @kbd{C-M-j} +@itemx @kbd{M-j} Like @key{RET} followed by inserting and aligning a comment (@code{comment-indent-new-line}). -@item M-x comment-region +@item @kbd{M-x comment-region} +@itemx @kbd{C-c C-c} (in C-like modes) Add or remove comment delimiters on all the lines in the region. @end table @@ -937,17 +942,20 @@ is indented like a line of code. @subsection Multiple Lines of Comments @kindex C-M-j +@kindex M-j @cindex blank lines in programs @findex comment-indent-new-line If you are typing a comment and wish to continue it on another line, -you can use the command @kbd{C-M-j} (@code{comment-indent-new-line}). -This terminates the comment you are typing, creates a new blank line -afterward, and begins a new comment indented under the old one. When -Auto Fill mode is on, going past the fill column while typing a comment -causes the comment to be continued in just this fashion. If point is -not at the end of the line when @kbd{C-M-j} is typed, the text on -the rest of the line becomes part of the new comment line. - +you can use the command @kbd{C-M-j} or @kbd{M-j} +(@code{comment-indent-new-line}). This terminates the comment you are +typing, creates a new blank line afterward, and begins a new comment +indented under the old one. When Auto Fill mode is on, going past the +fill column while typing a comment causes the comment to be continued +in just this fashion. If point is not at the end of the line when you +type the command, the text on the rest of the line becomes part of the +new comment line. + +@kindex C-c C-c (C mode) @findex comment-region To turn existing lines into comment lines, use the @kbd{M-x comment-region} command. It adds comment delimiters to the lines that start @@ -970,12 +978,13 @@ if within a defun, it must be three. @vindex comment-column @kindex C-x ; @findex comment-set-column - The comment column is stored in the variable @code{comment-column}. You -can set it to a number explicitly. Alternatively, the command @kbd{C-x ;} -(@code{comment-set-column}) sets the comment column to the column point is -at. @kbd{C-u C-x ;} sets the comment column to match the last comment -before point in the buffer, and then does a @kbd{M-;} to align the -current line's comment under the previous one. + The @dfn{comment column}, the column at which Emacs tries to place +comments, is stored in the variable @code{comment-column}. You can +set it to a number explicitly. Alternatively, the command @kbd{C-x ;} +(@code{comment-set-column}) sets the comment column to the column +point is at. @kbd{C-u C-x ;} sets the comment column to match the +last comment before point in the buffer, and then does a @kbd{M-;} to +align the current line's comment under the previous one. The variable @code{comment-column} is per-buffer: setting the variable in the normal fashion affects only the current buffer, but there is a @@ -990,7 +999,7 @@ Make sure this regexp does not match the null string. It may match more than the comment starting delimiter in the strictest sense of the word; for example, in C mode the value of the variable is @c This stops M-q from breaking the line inside that @code. -@code{@w{"/\\*+ *\\|//+ *""}}, which matches extra stars and spaces +@code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces after the @samp{/*} itself, and accepts C++ style comments also. (Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in the string, which is needed to deny the first star its special meaning @@ -1006,21 +1015,21 @@ into the comment. In C mode, @code{comment-start} has the value @vindex comment-padding The variable @code{comment-padding} specifies how many spaces -@code{comment-region} should insert on each line between the -comment delimiter and the line's original text. The default is 1, -to insert one space. +@code{comment-region} should insert on each line between the comment +delimiter and the line's original text. The default is 1, to insert +one space. @code{nil} means 0. Alternatively, @code{comment-padding} +can hold the actual string to insert. @vindex comment-multi-line The variable @code{comment-multi-line} controls how @kbd{C-M-j} -(@code{indent-new-comment-line}) behaves when used inside a comment. If -@code{comment-multi-line} is @code{nil}, as it normally is, then the -comment on the starting line is terminated and a new comment is started -on the new following line. If @code{comment-multi-line} is not -@code{nil}, then the new following line is set up as part of the same -comment that was found on the starting line. This is done by not -inserting a terminator on the old line, and not inserting a starter on -the new line. In languages where multi-line comments work, the choice -of value for this variable is a matter of taste. +(@code{indent-new-comment-line}) behaves when used inside a comment. +Specifically, when @code{comment-multi-line} is @code{nil} (the +default value), the command inserts a comment terminator, begins a new +line, and finally inserts a comment starter. Otherwise it does not +insert the terminator and starter, so it effectively continues the +current comment across multiple lines. In languages that allow +multi-line comments, the choice of value for this variable is a matter +of taste. @vindex comment-indent-function The variable @code{comment-indent-function} should contain a function @@ -1052,9 +1061,9 @@ use in your program. @findex info-lookup-symbol @findex info-lookup-file -@kindex C-h C-i +@kindex C-h S For C, Lisp, and other languages that have documentation in Info, -you can use @kbd{C-h C-i} (@code{info-lookup-symbol}) to view the Info +you can use @kbd{C-h S} (@code{info-lookup-symbol}) to view the Info documentation for a symbol. You specify the symbol with the minibuffer; the default is the symbol appearing in the buffer at point. @@ -1064,7 +1073,7 @@ symbol---which Info files to look in, and which indices to search. You can also use @kbd{M-x info-lookup-file} to look for documentation for a file name. - This feature currently supports the modes Awk, Autoconf, Bison, C, + This feature currently supports the modes AWK, Autoconf, Bison, C, Emacs Lisp, LaTeX, M4, Makefile, Octave, Perl, Scheme, and Texinfo, provided you have installed the relevant Info files, which are typically available with the appropriate GNU package. @@ -1081,7 +1090,7 @@ still useful to read manual pages. @findex manual-entry You can read the man page for an operating system command, library -function, or system call, with the @kbd{M-x manual-entry} command. It +function, or system call, with the @kbd{M-x man} command. It runs the @code{man} program to format the man page; if the system permits, it runs @code{man} asynchronously, so that you can keep on editing while the page is being formatted. (On MS-DOS and MS-Windows @@ -1393,25 +1402,27 @@ Mode}). The Foldout package provides folding-editor features @cindex CORBA IDL mode @cindex Objective C mode @cindex C++ mode +@cindex AWK mode @cindex mode, Java @cindex mode, C +@cindex mode, C++ @cindex mode, Objective C @cindex mode, CORBA IDL @cindex mode, Pike +@cindex mode, AWK This section gives a brief description of the special features -available in C, C++, Objective-C, Java, CORBA IDL, and Pike modes. +available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. (These are called ``C mode and related modes.'') @xref{Top, , CC Mode, ccmode, CC Mode}, for a more extensive description of these modes and their special features. @menu -* Motion in C:: Commands to move by C statements, etc. -* Electric C:: Colon and other chars can automatically reindent. -* Hungry Delete:: A more powerful DEL command. -* Other C Commands:: Filling comments, viewing expansion of macros, - and other neat features. -* Comments in C:: Options for customizing comment style. +* Motion in C:: Commands to move by C statements, etc. +* Electric C:: Colon and other chars can automatically reindent. +* Hungry Delete:: A more powerful DEL command. +* Other C Commands:: Filling comments, viewing expansion of macros, + and other neat features. @end menu @node Motion in C @@ -1421,15 +1432,29 @@ and their special features. related modes. @table @code +@item M-x c-beginning-of-defun +@itemx M-x c-end-of-defun +@findex c-beginning-of-defun +@findex c-end-of-defun +Move point to the beginning or end of the current function or +top-level definition. These are found by searching for the least +enclosing braces. (By contrast, @code{beginning-of-defun} and +@code{end-of-defun} search for braces in column zero.) If you are +editing code where the opening brace of a function isn't placed in +column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to +these commands. @xref{Moving by Defuns}. + @item C-c C-u @kindex C-c C-u @r{(C mode)} @findex c-up-conditional Move point back to the containing preprocessor conditional, leaving the mark behind. A prefix argument acts as a repeat count. With a negative argument, move point forward to the end of the containing -preprocessor conditional. When going backwards, @code{#elif} is treated -like @code{#else} followed by @code{#if}. When going forwards, -@code{#elif} is ignored.@refill +preprocessor conditional. + +@samp{#elif} is equivalent to @samp{#else} followed by @samp{#if}, so +the function will stop at a @samp{#elif} when going backward, but not +when going forward. @item C-c C-p @kindex C-c C-p @r{(C mode)} @@ -1446,27 +1471,22 @@ behind. A prefix argument acts as a repeat count. With a negative argument, move backward. @item M-a -@kindex ESC a +@kindex M-a (C mode) @findex c-beginning-of-statement Move point to the beginning of the innermost C statement (@code{c-beginning-of-statement}). If point is already at the beginning of a statement, move to the beginning of the preceding statement. With prefix argument @var{n}, move back @var{n} @minus{} 1 statements. -If point is within a string or comment, or next to a comment (only -whitespace between them), this command moves by sentences instead of -statements. - -When called from a program, this function takes three optional -arguments: the numeric prefix argument, a buffer position limit -(don't move back before that place), and a flag that controls whether -to do sentence motion when inside of a comment. +In comments or in strings which span more than one line, this command +moves by sentences instead of statements. @item M-e -@kindex ESC e +@kindex M-e (C mode) @findex c-end-of-statement -Move point to the end of the innermost C statement; like @kbd{M-a} -except that it moves in the other direction (@code{c-end-of-statement}). +Move point to the end of the innermost C statement or sentence; like +@kbd{M-a} except that it moves in the other direction +(@code{c-end-of-statement}). @item M-x c-backward-into-nomenclature @findex c-backward-into-nomenclature @@ -1530,12 +1550,14 @@ Insert a double colon scope operator at point, without reindenting the line or adding any newlines (@code{c-scope-operator}). @end table +@vindex c-electric-pound-behavior The electric @kbd{#} key reindents the line if it appears to be the beginning of a preprocessor directive. This happens when the value of @code{c-electric-pound-behavior} is @code{(alignleft)}. You can turn this feature off by setting @code{c-electric-pound-behavior} to @code{nil}. +@vindex c-hanging-braces-alist The variable @code{c-hanging-braces-alist} controls the insertion of newlines before and after inserted braces. It is an association list with elements of the following form: @code{(@var{syntactic-symbol} @@ -1550,6 +1572,7 @@ to determine where newlines are inserted: either before the brace, after, or both. If not found, the default is to insert a newline both before and after braces. +@vindex c-hanging-colons-alist The variable @code{c-hanging-colons-alist} controls the insertion of newlines before and after inserted colons. It is an association list with elements of the following form: @code{(@var{syntactic-symbol} @@ -1562,6 +1585,7 @@ where newlines are inserted: either before the brace, after, or both. If the syntactic symbol is not found in this list, no newlines are inserted. +@vindex c-cleanup-list Electric characters can also delete newlines automatically when the auto-newline feature is enabled. This feature makes auto-newline more acceptable, by deleting the newlines in the most common cases where you @@ -1613,6 +1637,7 @@ whitespace. @node Hungry Delete @subsection Hungry Delete Feature in C +@cindex hungry deletion (C Mode) When the @dfn{hungry-delete} feature is enabled (indicated by @samp{/h} or @samp{/ah} in the mode line after the mode name), a single @@ -1642,6 +1667,21 @@ hungry-delete feature is enabled. @subsection Other Commands for C Mode @table @kbd +@item M-x c-context-line-break +@findex c-context-line-break +This command inserts a line break and indents the new line in a manner +appropriate to the context. In normal code, it does the work of +@kbd{C-j} (@code{newline-and-indent}), in a C preprocessor line it +additionally inserts a @samp{\} at the line break, and within comments +it's like @kbd{M-j} (@code{c-indent-new-comment-line}). + +@code{c-context-line-break} isn't bound to a key by default, but it +needs a binding to be useful. The following code will bind it to +@kbd{C-j}. +@example +(define-key c-mode-base-map "\C-j" 'c-context-line-break) +@end example + @item C-M-h Put mark at the end of a function definition, and put point at the beginning (@code{c-mark-function}). @@ -1702,6 +1742,7 @@ directs how the line is indented. @itemx M-x global-cwarn-mode @findex cwarn-mode @findex global-cwarn-mode +@vindex global-cwarn-mode @cindex CWarn mode @cindex suspicious constructions in C, C++ CWarn minor mode highlights certain suspicious C and C++ constructions: @@ -1741,42 +1782,6 @@ to a C/C++ source file, or vice versa. The variable names. @end table -@node Comments in C -@subsection Comments in C Modes - - C mode and related modes use a number of variables for controlling -comment format. - -@table @code -@item c-comment-only-line-offset -@vindex c-comment-only-line-offset -Extra offset for line which contains only the start of a comment. It -can be either an integer or a cons cell of the form -@code{(@var{non-anchored-offset} . @var{anchored-offset})}, where -@var{non-anchored-offset} is the amount of offset given to -non-column-zero anchored comment-only lines, and @var{anchored-offset} -is the amount of offset to give column-zero anchored comment-only lines. -Just an integer as value is equivalent to @code{(@var{val} . 0)}. - -@item c-comment-start-regexp -@vindex c-comment-start-regexp -This buffer-local variable specifies how to recognize the start of a comment. - -@item c-hanging-comment-ender-p -@vindex c-hanging-comment-ender-p -If this variable is @code{nil}, @code{c-fill-paragraph} leaves the -comment terminator of a block comment on a line by itself. The default -value is @code{t}, which puts the comment-end delimiter @samp{*/} at the -end of the last line of the comment text. - -@item c-hanging-comment-starter-p -@vindex c-hanging-comment-starter-p -If this variable is @code{nil}, @code{c-fill-paragraph} leaves the -starting delimiter of a block comment on a line by itself. The default -value is @code{t}, which puts the comment-start delimiter @samp{/*} at -the beginning of the first line of the comment text. -@end table - @node Fortran @section Fortran Mode @cindex Fortran mode diff --git a/man/search.texi b/man/search.texi index 303074dcf0d..fbc8d24bf23 100644 --- a/man/search.texi +++ b/man/search.texi @@ -724,6 +724,18 @@ determines which characters these are. @xref{Syntax}. @item \W matches any character that is not a word-constituent. +@item \_< +matches the empty string, but only at the beginning of a symbol. A +symbol is a sequence of one or more word or symbol constituent +characters. @samp{\_<} matches at the beginning of the buffer only if +a symbol-constituent character follows. + +@item \_> +matches the empty string, but only at the end of a symbol. A symbol +is a sequence of one or more word or symbol constituent characters. +@samp{\_>} matches at the end of the buffer only if the contents end +with a symbol-constituent character. + @item \s@var{c} matches any character whose syntax is @var{c}. Here @var{c} is a character that designates a particular syntax class: thus, @samp{w} diff --git a/man/ses.texi b/man/ses.texi index e5f8059fd2a..8e0086ac54b 100644 --- a/man/ses.texi +++ b/man/ses.texi @@ -41,7 +41,7 @@ license to the document, as described in section 6 of the license. @title SES @subtitle Simple Emacs Spreadsheet @author Jonathan A. Yavner -@author @email{jyavner@@engineer.com} +@author @email{jyavner@@member.fsf.org} @page @vskip 0pt plus 1filll diff --git a/man/smtpmail.texi b/man/smtpmail.texi index 08ce87ac995..6efe6f71630 100644 --- a/man/smtpmail.texi +++ b/man/smtpmail.texi @@ -215,13 +215,30 @@ variables contains the authentication information needed for this. The first variable, @code{smtpmail-auth-credentials}, instructs the SMTP library to use a SASL authentication step, currently only the CRAM-MD5 and LOGIN mechanisms are supported and will be selected in -that order if the server supports them. The second variable, -@code{smtpmail-starttls-credentials}, instructs the SMTP library to -connect to the server using STARTTLS. This means the protocol -exchange can be integrity protected and confidential by using TLS, and -optionally also authentication of the client. It is common to use -both these mechanisms, e.g., to use STARTTLS to achieve integrity and -confidentiality and then use SASL for client authentication. +that order if the server support both. + +The second variable, @code{smtpmail-starttls-credentials}, instructs +the SMTP library to connect to the server using STARTTLS. This means +the protocol exchange may be integrity protected and confidential by +using TLS, and optionally also authentication of the client. This +feature uses the elisp package @file{starttls.el} (see it for more +information on customization), which in turn require that at least one +of the following external tools are installed: + +@enumerate +@item +The GNUTLS command line tool @samp{gnutls-cli}, you can get it from +@url{http://www.gnu.org/software/gnutls/}. This is the recommended +tool, mainly because it can verify the server certificates. + +@item +The @samp{starttls} external program, you can get it from +@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}. +@end enumerate + +It is not uncommon to use both these mechanisms, e.g., to use STARTTLS +to achieve integrity and confidentiality and then use SASL for client +authentication. @table @code @item smtpmail-auth-credentials @@ -231,11 +248,13 @@ hostname, port, username and password tuples. When the SMTP library connects to a host on a certain port, this variable is searched to find a matching entry for that hostname and port. If an entry is found, the authentication process is invoked and the credentials are -used. The hostname field follows the same format as +used. + +The hostname field follows the same format as @code{smtpmail-smtp-server} (i.e., a string) and the port field the same format as @code{smtpmail-smtp-service} (i.e., a string or an integer). The username and password fields, which either can be -@code{nil} to indicate that the user is queried for the value +@code{nil} to indicate that the user is prompted for the value interactively, should be strings with the username and password, respectively, information that is normally provided by system administrators. @@ -246,10 +265,7 @@ administrators. tuples with hostname, port, name of file containing client key, and name of file containing client certificate. The processing is similar to the previous variable. The client key and certificate may be -@code{nil} if you do not wish to use client authentication. The use -of this variable requires the @samp{starttls} external program to be -installed, you can get @file{starttls-*.tar.gz} from -@uref{ftp://ftp.opaopa.org/pub/elisp/}. +@code{nil} if you do not wish to use client authentication. @end table The following example illustrates what you could put in diff --git a/man/tramp.texi b/man/tramp.texi index 7e21b9c691f..ebba03d6260 100644 --- a/man/tramp.texi +++ b/man/tramp.texi @@ -17,16 +17,11 @@ @include trampver.texi -@c Macro to make formatting of the tramp program name consistent. -@macro tramp -@sc{tramp} -@end macro - @c Macros for formatting a filename. @c trampfn is for a full filename, trampfnmhp means method, host, localname @c were given, and so on. @macro trampfn(method, user, host, localname) -@value{tramp-prefix}@value{method}@value{user}@@@value{host}@value{tramp-postfix}@value{localname} +@value{prefix}@value{method}@value{user}@@@value{host}@value{postfix}@value{localname} @end macro @copying @@ -54,16 +49,16 @@ license to the document, as described in section 6 of the license. @end copying @c Entries for @command{install-info} to use -@dircategory @value{emacs-name} +@dircategory @value{emacsname} @direntry * TRAMP: (tramp). Transparent Remote Access, Multiple Protocol - @value{emacs-name} remote file access via rsh and rcp. + @value{emacsname} remote file access via rsh and rcp. @end direntry @tex @titlepage -@title @tramp{} version @trampver{} User Manual +@title @value{tramp} version @value{trampver} User Manual @author by Daniel Pittman @author based on documentation by Kai Gro@ss{}johann @@ -78,17 +73,17 @@ license to the document, as described in section 6 of the license. @ifnottex @node Top, Overview, (dir), (dir) -@top @tramp{} version @trampver{} User Manual +@top @value{tramp} version @value{trampver} User Manual -This file documents @tramp{} version @trampver{}, a remote file -editing package for @value{emacs-name}. +This file documents @value{tramp} version @value{trampver}, a remote file +editing package for @value{emacsname}. -@tramp{} stands for `Transparent Remote (file) Access, Multiple +@value{tramp} stands for `Transparent Remote (file) Access, Multiple Protocol'. This package provides remote file editing, similar to -@value{ftp-package-name}. +@value{ftppackagename}. -The difference is that @value{ftp-package-name} uses FTP to transfer -files between the local and the remote host, whereas @tramp{} uses a +The difference is that @value{ftppackagename} uses FTP to transfer +files between the local and the remote host, whereas @value{tramp} uses a combination of @command{rsh} and @command{rcp} or other work-alike programs, such as @command{ssh}/@command{scp}. @@ -96,27 +91,35 @@ You can find the latest version of this document on the web at @uref{http://www.freesoftware.fsf.org/tramp/}. @c Pointer to the other Emacs flavor is necessary only in case of -@c standalone installation. Text taken from trampinst.texi. -@ifset tramp-inst -@otherflavor{} +@c standalone installation. +@ifset installchapter +The manual has been generated for @value{emacsname}. +@ifinfo +If you want to read the info pages for @value{emacsothername}, you +should read in @ref{Installation} how to create them. +@end ifinfo +@ifhtml +If you're using the other Emacs flavour, you should read the +@uref{@value{emacsotherfilename}, @value{emacsothername}} pages. +@end ifhtml @end ifset @ifhtml @ifset jamanual -This manual is also available as a @uref{@value{japanese-manual}, +This manual is also available as a @uref{@value{japanesemanual}, Japanese translation}. @end ifset -The latest release of @tramp{} is available for -@uref{http://savannah.nongnu.org/download/tramp/, -download}, or you may see @ref{Obtaining @tramp{}} for more details, -including the CVS server details. +The latest release of @value{tramp} is available for +@uref{http://savannah.nongnu.org/download/tramp/, download}, or you +may see @ref{Obtaining Tramp} for more details, including the CVS +server details. -@tramp{} also has a @uref{http://savannah.nongnu.org/projects/tramp/, +@value{tramp} also has a @uref{http://savannah.nongnu.org/projects/tramp/, Savannah Project Page}. @end ifhtml -There is a mailing list for @tramp{}, available at +There is a mailing list for @value{tramp}, available at @email{tramp-devel@@mail.freesoftware.fsf.org}, and archived at @uref{http://savannah.nongnu.org/mail/?group=tramp, Savannah Mail Archive}. @@ -135,17 +138,17 @@ The Mail Archive}. @end ifnottex @menu -* Overview:: What @tramp{} can and cannot do. +* Overview:: What @value{tramp} can and cannot do. For the end user: -* Obtaining @tramp{}:: How to obtain @tramp{}. -* History:: History of @tramp{}. -@ifset tramp-inst -* Installation:: Installing @tramp{} with your @value{emacs-name}. +* Obtaining Tramp:: How to obtain @value{tramp}. +* History:: History of @value{tramp}. +@ifset installchapter +* Installation:: Installing @value{tramp} with your @value{emacsname}. @end ifset -* Configuration:: Configuring @tramp{} for use. -* Usage:: An overview of the operation of @tramp{}. +* Configuration:: Configuring @value{tramp} for use. +* Usage:: An overview of the operation of @value{tramp}. * Bug Reports:: Reporting Bugs and Problems. * Frequently Asked Questions:: Questions and answers from the mailing list. * Concept Index:: An item for each concept. @@ -159,16 +162,16 @@ For the developer: @detailmenu --- The Detailed Node Listing --- @c -@ifset tramp-inst -Installing @tramp{} with your @value{emacs-name} +@ifset installchapter +Installing @value{tramp} with your @value{emacsname} * Installation parameters:: Parameters in order to control installation. -* Load paths:: How to plug-in @tramp{} into your environment. +* Load paths:: How to plug-in @value{tramp} into your environment. * Japanese manual:: Japanese manual. @end ifset -Configuring @tramp{} for use +Configuring @value{tramp} for use * Connection types:: Types of connections made to remote machines. * Inline methods:: Inline methods. @@ -178,14 +181,14 @@ Configuring @tramp{} for use * Customizing Methods:: Using Non-Standard Methods. * Customizing Completion:: Selecting config files for user/host name completion. * Password caching:: Reusing passwords for several connections. -* Remote Programs:: How @tramp{} finds and uses programs on the remote machine. +* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. * Remote shell setup:: Remote shell setup hints. * Windows setup hints:: Issues with Cygwin ssh. * Auto-save and Backup:: Auto-save and Backup. -Using @tramp{} +Using @value{tramp} -* Filename Syntax:: @tramp{} filename conventions. +* Filename Syntax:: @value{tramp} filename conventions. * Multi-hop filename syntax:: Multi-hop filename conventions. * Filename completion:: Filename completion. * Dired:: Dired. @@ -211,10 +214,10 @@ How file names, directories and localnames are mangled and managed @end menu @node Overview -@chapter An overview of @tramp{} +@chapter An overview of @value{tramp} @cindex overview -After the installation of @tramp{} into your @value{emacs-name}, you +After the installation of @value{tramp} into your @value{emacsname}, you will be able to access files on remote machines as though they were local. Access to the remote file system for editing files, version control, and @command{dired} are transparently enabled. @@ -229,27 +232,26 @@ box, one of the more common uses of the package. This allows relatively secure access to machines, especially if @command{ftp} access is disabled. -The majority of activity carried out by @tramp{} requires only that +The majority of activity carried out by @value{tramp} requires only that the remote login is possible and is carried out at the terminal. In -order to access remote files @tramp{} needs to transfer their content +order to access remote files @value{tramp} needs to transfer their content to the local machine temporarily. -@tramp{} can transfer files between the machines in a variety of ways. +@value{tramp} can transfer files between the machines in a variety of ways. The details are easy to select, depending on your needs and the machines in question. The fastest transfer methods (for large files) rely on a remote file transfer package such as @command{rcp}, @command{scp} or -@command{rsync}. The use of these methods is only possible if the -file copy command does not ask for a password for the remote machine. +@command{rsync}. -If the remote copy methods are not suitable for you, @tramp{} also +If the remote copy methods are not suitable for you, @value{tramp} also supports the use of encoded transfers directly through the shell. This requires that the @command{mimencode} or @command{uuencode} tools are available on the remote machine. These methods are generally faster for small files. -Within these limitations, @tramp{} is quite powerful. It is worth +Within these limitations, @value{tramp} is quite powerful. It is worth noting that, as of the time of writing, it is far from a polished end-user product. For a while yet you should expect to run into rough edges and problems with the code now and then. @@ -258,8 +260,8 @@ It is finished enough that the developers use it for day to day work but the installation and setup can be a little difficult to master, as can the terminology. -@tramp{} is still under active development and any problems you encounter, -trivial or major, should be reported to the @tramp{} developers. +@value{tramp} is still under active development and any problems you encounter, +trivial or major, should be reported to the @value{tramp} developers. @xref{Bug Reports}. @@ -269,65 +271,65 @@ trivial or major, should be reported to the @tramp{} developers. @cindex how it works This section tries to explain what goes on behind the scenes when you -access a remote file through @tramp{}. +access a remote file through @value{tramp}. -Suppose you type @kbd{C-x C-f} and enter part of an @tramp{} file name, +Suppose you type @kbd{C-x C-f} and enter part of an @value{tramp} file name, then hit @kbd{@key{TAB}} for completion. Suppose further that this is -the first time that @tramp{} is invoked for the host in question. Here's +the first time that @value{tramp} is invoked for the host in question. Here's what happens: @itemize @item -@tramp{} discovers that it needs a connection to the host. So it +@value{tramp} discovers that it needs a connection to the host. So it invokes @samp{telnet @var{host}} or @samp{rsh @var{host} -l @var{user}} or a similar tool to connect to the remote host. Communication with this process happens through an -@value{emacs-name} buffer, that is, the output from the remote end +@value{emacsname} buffer, that is, the output from the remote end goes into a buffer. @item The remote host may prompt for a login name (for @command{telnet}). The -login name is given in the file name, so @tramp{} sends the login name and +login name is given in the file name, so @value{tramp} sends the login name and a newline. @item The remote host may prompt for a password or pass phrase (for @command{rsh} or for @command{telnet} after sending the login name). -@tramp{} displays the prompt in the minibuffer, asking you for the +@value{tramp} displays the prompt in the minibuffer, asking you for the password or pass phrase. -You enter the password or pass phrase. @tramp{} sends it to the remote +You enter the password or pass phrase. @value{tramp} sends it to the remote host, followed by a newline. @item -@tramp{} now waits for the shell prompt or for a message that the login +@value{tramp} now waits for the shell prompt or for a message that the login failed. -If @tramp{} sees neither of them after a certain period of time (a minute, +If @value{tramp} sees neither of them after a certain period of time (a minute, say), then it issues an error message saying that it couldn't find the remote shell prompt and shows you what the remote host has sent. -If @tramp{} sees a @samp{login failed} message, it tells you so, +If @value{tramp} sees a @samp{login failed} message, it tells you so, aborts the login attempt and allows you to try again. @item -Suppose that the login was successful and @tramp{} sees the shell prompt -from the remote host. Now @tramp{} invokes @command{/bin/sh} because +Suppose that the login was successful and @value{tramp} sees the shell prompt +from the remote host. Now @value{tramp} invokes @command{/bin/sh} because Bourne shells and C shells have different command syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login shell doesn't recognize @samp{exec /bin/sh} as a valid command. Maybe you use the Scheme shell @command{scsh}@dots{}} -After the Bourne shell has come up, @tramp{} sends a few commands to +After the Bourne shell has come up, @value{tramp} sends a few commands to ensure a good working environment. It turns off echoing, it sets the shell prompt, and a few other things. @item Now the remote shell is up and it good working order. Remember, what -was supposed to happen is that @tramp{} tries to find out what files exist +was supposed to happen is that @value{tramp} tries to find out what files exist on the remote host so that it can do filename completion. -So, @tramp{} basically issues @command{cd} and @command{ls} commands and +So, @value{tramp} basically issues @command{cd} and @command{ls} commands and also sometimes @command{echo} with globbing. Another command that is often used is @command{test} to find out whether a file is writable or a directory or the like. The output of each command is parsed for the @@ -339,14 +341,14 @@ C-f}, a full file name and hit @kbd{@key{RET}}. Now comes the time to transfer the file contents from the remote host to the local host so that you can edit them. -See above for an explanation of how @tramp{} transfers the file contents. +See above for an explanation of how @value{tramp} transfers the file contents. -For inline transfers, @tramp{} issues a command like @samp{mimencode -b +For inline transfers, @value{tramp} issues a command like @samp{mimencode -b /path/to/remote/file}, waits until the output has accumulated in the buffer that's used for communication, then decodes that output to produce the file contents. -For out-of-band transfers, @tramp{} issues a command like the following: +For out-of-band transfers, @value{tramp} issues a command like the following: @example rcp user@@host:/path/to/remote/file /tmp/tramp.4711 @end example @@ -359,35 +361,35 @@ behind the scenes. (Unless you have read this section, that is.) When you are finished, you type @kbd{C-x C-s} to save the buffer. @item -Again, @tramp{} transfers the file contents to the remote host either +Again, @value{tramp} transfers the file contents to the remote host either inline or out-of-band. This is the reverse of what happens when reading the file. @end itemize I hope this has provided you with a basic overview of what happens -behind the scenes when you open a file with @tramp{}. +behind the scenes when you open a file with @value{tramp}. @c For the end user -@node Obtaining @tramp{} -@chapter Obtaining @tramp{}. -@cindex obtaining @tramp{} +@node Obtaining Tramp +@chapter Obtaining Tramp. +@cindex obtaining Tramp -@tramp{} is freely available on the Internet and the latest release +@value{tramp} is freely available on the Internet and the latest release may be downloaded from @uref{http://savannah.nongnu.org/download/tramp/}. This -release includes the full documentation and code for @tramp{}, +release includes the full documentation and code for @value{tramp}, suitable for installation. But Emacs (21.4 or later) includes -@tramp{} already, and there is a @tramp{} package for XEmacs, as well. +@value{tramp} already, and there is a @value{tramp} package for XEmacs, as well. So maybe it is easier to just use those. But if you want the bleeding edge, read on@dots{...} -For the especially brave, @tramp{} is available from CVS. The CVS +For the especially brave, @value{tramp} is available from CVS. The CVS version is the latest version of the code and may contain incomplete features or new issues. Use these versions at your own risk. -Instructions for obtaining the latest development version of @tramp{} +Instructions for obtaining the latest development version of @value{tramp} from CVS can be found by going to the Savannah project page at the following URL and then clicking on the CVS link in the navigation bar at the top. @@ -399,18 +401,18 @@ at the top. Or follow the example session below: @example -] @strong{cd ~/@value{emacs-dir}} +] @strong{cd ~/@value{emacsdir}} ] @strong{export CVS_RSH="ssh"} ] @strong{cvs -z3 -d:ext:anoncvs@@savannah.nongnu.org:/cvsroot/tramp co tramp} @end example @noindent -You should now have a directory @file{~/@value{emacs-dir}/tramp} -containing the latest version of @tramp{}. You can fetch the latest +You should now have a directory @file{~/@value{emacsdir}/tramp} +containing the latest version of @value{tramp}. You can fetch the latest updates from the repository by issuing the command: @example -] @strong{cd ~/@value{emacs-dir}/tramp} +] @strong{cd ~/@value{emacsdir}/tramp} ] @strong{export CVS_RSH="ssh"} ] @strong{cvs update -d} @end example @@ -421,13 +423,13 @@ Once you've got updated files from the CVS repository, you need to run script: @example -] @strong{cd ~/@value{emacs-dir}/tramp} +] @strong{cd ~/@value{emacsdir}/tramp} ] @strong{autoconf} @end example @node History -@chapter History of @tramp{} +@chapter History of @value{tramp} @cindex history @cindex development history @@ -435,31 +437,31 @@ Development was started end of November 1998. The package was called @file{rssh.el}, back then. It only provided one method to access a file, using @command{ssh} to log in to a remote host and using @command{scp} to transfer the file contents. After a while, the name -was changed to @file{rcp.el}, and now it's @tramp{}. Along the way, +was changed to @file{rcp.el}, and now it's @value{tramp}. Along the way, many more methods for getting a remote shell and for transferring the file contents were added. Support for VC was added. The most recent addition of major features were the multi-hop methods -added in April 2000 and the unification of @tramp{} and Ange-FTP +added in April 2000 and the unification of @value{tramp} and Ange-FTP filenames in July 2002. @c Installation chapter is necessary only in case of standalone @c installation. Text taken from trampinst.texi. -@ifset tramp-inst -@installationchapter{} +@ifset installchapter +@include trampinst.texi @end ifset @node Configuration -@chapter Configuring @tramp{} for use +@chapter Configuring @value{tramp} for use @cindex configuration @cindex default configuration -@tramp{} is (normally) fully functional when it is initially installed. +@value{tramp} is (normally) fully functional when it is initially installed. It is initially configured to use the @command{ssh} program to connect to the remote host and to use base64 or uu encoding to transfer the files through that shell connection. So in the easiest case, you just type @kbd{C-x C-f} and then enter the filename -@file{@value{tramp-prefix}@var{user}@@@var{machine}@value{tramp-postfix}@var{/path/to.file}}. +@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}@var{/path/to.file}}. On some hosts, there are problems with opening a connection. These are related to the behavior of the remote shell. See @xref{Remote shell @@ -467,7 +469,7 @@ setup}, for details on this. If you do not wish to use these commands to connect to the remote host, you should change the default connection and transfer method -that @tramp{} uses. There are several different methods that @tramp{} +that @value{tramp} uses. There are several different methods that @value{tramp} can use to connect to remote machines and transfer files (@pxref{Connection types}). @@ -487,7 +489,7 @@ Method}. * Customizing Methods:: Using Non-Standard Methods. * Customizing Completion:: Selecting config files for user/host name completion. * Password caching:: Reusing passwords for several connections. -* Remote Programs:: How @tramp{} finds and uses programs on the remote machine. +* Remote Programs:: How @value{tramp} finds and uses programs on the remote machine. * Remote shell setup:: Remote shell setup hints. * Windows setup hints:: Issues with Cygwin ssh. * Auto-save and Backup:: Auto-save and Backup. @@ -503,7 +505,7 @@ advantages and limitations. Both types of connection make use of a remote shell access program such as @command{rsh}, @command{ssh} or @command{telnet} to connect to the remote machine. -This connection is used to perform many of the operations that @tramp{} +This connection is used to perform many of the operations that @value{tramp} requires to make the remote file system transparently accessible from the local machine. It is only when visiting files that the methods differ. @@ -534,10 +536,10 @@ methods. While these methods do see better performance when actually transferring files, the overhead of the cryptographic negotiation at startup may drown out the improvement in file transfer times. -External transfer methods do require that the remote copy command is not -interactive --- that is, the command does not prompt you for a password. -If you cannot perform remote copies without a password, you will need to -use an inline transfer method to work with @tramp{}. +External transfer methods should be configured such a way that they +don't require a password (with @command{ssh-agent}, or such alike). +If it isn't possible, you should consider @ref{Password caching}, +otherwise you will be prompted for a password every copy action. @cindex multi-hop methods @cindex methods, multi-hop @@ -553,7 +555,7 @@ connect to the outside world. @cindex inline methods @cindex methods, inline -The inline methods in @tramp{} are quite powerful and can work in +The inline methods in @value{tramp} are quite powerful and can work in situations where you cannot use an external transfer program to connect. Inline methods are the only methods that work when connecting to the remote machine via telnet. (There are also strange inline methods which @@ -561,20 +563,20 @@ allow you to transfer files between @emph{user identities} rather than hosts, see below.) These methods depend on the existence of a suitable encoding and -decoding command on remote machine. Locally, @tramp{} may be able to -use features of @value{emacs-name} to decode and encode the files or +decoding command on remote machine. Locally, @value{tramp} may be able to +use features of @value{emacsname} to decode and encode the files or it may require access to external commands to perform that task. @cindex uuencode @cindex mimencode @cindex base-64 encoding -@tramp{} checks the availability and usability of commands like +@value{tramp} checks the availability and usability of commands like @command{mimencode} (part of the @command{metamail} package) or @command{uuencode} on the remote host. The first reliable command will be used. The search path can be customized, see @ref{Remote Programs}. -If both commands aren't available on the remote host, @tramp{} +If both commands aren't available on the remote host, @value{tramp} transfers a small piece of Perl code to the remote host, and tries to apply it for encoding and decoding. @@ -658,20 +660,20 @@ the remote host, this option uses @samp{ssh -t -t @var{host} -l @var{user} /bin/sh} to open a connection. This is useful for users where the normal login shell is set up to ask them a number of questions when logging in. This procedure avoids these questions, and -just gives @tramp{} a more-or-less `standard' login shell to work +just gives @value{tramp} a more-or-less `standard' login shell to work with. Note that this procedure does not eliminate questions asked by @command{ssh} itself. For example, @command{ssh} might ask ``Are you sure you want to continue connecting?'' if the host key of the remote -host is not known. @tramp{} does not know how to deal with such a +host is not known. @value{tramp} does not know how to deal with such a question (yet), therefore you will need to make sure that you can log in without such questions. This is also useful for Windows users where @command{ssh}, when -invoked from an @value{emacs-name} buffer, tells them that it is not +invoked from an @value{emacsname} buffer, tells them that it is not allocating a pseudo tty. When this happens, the login shell is wont -to not print any shell prompt, which confuses @tramp{} mightily. For +to not print any shell prompt, which confuses @value{tramp} mightily. For reasons unknown, some Windows ports for @command{ssh} (maybe the Cygwin one) require the doubled @samp{-t} option. @@ -702,7 +704,7 @@ explicitely. CCC: Do we have to connect to the remote host once from the command line to accept the SSH key? Maybe this can be made automatic? -CCC: Does @command{plink} support the @samp{-p} option? @tramp{} will +CCC: Does @command{plink} support the @samp{-p} option? @value{tramp} will support that, anyway. @end table @@ -723,8 +725,8 @@ transfers to an external transfer utility. This saves the overhead of encoding and decoding that multiplexing the transfer through the one connection has with the inline methods. -If you want to use an external transfer method you @emph{must} be able -to execute the transfer utility to copy files to and from the remote +If you want to use an external transfer method you should be able to +execute the transfer utility to copy files to and from the remote machine without any interaction. @cindex ssh-agent @@ -735,9 +737,8 @@ This means that you will need to use @command{ssh-agent} if you use the If you use @command{rsync} via @command{ssh} then the same rule must apply to that connection. -If you cannot get @command{scp} to run without asking for a password but -would still like to use @command{ssh} to secure your connection, have a -look at the @command{ssh} based inline methods. +If you cannot get an external method to run without asking for a +password you should consider @ref{Password caching}. @table @asis @@ -785,7 +786,7 @@ know what these are, you do not need these options. All the @command{ssh} based methods support the kludgy @samp{-p} feature where you can specify a port number to connect to in the host -name. For example, the host name @file{host#42} tells @tramp{} to +name. For example, the host name @file{host#42} tells @value{tramp} to specify @samp{-p 42} in the argument list for @command{ssh}. @@ -823,13 +824,13 @@ the remote host, this option uses @samp{ssh -t -t @var{host} -l @var{user} /bin/sh} to open a connection. This is useful for users where the normal login shell is set up to ask them a number of questions when logging in. This procedure avoids these questions, and -just gives @tramp{} a more-or-less `standard' login shell to work +just gives @value{tramp} a more-or-less `standard' login shell to work with. This is also useful for Windows users where @command{ssh}, when -invoked from an @value{emacs-name} buffer, tells them that it is not +invoked from an @value{emacsname} buffer, tells them that it is not allocating a pseudo tty. When this happens, the login shell is wont -to not print any shell prompt, which confuses @tramp{} mightily. +to not print any shell prompt, which confuses @value{tramp} mightily. Maybe this applies to the Cygwin port of SSH. This method supports the @samp{-p} hack. @@ -873,7 +874,7 @@ This method uses the command @samp{fsh @var{host} -l @var{user} @cindex fsh method There is no inline method using @command{fsh} as the multiplexing -provided by the program is not very useful in our context. @tramp{} +provided by the program is not very useful in our context. @value{tramp} opens just one connection to the remote host and then keeps it open, anyway. @@ -882,8 +883,8 @@ anyway. @cindex method ftp @cindex ftp method -This is not a native @tramp{} method. Instead of, it forwards all -requests to @value{ftp-package-name}. +This is not a native @value{tramp} method. Instead of, it forwards all +requests to @value{ftppackagename}. @ifset xemacs This works only for unified filenames, see @ref{Issues}. @end ifset @@ -893,7 +894,7 @@ This works only for unified filenames, see @ref{Issues}. @cindex method smb @cindex smb method -This is another not natural @tramp{} method. It uses the +This is another not natural @value{tramp} method. It uses the @command{smbclient} command on different Unices in order to connect to an SMB server. An SMB server might be a Samba (or CIFS) server on another UNIX host or, more interesting, a host running MS Windows. So @@ -911,22 +912,22 @@ always for a password if you access another share on the same host. This can be suppressed by @ref{Password caching}. MS Windows uses for authorization both a user name and a domain name. -Because of this, the @tramp{} syntax has been extended: you can +Because of this, the @value{tramp} syntax has been extended: you can specify a user name which looks like @code{user%domain} (the real user name, then a percent sign, then the domain name). So, to connect to the machine @code{melancholia} as user @code{daniel} of the domain @code{BIZARRE}, and edit @file{.emacs} in the home directory (share @code{daniel$}) I would specify the filename -@file{@value{tramp-prefix}smb@value{tramp-postfix-single-hop}daniel%BIZARRE@@melancholia@value{tramp-postfix}/daniel$$/.emacs}. +@file{@value{prefix}smb@value{postfixsinglehop}daniel%BIZARRE@@melancholia@value{postfix}/daniel$$/.emacs}. The domain name as well as the user name are optional. If no user name is specified at all, the anonymous user (without password -prompting) is assumed. This is different from all other @tramp{} +prompting) is assumed. This is different from all other @value{tramp} methods, where in such a case the local user name is taken. The @option{smb} method supports the @samp{-p} hack. -@strong{Please note:} If @value{emacs-name} runs locally under MS +@strong{Please note:} If @value{emacsname} runs locally under MS Windows, this method isn't available. Instead of, you can use UNC file names like @file{//melancholia/daniel$$/.emacs}. The only disadvantage is that there's no possibility to specify another user @@ -945,7 +946,7 @@ For example, if you are in a secured network, you might have to log in to a `bastion host' first before you can connect to the outside world. Of course, the target host may also require a bastion host. The format of multi-hop filenames is slightly different than the format of normal -@tramp{} methods. +@value{tramp} methods. @cindex method multi @cindex multi method @@ -1014,7 +1015,7 @@ Some people might wish to use port forwarding with @command{ssh} or maybe they have to use a nonstandard port. This can be accomplished by putting a stanza in @file{~/.ssh/config} for the account which specifies a different port number for a certain host name. But it can -also be accomplished within @tramp{}, by adding a multi-hop method. +also be accomplished within @value{tramp}, by adding a multi-hop method. For example: @lisp @@ -1035,7 +1036,7 @@ the standard port. When you select an appropriate transfer method for your typical usage you should set the variable @code{tramp-default-method} to reflect that choice. This variable controls which method will be used when a method -is not specified in the @tramp{} file name. For example: +is not specified in the @value{tramp} file name. For example: @lisp (setq tramp-default-method "scp") @@ -1062,8 +1063,7 @@ See the documentation for the variable @code{tramp-default-method-alist} for more details. External transfer methods are normally preferable to inline transfer -methods, giving better performance. They may not be useful if you use -many remote machines where you cannot log in without a password. +methods, giving better performance. @xref{Inline methods}. @xref{External transfer methods}. @@ -1101,8 +1101,9 @@ to edit mostly small files. I guess that these days, most people can access a remote machine by using @code{ssh}. So I suggest that you use the @code{ssh} method. -So, type @kbd{C-x C-f /ssh:root@@otherhost:/etc/motd @key{RET}} to -edit the @file{/etc/motd} file on the other host. +So, type @kbd{C-x C-f +@value{prefix}ssh@value{postfixsinglehop}root@@otherhost@value{postfix}/etc/motd +@key{RET}} to edit the @file{/etc/motd} file on the other host. If you can't use @code{ssh} to log in to the remote host, then select a method that uses a program that works. For instance, Windows users @@ -1120,11 +1121,6 @@ first whether you really get a noticeable speed advantage from using an out-of-band method! Maybe even for large files, inline methods are fast enough. -The reason why I'm suggesting to use inline methods is that they work -even if the remote end is asking you for a password. Out-of-band -methods don't work in this situation. Also, multi-hop methods are -inherently inline. - @node Customizing Methods @section Using Non-Standard Methods @@ -1267,13 +1263,13 @@ times. Reentering passwords again and again would be annoying, when the choosen method does not support access without password prompt throught own configuration. -By default, @tramp{} caches the passwords entered by you. They will +By default, @value{tramp} caches the passwords entered by you. They will be reused next time if a connection needs them for the same user name and host name, independant of the connection method. @vindex password-cache-expiry Passwords are not saved permanently, that means the password caching -is limited to the lifetime of your @value{emacs-name} session. You +is limited to the lifetime of your @value{emacsname} session. You can influence the lifetime of password caching by customizing the variable @code{password-cache-expiry}. The value is the number of seconds how long passwords are cached. Setting it to @code{nil} @@ -1292,19 +1288,19 @@ can be disabled totally by customizing the variable Implementation Note: password caching is based on the package password.el in No Gnus. For the time being, it is activated only when -this package is seen in the @code{load-path} while loading @tramp{}. -@ifset tramp-inst -If you don't use No Gnus, you can take password.el from the @tramp{} +this package is seen in the @code{load-path} while loading @value{tramp}. +@ifset installchapter +If you don't use No Gnus, you can take password.el from the @value{tramp} @file{contrib} directory, see @ref{Installation parameters}. @end ifset It will be activated mandatory once No Gnus has found its way into -@value{emacs-name}. +@value{emacsname}. @node Remote Programs -@section How @tramp{} finds and uses programs on the remote machine. +@section How @value{tramp} finds and uses programs on the remote machine. -@tramp{} depends on a number of programs on the remote host in order to +@value{tramp} depends on a number of programs on the remote host in order to function, including @command{ls}, @command{test}, @command{find} and @command{cat}. @@ -1318,7 +1314,7 @@ available, they are used to improve the performance and accuracy of remote file access. @vindex tramp-remote-path -When @tramp{} connects to the remote machine, it searches for the +When @value{tramp} connects to the remote machine, it searches for the programs that it can use. The variable @var{tramp-remote-path} controls the directories searched on the remote machine. @@ -1327,16 +1323,16 @@ machines. It is possible, however, that your local (or remote ;) system administrator has put the tools you want in some obscure local directory. -In this case, you can still use them with @tramp{}. You simply need to +In this case, you can still use them with @value{tramp}. You simply need to add code to your @file{.emacs} to add the directory to the remote path. -This will then be searched by @tramp{} when you connect and the software +This will then be searched by @value{tramp} when you connect and the software found. To add a directory to the remote search path, you could use code such as: @lisp -@i{;; We load @tramp{} to define the variable.} +@i{;; We load @value{tramp} to define the variable.} (require 'tramp) @i{;; We have @command{perl} in "/usr/local/perl/bin"} (add-to-list 'tramp-remote-path "/usr/local/perl/bin") @@ -1351,19 +1347,19 @@ as: @cindex @file{.login} file @cindex shell init files -As explained in the @ref{Overview} section, @tramp{} connects to the +As explained in the @ref{Overview} section, @value{tramp} connects to the remote host and talks to the shell it finds there. Of course, when you log in, the shell executes its init files. Suppose your init file -requires you to enter the birth date of your mother; clearly @tramp{} +requires you to enter the birth date of your mother; clearly @value{tramp} does not know this and hence fails to log you in to that host. There are different possible strategies for pursuing this problem. One -strategy is to enable @tramp{} to deal with all possible situations. +strategy is to enable @value{tramp} to deal with all possible situations. This is a losing battle, since it is not possible to deal with @emph{all} situations. The other strategy is to require you to set up -the remote host such that it behaves like @tramp{} expects. This might +the remote host such that it behaves like @value{tramp} expects. This might be inconvenient because you have to invest a lot of effort into shell -setup before you can begin to use @tramp{}. +setup before you can begin to use @value{tramp}. The package, therefore, pursues a combined approach. It tries to figure out some of the more common setups, and only requires you to avoid @@ -1376,34 +1372,34 @@ builtin doesn't work but the program @code{/usr/bin/test -e} or @code{/bin/test -e} works. And on still other hosts, @code{ls -d} is the right way to do this.) -Below you find a discussion of a few things that @tramp{} does not deal +Below you find a discussion of a few things that @value{tramp} does not deal with, and that you therefore have to set up correctly. @table @asis @item @var{shell-prompt-pattern} @vindex shell-prompt-pattern -After logging in to the remote host, @tramp{} has to wait for the remote +After logging in to the remote host, @value{tramp} has to wait for the remote shell startup to finish before it can send commands to the remote shell. The strategy here is to wait for the shell prompt. In order to recognize the shell prompt, the variable @code{shell-prompt-pattern} has to be set correctly to recognize the shell prompt on the remote host. -Note that @tramp{} requires the match for @code{shell-prompt-pattern} +Note that @value{tramp} requires the match for @code{shell-prompt-pattern} to be at the end of the buffer. Many people have something like the following as the value for the variable: @code{"^[^>$][>$] *"}. Now suppose your shell prompt is @code{a <b> c $ }. In this case, -@tramp{} recognizes the @code{>} character as the end of the prompt, +@value{tramp} recognizes the @code{>} character as the end of the prompt, but it is not at the end of the buffer. @item @var{tramp-shell-prompt-pattern} @vindex tramp-shell-prompt-pattern -This regular expression is used by @tramp{} in the same way as +This regular expression is used by @value{tramp} in the same way as @code{shell-prompt-pattern}, to match prompts from the remote shell. This second variable exists because the prompt from the remote shell might be different from the prompt from a local shell --- after all, -the whole point of @tramp{} is to log in to remote hosts as a +the whole point of @value{tramp} is to log in to remote hosts as a different user. The default value of @code{tramp-shell-prompt-pattern} is the same as the default value of @code{shell-prompt-pattern}, which is reported to work well in many @@ -1415,10 +1411,10 @@ circumstances. Some people invoke the @code{tset} program from their shell startup scripts which asks the user about the terminal type of the shell. -Maybe some shells ask other questions when they are started. @tramp{} +Maybe some shells ask other questions when they are started. @value{tramp} does not know how to answer these questions. There are two approaches for dealing with this problem. One approach is to take care that the -shell does not ask any questions when invoked from @tramp{}. You can +shell does not ask any questions when invoked from @value{tramp}. You can do this by checking the @code{TERM} environment variable, it will be set to @code{dumb} when connecting. @@ -1426,7 +1422,7 @@ set to @code{dumb} when connecting. The variable @code{tramp-terminal-type} can be used to change this value to @code{dumb}. -The other approach is to teach @tramp{} about these questions. See +The other approach is to teach @value{tramp} about these questions. See the variables @code{tramp-actions-before-shell} and @code{tramp-multi-actions} (for multi-hop connections). @@ -1437,12 +1433,12 @@ If you have a user named frumple and set the variable @code{FRUMPLE} in your shell environment, then this might cause trouble. Maybe rename the variable to @code{FRUMPLE_DIR} or the like. -This weird effect was actually reported by a @tramp{} user! +This weird effect was actually reported by a @value{tramp} user! @item Non-Bourne commands in @file{.profile} -After logging in to the remote host, @tramp{} issues the command +After logging in to the remote host, @value{tramp} issues the command @code{exec /bin/sh}. (Actually, the command is slightly different.) When @code{/bin/sh} is executed, it reads some init files, such as @file{~/.shrc} or @file{~/.profile}. @@ -1476,9 +1472,9 @@ instead of @file{~/.profile}, if the former exists. So bash aficionados just rename their @file{~/.profile} to @file{~/.bash_profile} on all remote hosts, and Bob's your uncle. -The @tramp{} developers would like to circumvent this problem, so if you +The @value{tramp} developers would like to circumvent this problem, so if you have an idea about it, please tell us. However, we are afraid it is not -that simple: before saying @code{exec /bin/sh}, @tramp{} does not know +that simple: before saying @code{exec /bin/sh}, @value{tramp} does not know which kind of shell it might be talking to. It could be a Bourne-ish shell like ksh or bash, or it could be a csh derivative like tcsh, or it could be zsh, or even rc. If the shell is Bourne-ish already, then @@ -1492,42 +1488,122 @@ find out if the shell is Bourne-ish? @section Auto-save and Backup configuration @cindex auto-save @cindex backup +@ifset emacs @vindex backup-directory-alist +@end ifset +@ifset xemacs +@vindex bkup-backup-directory-info +@end ifset -Normally, @value{emacs-name} writes backup files to the same directory +Normally, @value{emacsname} writes backup files to the same directory as the original files, but this behavior can be changed via the -variable @code{backup-directory-alist}. In connection with @tramp{}, -this can have unexpected side effects. Suppose that you specify that -all backups should go to the directory @file{~/.emacs.d/backups/}, and -then you edit the file @file{/su:root@@localhost:/etc/secretfile}. +variable +@ifset emacs +@code{backup-directory-alist}. +@end ifset +@ifset xemacs +@code{bkup-backup-directory-info}. +@end ifset +In connection with @value{tramp}, this can have unexpected side effects. +Suppose that you specify that all backups should go to the directory +@file{~/.emacs.d/backups/}, and then you edit the file +@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile}. The effect is that the backup file will be owned by you and not by root, thus possibly enabling others to see it even if they were not intended to see it. -When @code{backup-directory-alist} is nil (the default), such problems -do not occur. +When +@ifset emacs +@code{backup-directory-alist} +@end ifset +@ifset xemacs +@code{bkup-backup-directory-info} +@end ifset +is nil (the default), such problems do not occur. -If you wish to customize the variable, the workaround is to include -special settings for @tramp{} files. For example, the following statement -effectively `turns off' the effect of @code{backup-directory-alist} for -@tramp{} files: +Therefore, it is usefull to set special values for @value{tramp} +files. For example, the following statement effectively `turns off' +the effect of +@ifset emacs +@code{backup-directory-alist} +@end ifset +@ifset xemacs +@code{bkup-backup-directory-info} +@end ifset +for @value{tramp} files: +@ifset emacs @lisp -(require 'tramp) (add-to-list 'backup-directory-alist (cons tramp-file-name-regexp nil)) @end lisp +@end ifset +@ifset xemacs +@lisp +(require 'backup-dir) +(add-to-list 'bkup-backup-directory-info + (list tramp-file-name-regexp "")) +@end lisp +@end ifset + +Another possibility is to use the @value{tramp} variable +@ifset emacs +@code{tramp-backup-directory-alist}. +@end ifset +@ifset xemacs +@code{tramp-bkup-backup-directory-info}. +@end ifset +This variable has the same meaning like +@ifset emacs +@code{backup-directory-alist}. +@end ifset +@ifset xemacs +@code{bkup-backup-directory-info}. +@end ifset +If a @value{tramp} file is backed up, and DIRECTORY is an absolute +local file name, DIRECTORY is prepended with the @value{tramp} file +name prefix of the file to be backed up. + +@noindent +Example: + +@ifset emacs +@lisp +(add-to-list 'backup-directory-alist + (cons "." "~/.emacs.d/backups/")) +(setq tramp-backup-directory-alist backup-directory-alist) +@end lisp +@end ifset +@ifset xemacs +@lisp +(require 'backup-dir) +(add-to-list 'bkup-backup-directory-info + (list "." "~/.emacs.d/backups/" 'full-path)) +(setq tramp-bkup-backup-directory-info bkup-backup-directory-info) +@end lisp +@end ifset + +@noindent +The backup file name of +@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}/etc/secretfile} +would be +@ifset emacs +@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile~} +@end ifset +@ifset xemacs +@file{@value{prefix}su@value{postfixsinglehop}root@@localhost@value{postfix}~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~} +@end ifset The same problem can happen with auto-saving files. @ifset emacs -Since @value{emacs-name} 21, the variable +Since @value{emacsname} 21, the variable @code{auto-save-file-name-transforms} keeps information, on which directory an auto-saved file should go. By default, it is initialized -for @tramp{} files to the local temporary directory. +for @value{tramp} files to the local temporary directory. -On some versions of @value{emacs-name}, namely the version built for +On some versions of @value{emacsname}, namely the version built for Debian Linux, the variable @code{auto-save-file-name-transforms} -contains the directory where @value{emacs-name} was built. A +contains the directory where @value{emacsname} was built. A workaround is to manually set the variable to a sane value. If auto-saved files should go into the same directory as the original @@ -1537,8 +1613,8 @@ Another possibility is to set the variable @code{tramp-auto-save-directory} to a proper value. @end ifset @ifset xemacs -For this purpose you can set the variable -@code{tramp-auto-save-directory} to a proper value. +For this purpose you can set the variable @code{auto-save-directory} +to a proper value. @end ifset @@ -1558,7 +1634,7 @@ setting up Cygwin in their FAQ at @uref{http://cygwin.com/faq/}. @cindex method scpx with Cygwin @cindex scpx method with Cygwin If you wish to use the @code{scpx} connection method, then you might -have the problem that @value{emacs-name} calls @code{scp} with a +have the problem that @value{emacsname} calls @code{scp} with a Windows filename such as @code{c:/foo}. The Cygwin version of @code{scp} does not know about Windows filenames and interprets this as a remote filename on the host @code{c}. @@ -1566,21 +1642,19 @@ as a remote filename on the host @code{c}. One possible workaround is to write a wrapper script for @code{scp} which converts the Windows filename to a Cygwinized filename. -I guess that another workaround is to run @value{emacs-name} under -Cygwin, or to run a Cygwinized @value{emacs-name}. +I guess that another workaround is to run @value{emacsname} under +Cygwin, or to run a Cygwinized @value{emacsname}. @cindex Cygwin and ssh-agent -@cindex SSH_AUTH_SOCK and @value{emacs-name} on Windows +@cindex SSH_AUTH_SOCK and @value{emacsname} on Windows If you want to use either @code{ssh} based method on Windows, then you might encounter problems with @code{ssh-agent}. Using this program, -you can avoid typing the pass-phrase every time you log in (and the -@code{scpx} method more or less requires you to use @code{ssh-agent} -because it does not allow you to type a password or pass-phrase). -However, if you start @value{emacs-name} from a desktop shortcut, then -the environment variable @code{SSH_AUTH_SOCK} is not set and so -@value{emacs-name} and thus @tramp{} and thus @code{ssh} and -@code{scp} started from @tramp{} cannot communicate with -@code{ssh-agent}. It works better to start @value{emacs-name} from +you can avoid typing the pass-phrase every time you log in. However, +if you start @value{emacsname} from a desktop shortcut, then the +environment variable @code{SSH_AUTH_SOCK} is not set and so +@value{emacsname} and thus @value{tramp} and thus @code{ssh} and +@code{scp} started from @value{tramp} cannot communicate with +@code{ssh-agent}. It works better to start @value{emacsname} from the shell. If anyone knows how to start @code{ssh-agent} under Windows in such a @@ -1589,30 +1663,30 @@ know anything at all about Windows@dots{} @node Usage -@chapter Using @tramp{} -@cindex using @tramp{} +@chapter Using @value{tramp} +@cindex using @value{tramp} -Once you have installed @tramp{} it will operate fairly transparently. You +Once you have installed @value{tramp} it will operate fairly transparently. You will be able to access files on any remote machine that you can log in to as though they were local. -Files are specified to @tramp{} using a formalized syntax specifying the +Files are specified to @value{tramp} using a formalized syntax specifying the details of the system to connect to. This is similar to the syntax used -by the @value{ftp-package-name} package. +by the @value{ftppackagename} package. @cindex type-ahead Something that might happen which surprises you is that -@value{emacs-name} remembers all your keystrokes, so if you see a -password prompt from @value{emacs-name}, say, and hit @kbd{@key{RET}} +@value{emacsname} remembers all your keystrokes, so if you see a +password prompt from @value{emacsname}, say, and hit @kbd{@key{RET}} twice instead of once, then the second keystroke will be processed by -@value{emacs-name} after @tramp{} has done its thing. Why, this +@value{emacsname} after @value{tramp} has done its thing. Why, this type-ahead is normal behavior, you say. Right you are, but be aware that opening a remote file might take quite a while, maybe half a minute when a connection needs to be opened. Maybe after half a minute you have already forgotten that you hit that key! @menu -* Filename Syntax:: @tramp{} filename conventions. +* Filename Syntax:: @value{tramp} filename conventions. * Multi-hop filename syntax:: Multi-hop filename conventions. * Filename completion:: Filename completion. * Dired:: Dired. @@ -1620,66 +1694,66 @@ minute you have already forgotten that you hit that key! @node Filename Syntax -@section @tramp{} filename conventions +@section @value{tramp} filename conventions @cindex filename syntax @cindex filename examples To access the file @var{localname} on the remote machine @var{machine} you would specify the filename -@file{@value{tramp-prefix}@var{machine}@value{tramp-postfix}@var{localname}}. +@file{@value{prefix}@var{machine}@value{postfix}@var{localname}}. This will connect to @var{machine} and transfer the file using the default method. @xref{Default Method}. -Some examples of @tramp{} filenames are shown below. +Some examples of @value{tramp} filenames are shown below. @table @file -@item @value{tramp-prefix}melancholia@value{tramp-postfix}.emacs +@item @value{prefix}melancholia@value{postfix}.emacs Edit the file @file{.emacs} in your home directory on the machine @code{melancholia}. -@item @value{tramp-prefix}melancholia.danann.net@value{tramp-postfix}.emacs +@item @value{prefix}melancholia.danann.net@value{postfix}.emacs This edits the same file, using the fully qualified domain name of the machine. -@item @value{tramp-prefix}melancholia@value{tramp-postfix}~/.emacs +@item @value{prefix}melancholia@value{postfix}~/.emacs This also edits the same file --- the @file{~} is expanded to your home directory on the remote machine, just like it is locally. -@item @value{tramp-prefix}melancholia@value{tramp-postfix}~daniel/.emacs +@item @value{prefix}melancholia@value{postfix}~daniel/.emacs This edits the file @file{.emacs} in the home directory of the user @code{daniel} on the machine @code{melancholia}. The @file{~<user>} construct is expanded to the home directory of that user on the remote machine. -@item @value{tramp-prefix}melancholia@value{tramp-postfix}/etc/squid.conf +@item @value{prefix}melancholia@value{postfix}/etc/squid.conf This edits the file @file{/etc/squid.conf} on the machine @code{melancholia}. @end table -Unless you specify a different name to use, @tramp{} will use the +Unless you specify a different name to use, @value{tramp} will use the current local user name as the remote user name to log in with. If you need to log in as a different user, you can specify the user name as part of the filename. To log in to the remote machine as a specific user, you use the syntax -@file{@value{tramp-prefix}@var{user}@@@var{machine}@value{tramp-postfix}/@var{path/to.file}}. +@file{@value{prefix}@var{user}@@@var{machine}@value{postfix}/@var{path/to.file}}. That means that connecting to @code{melancholia} as @code{daniel} and editing @file{.emacs} in your home directory you would specify -@file{@value{tramp-prefix}daniel@@melancholia@value{tramp-postfix}.emacs}. +@file{@value{prefix}daniel@@melancholia@value{postfix}.emacs}. It is also possible to specify other file transfer methods (@pxref{Default Method}) as part of the filename. @ifset emacs This is done by putting the method before the user and host name, as in -@file{@value{tramp-prefix}@var{method}@value{tramp-postfix-single-hop}} +@file{@value{prefix}@var{method}@value{postfixsinglehop}} (Note the trailing colon). @end ifset @ifset xemacs This is done by replacing the initial -@file{@value{tramp-prefix}} with -@file{@value{tramp-prefix}<method>@value{tramp-postfix-single-hop}}. +@file{@value{prefix}} with +@file{@value{prefix}<method>@value{postfixsinglehop}}. (Note the trailing slash!). @end ifset The user, machine and file specification remain the same. @@ -1687,7 +1761,7 @@ The user, machine and file specification remain the same. So, to connect to the machine @code{melancholia} as @code{daniel}, using the @option{ssh} method to transfer files, and edit @file{.emacs} in my home directory I would specify the filename -@file{@value{tramp-prefix}ssh@value{tramp-postfix-single-hop}daniel@@melancholia@value{tramp-postfix}.emacs}. +@file{@value{prefix}ssh@value{postfixsinglehop}daniel@@melancholia@value{postfix}.emacs}. @node Multi-hop filename syntax @@ -1696,11 +1770,11 @@ in my home directory I would specify the filename @cindex multi-hop filename syntax The syntax of multi-hop file names is necessarily slightly different -than the syntax of other @tramp{} file names. Here's an example +than the syntax of other @value{tramp} file names. Here's an example multi-hop file name: @example -@value{tramp-prefix}multi@value{tramp-postfix-single-hop}rsh@value{tramp-postfix-multi-hop}out@@gate@value{tramp-postfix-single-hop}telnet@value{tramp-postfix-multi-hop}kai@@real.host@value{tramp-postfix}/path/to.file +@value{prefix}multi@value{postfixsinglehop}rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host@value{postfix}/path/to.file @end example This is quite a mouthful. So let's go through it step by step. The @@ -1711,9 +1785,9 @@ The parts are separated by colons @ifset xemacs The parts are separated by slashes and square brackets. @end ifset -The first part is @file{@value{tramp-prefix}multi}, the method +The first part is @file{@value{prefix}multi}, the method specification. The second part is -@file{rsh@value{tramp-postfix-multi-hop}out@@gate@value{tramp-postfix-single-hop}telnet@value{tramp-postfix-multi-hop}kai@@real.host} +@file{rsh@value{postfixmultihop}out@@gate@value{postfixsinglehop}telnet@value{postfixmultihop}kai@@real.host} and specifies the hops. The final part is @file{/path/to.file} and specifies the file name on the remote host. @@ -1722,18 +1796,18 @@ Methods}, for a list of alternatives for the method specification. The second part can be subdivided again into components, so-called hops. In the above file name, there are two hops, -@file{rsh@value{tramp-postfix-multi-hop}out@@gate} and -@file{telnet@value{tramp-postfix-multi-hop}kai@@real.host}. +@file{rsh@value{postfixmultihop}out@@gate} and +@file{telnet@value{postfixmultihop}kai@@real.host}. Each hop can @emph{again} be subdivided into (three) components, the @dfn{hop method}, the @dfn{user name} and the @dfn{host name}. The meaning of the second and third component should be clear, and the hop method says what program to use to perform that hop. -The first hop, @file{rsh@value{tramp-postfix-multi-hop}out@@gate}, +The first hop, @file{rsh@value{postfixmultihop}out@@gate}, says to use @command{rsh} to log in as user @code{out} to the host @code{gate}. Starting at that host, the second hop, -@file{telnet@value{tramp-postfix-multi-hop}kai@@real.host}, says to +@file{telnet@value{postfixmultihop}kai@@real.host}, says to use @command{telnet} to log in as user @code{kai} to host @code{real.host}. @@ -1747,54 +1821,54 @@ should you want to add your own. @section Filename completion @cindex filename completion -Filename completion works with @tramp{} for both completing methods, +Filename completion works with @value{tramp} for both completing methods, user names and machine names (except multi hop methods) as well as for files on remote machines. -If you, for example, type @kbd{C-x C-f @value{tramp-prefix}t -@key{TAB}}, @tramp{} might give you as result the choice for +If you, for example, type @kbd{C-x C-f @value{prefix}t +@key{TAB}}, @value{tramp} might give you as result the choice for @example @ifset emacs -@value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop} tmp/ -@value{tramp-prefix-single-hop}toto@value{tramp-postfix} +@value{prefixsinglehop}telnet@value{postfixsinglehop} tmp/ +@value{prefixsinglehop}toto@value{postfix} @end ifset @ifset xemacs -@value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop} @value{tramp-prefix-single-hop}toto@value{tramp-postfix} +@value{prefixsinglehop}telnet@value{postfixsinglehop} @value{prefixsinglehop}toto@value{postfix} @end ifset @end example -@samp{@value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop}} +@samp{@value{prefixsinglehop}telnet@value{postfixsinglehop}} is a possible completion for the respective method, @ifset emacs @samp{tmp/} stands for the directory @file{/tmp} on your local machine, @end ifset -and @samp{@value{tramp-prefix-single-hop}toto@value{tramp-postfix}} -might be a host @tramp{} has detected in your @file{~/.ssh/known_hosts} +and @samp{@value{prefixsinglehop}toto@value{postfix}} +might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts} file (given you're using default method @option{ssh}). If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to -@samp{@value{tramp-prefix}telnet@value{tramp-postfix-single-hop}}. -Next @kbd{@key{TAB}} brings you all machine names @tramp{} detects in +@samp{@value{prefix}telnet@value{postfixsinglehop}}. +Next @kbd{@key{TAB}} brings you all machine names @value{tramp} detects in your @file{/etc/hosts} file, let's say @example -@value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop}127.0.0.1@value{tramp-postfix} @value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop}192.168.0.1@value{tramp-postfix} -@value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop}localhost@value{tramp-postfix} @value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop}melancholia.danann.net@value{tramp-postfix} -@value{tramp-prefix-single-hop}telnet@value{tramp-postfix-single-hop}melancholia@value{tramp-postfix} +@value{prefixsinglehop}telnet@value{postfixsinglehop}127.0.0.1@value{postfix} @value{prefixsinglehop}telnet@value{postfixsinglehop}192.168.0.1@value{postfix} +@value{prefixsinglehop}telnet@value{postfixsinglehop}localhost@value{postfix} @value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia.danann.net@value{postfix} +@value{prefixsinglehop}telnet@value{postfixsinglehop}melancholia@value{postfix} @end example Now you can choose the desired machine, and you can continue to complete file names on that machine. As filename completion needs to fetch the listing of files from the -remote machine, this feature is sometimes fairly slow. As @tramp{} +remote machine, this feature is sometimes fairly slow. As @value{tramp} does not yet cache the results of directory listing, there is no gain in performance the second time you complete filenames. If the configuration files (@pxref{Customizing Completion}), which -@tramp{} uses for analysis of completion, offer user names, those user +@value{tramp} uses for analysis of completion, offer user names, those user names will be taken into account as well. @@ -1802,7 +1876,7 @@ names will be taken into account as well. @section Dired @cindex dired -@tramp{} works transparently with dired, enabling you to use this powerful +@value{tramp} works transparently with dired, enabling you to use this powerful file management tool to manage files on any machine you have access to over the Internet. @@ -1815,11 +1889,11 @@ and will only fetch the directory listing once. @chapter Reporting Bugs and Problems @cindex bug reports -Bugs and problems with @tramp{} are actively worked on by the development +Bugs and problems with @value{tramp} are actively worked on by the development team. Feature requests and suggestions are also more than welcome. -The @tramp{} mailing list is a great place to get information on working -with @tramp{}, solving problems and general discussion and advice on topics +The @value{tramp} mailing list is a great place to get information on working +with @value{tramp}, solving problems and general discussion and advice on topics relating to the package. The mailing list is at @email{tramp-devel@@mail.freesoftware.fsf.org}. @@ -1830,9 +1904,9 @@ For help on subscribing to the list, send mail to the administrative address, @email{tramp-devel-request@@mail.freesoftware.fsf.org}, with the subject @samp{help}. -To report a bug in @tramp{}, you should execute @kbd{M-x tramp-bug}. This +To report a bug in @value{tramp}, you should execute @kbd{M-x tramp-bug}. This will automatically generate a buffer with the details of your system and -@tramp{} version. +@value{tramp} version. When submitting a bug report, please try to describe in excruciating detail the steps required to reproduce the problem, the setup of the @@ -1849,9 +1923,9 @@ development team to analyze and correct the problem. @itemize @bullet @item -Where can I get the latest @tramp{}? +Where can I get the latest @value{tramp}? -@tramp{} is available under the URL below. +@value{tramp} is available under the URL below. @noindent @uref{http://savannah.nongnu.org/download/tramp/} @@ -1871,10 +1945,10 @@ as XEmacs 21. XEmacs 20 is more problematic, see the notes in The package was intended to work on Unix, and it really expects a Unix-like system on the remote end (except the @option{smb} method), -but some people seemed to have some success getting it to work on NT -Emacs. +but some people seemed to have some success getting it to work on MS +Windows NT/2000/XP @value{emacsname}. -There is some informations on @tramp{} on NT at the following URL; +There is some informations on @value{tramp} on NT at the following URL; many thanks to Joe Stoy for providing the information: @uref{ftp://ftp.comlab.ox.ac.uk/tmp/Joe.Stoy/} @@ -1889,12 +1963,12 @@ Emacs? I think there was some issue with @command{ssh}? @item -I can't stop @value{ftp-package-name} starting with @value{emacs-name} +I can't stop @value{ftppackagename} starting with @value{emacsname} @ifset emacs -@value{ftp-package-name} is loaded from @tramp{} automatically if you +@value{ftppackagename} is loaded from @value{tramp} automatically if you require a file by the ftp method. Unfortunately, there are some Lisp -packages which make @value{ftp-package-name} file name handlers active. +packages which make @value{ftppackagename} file name handlers active. You can see it applying @kbd{C-h v file-name-handler-alist}: @example @@ -1907,27 +1981,27 @@ file-name-handler-alist's value is @end example Please try to find out which package is responsible for loading -@value{ftp-package-name}, and raise a bug report. +@value{ftppackagename}, and raise a bug report. -A workaround is to require @value{ftp-package-name} before @tramp{} in -your @file{~/.emacs}, because @tramp{} cleans up the entries in +A workaround is to require @value{ftppackagename} before @value{tramp} in +your @file{~/.emacs}, because @value{tramp} cleans up the entries in @code{file-name-handler-alist}: @lisp -;; @value{ftp-package-name} temporarily required +;; @value{ftppackagename} temporarily required (require 'ange-ftp) -;; @tramp{} cleans up @code{file-name-handler-alist} +;; @value{tramp} cleans up @code{file-name-handler-alist} (require 'tramp) @end lisp @end ifset @ifset xemacs -Not all the older versions of @tramp{} supported @value{emacs-name} +Not all the older versions of @value{tramp} supported @value{emacsname} correctly. The first thing to do is to make sure that you have the -latest version of @tramp{} installed. +latest version of @value{tramp} installed. If you do, please try and find out exactly the conditions required for -the @value{ftp-package-name} handlers to fire. If you can, putting a +the @value{ftppackagename} handlers to fire. If you can, putting a breakpoint on @code{efs-ftp-path} and sending in the stack trace along with your bug report would make it easier for the developers to work out what is going wrong. @@ -1935,14 +2009,14 @@ what is going wrong. @item -File name completion does not work with @tramp{} +File name completion does not work with @value{tramp} When you log in to the remote machine, do you see the output of @command{ls} in color? If so, this may be the cause of your problems. @command{ls} outputs @acronym{ANSI} escape sequences that your terminal emulator interprets to set the colors. These escape sequences will -confuse @tramp{} however. +confuse @value{tramp} however. In your @file{.bashrc}, @file{.profile} or equivalent on the remote machine you probably have an alias configured that adds the option @@ -1950,13 +2024,13 @@ machine you probably have an alias configured that adds the option You should remove that alias and ensure that a new login @emph{does not} display the output of @command{ls} in color. If you still cannot use -filename completion, report a bug to the @tramp{} developers. +filename completion, report a bug to the @value{tramp} developers. @item File name completion does not work in large directories -@tramp{} uses globbing for some operations. (Globbing means to use the +@value{tramp} uses globbing for some operations. (Globbing means to use the shell to expand wildcards such as `*.c'.) This might create long command lines, especially in directories with many files. Some shells choke on long command lines, or don't cope well with the globbing @@ -1970,18 +2044,10 @@ of those supports tilde expansion. @item -What kinds of systems does @tramp{} work on - -@tramp{} really expects the remote system to be a Unix-like system. The -local system should preferably be Unix-like, as well, but @tramp{} might -work on NT with some tweaking. - - -@item -How can I get notified when @tramp{} file transfers are complete? +How can I get notified when @value{tramp} file transfers are complete? The following snippet can be put in your @file{~/.emacs} file. It -makes @value{emacs-name} beep after reading from or writing to the +makes @value{emacsname} beep after reading from or writing to the remote host. @lisp @@ -2007,8 +2073,8 @@ remote host. There's this @file{~/.sh_history} file on the remote host which keeps growing and growing. What's that? -Sometimes, @tramp{} starts @code{ksh} on the remote host for tilde -expansion. Maybe @code{ksh} saves the history by default. @tramp{} +Sometimes, @value{tramp} starts @code{ksh} on the remote host for tilde +expansion. Maybe @code{ksh} saves the history by default. @value{tramp} tries to turn off saving the history, but maybe you have to help. For example, you could put this in your @file{.kshrc}: @@ -2025,7 +2091,7 @@ fi @end example -@item @tramp{} doesn't transfer strings with more than 500 characters +@item @value{tramp} doesn't transfer strings with more than 500 characters correctly On some few systems, the implementation of @code{process-send-string} @@ -2042,16 +2108,16 @@ documentation of @code{tramp-chunksize}. @chapter The inner workings of remote version control @cindex Version Control -Unlike @value{ftp-package-name}, @tramp{} has full shell access to the +Unlike @value{ftppackagename}, @value{tramp} has full shell access to the remote machine. This makes it possible to provide version control for -files accessed under @tramp{}. +files accessed under @value{tramp}. The actual version control binaries must be installed on the remote machine, accessible in the directories specified in @var{tramp-remote-path}. This transparent integration with the version control systems is one of -the most valuable features provided by @tramp{}, but it is far from perfect. +the most valuable features provided by @value{tramp}, but it is far from perfect. Work is ongoing to improve the transparency of the system. @menu @@ -2068,7 +2134,7 @@ Work is ongoing to improve the transparency of the system. The VC package uses the existence of on-disk revision control master files to determine if a given file is under revision control. These file -tests happen on the remote machine through the standard @tramp{} mechanisms. +tests happen on the remote machine through the standard @value{tramp} mechanisms. @node Remote Commands @@ -2082,7 +2148,7 @@ provide hooks for remote execution of commands. To work around this, the functions @code{vc-do-command} and @code{vc-simple-command} have been advised to intercept requests for -operations on files accessed via @tramp{}. +operations on files accessed via @value{tramp}. In the case of a remote file, the @code{shell-command} interface is used, with some wrapper code, to provide the same functionality on the @@ -2094,7 +2160,7 @@ remote machine as would be seen on the local machine. As there is currently no way to get access to the mtime of a file on a remote machine in a portable way, the @code{vc-workfile-unchanged-p} -function is advised to call an @tramp{} specific function for remote files. +function is advised to call an @value{tramp} specific function for remote files. The @code{tramp-vc-workfile-unchanged-p} function uses the functioning VC diff functionality to determine if any changes have occurred between the @@ -2111,7 +2177,7 @@ this will remain the cost of remote version control. VC will, by default, check for remote files and refuse to act on them when checking out files from the repository. To work around this -problem, the function @code{vc-checkout} knows about @tramp{} files and +problem, the function @code{vc-checkout} knows about @value{tramp} files and allows version control to occur. @@ -2129,7 +2195,7 @@ Minor implementation details, &c. @node Remote File Ownership @subsection How VC determines who owns a workfile -@value{emacs-name} provides the @code{user-full-name} function to +@value{emacsname} provides the @code{user-full-name} function to return the login name of the current user as well as mapping from arbitrary user id values back to login names. The VC code uses this functionality to map from the uid of the owner of a workfile to the @@ -2171,9 +2237,9 @@ comes into the picture. Each remote machine may have a different version of the version control tools and, while this is painful, we need to ensure that unavailable features are not used remotely. -To resolve this issue, @tramp{} currently takes the sledgehammer +To resolve this issue, @value{tramp} currently takes the sledgehammer approach of making the release values of the revision control tools -local to each @tramp{} buffer, forcing VC to determine these values +local to each @value{tramp} buffer, forcing VC to determine these values again each time a new file is visited. This has, quite obviously, some performance implications. Thankfully, @@ -2181,7 +2247,7 @@ most of the common operations performed by VC do not actually require that the remote version be known. This makes the problem far less apparent. -Eventually these values will be captured by @tramp{} on a system by +Eventually these values will be captured by @value{tramp} on a system by system basis and the results cached to improve performance. @@ -2196,17 +2262,17 @@ system basis and the results cached to improve performance. @node Localname deconstruction @section Breaking a localname into its components. -@tramp{} file names are somewhat different, obviously, to ordinary file +@value{tramp} file names are somewhat different, obviously, to ordinary file names. As such, the lisp functions @code{file-name-directory} and -@code{file-name-nondirectory} are overridden within the @tramp{} +@code{file-name-nondirectory} are overridden within the @value{tramp} package. Their replacements are reasonably simplistic in their approach. They dissect the filename, call the original handler on the localname and -then rebuild the @tramp{} file name with the result. +then rebuild the @value{tramp} file name with the result. This allows the platform specific hacks in the original handlers to take -effect while preserving the @tramp{} file name information. +effect while preserving the @value{tramp} file name information. @node Issues @@ -2215,7 +2281,7 @@ effect while preserving the @tramp{} file name information. @itemize @bullet @item The uuencode method does not always work. -Due to the design of @tramp{}, the encoding and decoding programs need to +Due to the design of @value{tramp}, the encoding and decoding programs need to read from stdin and write to stdout. On some systems, @code{uudecode -o -} will read stdin and write the decoded file to stdout, on other systems @code{uudecode -p} does the same thing. But some systems have @@ -2231,29 +2297,29 @@ deleted. But I have decided that this is too fragile to reliably work, so on some systems you'll have to do without the uuencode methods. -@item @tramp{} does not work on XEmacs 20. +@item @value{tramp} does not work on XEmacs 20. This is because it requires the macro @code{with-timeout} which does not appear to exist in XEmacs 20. I'm somewhat reluctant to add an -emulation macro to @tramp{}, but if somebody who uses XEmacs 20 steps +emulation macro to @value{tramp}, but if somebody who uses XEmacs 20 steps forward and wishes to implement and test it, please contact me or the mailing list. -@item The @tramp{} filename syntax differs between Emacs and XEmacs. +@item The @value{tramp} filename syntax differs between Emacs and XEmacs. The Emacs maintainers wish to use a unified filename syntax for -Ange-FTP and @tramp{} so that users don't have to learn a new +Ange-FTP and @value{tramp} so that users don't have to learn a new syntax. It is sufficient to learn some extensions to the old syntax. For the XEmacs maintainers, the problems caused from using a unified filename syntax are greater than the gains. The XEmacs package system uses EFS for downloading new packages. So, obviously, EFS has to be -installed from the start. If the filenames were unified, @tramp{} +installed from the start. If the filenames were unified, @value{tramp} would have to be installed from the start, too. @ifset xemacs @strong{Note:} If you'ld like to use a similar syntax like -@value{ftp-package-name}, you need the following settings in your init +@value{ftppackagename}, you need the following settings in your init file: @lisp @@ -2261,17 +2327,17 @@ file: (require 'tramp) @end lisp -The autoload of the @value{emacs-name} @tramp{} package must be +The autoload of the @value{emacsname} @value{tramp} package must be disabled. This can be achieved by setting file permissions @code{000} to the files @file{.../xemacs-packages/lisp/tramp/auto-autoloads.el*}. -In case of unified filenames, all @value{emacs-name} download sites +In case of unified filenames, all @value{emacsname} download sites are added to @code{tramp-default-method-alist} with default method @code{ftp} @xref{Default Method}. These settings shouldn't be touched -for proper working of the @value{emacs-name} package system. +for proper working of the @value{emacsname} package system. -The syntax for unified filenames is described in the @tramp{} manual -for @value{emacs-other-name}. +The syntax for unified filenames is described in the @value{tramp} manual +for @value{emacsothername}. @end ifset @end itemize diff --git a/man/trampver.texi b/man/trampver.texi index 38862115ce9..4ffc14a48c2 100644 --- a/man/trampver.texi +++ b/man/trampver.texi @@ -4,15 +4,16 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@macro trampver{} -2.0.39 -@end macro +@set trampver 2.0.41 @c Other flags from configuration @set prefix /usr/local @set lispdir /usr/local/share/emacs/site-lisp @set infodir /usr/local/info +@c Formatting of the tramp program name consistent. +@set tramp @sc{tramp} + @c Some flags which make the text independent on the (X)Emacs flavor. @c "emacs" resp "xemacs" are set in the Makefile. Default is "emacs". @@ -24,41 +25,36 @@ @c Emacs values. @ifset emacs -@set emacs-name Emacs -@set emacs-dir emacs -@set ftp-package-name Ange-FTP -@set tramp-prefix / -@set tramp-prefix-single-hop -@set tramp-postfix : -@set tramp-postfix-single-hop : -@set tramp-postfix-multi-hop : -@set japanese-manual tramp_ja-emacs.html +@set emacsname Emacs +@set emacsdir emacs +@set ftppackagename Ange-FTP +@set prefix / +@set prefixsinglehop +@set postfix : +@set postfixsinglehop : +@set postfixmultihop : +@set emacsothername XEmacs +@set emacsotherdir xemacs +@set emacsotherfilename tramp-xemacs.html +@set japanesemanual tramp_ja-emacs.html @end ifset @c XEmacs counterparts. @ifset xemacs -@set emacs-name XEmacs -@set emacs-dir xemacs -@set ftp-package-name EFS -@set tramp-prefix /[ -@set tramp-prefix-single-hop [ -@set tramp-postfix ] -@set tramp-postfix-single-hop / -@set tramp-postfix-multi-hop : -@set japanese-manual tramp_ja-xemacs.html +@set emacsname XEmacs +@set emacsdir xemacs +@set ftppackagename EFS +@set prefix /[ +@set prefixsinglehop [ +@set postfix ] +@set postfixsinglehop / +@set postfixmultihop : +@set emacsothername Emacs +@set emacsotherdir emacs +@set emacsotherfilename tramp-emacs.html +@set japanesemanual tramp_ja-xemacs.html @end ifset -@c Empty macro definitions in order to satisfy texi2dvi -@macro otherflavor -@end macro - -@macro installationchapter -@end macro - -@c The installation chapter is needed only in case Tramp is installed -@c standalone. That's why it is included from `trampinst.texi'. -@c Otherwise, '/dev/null/' is taken, which leaves this part empty. - @ignore arch-tag: e0fe322c-e06b-46eb-bb5b-d091b521f41c @end ignore diff --git a/man/viper.texi b/man/viper.texi index a31ce9a003d..5d4329730dc 100644 --- a/man/viper.texi +++ b/man/viper.texi @@ -314,8 +314,8 @@ x}. Viper uses @key{ESC} to switch from Insert state to Vi state. Therefore Viper defines @kbd{C-\} as its Meta key in Vi state. @xref{Vi State}, for more info.@refill -Emacs is structured as a lisp interpreter around a C core. Emacs keys -cause lisp functions to be called. It is possible to call these +Emacs is structured as a Lisp interpreter around a C core. Emacs keys +cause Lisp functions to be called. It is possible to call these functions directly, by typing @kbd{M-x function-name}. @node Loading Viper, States in Viper, Emacs Preliminaries, Overview @@ -2066,7 +2066,7 @@ To customize the binding for @kbd{C-h} in Insert state: @end example @noindent -Each Emacs command key calls some lisp function. If you have enabled the +Each Emacs command key calls some Lisp function. If you have enabled the Help, (@pxref{Rudimentary Changes}) @kbd{C-h k} will show you the function for each specific key; @kbd{C-h b} will show all bindings, and @kbd{C-h m} will provide information on the major mode in effect. If Help is not diff --git a/man/widget.texi b/man/widget.texi index 290c56c6812..457af8a07bb 100644 --- a/man/widget.texi +++ b/man/widget.texi @@ -341,6 +341,7 @@ Interface}). (make-local-variable 'widget-example-repeat) (let ((inhibit-read-only t)) (erase-buffer)) + (remove-overlays) (widget-insert "Here is some documentation.\n\nName: ") (widget-create 'editable-field :size 13 @@ -680,7 +681,7 @@ image, with either a @file{.xpm} (if supported) or @file{.xbm} extension. @end deffn @deffn{User Option} widget-glyph-enable -If non-nil, allow glyphs to appear on displays where they are supported. +If non-@code{nil}, allow glyphs to appear on displays where they are supported. @end deffn @@ -813,7 +814,7 @@ Face used for highlighting the editable field. Default is @item :secret Character used to display the value. You can set this to e.g.@: @code{?*} if the field contains a password or other secret information. By -default, this is nil, and the value is not secret. +default, this is @code{nil}, and the value is not secret. @vindex valid-regexp@r{ keyword} @item :valid-regexp @@ -865,12 +866,12 @@ specified @var{type} arguments. @vindex case-fold@r{ keyword} @item :case-fold -Set this to nil if you don't want to ignore case when prompting for a +Set this to @code{nil} if you don't want to ignore case when prompting for a choice through the minibuffer. @vindex children@r{ keyword} @item :children -A list whose @code{car} is the widget representing the currently chosen +A list whose @sc{car} is the widget representing the currently chosen type in the buffer. @vindex choice@r{ keyword} @@ -1064,9 +1065,9 @@ Insert a literal @samp{%}. @item :greedy Usually a checklist will only match if the items are in the exact sequence given in the specification. By setting @code{:greedy} to -non-nil, it will allow the items to come in any sequence. However, if -you extract the value they will be in the sequence given in the -checklist, i.e.@: the original sequence is forgotten. +non-@code{nil}, it will allow the items to come in any sequence. +However, if you extract the value they will be in the sequence given +in the checklist, i.e.@: the original sequence is forgotten. @vindex button-args@r{ keyword} @item :button-args @@ -1141,7 +1142,7 @@ The widgets representing the elements of the list. @vindex args@r{ keyword} @item :args -List whose @code{car} is the type of the list elements. +List whose @sc{car} is the type of the list elements. @end table @node group, , editable-list, Basic Types @@ -1164,7 +1165,7 @@ The value is a list, with one member for each @var{type}. @section Sexp Types @cindex sexp types -A number of widgets for editing @dfn{s-expressions} (lisp types), sexp +A number of widgets for editing @dfn{s-expressions} (Lisp types), sexp for short, are also available. These basically fall in several categories described in this section. @@ -1180,7 +1181,7 @@ categories described in this section. @subsection The Constant Widgets @cindex constant widgets -The @code{const} widget can contain any lisp expression, but the user is +The @code{const} widget can contain any Lisp expression, but the user is prohibited from editing it, which is mainly useful as a component of one of the composite widgets. @@ -1217,7 +1218,7 @@ An immutable symbol that is bound as a function. @subsection Generic Sexp Widget @cindex generic sexp widget -The @code{sexp} widget can contain any lisp expression, and allows the +The @code{sexp} widget can contain any Lisp expression, and allows the user to edit it inline in the buffer. The syntax for the @code{sexp} widget is: @@ -1278,8 +1279,8 @@ Keywords: @table @code @vindex must-match@r{ keyword} @item :must-match -If this is set to non-nil, only existing file names will be allowed in -the minibuffer. +If this is set to non-@code{nil}, only existing file names will be +allowed in the minibuffer. @end table @end deffn @@ -1289,7 +1290,7 @@ Similar to the @code{file} widget. @end deffn @deffn Widget symbol -Allows you to edit a lisp symbol in an editable field. +Allows you to edit a Lisp symbol in an editable field. @end deffn @deffn Widget function @@ -1309,8 +1310,8 @@ Allows you to edit a number in an editable field. @end deffn @deffn Widget boolean -Allows you to edit a boolean. In lisp this means a variable which is -either nil meaning false, or non-nil meaning true. +Allows you to edit a boolean. In Lisp this means a variable which is +either @code{nil} meaning false, or non-@code{nil} meaning true. @end deffn @@ -1330,8 +1331,8 @@ where each @var{component} must be a widget type. Each component widget will be displayed in the buffer, and will be editable by the user. @deffn Widget cons -The value of a @code{cons} widget is a cons-cell where the @code{car} is -the value of the first component and the @code{cdr} is the value of the +The value of a @code{cons} widget is a cons-cell where the @sc{car} is +the value of the first component and the @sc{cdr} is the value of the second component. There must be exactly two components. @end deffn @@ -1432,7 +1433,8 @@ In @var{widget} return the value for @var{property}. @end defun @defun widget-member widget property -Non-nil if @var{widget} has a value (even nil) for property @var{property}. +Non-@code{nil} if @var{widget} has a value (even @code{nil}) for +property @var{property}. @end defun Occasionally it can be useful to know which kind of widget you have, @@ -1475,7 +1477,7 @@ all its ancestors. @end lisp You can check if a widget has been made inactive by examining the value -of the @code{:inactive} keyword. If this is non-nil, the widget itself +of the @code{:inactive} keyword. If this is non-@code{nil}, the widget itself has been deactivated. This is different from using the @code{:active} keyword, in that the latter tells you if the widget @strong{or} any of its ancestors have been deactivated. Do not attempt to set the @@ -1500,7 +1502,7 @@ Define a new widget type named @var{name} from @code{class}. @var{name} and class should both be symbols, @code{class} should be one of the existing widget types. -The third argument @var{DOC} is a documentation string for the widget. +The third argument @var{doc} is a documentation string for the widget. After the new widget has been defined, the following two calls will create identical widgets: @@ -1653,7 +1655,7 @@ Function to prompt for a value in the minibuffer. The function should take four arguments, @var{widget}, @var{prompt}, @var{value}, and @var{unbound} and should return a value for widget entered by the user. @var{prompt} is the prompt to use. @var{value} is the default value to -use, unless @var{unbound} is non-nil, in which case there is no default +use, unless @var{unbound} is non-@code{nil}, in which case there is no default value. The function should read the value using the method most natural for this widget, and does not have to check that it matches. @end table @@ -1719,7 +1721,7 @@ Keymap used in @code{widget-minor-mode}. @defun widget-prompt-value widget prompt [ value unbound ] Prompt for a value matching @var{widget}, using @var{prompt}. The current value is assumed to be @var{value}, unless @var{unbound} is -non-nil.@refill +non-@code{nil}.@refill @end defun @defun widget-get-sibling widget diff --git a/msdos/ChangeLog b/msdos/ChangeLog index 2950be8843d..6d221726b7e 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,13 @@ +2004-05-11 Eli Zaretskii <eliz@gnu.org> + + * sedleim.inp (distclean): Remove stamp-subdirs. + (SUBDIRS): Don't use `touch', use `djecho' instead. + (changed.tit, changed.misc): Use `djecho' instead of `echo'. + +2004-05-02 Eli Zaretskii <eliz@gnu.org> + + * sed2v2.inp (HAVE_GETRUSAGE): Define. + 2003-09-22 Eli Zaretskii <eliz@gnu.org> * mainmake.v2 (man lispref lispintro): Specify an explicit target diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 91df8a21225..4d77194cff0 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -42,6 +42,7 @@ /^#undef HAVE_MEMCMP *$/s/^.*$/#define HAVE_MEMCMP 1/ /^#undef HAVE_MEMMOVE *$/s/^.*$/#define HAVE_MEMMOVE 1/ /^#undef HAVE_SETRLIMIT *$/s/^.*$/#define HAVE_SETRLIMIT 1/ +/^#undef HAVE_GETRUSAGE *$/s/^.*$/#define HAVE_GETRUSAGE 1/ /^#undef HAVE_TM_GMTOFF *$/s/^.*$/#define HAVE_TM_GMTOFF 1/ /^#undef HAVE_MBLEN *$/s/^.*$/#define HAVE_MBLEN 1/ /^#undef HAVE_STRUCT_TIMEZONE *$/s/^.*$/#define HAVE_STRUCT_TIMEZONE 1/ diff --git a/msdos/sedleim.inp b/msdos/sedleim.inp index ff9c6b73337..f4795e749b8 100644 --- a/msdos/sedleim.inp +++ b/msdos/sedleim.inp @@ -28,6 +28,9 @@ MAKESHELL=/xyzzy/command /^INSTALLDIR=/c\ INSTALLDIR=. +/touch stamp-subdir/s|touch|djecho "stamp-subdir" >| +s|\([ ]\)echo|\1djecho|g + /RUN-EMACS *=/,/^$/c\ export EMACSLOADPATH=${buildlisppath}\ RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte @@ -52,5 +55,8 @@ RUN-EMACS = ${BUILT-EMACS} -batch --no-init-file --no-site-file --multibyte install: all\ /^ if test -f/d +/^distclean:/,/^$/ { + s|\(rm -f Makefile\)|\1 stamp-subdir| +} # arch-tag: 33c5eed1-78bc-4a6e-9d11-cbc7c541b763 diff --git a/nt/ChangeLog b/nt/ChangeLog index f568ef39ffc..af6e93c3ff5 100644 --- a/nt/ChangeLog +++ b/nt/ChangeLog @@ -1,6 +1,49 @@ +2004-06-07 Juanma Barranquero <lektu@terra.es> + + * INSTALL: Clarify paragraph about compatibility between image + libraries and builds of Emacs with several compilers. + +2004-06-06 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in (bootstrap-nmake): When nmake'ing bootstrap on + the lisp/ directory, set SHELL to $(SHELLTYPE); this avoids + calling non-existent cmdproxy.exe on boostrappings after a + previous install followed by realclean. + + * nmake.defs: Add quote in comment to resync font-locking. + +2004-06-04 Juanma Barranquero <lektu@terra.es> + + * INSTALL: Reword the section on image support. Add reference to + GnuWin32. Mention problems when mixing binaries from different + compilers. + +2004-05-06 Jason Rumney <jasonr@gnu.org> + + * configure.bat: Use -mno-cygwin to check for image libraries + when needed. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.nt, ebuild.bat, install.bat, fast-install.bat: + * makefile.def: Remove. + + * nmake.defs (SYS_LDFLAGS): Add -nologo. + + * makefile.w32-in (info-gmake, info-nmake): New targets. + (info): Use them. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * nmake.defs: + * gmake.defs: + * makefile.w32-in: + * makefile.def: + * makefile.nt: Add "-*- makefile -*-" mode tag. + 2004-04-10 Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de> - * runemacs.c (WinMain): Let emacs environment default to parent. + * runemacs.c (WinMain): Let Emacs environment default to parent. 2004-03-11 Jason Rumney <jasonr@gnu.org> @@ -21,7 +64,7 @@ 2003-11-22 Lars Hansen <larsh@math.ku.dk> - * inc/grp.h: Added. + * inc/grp.h: New file. 2003-09-03 Peter Runestig <peter@runestig.com> @@ -157,7 +200,7 @@ * INSTALL: Update table of versions of make that are suitable for building Emacs, based on recent feedback. - * TODO, _emacs, emacs.bat.in, debug.bat.in: Removed. + * TODO, _emacs, emacs.bat.in, debug.bat.in: Remove. 2001-11-19 Andrew Innes <andrewi@gnu.org> diff --git a/nt/INSTALL b/nt/INSTALL index 273c6b1e16b..646054e07f4 100644 --- a/nt/INSTALL +++ b/nt/INSTALL @@ -1,7 +1,7 @@ Building and Installing Emacs - on Windows NT/2000 and Windows 95/98/ME + on Windows NT/2K/XP and Windows 95/98/ME - Copyright (c) 2001 Free Software Foundation, Inc. + Copyright (c) 2001,2004 Free Software Foundation, Inc. See the end of the file for copying permissions. If you used WinZip to unpack the distribution, we suggest to @@ -31,7 +31,7 @@ like this, we recommend the use of the supported compilers mentioned in the previous paragraph. - If you build Emacs on Windows 9X or ME, not on Windows 2000 or + If you build Emacs on Windows 9X or ME, not on Windows 2K/XP or Windows NT, we suggest to install the Cygwin port of Bash. Please see http://www.mingw.org for pointers to GCC/Mingw binaries. @@ -90,22 +90,35 @@ * Optional image library support - To build Emacs with support for PNG images, the libpng and zlib - headers must be in the include path when the configure script is - run. This can be setup using environment variables, or by - specifying --cflags -I... options on the command-line to - configure.bat. Similarly, the jpeg-6b, libXpm, tiff and libungif - headers need to be in the include path for support for those image - formats to work. The configure script will report whether it was + In addition to its "native" image formats (pbm and xbm), Emacs can + handle other image types: xpm, tiff, gif, png and jpeg (postscript is + currently unsupported on Windows). To build Emacs with support for + them, the corresponding headers must be in the include path when the + configure script is run. This can be setup using environment + variables, or by specifying --cflags -I... options on the command-line + to configure.bat. The configure script will report whether it was able to detect the headers. - To use the PNG support, zlib.dll (or zlibd.dll) and libpng.dll (or - libpng13.dll, or libpng13d.dll) must be on the PATH or in the same - directory as emacs.exe when Emacs is started. Similar instructions - apply for other image libraries. Note that tiff support depends on - the jpeg library. If you did not compile the libraries yourself, you - must make sure that the jpeg library you install is the same one - that the tiff library was compiled against. + To use the external image support, the DLLs implementing the + functionality must be found when Emacs is started, either on the PATH, + or in the same directory as emacs.exe. Failure to find a library is + not an error; the associated image format will simply be unavailable. + + Some image libraries have dependencies on one another, or on zlib. + For example, tiff support depends on the jpeg library. If you did not + compile the libraries yourself, you must make sure that any dependency + is in the PATH or otherwise accesible and that the binaries are + compatible (for example, that they were built with the same compiler). + + Binaries for the image libraries (among many others) can be found at + GnuWin32 (http://gnuwin32.sourceforge.net). These are built with + MinGW, and so are very compatible with GCC/MinGW builds of Emacs (like + the official binary tarballs for Windows). Compatibility with MSVC, + on the other hand, is still weak and should not be trusted in + production environments; if you really need an MSVC-compiled Emacs + with image support, you should try to build the required libraries + with the same compiler (though it can be extremely non-trivial, and + we'll be interested on hearing of any such effort). * Building diff --git a/nt/configure.bat b/nt/configure.bat index a27bbcd8cdd..216420873c7 100755 --- a/nt/configure.bat +++ b/nt/configure.bat @@ -294,13 +294,20 @@ rem Check for external image libraries. Since they are loaded rem dynamically, the libraries themselves do not need to be present
rem at compile time, but the header files are required.
+set mingwflag=
+
+if (%nocygwin%) == (N) goto flagsOK
+set mingwflag=-mno-cygwin
+
+:flagsOK
+
if (%pngsupport%) == (N) goto pngDone
echo Checking for libpng...
echo #include "png.h" >junk.c
echo main (){} >>junk.c
rem -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err
if exist junk.obj goto havePng
echo ...png.h not found, building without PNG support.
@@ -320,7 +327,7 @@ echo Checking for jpeg-6b... echo #include "jconfig.h" >junk.c
echo main (){} >>junk.c
rem -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err
if exist junk.obj goto haveJpeg
echo ...jconfig.h not found, building without JPEG support.
@@ -340,7 +347,7 @@ echo Checking for libgif... echo #include "gif_lib.h" >junk.c
echo main (){} >>junk.c
rem -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err
if exist junk.obj goto haveGif
echo ...gif_lib.h not found, building without GIF support.
@@ -360,7 +367,7 @@ echo Checking for tiff... echo #include "tiffio.h" >junk.c
echo main (){} >>junk.c
rem -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err
if exist junk.obj goto haveTiff
echo ...tiffio.h not found, building without TIFF support.
@@ -381,7 +388,7 @@ echo #define FOR_MSW 1 >junk.c echo #include "X11/xpm.h" >>junk.c
echo main (){} >>junk.c
rem -o option is ignored with cl, but allows result to be consistent.
-%COMPILER% %usercflags% -c junk.c -o junk.obj >junk.out 2>junk.err
+%COMPILER% %usercflags% %mingwflag% -c junk.c -o junk.obj >junk.out 2>junk.err
if exist junk.obj goto haveXpm
echo ...X11/xpm.h not found, building without XPM support.
@@ -466,6 +473,7 @@ set COMPILER= set MAKECMD=
set usercflags=
set userldflags=
+set mingwflag=
goto skipArchTag
arch-tag: 300d20a4-1675-4e75-b615-7ce1a8c5376c
diff --git a/nt/ebuild.bat b/nt/ebuild.bat deleted file mode 100755 index c7851779cc5..00000000000 --- a/nt/ebuild.bat +++ /dev/null @@ -1,7 +0,0 @@ -@echo off -if (%1) == () nmake -f makefile.nt all -if not (%1) == () nmake -f makefile.nt %1 %2 %3 %4 %5 %6 %7 %8 %9 - -goto skipArchTag - arch-tag: f01be12a-fd17-448d-8275-c7f527c50a1f -:skipArchTag diff --git a/nt/fast-install.bat b/nt/fast-install.bat deleted file mode 100755 index 11e969eb5a4..00000000000 --- a/nt/fast-install.bat +++ /dev/null @@ -1,5 +0,0 @@ -nmake -f makefile.nt fast_install
-
-goto skipArchTag
- arch-tag: 13c64379-e658-452f-92d3-90d0f230ca70
-:skipArchTag
diff --git a/nt/gmake.defs b/nt/gmake.defs index 7fe580426a8..bd201cd3314 100644 --- a/nt/gmake.defs +++ b/nt/gmake.defs @@ -1,5 +1,4 @@ -# -# Makefile definition file for building GNU Emacs on the Microsoft W32 API. +# -*- Makefile -*- definition file for building GNU Emacs on Windows NT. # Copyright (c) 2000-2001 Free Software Foundation, Inc. # # GNU Emacs is free software; you can redistribute it and/or modify diff --git a/nt/install.bat b/nt/install.bat deleted file mode 100755 index 1074c03454b..00000000000 --- a/nt/install.bat +++ /dev/null @@ -1,12 +0,0 @@ -@echo off
-if (%1) == (speed) set BUILD_TYPE=spd
-if (%1) == (speed) shift
-if not (%1) == () set INSTALL_DIR=%1
-if not (%1) == () shift
-nmake -f makefile.nt install %1 %2 %3 %4 %5 %6 %7 %8 %9
-set INSTALL_DIR=
-set BUILD_TYPE=
-
-goto skipArchTag
- arch-tag: 1db5223b-8fc9-4bdb-8ad1-9e3962bf034a
-:skipArchTag
diff --git a/nt/makefile.def b/nt/makefile.def deleted file mode 100644 index 224d4619b6b..00000000000 --- a/nt/makefile.def +++ /dev/null @@ -1,232 +0,0 @@ -# -# Makefile definition file for building GNU Emacs on Windows NT -# Copyright (c) 1994-2001 Free Software Foundation, Inc. -# -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# Geoff Voelker (voelker@cs.washington.edu) 9-6-94 - -# -# BEGIN CONFIGURATION -# - -# Define the following to build the GUI version -# -NTGUI=1 - -# Set INSTALL_DIR to be the directory into which you want emacs installed. -# -!ifndef INSTALL_DIR -INSTALL_DIR = C:\emacs -!endif - -# Define MSVCNT11 to be nonzero if you are using the MSVCNT 1.1 environment. -# MSVCNT11 = 1 -!ifndef MSVCNT11 -MSVCNT11 = 0 -!endif - -# -# END CONFIGURATION -# - -# -# Allow detection of builds with MSVC 5 or later -# -_NMAKE_VER_5=162 -_NMAKE_VER_4=0 - -!IFNDEF _NMAKE_VER -_NMAKE_VER=$(_NMAKE_VER_4) -!ENDIF - -# Check that the INCLUDE and LIB environment variables are set. -# -!ifndef INCLUDE -!error The INCLUDE environment variable needs to be set. -!endif -!ifndef LIB -!error The LIB environment variable needs to be set. -!endif - -# Determine the architecture we're running on. -# Define ARCH for our purposes; -# Define CPU for use by ntwin32.mak; -# Define CONFIG_H to the appropriate config.h for the system; -# -!ifdef PROCESSOR_ARCHITECTURE -# We're on Windows NT -CPU = $(PROCESSOR_ARCHITECTURE) -CONFIG_H = config.nt -OS_TYPE = windowsnt -! if "$(PROCESSOR_ARCHITECTURE)" == "x86" -ARCH = i386 -CPU = i386 -! else -! if "$(PROCESSOR_ARCHITECTURE)" == "MIPS" -ARCH = mips -! else -! if "$(PROCESSOR_ARCHITECTURE)" == "ALPHA" -ARCH = alpha -! else -! if "$(PROCESSOR_ARCHITECTURE)" == "PPC" -ARCH = ppc -! else -!error Unknown architecture type "$(PROCESSOR_ARCHITECTURE)" -! endif -! endif -! endif -! endif -!else -# We're on Windows 95 -ARCH = i386 -CPU = i386 -CONFIG_H = config.nt -OS_TYPE = windows95 -!endif - -# Include ntwin32.mak. So far, this file seems to be supported by every -# Microsoft compiler on NT and Windows 95 and properly defines the executable -# names and libraries necessary to build Emacs. I do not have access -# to any other vendor compilers, so I do not know if they supply this -# file, too. For now I'll assume that they do. -# -!include <ntwin32.mak> - -# Using cvtres is necessary on NT 3.10 and doesn't hurt on later platforms. -CVTRES = cvtres.exe -AR = $(implib) -# The assignment $(CC) = $(cc) fails even though variables are case sensitive. -LINK_TMP = $(link) -LINK = $(LINK_TMP) -CC_TMP = $(cc) -CC = $(CC_TMP) - -# advapi32.lib is left off of $(baselibs) on NT 3.10 -!if "$(baselibs)" == "kernel32.lib " -ADVAPI32 = advapi32.lib -!else -ADVAPI32 = -!endif - -# Older ntwin32.mak files do not define libc; do it for them. -!ifndef libc -libc = libc.lib -!endif - -# The base libraries for compiling Emacs on NT. With MSVC, this should -# include oldnames.lib. -!if $(MSVCNT11) -BASE_LIBS = $(libc) $(baselibs) oldnames.lib -!else -BASE_LIBS = $(libc) $(baselibs) -nodefaultlib:oldnames.lib -!endif - -# We want any debugging info in the executable. -!if "$(LINK)" == "link32" -SYS_LDFLAGS = -nologo -!else -SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -!endif - -# Tag the executables to run out of the swapfile when execute off CD or network shares -SYS_LDFLAGS = $(SYS_LDFLAGS) -swaprun:cd -swaprun:net - -INC = -I. -!if "$(BUILD_TYPE)" == "spd" -CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -!else -CFLAGS_COMMON = -nologo $(INC) $(ARCH_CFLAGS) $(LOCAL_FLAGS) -DWIN32_LEAN_AND_MEAN -D$(ARCH) -Fd$(BLD)\vc.pdb -DEMACSDEBUG -!endif -!if $(MSVCNT11) -CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl -!else -CFLAGS = $(CFLAGS_COMMON) -D_CRTAPI1=_cdecl -!endif - -!ifdef BUILD_TYPE -OBJDIR = obj-$(BUILD_TYPE) -!else -OBJDIR = obj -!endif -$(OBJDIR):; -mkdir $(OBJDIR) -BLD = $(OBJDIR)\$(ARCH) -$(BLD): $(OBJDIR) - -mkdir $(BLD) - -CP = copy -CP_DIR = xcopy /f/r/i/e/d/k - -!if "$(OS_TYPE)" == "windows95" -DEL = deltree /y -DEL_TREE = deltree /y -!else -DEL = del -# NT better way of killing a deltree -DEL_TREE = rd /s/q -!endif - -# Lets us add icons to the GNU Emacs folder -ADDPM = ..\nt\$(BLD)\addpm.exe - -!if "$(ARCH)" == "i386" -!if "$(BUILD_TYPE)" == "spd" -ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Oxsb2 -G6dF -Zi -Zp8 -!else -ARCH_CFLAGS = -nologo -D_X86_=1 -c -Zel -W2 -H63 -Od -G3d -Zi -Zp8 -!endif -ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) - -!else -!if "$(ARCH)" == "mips" -ARCH_CFLAGS = -D_MIPS_=1 -c -W2 -Zi -Od -Gt0 -ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) - -!else -!if "$(ARCH)" == "alpha" -!if "$(BUILD_TYPE)" == "spd" -ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -Od -D__stdcall= -D__cdecl= -!else -ARCH_CFLAGS = -D_ALPHA_=1 -c -Ze -Zi -W2 -O1 -D__stdcall= -D__cdecl= -!endif -ARCH_LDFLAGS = -align:0x2000 $(SYS_LDFLAGS) - -!else -!if "$(ARCH)" == "ppc" -# These flags are a guess...if they don't work, please send me mail. -ARCH_CFLAGS = -D_PPC_=1 -c -Ze -Zi -W2 -Od -ARCH_LDFLAGS = -align:0x1000 $(SYS_LDFLAGS) - -!else -!ERROR Unknown architecture type "$(ARCH)". -!endif -!endif -!endif -!endif - -# -# If the compiler supports compiling multiple .c files to .o files at -# one time, use this feature. -# -!IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") -.c{$(BLD)}.obj: - $(CC) $(CFLAGS) -Fo$(BLD)\ $< -!ELSE -.c{$(BLD)}.obj:: - $(CC) $(CFLAGS) -Fo$(BLD)\ $< -!ENDIF - -# arch-tag: a8aa26d5-5f28-4263-b42a-6f91acb7d824 diff --git a/nt/makefile.nt b/nt/makefile.nt deleted file mode 100644 index 4a92f7f3e1f..00000000000 --- a/nt/makefile.nt +++ /dev/null @@ -1,214 +0,0 @@ -# -# Top level makefile for building GNU Emacs on Windows NT -# Copyright (c) 1993-2000 Free Software Foundation, Inc. -# -# This file is part of GNU Emacs. -# -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# -# Geoff Voelker (voelker@cs.washington.edu) 11-20-93 -# 9-6-94 -!include makefile.def - -ALL = addpm ddeclient runemacs cmdproxy addsection preprep -!if $(MSVCNT11) -TRES = $(BLD)\emacs.res -!else -TRES = $(BLD)\emacs.rbj -!endif - -addpm: $(BLD) $(BLD)\addpm.exe -$(BLD)\addpm.obj: addpm.c -$(BLD)\addpm.exe: $(BLD)\addpm.obj - $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \ - $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib - -ddeclient: $(BLD) $(BLD)\ddeclient.exe -$(BLD)\ddeclient.obj: ddeclient.c -$(BLD)\ddeclient.exe: $(BLD)\ddeclient.obj - $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \ - $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib - -cmdproxy: $(BLD) $(BLD)\cmdproxy.exe -$(BLD)\cmdproxy.obj: cmdproxy.c -$(BLD)\cmdproxy.exe: $(BLD)\cmdproxy.obj - $(LINK) -out:$@ -subsystem:console -entry:mainCRTStartup \ - $(SYS_LDFLAGS) $** $(BASE_LIBS) user32.lib - -addsection: $(BLD) $(BLD)\addsection.exe -$(BLD)\addsection.obj: addsection.c -$(BLD)\addsection.exe: $(BLD)\addsection.obj - $(LINK) -debug:full -out:$@ -subsystem:console -entry:mainCRTStartup \ - $(SYS_LDFLAGS) $** $(BASE_LIBS) user32.lib - -preprep: $(BLD) $(BLD)\preprep.exe -$(BLD)\preprep.obj: preprep.c -$(BLD)\preprep.exe: $(BLD)\preprep.obj - $(LINK) -debug:full -out:$@ -subsystem:console -entry:mainCRTStartup \ - $(SYS_LDFLAGS) $** $(BASE_LIBS) - -# -# The resource file. NT 3.10 requires the use of cvtres; even though -# it is not necessary on later versions, it is still ok to use it. -# -$(TRES): emacs.rc - $(RC) -Fo$(BLD)\emacs.res $** -!if !$(MSVCNT11) - $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res -!endif - -runemacs: $(BLD) $(BLD)\runemacs.exe -$(BLD)\runemacs.obj: runemacs.c -$(BLD)\runemacs.exe: $(BLD)\runemacs.obj $(TRES) - $(LINK) -out:$@ -subsystem:windows -entry:WinMainCRTStartup \ - $(SYS_LDFLAGS) $** $(BASE_LIBS) $(ADVAPI32) user32.lib - -# Since Windows 95 does not support multiple commands on one command line -# (e.g., in for loops), we cannot use for loops any more. -# SUBDIRS = lib-src src lisp - -# -# Build emacs -# -BUILD_CMD = $(MAKE) $(MFLAGS) -f makefile.nt all -all: $(BLD) $(ALL) - cd ..\lib-src - $(BUILD_CMD) - cd ..\src - $(BUILD_CMD) - cd ..\lisp - $(BUILD_CMD) - cd ..\leim - if exist makefile.nt $(BUILD_CMD) - cd ..\nt - -BOOTSTRAP_CMD = $(MAKE) $(MFLAGS) -f makefile.nt bootstrap -bootstrap: $(BLD) $(ALL) - cd ..\src - $(BOOTSTRAP_CMD) - $(BOOTCLEAN_CMD) - cd ..\lisp - $(BOOTSTRAP_CMD) - cd ..\nt - -BOOTCLEAN_CMD = $(MAKE) $(MFLAGS) -f makefile.nt bootstrap-clean -bootstrap-clean: - cd ..\src - $(BOOTCLEAN_CMD) - cd ..\lisp - $(BOOTCLEAN_CMD) - -$(INSTALL_DIR): - - mkdir $(INSTALL_DIR) - -$(INSTALL_DIR)\bin: - - mkdir $(INSTALL_DIR)\bin - -# -# Build and install emacs in INSTALL_DIR -# -INSTALL_CMD = $(MAKE) -f makefile.nt install -install: all $(INSTALL_DIR) - cd ..\lib-src - $(INSTALL_CMD) - cd ..\src - $(INSTALL_CMD) - cd ..\lisp - $(INSTALL_CMD) - cd ..\leim - if exist makefile.nt $(INSTALL_CMD) - cd ..\nt - - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin - - $(CP) $(BLD)\ddeclient.exe $(INSTALL_DIR)\bin - - $(CP) $(BLD)\cmdproxy.exe $(INSTALL_DIR)\bin - - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin - - $(CP) ..\lib-src\fns-*.el $(INSTALL_DIR)\bin - - $(ADDPM) $(INSTALL_DIR) - - $(DEL) ..\same-dir.tst - - $(DEL) $(INSTALL_DIR)\same-dir.tst - - mkdir $(INSTALL_DIR)\etc\icons - - $(CP_DIR) icons $(INSTALL_DIR)\etc\icons - echo SameDirTest > $(INSTALL_DIR)\same-dir.tst - if not exist ..\same-dir.tst $(MAKE) -f makefile.nt real_install - - $(DEL) ..\same-dir.tst - - $(DEL) $(INSTALL_DIR)\same-dir.tst - -# -# This installs executables from ..\bin into the installation directory -# without building anything. -# -fast_install: - - mkdir $(INSTALL_DIR)\data - $(CP) ..\lib-src\DOC $(INSTALL_DIR)\etc - - mkdir $(INSTALL_DIR)\bin - - $(CP) $(BLD)\addpm.exe $(INSTALL_DIR)\bin - - $(CP) $(BLD)\ddeclient.exe $(INSTALL_DIR)\bin - - $(CP) $(BLD)\cmdproxy.exe $(INSTALL_DIR)\bin - - $(CP) $(BLD)\runemacs.exe $(INSTALL_DIR)\bin - - $(CP) ..\lib-src\fns-*.el $(INSTALL_DIR)\bin - - $(DEL) ..\same-dir.tst - - $(DEL) $(INSTALL_DIR)\same-dir.tst - echo SameDirTest > $(INSTALL_DIR)\same-dir.tst - if not exist ..\same-dir.tst $(CP) ..\bin\emacs.exe $(INSTALL_DIR)\bin - if not exist ..\same-dir.tst $(CP) ..\bin\etags.exe $(INSTALL_DIR)\bin - if not exist ..\same-dir.tst $(CP) ..\bin\ctags.exe $(INSTALL_DIR)\bin - if not exist ..\same-dir.tst $(MAKE) -f makefile.nt real_install - - $(DEL) ..\same-dir.tst - - $(DEL) $(INSTALL_DIR)\same-dir.tst - -real_install: - - $(DEL) ..\same-dir.tst - - $(DEL) $(INSTALL_DIR)\same-dir.tst - echo SameDirTest > $(INSTALL_DIR)\same-dir.tst - - mkdir $(INSTALL_DIR)\etc - - mkdir $(INSTALL_DIR)\info - - mkdir $(INSTALL_DIR)\lock - - mkdir $(INSTALL_DIR)\data - - mkdir $(INSTALL_DIR)\site-lisp - - mkdir $(INSTALL_DIR)\etc\icons - - $(CP_DIR) icons $(INSTALL_DIR)\etc\icons - if not exist ..\same-dir.tst $(CP_DIR) ..\etc $(INSTALL_DIR)\etc - if not exist ..\same-dir.tst $(CP_DIR) ..\info $(INSTALL_DIR)\info - - $(DEL) ..\same-dir.tst - - $(DEL) $(INSTALL_DIR)\same-dir.tst - -# -# Maintenance -# -CLEAN_CMD = $(MAKE) -f makefile.nt clean -clean: - - $(DEL) *~ *.pdb - - $(DEL) *.orig - - $(DEL) *.rej - - $(DEL) *.crlf - - $(DEL_TREE) deleted - - $(DEL_TREE) obj - - $(DEL_TREE) obj-spd - - $(DEL) ..\etc\DOC ..\etc\DOC-X - cd ..\lib-src - $(CLEAN_CMD) - cd ..\src - $(CLEAN_CMD) - cd ..\lisp - $(CLEAN_CMD) - cd ..\leim - if exist makefile.nt $(CLEAN_CMD) - cd ..\nt - -realclean: clean - - $(DEL_TREE) ..\bin - -# arch-tag: b01debf7-6859-439e-b08e-f041aa03c32f diff --git a/nt/makefile.w32-in b/nt/makefile.w32-in index 915259ead65..adbb3fd57b8 100644 --- a/nt/makefile.w32-in +++ b/nt/makefile.w32-in @@ -1,5 +1,5 @@ -# Makefile for GNU Emacs on the Microsoft W32 API.
-# Copyright (c) 2000-2001 Free Software Foundation, Inc.
+# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API.
+# Copyright (c) 2000-2001, 2004 Free Software Foundation, Inc.
#
# Top level makefile for building GNU Emacs on Windows NT
#
@@ -139,7 +139,7 @@ bootstrap-nmake: $(MAKE) $(MFLAGS) bootstrap
$(MAKE) $(MFLAGS) bootstrap-clean
cd ..\lisp
- $(MAKE) $(MFLAGS) bootstrap
+ $(MAKE) $(MFLAGS) SHELL=$(SHELLTYPE) bootstrap
cd ..\lib-src
$(MAKE) $(MFLAGS) DOC
cd ..\nt
@@ -217,11 +217,20 @@ force-info: # Note that man/makefile knows how to
# put the info files in $(infodir),
# so we can do ok running make in the build dir.
-info: force-info
- (cd ..\man && $(MAKE) $(MFLAGS) info)
- (cd ..\lispref && $(MAKE) $(MFLAGS) info)
- (cd ..\lispintro && $(MAKE) $(MFLAGS) info)
+info: force-info info-$(MAKETYPE)
+
+info-nmake:
+ cd ..\man
+ $(MAKE) $(MFLAGS) info
+ cd ..\lispref
+ $(MAKE) $(MFLAGS) info
+ cd ..\lispintro
+ $(MAKE) $(MFLAGS) info
+info-gmake:
+ $(MAKE) $(MFLAGS) -C ../man info
+ $(MAKE) $(MFLAGS) -C ../lispref info
+ $(MAKE) $(MFLAGS) -C ../lispintro info
#
# Maintenance
#
@@ -272,5 +281,3 @@ cleanall: clean cleanall-other-dirs-$(MAKETYPE) realclean: cleanall
- $(DEL_TREE) ../bin
-
-# arch-tag: 6f5b23a6-774b-4598-9c29-58235b2b4219
diff --git a/nt/nmake.defs b/nt/nmake.defs index aef2b6cf472..89bf9ac91fc 100644 --- a/nt/nmake.defs +++ b/nt/nmake.defs @@ -1,5 +1,4 @@ -#
-# Makefile definition file for building GNU Emacs on the Microsoft W32 API.
+# -*- Makefile -*- definition file for building GNU Emacs on Windows NT.
# Copyright (c) 2000-2001 Free Software Foundation, Inc.
#
# GNU Emacs is free software; you can redistribute it and/or modify
@@ -135,7 +134,7 @@ CFLAGS = -I. -DWIN32_LEAN_AND_MEAN -D_WIN32_WINNT=0x0400 $(ARCH_CFLAGS) -D_CRTAPI1=_cdecl $(DEBUG_CFLAGS) $(USER_CFLAGS) $(LOCAL_FLAGS)
EMACS_EXTRA_C_FLAGS =
-SYS_LDFLAGS = -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj
+SYS_LDFLAGS = -nologo -release -incremental:no -version:3.10 -swaprun:cd -swaprun:net setargv.obj
# see comments in allocate_heap in w32heap.c before changing any of the
# -stack, -heap, or -base settings.
@@ -162,6 +161,7 @@ FORVAR = %%f FORDO = ) do
ENDFOR =
ARGQUOTE = "
+# "
DQUOTE = \"
DEL = rm
DEL_TREE = rm -r
diff --git a/oldXMenu/Makefile.in b/oldXMenu/Makefile.in index 82269282c03..e20a583514a 100644 --- a/oldXMenu/Makefile.in +++ b/oldXMenu/Makefile.in @@ -107,5 +107,3 @@ maintainer-clean: distclean tags:: $(TAGS) -t *.[ch] - -# arch-tag: dbfc0b16-4e0c-4acb-a9c1-fc12ee76db06 diff --git a/src/.arch-inventory b/src/.arch-inventory new file mode 100644 index 00000000000..a98d4c9932f --- /dev/null +++ b/src/.arch-inventory @@ -0,0 +1,9 @@ +# Source files which don't match the usual naming conventions, mostly dot files +source ^\.(gdbinit|dbxinit)$ + +# Auto-generated files, which ignore +precious ^(config\.stamp|config\.h|epaths\.h)$ + +backup ^(stamp-oldxmenu|prefix-args|temacs|emacs|emacs-[0-9.]*)$ + +# arch-tag: 277cc7ae-b3f5-44af-abf1-84c073164543 diff --git a/src/.gdbinit b/src/.gdbinit index 9e4e674c740..943481d419e 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -81,7 +81,7 @@ end define xvectype xgetptr $ set $size = ((struct Lisp_Vector *) $ptr)->size - output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size + output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~gdb_array_mark_flag echo \n end document xvectype @@ -186,9 +186,10 @@ Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value end define xsymbol - xgetptr $ + set $sym = $ + xgetptr $sym print (struct Lisp_Symbol *) $ptr - xprintsym $ + xprintsym $sym echo \n end document xsymbol @@ -199,7 +200,7 @@ end define xstring xgetptr $ print (struct Lisp_String *) $ptr - output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) + xprintstr $ echo \n end document xstring @@ -210,7 +211,7 @@ end define xvector xgetptr $ print (struct Lisp_Vector *) $ptr - output ($->size > 50) ? 0 : ($->contents[0])@($->size) + output ($->size > 50) ? 0 : ($->contents[0])@($->size & ~gdb_array_mark_flag) echo \n end document xvector @@ -289,7 +290,7 @@ end define xboolvector xgetptr $ print (struct Lisp_Bool_Vector *) $ptr - output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8) + output ($->size > 256) ? 0 : ($->data[0])@((($->size & ~gdb_array_mark_flag) + 7)/ 8) echo \n end document xboolvector @@ -372,12 +373,17 @@ document xscrollbar Print $ as a scrollbar pointer. end +define xprintstr + set $data = $arg0->data + output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte) +end + define xprintsym xgetptr $arg0 set $sym = (struct Lisp_Symbol *) $ptr xgetptr $sym->xname set $sym_name = (struct Lisp_String *) $ptr - output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size : $sym_name->size_byte) + xprintstr $sym_name end document xprintsym Print argument as a symbol. @@ -418,7 +424,7 @@ define xbacktrace if $type == Lisp_Vectorlike xgetptr (*$bt->function) set $size = ((struct Lisp_Vector *) $ptr)->size - output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size + output ($size & PVEC_FLAG) ? (enum pvec_type) ($size & PVEC_TYPE_MASK) : $size & ~gdb_array_mark_flag else printf "Lisp type %d", $type end diff --git a/src/ChangeLog b/src/ChangeLog index 35ebc439bdd..3b262ee76bc 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,1130 @@ +2004-06-20 Richard M. Stallman <rms@gnu.org> + + * xfaces.c (Finternal_copy_lisp_face): Small cleanup; doc fix. + + * search.c (match_limit): Cleaner err msg when no match data available. + + * window.c (syms_of_window): Doc fix. + + * keyboard.c (command_loop_1): Handle values `only' and `identity' + for Vtransient_mark_mode. + + * buffer.c (syms_of_buffer): Doc fix. + +2004-06-21 David Kastrup <dak@gnu.org> + + * minibuf.c (Ftry_completion, Fall_completions): Do lazy binding + and unbinding of `case-fold-search' according to + `completion-ignore-case' around calls of string-match and + predicates, respectively. Should give satisfactory performance + in all relevant cases. + +2004-06-17 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xterm.c (x_draw_image_foreground_1): Subtract slice.x/y from + clip_x/y_origin. + + * fns.c (string_to_multibyte): Use xmalloc/xfree instead of alloca. + + * macfns.c (Fx_display_color_cells): Do not limit return value to 256. + + * macterm.c (mac_initialize_display_info): Initialize n_planes correctly + on Mac OSX. + +2004-06-16 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (syms_of_buffer): Clarify `fill-column' docstring. + +2004-06-16 Kim F. Storm <storm@cua.dk> + + * dispextern.h (Vimage_types): Remove extern. + +2004-06-16 Miles Bader <miles@gnu.org> + + * image.c (lookup_image_type): Initialize image type if necessary. + +2004-06-15 Kim F. Storm <storm@cua.dk> + + * xdisp.c (try_cursor_movement): Exclude header line from scroll + margin at top of window. + (try_window_reusing_current_matrix): Calculate proper cursor position + after scrolling up with non-zero scroll margin, as the old cursor + position corresponds to value of PT before executing this command. + (try_window_id): Consider scroll margin at bottom of window too; + otherwise we fail to scroll when hl-line-mode is enabled. + + * syntax.c (skip_chars): Only recognize [:class:] when it has the + proper format and class is a lower-case word. + +2004-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_get_image_for_pixmap): New function. + (xg_get_gdk_pixmap_and_mask): Removed. + (update_frame_tool_bar): Call xg_get_image_for_pixmap instead of + xg_get_gdk_pixmap_and_mask. + + * xterm.h (struct x_display_info): Typo in comment fixed. + +2004-06-14 Juanma Barranquero <lektu@terra.es> + + * dispextern.h (Vimage_types): Make it conditional on + HAVE_WINDOW_SYSTEM. + + * image.c (Vimage_types): Move from xdisp.c. + (Vimage_type_cache): New variable. + (define_image_type): New argument indicating whether an image + library was loaded; cache loaded status and return t on success, + nil otherwise. + (CACHE_IMAGE_TYPE, ADD_IMAGE_TYPE): New macros. + (w32_delayed_load): New function to load an image library from a + list of possible filenames. + (init_xpm_functions, init_png_functions, init_jpeg_functions) + (init_tiff_functions, init_gif_functions): Use `w32_delayed_load'. + (CHECK_LIB_AVAILABLE): Call `define_image_library' with new + argument. + (Finit_image_library): New function, extracted from `init_image'. + Try to initialize an image library on demand and cache whether we + were successful or not. + (syms_of_image): Initialize `Vimage_types' and + `Vimage_type_cache'. Add recognized image types to Vimage_types. + Export `init-image-library'. + (init_image): Remove initialization of all image types, except xbm + and pbm. + + * xdisp.c (Vimage_types): Delete (moved to image.c). + +2004-06-14 Andreas Schwab <schwab@suse.de> + + * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion): + Avoid calling specbind when completion-regexp-list is empty. + +2004-06-13 Richard M. Stallman <rms@gnu.org> + + * regex.h (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t) + (re_wctype, re_iswctype, re_wctype_to_bit): + Non-function definitions moved here from regex.c. + + * regex.c (re_wctype, re_iswctype): Function defs longer static. + (CHAR_CLASS_MAX_LENGTH, re_wctype_t, re_wchar_t) + (re_wctype, re_iswctype, re_wctype_to_bit): + Non-function definitions moved to regex.h. + + * window.c (Fselect_window): Doc fix. + + * syntax.c: Include regex.h. + (skip_chars): New arg HANDLE_ISO_CLASSES. Callers changed. + If requested, make a list of classes, then check the scanned + chars for membership in them. + (in_classes): New function. + Doc fix. + + * keyboard.c (cmd_error): Don't call any_kboard_state + if inside a recursive edit level. + +2004-06-13 Lorentey K,Aa(Broly <lorentey@elte.hu> + + * keyboard.c (command_loop): Call any_kboard_state before + command_loop_2 when at top level. + +2004-06-13 Andreas Schwab <schwab@suse.de> + + * print.c (print_object): Always use %ld for printing EMACS_INT. + + * keyboard.c (cancel_hourglass_unwind): Return a value. + (modify_event_symbol): Always use %ld for printing EMACS_INT. + (Fexecute_extended_command): Likewise. + + * syntax.h (SYNTAX_ENTRY_FOLLOW_PARENT): Rename local variable to + avoid clashes. + (SYNTAX): Likewise. + (SYNTAX_WITH_FLAGS): Likewise. + (SYNTAX_MATCH): Likewise. + + * syntax.c (char_quoted): Avoid warning about undefined operation. + (find_defun_start): Likewise. + (scan_lists): Likewise. + (INC_FROM): Likewise. + (scan_sexps_forward): Likewise. + + * image.c: Include <ctype.h>. + + * xfaces.c (face_attr_equal_p): Declare parameters. + +2004-06-13 Kenichi Handa <handa@m17n.org> + + * ccl.c (CCL_READ_CHAR): If hit EOF, set REG to -1. + +2004-06-12 Matthew Mundell <matt@mundell.ukfsn.org> + + * eval.c (Fdefun): Signal an error if NAME is not a symbol. + +2004-06-12 Kenichi Handa <handa@m17n.org> + + * ccl.c (CCL_CALL_FOR_MAP_INSTRUCTION): Save eof_ic in + ccl_prog_stack_struct and update it. + (CCL_INVALID_CMD): If CCL_DEBUG is defined, call ccl_debug_hook. + (CCL_READ_CHAR): Get instruction counter from eof_ic, not from + ccl->eof_ic on EOF. + (ccl_debug_hook): New function. + (struct ccl_prog_stack): New member eof_ic. + (ccl_driver): Handle EOF in subrountine call correctly. + +2004-06-11 Kenichi Handa <handa@m17n.org> + + * coding.c (decode_coding_string): Check CODING_FINISH_INTERRUPT. + +2004-06-11 Kim F. Storm <storm@cua.dk> + + * emacs.c (shut_down_emacs): Inhibit redisplay during shutdown. + +2004-06-11 Juanma Barranquero <lektu@terra.es> + + * keyboard.c (Fposn_at_point): Doc fix. + +2004-06-11 David Kastrup <dak@gnu.org> + + * search.c (match_limit): Don't flag an error if match-data + exceeding the allocated search_regs.num_regs gets requested, just + return Qnil. + +2004-06-08 Miles Bader <miles@gnu.org> + + * xfaces.c (push_named_merge_point): Return 0 when a cycle is detected. + +2004-06-07 Juanma Barranquero <lektu@terra.es> + + * editfns.c (Fuser_login_name, Ffloat_time, Fencode_time) + (Fcurrent_time_string, Fcurrent_time_zone) + (Finsert_buffer_substring, Ftranspose_regions): Doc fixes. + +2004-06-07 Miles Bader <miles@gnu.org> + + * xfaces.c (struct named_merge_point): New type. + (push_named_merge_point): New function. + (merge_named_face): New function. + (merge_face_ref, face_at_buffer_position, face_at_string_position): + Use `merge_named_face'. + (merge_face_inheritance): Function removed. + (merge_face_ref): Renamed from `merge_face_vector_with_property'. + Add new `err_msgs' and `named_merge_points' args. Return error + status. Only print error messages if ERR_MSGS is true. Don't try to + do :inherit attribute validation. + (merge_face_heights): Handle `unspecified' in both directions. + (merge_face_vectors): Rename `cycle_check' arg to `named_merge_points'. + Call `merge_face_ref' instead of `merge_face_inheritance'. + (Fdisplay_supports_face_attributes_p, Fface_attributes_as_vector) + (compute_char_face, face_at_buffer_position) + (face_at_string_position): Call `merge_face_ref' instead of + `merge_face_vector_with_property'. + +2004-06-07 Kenichi Handa <handa@m17n.org> + + * coding.c (find_safe_codings): Check NILP (safe_codings) only at + the necessary places. + +2004-06-07 Kim F. Storm <storm@cua.dk> + + * process.c (Fdelete_process): Undo 2004-05-28 change. + Instead, call status_notify also for network process. + (status_message): Use process instead of status as arg. + Give messages "deleted" or "connection broken by remote peer" for + an exited network process. + (status_notify): Change call to status_message. + (read_process_output): Increase readmax to 4096. Do not increase + buffer size for datagram channels (default is now large enough). + +2004-06-06 Steven Tamm <tamm@Steven-Tamms-Computer.local> + + * macfns.c (x_create_tip_frame): Fix Mac OS X 10.1 compilation + problem due to newly defined variable. + +2004-06-06 Miles Bader <miles@gnu.org> + + * xfaces.c (Fdisplay_supports_face_attributes_p): Give up + immediately if non-interactive or not initialized. + +2004-06-05 Richard M. Stallman <rms@gnu.org> + + * minibuf.c (Fcompleting_read): Doc fix. + +2004-06-05 Andreas Schwab <schwab@suse.de> + + * macfns.c (x_create_tip_frame): Fix declaration after statement. + +2004-06-05 Juanma Barranquero <lektu@terra.es> + + * keymap.c (Fdescribe_vector): Fix docstring. + (Fkey_description, Fglobal_key_binding): Fix typo in docstring. + +2004-06-05 Miles Bader <miles@gnu.org> + + * xfaces.c (tty_supports_face_attributes_p): Make sure the specified + attributes have different values than the default face. + +2004-06-04 Eli Zaretskii <eliz@gnu.org> + + * xfaces.c (x_supports_face_attributes_p): Make this function + conditional on HAVE_WINDOW_SYSTEM. + (Fdisplay_supports_face_attributes_p) [HAVE_WINDOW_SYSTEM]: Don't + call x_supports_face_attributes_p if it was not compiled in. + +2004-06-04 Miles Bader <miles@gnu.org> + + * xfaces.c (tty_supports_face_attributes_p): New function, mostly + from Ftty_supports_face_attributes_p. + (x_supports_face_attributes_p): New function. + (Ftty_supports_face_attributes_p): Function deleted. + (Fdisplay_supports_face_attributes_p): New function. + (syms_of_xfaces): Initialize Sdisplay_supports_face_attributes_p. + (face_attr_equal_p): New function. + (lface_equal_p): Use it. + +2004-06-03 Juanma Barranquero <lektu@terra.es> + + * w32fns.c (Fx_display_grayscale_p, Fw32_send_sys_command) + (Vw32_color_map): Fix typo in docstring. + (Fx_create_frame, Fw32_find_bdf_fonts, Fx_show_tip) + (Fw32_unregister_hot_key, Fw32_reconstruct_hot_key): + Make argument names match their use in docstring. + +2004-06-02 Juanma Barranquero <lektu@terra.es> + + Work around bugs/problems with MinGW builds of graphics libraries + called from MSVC builds of Emacs. + + * image.c (lookup_image): Make pointer to img static. + (png_read_from_memory): Disable "global" optimization. + +2004-06-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * mem-limits.h (EXCEEDS_LISP_PTR) [USE_LSB_TAG]: Never true. + +2004-05-29 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macfns.c: Don't include ccl.h. + [MAC_OSX]: Don't include QuickTime/QuickTime.h. + [!MAC_OSX]: Don't include alloca.h, Windows.h, Gestalt.h, or + TextUtils.h. + (Fx_create_frame): Sync with xfns.c. Initialize cursor + descriptors. + (Fx_display_mm_height, Fx_display_mm_width): Calculate length from + display height/width. + (compute_tip_xy, Vx_max_tooltip_size): Declare. + (unwind_create_tip_frame, compute_tip_xy): New functions. + (x_create_tip_frame, Fx_show_tip, Fx_hide_tip): Sync with xfns.c. + (syms_of_macfns): Initialize Qcancel_timer, Vx_max_tooltip_size, + and last_show_tip_args. + + * macgui.h [!MAC_OSX]: Include Gestalt.h. + (Cursor, No_Cursor): New defines. + [!TARGET_API_MAC_CARBON] (SetPortWindowPort): New compatibility + macro. + [!TARGET_API_MAC_CARBON] (arrow_cursor): Declare. + + * macmenu.c (mac_menu_show, mac_dialog): Use SetPortWindowPort. + + * macterm.c: Don't include Gestalt.h. + (enum mouse_tracking_type, mouse_tracking_in_progress): Remove. + (XDrawLine, XClearArea, XClearWindow, mac_draw_bitmap) + (mac_set_clip_rectangle, mac_reset_clipping, XCreatePixmap) + (XFillRectangle, mac_draw_rectangle, mac_draw_string_common) + (mac_copy_area, mac_copy_area_with_mask, x_update_end) + (construct_mouse_click, XTmouse_position) + (x_scroll_bar_report_motion, x_calc_absolute_position) + (do_mouse_moved, do_zoom_window, mac_do_receive_drag) + (XTread_socket, make_mac_frame): Use SetPortWindowPort. + (note_mouse_movement): Clear the mouse face and reset the pointer + shape when the pointer goes outside the frame without grabbing. + (mac_front_window): New function. + (mac_window_to_frame): New macro. + (XTmouse_position, x_scroll_bar_report_motion, do_window_update) + (do_window_activate, do_window_deactivate, do_app_resume) + (do_app_suspend, do_mouse_moved, do_menu_choice, do_grow_window) + (do_zoom_window, mac_do_receive_drag, XTread_socket) + (mac_check_for_quit_char): Use mac_front_window and/or + mac_window_to_frame. + (x_scroll_bar_handle_click): Set `(PORTION . WHOLE)' part in a + scroll-bar click event. + (mac_define_frame_cursor): Change the pointer shape. + (x_free_frame_resources): Reset tip_window to NULL when it is + disposed. + [!TARGET_API_MAC_CARBON] (arrow_cursor): New variable. + [!TARGET_API_MAC_CARBON] (do_init_managers): Initialize + arrow_cursor. + (do_window_update): Don't do anything if the updated window is the + tooltip window. + (do_mouse_moved): Handle mouse movement events here (previously in + XTread_socket). Clear the mouse face if + dpyinfo->mouse_face_hidden is set. + (do_os_event, do_events): Remove (now in XTread_socket). + (XTread_socket): Immediately return if interrupt_input_blocked. + Loop until all the events in the queue are processed. Rearrange + codes for mouse grabbing. Add tooltip support. Include the + contents of do_os_event and do_events. Remove mouse movement + handling (now in do_mouse_moved). Add the case where + Vmouse_highlight has an integer value. + (NewMacWindow): Remove. + (make_mac_frame): Do what NewMacWindow previously did. Don't do + excess initializations. + (make_mac_terminal_frame): Previous initializations in + make_mac_frame are moved here. + (mac_initialize_display_info): Initialize + dpyinfo->mouse_face_overlay and dpyinfo->mouse_face_hidden. + + * xdisp.c [MAC_OS] (No_Cursor): Remove variable. + (define_frame_cursor1): Don't treat HAVE_CARBON as a special case. + +2004-05-29 Richard M. Stallman <rms@gnu.org> + + * lisp.h (truncate_undo_list): Update decl. + + * alloc.c (undo_outer_limit): New variable. + (syms_of_alloc): Defvar it. + (Fgarbage_collect): Pass undo_outer_limit to truncate_undo_list. + + * undo.c (truncate_undo_list): New arg LIMITSIZE. + + * alloc.c (lisp_align_malloc): Check for base == 0 + regardless of HAVE_POSIX_MEMALIGN. + Clean up HAVE_POSIX_MEMALIGN handling of `err'. + +2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c: Undo Kim's recent changes and fix the same bug differently. + (marker_blocks_pending_free): Remove. + (Fgarbage_collect): Sweep after cleaning up undo-lists. + Mark the undo lists after claning them up. + Don't free block in marker_blocks_pending_free. + (mark_buffer): Don't mark undo_list. + (gc_sweep): Sweep hash-tables and strings first. + Do free marker blocks that are empty. + +2004-05-28 Jim Blandy <jimb@redhat.com> + + * regex.c (print_partial_compiled_pattern): Add missing 'break' + after 'case wordend'. For symbeg and symend, print to stderr, + like the other cases. + +2004-05-28 Noah Friedman <friedman@splode.com> + + * process.c (Fdelete_process): Do not call remove_process. + +2004-05-28 Stefan Monnier <monnier@iro.umontreal.ca> + + * alloc.c (struct backtrace): Remove. + (Fgarbage_collect): Use the new mark_backtrace. + + * eval.c (mark_backtrace): New function. + + * minibuf.c (run_exit_minibuf_hook): New function. + (read_minibuf_unwind): Don't run exit-minibuffer-hook any more. + (read_minibuf): Use separate unwind handler to run exit-minibuf-hook. + +2004-05-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (back_to_previous_visible_line_start): Skip backwards + over display properties, e.g. images, that replace buffer text. + +2004-05-25 Kim F. Storm <storm@cua.dk> + + * alloc.c (marker_blocks_pending_free): New var. + (gc_sweep): Store free marker blocks on that list. + (Fgarbage_collect): Free them after undo-list cleanup. + + * process.c (wait_reading_process_input): Check connect_wait_mask + before actually accepting connection in case it has already been + accepted due to recursion. + +2004-05-23 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu> (tiny change) + + * coding.c (Fset_safe_terminal_coding_system_internal): + Set suppress_error in safe_terminal_coding, not terminal_coding. + +2004-05-22 Richard M. Stallman <rms@gnu.org> + + * alloc.c (Fmake_string): Doc fix. + + * buffer.c (clone_per_buffer_values): Copy the alist of local vars, + and the alist pairs too. + + * casefiddle.c (casify_object): Return OBJ unchanged if not real char. + + * emacs.c (main): Update copyright year. + + * fileio.c (Fread_file_name): Expand DIR if not absolute. + + * insdel.c (del_range_2, replace_range): Don't write an anchor + if the gap is empty. + + * xdisp.c (try_scrolling): If scroll-up-aggressively or + scroll-down-aggressively is small but positive, put point + near the screen edge. + +2004-05-22 Juanma Barranquero <lektu@terra.es> + + * keymap.c (Fdefine_key): Doc fix. + +2004-05-22 Kim F. Storm <storm@cua.dk> + + * alloc.c (struct backtrace): Add debug_on_exit member. + (Fgarbage_collect): Clear out buffer undo_list markers after gc_sweep. + Identify those markers as Lisp_Misc_Free objects. Clear car and cdr of + the removed cons cells. + (mark_object): Undo previous change - disallow Lisp_Misc_Free objects. + (gc_sweep): Clear cons_blocks before sweeping strings, so we don't have + any cons cells pointing to unallocated stings. + Do not lisp_free any marker blocks, as there may still be pointers + to them from buffer undo lists at this stage of GC. + + * keyboard.c (struct backtrace): Add debug_on_exit member. + (Fcommand_execute): Clear it. + +2004-05-20 Luc Teirlinck <teirllm@auburn.edu> + + * intervals.c (lookup_char_property): Do not prematurely return nil. + +2004-05-19 Jim Blandy <jimb@redhat.com> + + Add support for new '\_<' and '\_>' regexp operators, matching the + beginning and end of symbols. + + * regex.c (enum syntaxcode): Add Ssymbol. + (init_syntax_once): Set the syntax for '_' to Ssymbol, not Sword. + (re_opcode_t): New opcodes `symbeg' and `symend'. + (print_partial_compiled_pattern): Print the new opcodes properly. + (regex_compile): Parse the new operators. + (analyse_first): Skip sym(beg|end) (they match only the empty string). + (mutually_exclusive_p): `symend' is mutually exclusive with \s_ and + \sw; `symbeg' is mutually exclusive with \S_ and \Sw. + (re_match_2_internal): Match symbeg and symend. + + * search.c (trivial_regexp_p): \_ is no longer a trivial regexp. + +2004-05-19 Kim F. Storm <storm@cua.dk> + + * .gdbinit (xsymbol): Fix last change. + +2004-05-18 Stefan Monnier <monnier@iro.umontreal.ca> + + * .gdbinit (xprintstr): New fun. + (xstring, xprintsym): Use it. + + * w32proc.c (create_child): Use INTMASK. + + * alloc.c (Fgarbage_collect): Do all the marking before flushing + unmarked elements of the undo list. + +2004-05-18 David Ponce <david@dponce.com> + + * print.c (print): Reset print_depth before to call print_object. + +2004-05-18 Jason Rumney <jasonr@gnu.org> + + * w32console.c: Prefix RIF functions with w32con_ to avoid + namespace clash with functions in term.c and w32term.c. + + * w32menu.c (add_menu_item, w32_menu_display_help) + [USE_LISP_UNION_TYPE]: Cast from Lisp_Object using i member. + + * w32term.h (display_x_get_resource, vga_stdcolor_name): Add prototype. + +2004-05-18 Eli Zaretskii <eliz@gnu.org> + + * lisp.h (DECL_ALIGN): Remove restriction on MS-DOS systems. + + * msdos.c (syms_of_msdos): Initialize dos-unsupported-char-glyph + with make_number. + (IT_write_glyphs): Extract glyph from dos-unsupported-char-glyph + with XINT. + +2004-05-18 Kim F. Storm <storm@cua.dk> + + * blockinput.h (INPUT_BLOCKED_P): New macros. + + * keyboard.c (Frecursive_edit): Return immediately if input blocked. + (Ftop_level): Unblock input if blocked. + + * buffer.h (GET_OVERLAYS_AT): New macro. + * msdos.c (IT_note_mouse_highlight): Use it. + * textprop.c (get_char_property_and_overlay): Use it. + * xdisp.c (next_overlay_change, note_mouse_highlight): Use it. + * xfaces.c (face_at_buffer_position): Use it. + + * print.c (print_object): Increase buf size. + +2004-05-17 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Fw32_register_hot_key, Fw32_unregister_hot_key) + (Fw32_toggle_lock_key) [USE_LISP_UNION_TYPE]: Cast from + Lisp_Object using i member. + (w32_quit_key): Rename from Vw32_quit_key, and make an int. + (syms_of_w32fns, globals_of_w32fns): Use Lisp_Object and int + consistently. + + * w32proc.c (create_child): Use make_number instead of masking pid. + + * w32fns.c (w32_color_map_lookup): Return a Lisp_Object. + (x_to_w32_charset, w32_to_x_charset, w32_to_all_x_charsets): + Use EQ to compare Lisp_Objects. + (w32_parse_hot_key): Use int for lisp_modifiers consistently. + + * w32term.c (w32_num_mouse_buttons): Rename from + Vw32_num_mouse_buttons and make it an int. + + * w32.c (init_environment): Use it. + + * w32fns.c (w32_wnd_proc): Likewise. + + * w32proc.c (w32_pipe_read_delay): Rename from + Vw32_pipe_read_delay and make it an int. + + * w32.c (_sys_read_ahead): Use it. + + * lisp.h (egetenv) [USE_CRT_DLL]: Remove condition. + + * w32proc.c (create_child) [USE_LSB_TAG]: Don't try to mask pid. + + * w32inevt.c (w32_console_mouse_position, do_mouse_event) + (key_event): Don't mix Lisp_Object and int. + + * w32heap.c (init_heap) [USE_LSB_TAG]: Don't check heap location. + + * keyboard.c (kbd_buffer_get_event): Don't use event->code and + modifiers in language change event. + +2004-05-17 Kim F. Storm <storm@cua.dk> + + * alloc.c (mark_object): Ignore Lisp_Misc_Free objects. + Such objects may be freed markers which still exist on an undo list. + +2004-05-16 Juanma Barranquero <lektu@terra.es> + + * data.c (Fset_default): Make argument names match their use in + docstring. + +2004-05-15 Andreas Schwab <schwab@suse.de> + + * emacs.c (gdb_array_mark_flag): Define. + * .gdbinit: Mask off gdb_array_mark_flag from vector sizes. + +2004-05-15 Eli Zaretskii <eliz@gnu.org> + + * lisp.h (DECL_ALIGN) [MSDOS]: Don't define DECL_ALIGN to use + __attribute__((__aligned__)), so that USE_LSB_TAG would not become + defined for the MS-DOS build. + +2004-05-14 Stefan Monnier <monnier@iro.umontreal.ca> + + * w32fns.c (Fw32_define_rgb_color): Avoid XSET. + +2004-05-14 Kenichi Handa <handa@m17n.org> + + * ccl.c (Fccl_execute_on_string): Fix setting elements of STATUS. + +2004-05-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * lisp.h (Vx_resource_name, Vx_resource_class): Move from xfns.c + section to frame.c section. + (Fxw_display_color_p, Fx_file_dialog): Declare if + HAVE_WINDOW_SYSTEM defined. + + * macfns.c (Fx_create_frame): Fix int/Lisp_Object mixup. + + * macmenu.c (set_frame_menubar): Use NILP to test a lisp value. + + * macterm.c (mac_get_emulated_btn, mac_event_to_emacs_modifiers) + (mac_get_mouse_btn): Use NILP and EQ to test/compare lisp values. + (XTread_socket): Fix int/Lisp_Object mixup. + (mac_check_for_quit_char): Fix pointer/Lisp_Object mixup. + + * macterm.h (struct frame, struct face, struct image) + (display_x_get_resource, Fx_display_color_p) + (Fx_display_grayscale_p, Fx_display_planes, x_free_gcs): + Add prototypes. + +2004-05-14 Kim F. Storm <storm@cua.dk> + + * process.c (wait_reading_process_input): Make reentrant. + Make Available and Connecting non-static. Save and restore value + of waiting_for_user_input_p. + +2004-05-13 Kim F. Storm <storm@cua.dk> + + * keyboard.c (mark_kboards): Don't mark x and y members + that are overloaded in selection request events. + +2004-05-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (USE_LSB_TAG): Make it the default when it is known to work. + +2004-05-13 Glenn Morris <gmorris@ast.cam.ac.uk> + + * window.c (Fdisplay_buffer, Fsplit_window) + (split-height-threshold): Doc fix. + +2004-05-13 Juanma Barranquero <lektu@terra.es> + + * xfaces.c (Ftty_supports_face_attributes_p) + (Finternal_copy_lisp_face): Fix typo in docstring. + (Finternal_get_lisp_face_attribute): Fix docstring. + +2004-05-12 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * xfns.c (syms_of_xfns): Provide x-toolkit also for GTK. + +2004-05-11 Steven Tamm <steventamm@mac.com> + + * macfns.c (Fx_create_frame): Default to using tool-bar by + setting tool-bar-lines to 1 in default-frame-alist. + +2004-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * image.c (xpm_scan, xpm_make_color_table_v, xpm_put_color_table_v) + (xpm_get_color_table_v, xpm_make_color_table_h) + (xpm_put_color_table_h, xpm_get_color_table_h) + (xpm_str_to_color_key, xpm_load_image, xpm_load) + (syms_of_image): Support XPM on Carbon Emacs. Does not + depend on libXpm, but only supports XPM version 3 without extensions. + +2004-05-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (x_flush, XTframe_up_to_date): Use FRAME_MAC_P + instead of FRAME_X_P + +2004-05-11 Kim F. Storm <storm@cua.dk> + + * process.c (read_process_output): Grow decoding_buf when needed; + this could cause a crash in allocate_string and compact_small_strings. + +2004-04-29 Jim Blandy <jimb@redhat.com> + + * regex.c (mutually_exclusive_p): In 'case wordbeg', compare op2 + against proper opcode. + +2004-05-10 Juanma Barranquero <lektu@terra.es> + + * process.c (Fstart_process): Fix docstring. + + * charset.c (Fget_unused_iso_final_char): Fix typos in docstring. + (Fchar_bytes, Fchar_width, Fstring_width, Fchar_direction) + (Fsplit_char, Fchar_charset): Make argument names match their use + in docstring. + +2004-05-10 Richard M. Stallman <rms@gnu.org> + + * print.c (print_preprocess): Use being_printed, loop_count and + halftail to detect overdeep nesting and cyclic cdr chains. + +2004-05-10 Andreas Schwab <schwab@suse.de> + + * lisp.h: Declare Fmake_symbolic_link. + + * fileio.c (Frename_file): Remove extra argument in call to + Fmake_symbolic_link. + +2004-05-10 Kim F. Storm <storm@cua.dk> + + * xdisp.c (calc_line_height_property): Use string position when + object is a string. + +2004-05-10 Kenichi Handa <handa@m17n.org> + + * print.c (temp_output_buffer_setup): Bind inhibit-read-only and + inhibit-modification-hooks to t temporarily before calling + Ferase_buffer. + + * xfns.c (x_create_tip_frame): Bind inhibit-read-only and + inhibit-modification-hooks to t temporarily before calling + Ferase_buffer. + + * w32fns.c (x_create_tip_frame): Bind inhibit-read-only and + inhibit-modification-hooks to t temporarily before calling + Ferase_buffer. + + * fns.c (count_combining): Delete it. + (concat): Don't check combining bytes. + +2004-05-09 Jason Rumney <jasonr@gnu.org> + + * w32fns.c (Vw32_ansi_code_page): New Lisp variable. + (globals_of_w32fns): Set it. + +2004-05-09 Piet van Oostrum <piet@cs.uu.nl> (tiny change) + + * data.c (Fquo): Simplify. + +2004-05-08 Peter Whaite <emacs@whaite.ca> (tiny change) + + * data.c (Fquo): If any argument is float, do the computation in + floating point. + +2004-05-08 Juanma Barranquero <lektu@terra.es> + + * process.c (Fwaiting_for_user_input_p, Fmake_network_process) + (Fset_process_query_on_exit_flag, Vprocess_adaptive_read_buffering): + Fix spelling of Emacs on docstring. + (Fset_process_coding_system, Fprocess_coding_system) + (Fset_process_filter_multibyte, Fprocess_filter_multibyte_p): + Make argument names match their use in docstring. + (Fprocess_id, Fprocess_query_on_exit_flag, Finterrupt_process): + Fix docstring. + + * editfns.c (Finsert_buffer_substring): Make argument names match their + use in docstring. + + * syntax.c (Fmodify_syntax_entry): Fix docstring. + +2004-05-07 Steven Tamm <steventamm@mac.com> + + * macterm.c (mac_check_for_quit_char): Adding BLOCK_INPUT + around call to ReceiveEvent to avoid certain crashes. + +2004-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> + + * macterm.c (mac_draw_line_to_pixmap, XCreatePixmapFromBitmapData) + (mac_fill_rectangle_to_pixmap, mac_draw_rectangle_to_pixmap) + (mac_copy_area_to_pixmap, mac_copy_area_with_mask_to_pixmap): + Save/restore the current graphics port and device handle when + drawing into an offscreen graphics world. + + * image.c [MAC_OS] (XPutPixel, XGetPixel, image_load_qt_1) + (gif_load): Likewise. + +2004-05-07 Juanma Barranquero <lektu@terra.es> + + * window.c (Fset_window_buffer): Fix docstring. + +2004-05-06 Thien-Thi Nguyen <ttn@gnu.org> + + * emacs.c (main) [VMS]: Fix var ref. + +2004-05-06 Romain Francoise <romain@orebokech.com> (tiny change) + + * data.c (Fsetq_default): Fix docstring. + +2004-05-06 Jason Rumney <jasonr@gnu.org> + + * image.c (Display) [HAVE_NTGUI]: Redefine while loading xpm.h + to avoid name clash. + +2004-05-04 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * fileio.c (barf_or_query_if_file_exists): Use lstat. + (Frename_file): Handle renaming of symlinks across file systems. + (Frename_file): Put symlink handling inside #ifdef S_IFLNK. + +2004-05-04 Kim F. Storm <storm@cua.dk> + + * xdisp.c (Qtotal): New var. + (syms_of_xdisp): Intern and staticpro it. + (calc_line_height_property): New arg total. Set it if + line-spacing property has format (total . VALUE). + (x_produce_glyphs): Ignore line-spacing if line-height is 0. + Handle total line-spacing property. + +2004-05-03 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * gtkutil.c (xg_update_scrollbar_pos): Call XClearWindow to clear + "under" scroll bar when size/position changes. + +2004-05-03 Jason Rumney <jasonr@gnu.org> + + * makefile.nt: Remove. + +2004-05-02 Eli Zaretskii <eliz@gnu.org> + + * syntax.h (SET_RAW_SYNTAX_ENTRY, SYNTAX_ENTRY_INT): + Avoid compiler warnings. + + * Makefile.in (region-cache.o): Depend on config.h. + +2004-05-02 Romain Francoise <romain@orebokech.com> (tiny change) + + * indent.c (compute_motion): Save vpos in prev_vpos when dealing + with continuation lines, too. + +2004-05-02 Thien-Thi Nguyen <ttn@gnu.org> + + * syssignal.h (init_signals): Move decl outside `#ifdef POSIX_SIGNALS'. + +2004-05-01 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (calc_line_height_property): YAILOM (yet another + int/Lisp_Object mixup). + +2004-05-01 Eli Zaretskii <eliz@gnu.org> + + * msdos.c (top-level): Add "#pragma pack(0)" after <dir.h>, to + undo bad effect of pack(4) in some versions of system headers. + +2004-05-01 Jason Rumney <jasonr@gnu.org> + + * w32term.c (x_draw_hollow_cursor): Sync with xterm.c + +2004-04-30 Kim F. Storm <storm@cua.dk> + + * buffer.c (syms_of_buffer) <line-spacing>: Allow float value. + (syms_of_buffer) <cursor-type>: Doc fix. + + * dispextern.h (struct it): Remove member use_default_face. + Add members override_ascent, override_descent, override_boff. + + * xdisp.c (init_iterator): Handle line-spacing float value. + Initialize override_ascent member. + (append_space_for_newline): Reset override_ascent. + Remove use_default_face. + (calc_line_height_property): New function to calculate value of + line-height and line-spacing properties. Look at overlays, too. + Set override_ascent, override_descent, override_boff members when + using another face than the current face. Float values are now + relative to the frame default font, by default; accept a cons + of ratio and face name to specify value relative to a specific face. + (x_produce_glyphs): Use calc_line_height_property. + Use override_ascent etc. when set to handle different face heights. + A negative line-spacing property value is interpreted as a total + line height, rather than inter-line spacing. + (note_mouse_highlight): Allocate room for 40 overlays initially. + +2004-04-29 Stefan Monnier <monnier@iro.umontreal.ca> + + * data.c (Fsubr_name): New fun. + (syms_of_data): Defsubr it. + +2004-04-29 Kim F. Storm <storm@cua.dk> + + * xdisp.c (null_glyph_slice): New var. + (append_glyph, append_composite_glyph, append_stretch_glyph): + Use it to initialize glyph slice. + +2004-04-27 Stefan Monnier <monnier@iro.umontreal.ca> + + * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup. + (on_hot_spot_p): Make sure we always return a value. + (Flookup_image_map): Remove unused var ix and iy. + (note_mode_line_or_margin_highlight): Remove unused var `image'. + +2004-04-27 Eli Zaretskii <eliz@gnu.org> + + * msdos.c (init_environment): If one of the TMP... environment + variables is set to a drive letter without a trailing slash, + append a slash. + +2004-04-27 Matthew Mundell <matt@mundell.ukfsn.org> + + * editfns.c (lisp_time_argument): Provide externally. + + * fileio.c (Fset_file_times): New function. + (syms_of_fileio): Intern and staticpro it. + +2004-04-27 Kim F. Storm <storm@cua.dk> + + * xdisp.c (x_produce_glyphs): Fix last change; handle newline in + header line strings. + + * dispextern.h (struct it): New member use_default_face. + + * xdisp.c (Qline_height): New variable. + (syms_of_xdisp): Intern and staticpro it. + (append_space_for_newline): Partially undo 2004-04-25 change; + add default_face_p arg, and restore callers. + Clear it->use_default_face after use. + (x_produce_glyphs): Set default font for ascii char if + it->use_default_font is set. Change line-spacing property to set + just extra line spacing. Handle new line-height property. + +2004-04-26 Andreas Schwab <schwab@suse.de> + + * print.c (print_object): Print non-ascii characters in bool + vector representation as octal escapes. + + * lisp.h (BOOL_VECTOR_BITS_PER_CHAR): Define. + * print.c (print_object): Use it instead of BITS_PER_CHAR for + bool vectors. + * lread.c (read1): Likewise. + * alloc.c (Fmake_bool_vector): Likewise. + * data.c (Faref, Faset): Likewise. + * fns.c (Fcopy_sequence, concat, internal_equal, Ffillarray) + (mapcar1): Likewise. + +2004-04-26 Steven Tamm <tamm@Steven-Tamms-Computer.local> + + * lread.c (init_lread): Fixing typo HAVE_CARBON test logic + +2004-04-26 Miles Bader <miles@gnu.org> + + * lisp.h (CYCLE_CHECK): Macro moved from xfaces.c. + +2004-04-26 Juanma Barranquero <lektu@terra.es> + + * buffer.c (Fpop_to_buffer): Fix docstring. + +2004-04-26 Steven Tamm <steventamm@mac.com> + + * lread.c (init_lread): Don't display missing lisp directory + warnings with Carbon Emacs because self-contained bundled Emacs + may be built without correct installation path. + +2004-04-25 Kim F. Storm <storm@cua.dk> + + * macterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines. + + * xterm.c (x_draw_hollow_cursor): Fix height of box for narrow lines. + + * xdisp.c (append_space_for_newline): Rename from append_space. + Remove DEFAULT_FACE_P arg; always use current face. Callers changed. + (x_produce_glyphs): Handle line-spacing property on newline char. + If value is t, adjust ascent and descent to fit current row height. + If value is an integer or float, set extra_line_spacing to integer + value, or to float value x current line height. + +2004-04-23 Kenichi Handa <handa@m17n.org> + + * fontset.c (Finternal_char_font): If POSITION is nil, return + font for displaying CH with the default face. + +2004-04-23 Juanma Barranquero <lektu@terra.es> + + * makefile.w32-in: Add "-*- makefile -*-" mode tag. + +2004-04-21 Stefan Monnier <monnier@iro.umontreal.ca> + + * lisp.h (XINT) [EXPLICIT_SIGN_EXTEND && !NO_UNION_TYPE]: + Don't make assumptions about the relative place of i and val. + (EQ) [!NO_UNION_TYPE]: Don't forget to check the type match as well. + +2004-04-21 Kim F. Storm <storm@cua.dk> + + * dispextern.h (struct glyph_slice): New struct. + (struct glyph): New member slice. + (GLYPH_SLICE_EQUAL_P): New macro. + (GLYPH_EQUAL_P): Use it. + (struct glyph_string): New member slice. + (struct it_slice): New struct. + (struct it): New member slice, add member to stack too. + New member constrain_row_ascent_descent_p. + (image_ascent): Add prototype. + + * dispnew.c (buffer_posn_from_coords): Return full image width + and height even for image slices (posn is relative to full image). + (marginal_area_string): Adjust x0,y0 for image slice. + + * image.c (image_ascent): Add slice arg; calculate ascent for + image slice (or full image). + + * keyboard.c (Fposn_at_x_y, Fposn_at_point): New defuns. + (syms_of_keyboard): Defsubr them. + + * lisp.h (pos_visible_p): Fix prototype. + + * macterm.c (x_draw_relief_rect): Add top_p and bot_p args. + (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. + (x_draw_image_foreground, x_draw_image_relief) + (x_draw_image_foreground_1, x_draw_image_glyph_string): + Draw sliced images. + + * w32term.c (w32_draw_relief_rect): Add top_p and bot_p args. + (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. + (x_draw_image_foreground, x_draw_image_relief) + (w32_draw_image_foreground_1, x_draw_image_glyph_string): + Draw sliced images. + + * w32term.h (image_ascent): Remove prototype. + + * window.c (Fpos_visible_in_window_p): Return pixel position if + PARTIALLY arg is non-nil. Simplify. Doc fix. + (Fwindow_vscroll, Fset_window_vscroll): Add optional PIXEL_P arg + to return/set vscroll in pixels. + + * window.h (Fwindow_vscroll, Fset_window_vscroll): Fix EXFUN. + + * xdisp.c (Qslice): New variable. + (syms_of_xdisp): Intern and staticpro it. + (pos_visible_p): Return pixel position in new x and y args. + (init_iterator): Reset it->slice info. + (handle_display_prop): Parse (slice ...) property. + (push_it, pop_it): Save/restore slice info. + (make_cursor_line_fully_visible): Fix 2004-04-14 change. Do not + force repositioning of tall row if window is vscrolled, as that + would reset vscroll. + (append_space): Set it->constrain_row_ascent_descent_p to avoid + increasing row height if row is non-empty. + (fill_image_glyph_string): Copy slice info. + (take_vertical_position_into_account): Simplify. + (produce_image_glyph): Handle iterator slice info, setup glyph + slice info. Do not force minimum line height. + (x_produce_glyphs): If it->constrain_row_ascent_descent_p is set, + do not increase height (ascent/descent) of non-empty row when + adding normal character glyph; instead reduce glyph ascent/descent + appropriately; if row is higher than current glyph, adjust glyph + descent/ascent to reposition glyph within the existing row. + Likewise, when char is newline, only set ascent/descent if row is + currently empty. + (note_mouse_highlight): Handle hotspots with sliced image. + + * xterm.c (x_draw_relief_rect): Add top_p and bot_p args. + (x_draw_glyph_string_box): Fix call to x_draw_relief_rect. + (x_draw_image_foreground, x_draw_image_relief) + (x_draw_image_foreground_1, x_draw_image_glyph_string): + Draw sliced images. + + * xterm.h (image_ascent): Remove prototype. + +2004-04-20 Stefan Monnier <monnier@iro.umontreal.ca> + + * keymap.c (Fkey_description): Fix the usual int/Lisp_Object mixup. + +2004-04-20 John Paul Wallington <jpw@gnu.org> + + * fns.c (Fassoc, Feql): Fix indentation. + + * fontset.c (regularize_fontname): Rename from regulalize_fontname. + +2004-04-19 John Paul Wallington <jpw@gnu.org> + + * fns.c (Feql): New function. + (syms_of_fns): Defsubr it. + +2004-04-18 Jason Rumney <jasonr@gnu.org> + + * w32select.c (Fw32_set_clipboard_data): Get sequence number + after closing the clipboard. + +2004-04-16 Luc Teirlinck <teirllm@auburn.edu> + + * buffer.c (Fbuffer_base_buffer): Doc fix. + +2004-04-17 Kim F. Storm <storm@cua.dk> + + * keymap.c (Fkey_description): Add optional PREFIX arg. + Combine prefix with KEYS to make up the full key sequence to describe. + Correlate meta_prefix_char and following (simple) key to describe + as meta modifier. All callers changed. + (describe_map): Rename arg `keys' to `prefix'. Remove local + `elt_prefix' var. Use Fkey_description with prefix instead of + elt_prefix combined with Fsingle_key_description. + (describe_vector): Declare static. Replace arg `elt_prefix' with + `prefix'. Add KEYMAP_P arg. Add local var `elt_prefix'; use it + if !KEYMAP_P. Use Fkey_description with prefix instead of + Fsingle_key_description. + + * keymap.h (Fkey_description): Fix prototype. + (describe_vector): Remove prototype. + + * xdisp.c (update_overlay_arrows): Fix handling of up_to_date < 0. + + * image.c (PNG_BG_COLOR_SHIFT): Remove. + (png_load): Fix calculation of transparent background color on X + and W32 platforms. + +2004-04-16 Juanma Barranquero <lektu@terra.es> + + * xdisp.c (try_scrolling): Make sure `scroll-conservatively' is + not too large before computing how much to scroll. + +2004-04-15 Stefan Monnier <monnier@iro.umontreal.ca> + + * dired.c (Ffile_attributes): Don't pass extra nil arg to file-handler. + 2004-04-14 Luc Teirlinck <teirllm@auburn.edu> * fileio.c (Fverify_visited_file_modtime, Fvisited_file_modtime): @@ -30,6 +1157,11 @@ centering_position = 0. Clear desired matrix before retrying with centering_position = 0. +2004-04-13 Stefan Monnier <monnier@iro.umontreal.ca> + + * syntax.c (scan_lists): Simplify backward string scan. + Fix off-by-one boundary check for string and comment fences. + 2004-04-13 Joe Buehler <jbuehler@hekimian.com> * sheap.c, unexcw.c: New files. @@ -573,7 +1705,7 @@ * macterm.c (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg. - Rework to use just one, local, inev input_event. Store inev + Rework to use just one, local, inev input_event. Store inev directly in fifo using kbd_buffer_store_event_hold. * sysdep.c (BUFFER_SIZE_FACTOR): Remove. @@ -589,14 +1721,14 @@ * w32inevt.c (w32_console_read_socket): Remove bufp_r and numcharsp args. Add hold_quit arg. - Rework to use just one, local, inev input_event. Store inev + Rework to use just one, local, inev input_event. Store inev directly in fifo using kbd_buffer_store_event_hold. * w32inevt.h (w32_console_mouse_position): Fix prototype. * w32term.c (w32_read_socket): Remove bufp_r and numcharsp args. - Add hold_quit arg. Rework to use just one, local, inev - input_event. Store inev directly in fifo using + Add hold_quit arg. Rework to use just one, local, inev + input_event. Store inev directly in fifo using kbd_buffer_store_event_hold. Update count in one place. Postpone call to gen_help_event until inev is stored; use new local do_help for this. @@ -615,8 +1747,8 @@ (current_hold_quit) [USE_GTK]: Add. (event_handler_gdk): Adapt to new handle_one_xevent. (handle_one_xevent): Remove bufp_r and numcharsp args. - Add hold_quit arg. Rework to use just one, local, inev - input_event. Store inev directly in fifo using + Add hold_quit arg. Rework to use just one, local, inev + input_event. Store inev directly in fifo using kbd_buffer_store_event_hold. Update count in one place. Postpone call to gen_help_event until inev is stored; use new local do_help for this. @@ -628,7 +1760,7 @@ `goto done' to clarify code flow in deeply nested blocks. (x_dispatch_event): Simplify as handle_one_xevent now calls kbd_buffer_store_event itself. - (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit + (XTread_socket): Remove bufp_r and numcharsp args. Add hold_quit arg. Call handle_one_xevent with new arglist. Store event from x_session_check_input in fifo. [USE_GTK]: Setup current_hold_quit. @@ -1047,7 +2179,7 @@ 2004-02-09 Sam Steingold <sds@gnu.org> - * w32term.c (w32_draw_fringe_bitmap): Fixed a typo in the last patch. + * w32term.c (w32_draw_fringe_bitmap): Fix a typo in the last patch. 2004-02-09 Kim F. Storm <storm@cua.dk> @@ -1181,7 +2313,7 @@ completion-regexp-list. Define Qcase_fold_search and staticpro it. (read_minibuf): Fix initial comment. (Ftry_completion, Fall_completions, Ftest_completion): Bind - case-fold-serach to the value of completion-ignore-case when + case-fold-search to the value of completion-ignore-case when checking completion-regexp-list. (Fdisplay_completion_list): Make it handle arguments that are symbols. Doc fix. @@ -1557,7 +2689,7 @@ (marginal_area_string): Fix prototypes. * keyboard.h (POSN_POSN, POSN_SET_POSN): Rename macros from - POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed. + POSN_BUFFER_POSN and POSN_SET_BUFFER_POSN. All uses changed. (POSN_INBUFFER_P, POSN_BUFFER_POSN): New macros. * keyboard.c (make_lispy_position): Use modified mode_line_string, @@ -1724,7 +2856,7 @@ control frame pointer shape. Detect image hot-spots for pointer and help_echo properties. Use define_frame_cursor1. (note_mouse_highlight): Use Vvoid_text_area_pointer. - (syms_of_xdisp): Defsubr new defun. Intern and staticpro new variables. + (syms_of_xdisp): Defsubr new defun. Intern and staticpro new variables. DEFVAR_LISP Vvoid_text_area_pointer instead of Vshow_text_cursor_in_void. * xfaces.c (cache_face): Abort if c->size exceeds MAX_FACE_ID. @@ -1845,7 +2977,7 @@ (glyph_to_pixel_coords): Don't use negative hpos. (x_y_to_hpos_vpos): Fix for partially visible first glyph. (append_stretch_glyph): Change ascent arg to be actual value - in pixels rather than ratio to height. Callers changed. + in pixels rather than ratio to height. Callers changed. (calc_pixel_width_or_height): New aux function, implementing pixel based artihmetic for glyph widths and heights. (produce_stretch_glyph): Use calc_pixel_width_or_height for @@ -2047,7 +3179,7 @@ x_display_info_for_display instead. Use Display in xev instead of GDK_DISPLAY. (x_dispatch_event): Call x_display_info_for_display. - (XTread_socket): Move GTK part out of loop. current_dpyinfo removed. + (XTread_socket): Move GTK part out of loop. current_dpyinfo removed. (x_connection_closed): Call xg_display_close for GTK. (x_term_init): Call xg_display_open for additional displays. Initiate dpyinfo->xg_cursor with call to xg_create_default_cursor @@ -2954,7 +4086,7 @@ 2003-07-09 Kim F. Storm <storm@cua.dk> - * xterm.c (use_xim) [!USE_XIM]: Default to disable XIM if emacs + * xterm.c (use_xim) [!USE_XIM]: Default to disable XIM if Emacs was configured with --without-xim. (x_term_init) [!USE_XIM]: Use `useXIM' resource to turn on XIM. @@ -3549,7 +4681,7 @@ from x/w32/macterm.h files. All uses changed. Also change code which referred to f->output_data...->pixel_height. (FRAME_PIXEL_WIDTH): Renamed from PIXEL_WIDTH and moved - from x/w32/macterm.h files. All uses changed. Also change code + from x/w32/macterm.h files. All uses changed. Also change code which referred to f->output_data...->pixel_width. (FRAME_LINES): Renamed from FRAME_HEIGHT. All uses changed. Also change code which referred to f->height. @@ -3811,7 +4943,7 @@ window to only preserve the display margins in one of the windows. When splitting horizontally, call adjust_window_margins on both windows to ensure that the text area of the new windows is non too - narrow. This fixes a bug which could cause emacs to trap if the + narrow. This fixes a bug which could cause Emacs to trap if the width of the split window was less than the width of the display margins. (window_box_text_cols): Renamed from window_internal_width. @@ -3842,7 +4974,7 @@ (Fset_window_margins): Do nothing if display margins are not really changed. Otherwise, call adjust_window_margins to ensure the text area doesn't get too narrow. This fixes a bug which - could cause emacs to trap if setting display margins wider than + could cause Emacs to trap if setting display margins wider than the width of the window. (Fset_window_fringes): New defun to allow user to specifically set this window's fringe widths and position vs. display margins. @@ -3859,7 +4991,7 @@ * xdisp.c: Make (many) trivial substitutions for renamed and new macros in dispextern.h, frame.h and window.h. (window_box_width): Adapt to per-window fringes and scroll bars, - and new fringe vs. display margin position. Note that returned + and new fringe vs. display margin position. Note that returned value is no longer guaranteed to be a whole multiple of the frame column width, since per-window fringes may now be any width. (window_box_left_offset): New function like window_box_left, but @@ -4609,7 +5741,7 @@ * xfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame parameters now defined in frame.h and frame.c. - (Vx_resource_name): Remove. Use generic var. + (Vx_resource_name): Remove. Use generic var. (enum x_frame_parms): Remove (bogus, unused enum). (check_x_display_info): Make non-static (for frame.c). (struct x_frame_parm_table, x_frame_parms): Remove. @@ -4629,7 +5761,7 @@ (syms_of_xfns): Don't intern/staticpro removed vars. * xterm.c: Remove unnecessary extern declarations. - (x_fullscreen_adjust): Remove. Use generic instead. + (x_fullscreen_adjust): Remove. Use generic instead. (x_redisplay_interface): Add x_frame_parm_handlers member. * w32gui.h (XrmDatabase): New (dummy) typedef. @@ -4641,7 +5773,7 @@ * w32fns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame parameters now defined in frame.h and frame.c. - (Vx_resource_name): Remove. Use generic var. + (Vx_resource_name): Remove. Use generic var. (enum x_frame_parms): Remove (bogus, unused enum). (check_x_display_info): Make non-static (for frame.c). (struct x_frame_parm_table, x_frame_parms): Remove. @@ -4674,7 +5806,7 @@ * macfns.c (Qauto_raise, Qauto_lower, ...): Remove vars for frame parameters now defined in frame.h and frame.c. - (Vx_resource_name): Remove. Use generic var. + (Vx_resource_name): Remove. Use generic var. (check_x_display_info): Make non-static (for frame.c). (struct x_frame_parm_table, x_frame_parms): Remove. (init_x_parm_symbols, x_set_frame_parameters, x_report_frame_params) @@ -5655,7 +6787,7 @@ [HAVE_XPM]: Avoid clashes with XColor, XImage and Pixel definitions in xpm.h. (init_xpm_functions): New function. - (xpm_load): Sync with xfns.c. Adapt for Windows version of libXpm. + (xpm_load): Sync with xfns.c. Adapt for Windows version of libXpm. (init_external_image_libraries): Try to load libXpm.dll. * fileio.c (Fcopy_file) [WINDOWSNT]: Reverse logic for setting @@ -5684,8 +6816,8 @@ * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows when including gif_lib.h. (init_gif_functions, init_tiff_functions): New functions. - (gif_load, tiff_load): Sync with xfns.c version. Adjust colors for - Windows. Disable color table lookups. Call library functions + (gif_load, tiff_load): Sync with xfns.c version. Adjust colors for + Windows. Disable color table lookups. Call library functions through pointers determined at runtime. (init_external_image_libraries): Try to load libungif.dll and libtiff.dll. @@ -5751,8 +6883,8 @@ * w32fns.c (init_jpeg_functions, jpeg_resync_to_restart_wrapper): New functions. - (jpeg_load): Sync with xfns.c version. Adjust colors for Windows. - Disable color table lookups. Call jpeg library functions + (jpeg_load): Sync with xfns.c version. Adjust colors for Windows. + Disable color table lookups. Call jpeg library functions through pointers determined at runtime. (init_external_image_libraries): Try to load jpeg.dll. @@ -5789,8 +6921,8 @@ * w32fns.c (XPutPixel): Handle monochrome images; used for masks. [HAVE_PNG]: Sync with xfns.c version. - (png_load): Adjust colors for Windows. Use Windows - bitmaps. Disable color table lookups. + (png_load): Adjust colors for Windows. Use Windows + bitmaps. Disable color table lookups. (DEF_IMGLIB_FN, LOAD_IMGLIB_FN): New macros. (init_png_functions): New function. (png_read_from_memory, png_load): Call png library functions @@ -5887,7 +7019,7 @@ 2003-01-21 David Ponce <david@dponce.com> * w32term.c (w32_encode_char): For DIM=1 charset, set - ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c + ccl->reg[2] to -1 before calling ccl_driver. (Sync. with xterm.c x_encode_char change by Kenichi Handa <handa@m17n.org> on 2002-09-30.) (w32_draw_relief_rect): Declare all args. @@ -6420,7 +7552,7 @@ only if g_b_init_get_sid_identifier_authority is equal to 0. On initialization set g_b_init_get_sid_identifier_authority equal to 1. - * w32fns.c (globals_of_w32fns): New function. Used to initialize + * w32fns.c (globals_of_w32fns): New function. Used to initialize those global variables that must always be initialized on startup even when the global variable initialized is non zero. Its primary purpose at this time is to initialize the global variable @@ -6431,7 +7563,7 @@ * w32fns.c (syms_of_w32fns): Call globals_of_w32fns. - * w32menu.c (globals_of_w32menu): New function. Used to + * w32menu.c (globals_of_w32menu): New function. Used to initialize those global variables that must always be initialized on startup even when the global variable initialized is non zero. Its primary purpose at this time is to initialize the global @@ -7116,7 +8248,7 @@ * process.c (Fformat_network_address): New function. (syms_of_process): Defsubr it. (list_processes_1): Use it to format :local/:remote address if - service/host is not set; before emacs would crash in that case. + service/host is not set; before Emacs would crash in that case. (Fmake_network_process): Don't use Ffind_operation_coding_system to setup coding system if host or service is not set. @@ -7779,7 +8911,7 @@ * msdos.c (croak): Add `void' to definition. - * sysdep.c [MSDOS] (request_sigio, unrequest_sigio): + * sysdep.c (request_sigio, unrequest_sigio) [MSDOS]: Don't define them, they are defined in msdos.c. * mem-limits.h [MSDOS]: Declare etext. @@ -7789,7 +8921,7 @@ 2002-08-19 Kim F. Storm <storm@cua.dk> - * keyboard.c (Fclear_this_command_keys): Added optional arg + * keyboard.c (Fclear_this_command_keys): Add optional arg KEEP-RECORD to avoid clearing lossage when we just want to clear the current key sequence (kmacro needs this). @@ -8181,12 +9313,11 @@ 2002-07-19 Juanma Barranquero <lektu@terra.es> - * fileio.c (Ffile_name_as_directory): Fix argument name in docstring. - (file_name_as_directory): Use literal '/' instead of DIRECTORY_SEP. - * xdisp.c (syms_of_xdisp): Remove redundant deprecation info. * fileio.c (syms_of_fileio): Likewise. + (Ffile_name_as_directory): Fix argument name in docstring. + (file_name_as_directory): Use literal '/' instead of DIRECTORY_SEP. 2002-07-18 Richard M. Stallman <rms@gnu.org> @@ -8423,8 +9554,8 @@ 2002-07-10 Juanma Barranquero <lektu@terra.es> - * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE. All callers - changed. + * lisp.h (SPECPDL_INDEX): Rename from BINDING_STACK_SIZE. + All callers changed. 2002-07-09 Stefan Monnier <monnier@cs.yale.edu> @@ -8654,7 +9785,7 @@ 2002-06-21 Pavel Jan,Am(Bk <Pavel@Janik.cz> * m/pmax.h (START_FILES): Define START_FILES for NetBSD and - OpenBSD. Add support for mipseb-*-netbsd* machines. + OpenBSD. Add support for mipseb-*-netbsd* machines. 2002-06-17 Andrew Choi <akochoi@shaw.ca> @@ -10056,7 +11187,7 @@ (server_accept_connection): New function. (wait_reading_process_input): Use it to handle incoming connects. Do not enable input on a new connection if process is stopped. - (read_process_output): Handle datagram sockets. Use 2k buffer for them. + (read_process_output): Handle datagram sockets. Use 2k buffer for them. (send_process): Handle datagram sockets. (Fstop_process, Fcontinue_process): Apply to network processes. A stopped network process is indicated by setting command field to t . @@ -11442,7 +12573,7 @@ 2001-12-14 Andrew Innes <andrewi@gnu.org> * makefile.w32-in (EMACSLOADPATH): Define. - ($(EMACS)): Run `list-load-path-shadows' after dumping emacs. + ($(EMACS)): Run `list-load-path-shadows' after dumping Emacs. (bootstrap-temacs): Remove dependency on bootstrap-clean. 2001-12-13 Eli Zaretskii <eliz@is.elta.co.il> @@ -11642,7 +12773,7 @@ 2001-12-01 Jason Rumney <jasonr@gnu.org> - * window.c (Qleft_fringe, Qright_fringe): Remove. Now in frame.c. + * window.c (Qleft_fringe, Qright_fringe): Remove. Now in frame.c. * w32term.h (WM_MOUSELEAVE, TME_LEAVE, TRACKMOUSEEVENT) [!WM_MOUSELEAVE]: Define. @@ -11694,7 +12825,7 @@ * xterm.c (zv_height, zv_bits, zv_period): Changed zv bitmap to fill fringe evenly with small dashes. - (x_draw_fringe_bitmap): Clear background if necessary. Align and + (x_draw_fringe_bitmap): Clear background if necessary. Align and clip the new ZV bitmap to avoid jitter between rows. (x_draw_row_fringe_bitmaps): Rely on x_draw_fringe_bitmap to clear background. Don't draw fringe bitmaps if fringe width is zero. @@ -11759,7 +12890,7 @@ menu items. From David Ponce <dponce@wanadoo.fr>. (w32_dialog_show) [HAVE_DIALOGS]: Compile whole function conditionally. - (w32_menu_display_help): New argument OWNER. Rewritten to store a + (w32_menu_display_help): New argument OWNER. Rewritten to store a help event in the owner frame's keyboard buffer. * w32fns.c (w32_wnd_proc) <WM_MENUSELECT>: Display help directly. @@ -11836,9 +12967,9 @@ * abbrev.c (Fexpand_abbrev): Use Frun_hooks instead of Vrun_hooks. - * buffer.c (Fkill_buffer): Use Frun_hooks, not Vrun_hooks. + * buffer.c (Fkill_buffer): Likewise. - * print.c (temp_output_buffer_setup): Use Frun_hooks, not Vrun_hooks. + * print.c (temp_output_buffer_setup): Likewise. 2001-11-25 Stefan Monnier <monnier@cs.yale.edu> @@ -11875,7 +13006,7 @@ (my_create_tip_window): Assign tip_window. (x_create_tip_frame): Use same defaults as X. (compute_tip_xy): Remove unused variable. Use full screen width. - (Fx_show_tip): Do not double height. Call ShowWindow directly. + (Fx_show_tip): Do not double height. Call ShowWindow directly. * w32term.c (x_after_update_window_line): Doc fix. (w32_read_socket): Doc fix. Avoid SET_FRAME_GARBAGED for tip @@ -12112,9 +13243,9 @@ `bitmaps': * dispextern.h (FRINGE_FACE_ID): Renamed from BITMAP_AREA_FACE_ID. - Comments fixed. Use renamed symbols. + Comments fixed. Use renamed symbols. - * dispnew.c: Comment fix. Use renamed symbols. + * dispnew.c: Comment fix. Use renamed symbols. * frame.h (FRAME_FRINGE_COLS): Renamed from FRAME_FLAGS_AREA_COLS. (FRAME_FRINGE_WIDTH): Renamed from FRAME_FLAGS_AREA_WIDTH. @@ -12124,13 +13255,13 @@ * w32fns.c: Use renamed symbols. - * w32term.c: Comment fixes. Use renamed symbols. + * w32term.c: Comment fixes. Use renamed symbols. (fringe_bitmap_type): Renamed from bitmap_type. (NO_FRINGE_BITMAP): Renamed from NO_BITMAP. (w32_draw_fringe_bitmap): Renamed from w32_draw_bitmap. (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps. - * w32term.h: Comment fixes. Use renamed symbols. + * w32term.h: Comment fixes. Use renamed symbols. (fringes_extra): Renamed from flags_areas_extra. (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH. (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT. @@ -12143,22 +13274,22 @@ * widget.c: Use renamed symbols. - * window.c: Comment fixes. Use renamed symbols. + * window.c: Comment fixes. Use renamed symbols. (coordinates-in-window-p): Doc fix. - * xdisp.c: Comment fixes. Use renamed symbols. + * xdisp.c: Comment fixes. Use renamed symbols. * xfaces.c (realize_basic_faces): Use FRINGE_FACE_ID. * xfns.c: Use renamed symbols. - * xterm.c: Comment fixes. Use renamed symbols. + * xterm.c: Comment fixes. Use renamed symbols. (fringe_bitmap_type): Renamed from bitmap_type. (NO_FRINGE_BITMAP): Renamed from NO_BITMAP. (x_draw_fringe_bitmap): Renamed from x_draw_bitmap. (x_draw_row_fringe_bitmaps): Renamed from x_draw_row_bitmaps. - * xterm.h: Comment fixes. Use renamed symbols. + * xterm.h: Comment fixes. Use renamed symbols. (fringes_extra): Renamed from flags_areas_extra. (FRAME_FRINGE_BITMAP_WIDTH): Renamed from FRAME_FLAGS_BITMAP_WIDTH. (FRAME_FRINGE_BITMAP_HEIGHT): Renamed from FRAME_FLAGS_BITMAP_HEIGHT. @@ -12276,8 +13407,8 @@ 2001-11-12 Jason Rumney <jasonr@gnu.org> * w32console.c, w32fns.c, w32menu.c, w32proc.c, w32select.c, - * w32term.c: Change doc-string comments to `new style'. - [w/`doc:' keyword]. Doc fixes. + * w32term.c: Change doc-string comments to `new style' + [w/`doc:' keyword]. Doc fixes. * w32fns.c: Don't define max. (Fx_open_connection): Only execute once. @@ -12312,7 +13443,7 @@ 2001-11-10 Jason Rumney <jasonr@gnu.org> * w32fns.c (enum_font_cb2): Use leading @ on face name to detect - vertical fonts. Allow them if face name is explicitly specified. + vertical fonts. Allow them if face name is explicitly specified. Do not give up if we find a font that cannot be converted to an xlfd. 2001-11-10 Gerd Moellmann <gerd@gnu.org> @@ -12739,7 +13870,7 @@ 2001-10-28 Pavel Jan,Am(Bk <Pavel@Janik.cz> - * emacs.c: Use argv[0] instead of emacs when -t was specified. + * emacs.c: Use argv[0] instead of "emacs" when -t was specified. * keyboard.c: Change doc-string comments to `new style' [w/`doc:' keyword]. @@ -13122,7 +14253,7 @@ full-width rows. (x_dump_glyph_string): Put in #if GLYPH_DEBUG. (w32_draw_relief_rect): Extend left shadow to the bottom and left; - change bottom shadow accordingly. Some cleanup. + change bottom shadow accordingly. Some cleanup. (x_update_window_end): Handle overwritten mouse face also for tool bar windows. (show_mouse_face): Set the glyph row's mouse_face_p flag also when @@ -13168,7 +14299,7 @@ (Fv_max_tooltip_size): New variable. (syns_of_xfns): DEFVAR_LISP it. (Fx_show_tip): Add parameter TEXT. Set the tip frame's root - window buffer to *tip* right after creating the frame. Set frame's + window buffer to *tip* right after creating the frame. Set frame's window_width. Use a maximum tooltip size specified by Vx_max_tooltip_size, if that has valid contents. (compute_tip_xy): Add parameters WIDTH and HEIGHT. diff --git a/src/abbrev.c b/src/abbrev.c index 54ea8f1128e..086a58021fb 100644 --- a/src/abbrev.c +++ b/src/abbrev.c @@ -1,5 +1,5 @@ /* Primitives for word-abbrev mode. - Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001 + Copyright (C) 1985, 1986, 1993, 1996, 1998, 2001,02,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/alloc.c b/src/alloc.c index e427c1f5676..ea7886dd4dc 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -155,6 +155,7 @@ int malloc_sbrk_unused; EMACS_INT undo_limit; EMACS_INT undo_strong_limit; +EMACS_INT undo_outer_limit; /* Number of live and free conses etc. */ @@ -256,6 +257,7 @@ EMACS_INT gcs_done; /* accumulated GCs */ static void mark_buffer P_ ((Lisp_Object)); extern void mark_kboards P_ ((void)); +extern void mark_backtrace P_ ((void)); static void gc_sweep P_ ((void)); static void mark_glyph_matrix P_ ((struct glyph_matrix *)); static void mark_face_cache P_ ((struct face_cache *)); @@ -753,17 +755,20 @@ lisp_align_malloc (nbytes, type) #ifdef HAVE_POSIX_MEMALIGN { int err = posix_memalign (&base, BLOCK_ALIGN, ABLOCKS_BYTES); - abase = err ? (base = NULL) : base; + if (err) + base = NULL; + abase = base; } #else base = malloc (ABLOCKS_BYTES); abase = ALIGN (base, BLOCK_ALIGN); +#endif + if (base == 0) { UNBLOCK_INPUT; memory_full (); } -#endif aligned = (base == abase); if (!aligned) @@ -844,7 +849,7 @@ lisp_align_free (block) free_ablock = ablock; /* Update busy count. */ ABLOCKS_BUSY (abase) = (struct ablocks *) (-2 + (long) ABLOCKS_BUSY (abase)); - + if (2 > (long) ABLOCKS_BUSY (abase)) { /* All the blocks are free. */ int i = 0, aligned = (long) ABLOCKS_BUSY (abase); @@ -1893,8 +1898,9 @@ compact_small_strings () DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, - doc: /* Return a newly created string of length LENGTH, with each element being INIT. -Both LENGTH and INIT must be numbers. */) + doc: /* Return a newly created string of length LENGTH, with INIT in each element. +LENGTH must be an integer. +INIT must be an integer that represents a character. */) (length, init) Lisp_Object length, init; { @@ -1949,10 +1955,11 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) CHECK_NATNUM (length); - bits_per_value = sizeof (EMACS_INT) * BITS_PER_CHAR; + bits_per_value = sizeof (EMACS_INT) * BOOL_VECTOR_BITS_PER_CHAR; length_in_elts = (XFASTINT (length) + bits_per_value - 1) / bits_per_value; - length_in_chars = ((XFASTINT (length) + BITS_PER_CHAR - 1) / BITS_PER_CHAR); + length_in_chars = ((XFASTINT (length) + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); /* We must allocate one more elements than LENGTH_IN_ELTS for the slot `size' of the struct Lisp_Bool_Vector. */ @@ -1969,9 +1976,9 @@ LENGTH must be a number. INIT matters only in whether it is t or nil. */) p->data[i] = real_init; /* Clear the extraneous bits in the last byte. */ - if (XINT (length) != length_in_chars * BITS_PER_CHAR) + if (XINT (length) != length_in_chars * BOOL_VECTOR_BITS_PER_CHAR) XBOOL_VECTOR (val)->data[length_in_chars - 1] - &= (1 << (XINT (length) % BITS_PER_CHAR)) - 1; + &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; return val; } @@ -2333,7 +2340,6 @@ free_cons (ptr) cons_free_list = ptr; } - DEFUN ("cons", Fcons, Scons, 2, 2, 0, doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) (car, cdr) @@ -4233,18 +4239,6 @@ struct catchtag struct catchtag *next; }; -struct backtrace -{ - struct backtrace *next; - Lisp_Object *function; - Lisp_Object *args; /* Points to vector of args. */ - int nargs; /* Length of vector. */ - /* If nargs is UNEVALLED, args points to slot holding list of - unevalled args. */ - char evalargs; -}; - - /*********************************************************************** Protection from GC @@ -4279,7 +4273,6 @@ returns nil, because real GC can't be done. */) register struct specbinding *bind; struct catchtag *catch; struct handler *handler; - register struct backtrace *backlist; char stack_top_variable; register int i; int message_p; @@ -4348,7 +4341,7 @@ returns nil, because real GC can't be done. */) if (! EQ (nextb->undo_list, Qt)) nextb->undo_list = truncate_undo_list (nextb->undo_list, undo_limit, - undo_strong_limit); + undo_strong_limit, undo_outer_limit); /* Shrink buffer gaps, but skip indirect and dead buffers. */ if (nextb->base_buffer == 0 && !NILP (nextb->name)) @@ -4408,20 +4401,23 @@ returns nil, because real GC can't be done. */) mark_object (handler->handler); mark_object (handler->var); } - for (backlist = backtrace_list; backlist; backlist = backlist->next) - { - mark_object (*backlist->function); - - if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) - i = 0; - else - i = backlist->nargs - 1; - for (; i >= 0; i--) - mark_object (backlist->args[i]); - } + mark_backtrace (); mark_kboards (); - /* Look thru every buffer's undo list +#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES + mark_stack (); +#endif + +#ifdef USE_GTK + { + extern void xg_mark_data (); + xg_mark_data (); + } +#endif + + /* Everything is now marked, except for the things that require special + finalization, i.e. the undo_list. + Look thru every buffer's undo list for elements that update markers that were not marked, and delete them. */ { @@ -4459,22 +4455,14 @@ returns nil, because real GC can't be done. */) } } } + /* Now that we have stripped the elements that need not be in the + undo_list any more, we can finally mark the list. */ + mark_object (nextb->undo_list); nextb = nextb->next; } } -#if GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES - mark_stack (); -#endif - -#ifdef USE_GTK - { - extern void xg_mark_data (); - xg_mark_data (); - } -#endif - gc_sweep (); /* Clear the mark bits that we set in certain root slots. */ @@ -5043,41 +5031,9 @@ mark_buffer (buf) MARK_INTERVAL_TREE (BUF_INTERVALS (buffer)); - if (CONSP (buffer->undo_list)) - { - Lisp_Object tail; - tail = buffer->undo_list; - - /* We mark the undo list specially because - its pointers to markers should be weak. */ - - while (CONSP (tail)) - { - register struct Lisp_Cons *ptr = XCONS (tail); - - if (CONS_MARKED_P (ptr)) - break; - CONS_MARK (ptr); - if (GC_CONSP (ptr->car) - && !CONS_MARKED_P (XCONS (ptr->car)) - && GC_MARKERP (XCAR (ptr->car))) - { - CONS_MARK (XCONS (ptr->car)); - mark_object (XCDR (ptr->car)); - } - else - mark_object (ptr->car); - - if (CONSP (ptr->cdr)) - tail = ptr->cdr; - else - break; - } - - mark_object (XCDR (tail)); - } - else - mark_object (buffer->undo_list); + /* For now, we just don't mark the undo_list. It's done later in + a special way just before the sweep phase, and after stripping + some of its elements that are not needed any more. */ if (buffer->overlays_before) { @@ -5671,12 +5627,20 @@ which includes both saved text and other data. */); DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, doc: /* Don't keep more than this much size of undo information. -A command which pushes past this size is itself forgotten. -This limit is applied when garbage collection happens. +A previous command which pushes the undo list past this size +is entirely forgotten when GC happens. The size is counted as the number of bytes occupied, which includes both saved text and other data. */); undo_strong_limit = 30000; + DEFVAR_INT ("undo-outer-limit", &undo_outer_limit, + doc: /* Don't keep more than this much size of undo information. +If the current command has produced more than this much undo information, +GC discards it. This is a last-ditch limit to prevent memory overflow. +The size is counted as the number of bytes occupied, +which includes both saved text and other data. */); + undo_outer_limit = 300000; + DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, doc: /* Non-nil means display messages at start and end of garbage collection. */); garbage_collection_messages = 0; diff --git a/src/atimer.c b/src/atimer.c index 2ddc7427f56..7e78bdad9c0 100644 --- a/src/atimer.c +++ b/src/atimer.c @@ -1,5 +1,5 @@ /* Asynchronous timers. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/atimer.h b/src/atimer.h index 3ecc97e5511..f987a47a6bd 100644 --- a/src/atimer.h +++ b/src/atimer.h @@ -1,5 +1,5 @@ /* Asynchronous timers. - Copyright (C) 2000 Free Software Foundation, Inc. + Copyright (C) 2000, 2003 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/blockinput.h b/src/blockinput.h index eba192c9863..a4c8a9b9c22 100644 --- a/src/blockinput.h +++ b/src/blockinput.h @@ -1,5 +1,5 @@ /* blockinput.h - interface to blocking complicated interrupt-driven input. - Copyright (C) 1989, 1993 Free Software Foundation, Inc. + Copyright (C) 1989, 1993, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -97,6 +97,9 @@ extern int pending_atimers; #define TOTALLY_UNBLOCK_INPUT (interrupt_input_blocked = 0) #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT +/* In critical section ? */ +#define INPUT_BLOCKED_P (interrupt_input_blocked > 0) + /* Defined in keyboard.c */ /* Don't use a prototype here; it causes trouble in some files. */ extern void reinvoke_input_signal (); diff --git a/src/buffer.c b/src/buffer.c index 4c7e709adb5..bd4e061b05f 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -488,7 +488,7 @@ static void clone_per_buffer_values (from, to) struct buffer *from, *to; { - Lisp_Object to_buffer; + Lisp_Object to_buffer, tem; int offset; XSETBUFFER (to_buffer, to); @@ -515,6 +515,14 @@ clone_per_buffer_values (from, to) to->overlays_before = copy_overlays (to, from->overlays_before); to->overlays_after = copy_overlays (to, from->overlays_after); + + /* Copy the alist of local variables, + and all the alist elements too. */ + to->local_var_alist + = Fcopy_sequence (from->local_var_alist); + for (tem = to->local_var_alist; CONSP (tem); + tem = XCDR (tem)) + XSETCAR (tem, Fcons (XCAR (XCAR (tem)), XCDR (XCAR (tem)))); } @@ -833,7 +841,8 @@ No argument or nil as argument means use the current buffer. */) DEFUN ("buffer-base-buffer", Fbuffer_base_buffer, Sbuffer_base_buffer, 0, 1, 0, doc: /* Return the base buffer of indirect buffer BUFFER. -If BUFFER is not indirect, return nil. */) +If BUFFER is not indirect, return nil. +BUFFER defaults to the current buffer. */) (buffer) register Lisp_Object buffer; { @@ -1683,7 +1692,7 @@ DEFUN ("pop-to-buffer", Fpop_to_buffer, Spop_to_buffer, 1, 3, 0, doc: /* Select buffer BUFFER in some window, preferably a different one. If BUFFER is nil, then some other buffer is chosen. If `pop-up-windows' is non-nil, windows can be split to do this. -If optional second arg OTHER-WINDOW is nil, insist on finding another +If optional second arg OTHER-WINDOW is non-nil, insist on finding another window even if BUFFER is already visible in the selected window, and ignore `same-window-regexps' and `same-window-buffer-names'. This uses the function `display-buffer' as a subroutine; see the documentation @@ -2145,7 +2154,7 @@ current buffer is cleared. */) GPT = GPT_BYTE; TEMP_SET_PT_BOTH (PT_BYTE, PT_BYTE); - + for (tail = BUF_MARKERS (current_buffer); tail; tail = tail->next) tail->charpos = tail->bytepos; @@ -3354,7 +3363,7 @@ fix_start_end_in_overlays (start, end) if (endpos < start) break; - + if (endpos < end || (startpos >= start && startpos < end)) { @@ -3397,7 +3406,7 @@ fix_start_end_in_overlays (start, end) { startpos = endpos; Fset_marker (OVERLAY_START (overlay), make_number (startpos), - Qnil); + Qnil); } if (startpos >= end) @@ -4208,7 +4217,7 @@ report_overlay_modification (start, end, after, arg1, arg2, arg3) add_overlay_mod_hooklist (prop, overlay); } } - + for (tail = current_buffer->overlays_after; tail; tail = tail->next) { int startpos, endpos; @@ -5444,7 +5453,7 @@ nil here means use current buffer's major mode. */); DEFVAR_PER_BUFFER ("fill-column", ¤t_buffer->fill_column, make_number (Lisp_Int), doc: /* *Column beyond which automatic line-wrapping should happen. -Interactively, you can set this using \\[set-fill-column]. */); +Interactively, you can set the buffer local value using \\[set-fill-column]. */); DEFVAR_PER_BUFFER ("left-margin", ¤t_buffer->left_margin, make_number (Lisp_Int), @@ -5854,7 +5863,11 @@ If the buffer has never been shown in a window, the value is nil. */); doc: /* *Non-nil means deactivate the mark when the buffer contents change. Non-nil also enables highlighting of the region whenever the mark is active. The variable `highlight-nonselected-windows' controls whether to highlight -all windows or just the selected window. */); +all windows or just the selected window. + +If the value is `lambda', that enables Transient Mark mode temporarily +until the next buffer modification. If a command sets the value to `only', +that enables Transient Mark mode for the following command only. */); Vtransient_mark_mode = Qnil; DEFVAR_LISP ("inhibit-read-only", &Vinhibit_read_only, @@ -5871,9 +5884,13 @@ Values are interpreted as follows: t use the cursor specified for the frame nil don't display a cursor - bar display a bar cursor with default width - (bar . WIDTH) display a bar cursor with width WIDTH - ANYTHING ELSE display a box cursor. + box display a filled box cursor + hollow display a hollow box cursor + bar display a vertical bar cursor with default width + (bar . WIDTH) display a vertical bar cursor with width WIDTH + hbar display a horisontal bar cursor with default width + (hbar . WIDTH) display a horisontal bar cursor with width WIDTH + ANYTHING ELSE display a hollow box cursor. When the buffer is displayed in a nonselected window, this variable has no effect; the cursor appears as a hollow box. */); @@ -5881,7 +5898,9 @@ this variable has no effect; the cursor appears as a hollow box. */); DEFVAR_PER_BUFFER ("line-spacing", ¤t_buffer->extra_line_spacing, Qnil, doc: /* Additional space to put between lines when displaying a buffer. -The space is measured in pixels, and put below lines on window systems. */); +The space is measured in pixels, and put below lines on window systems. +If value is a floating point number, it specifies the spacing relative +to the default frame line height. */); DEFVAR_LISP ("kill-buffer-query-functions", &Vkill_buffer_query_functions, doc: /* List of functions called with no args to query before killing a buffer. */); diff --git a/src/buffer.h b/src/buffer.h index 0755db25f9f..47f00560824 100644 --- a/src/buffer.h +++ b/src/buffer.h @@ -1,5 +1,5 @@ /* Header file for the buffer manipulation primitives. - Copyright (C) 1985, 86, 93, 94, 95, 97, 1998, 1999, 2000, 01, 2003 + Copyright (C) 1985,86,93,94,95,97,98,99,2000,01,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -827,6 +827,25 @@ extern void buffer_slot_type_mismatch P_ ((int)); extern void fix_overlays_before P_ ((struct buffer *, EMACS_INT, EMACS_INT)); extern void mmap_set_vars P_ ((int)); +/* Get overlays at POSN into array OVERLAYS with NOVERLAYS elements. + If NEXTP is non-NULL, return next overlay there. + See overlay_at arg CHANGE_REQ for meaning of CHRQ arg. */ + +#define GET_OVERLAYS_AT(posn, overlays, noverlays, nextp, chrq) \ + do { \ + int maxlen = 40; \ + overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \ + noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ + nextp, NULL, chrq); \ + if (noverlays > maxlen) \ + { \ + maxlen = noverlays; \ + overlays = (Lisp_Object *) alloca (maxlen * sizeof (Lisp_Object)); \ + noverlays = overlays_at (posn, 0, &overlays, &maxlen, \ + nextp, NULL, chrq); \ + } \ + } while (0) + EXFUN (Fbuffer_live_p, 1); EXFUN (Fbuffer_name, 1); EXFUN (Fget_file_buffer, 1); diff --git a/src/callint.c b/src/callint.c index 50090db8b28..a3e4984fd16 100644 --- a/src/callint.c +++ b/src/callint.c @@ -612,7 +612,7 @@ supply if the command inquires which events were used to invoke it. */) Qnil, Qnil, Qnil, Qnil); unbind_to (speccount1, Qnil); teml = args[i]; - visargs[i] = Fkey_description (teml); + visargs[i] = Fkey_description (teml, Qnil); /* If the key sequence ends with a down-event, discard the following up-event. */ @@ -639,7 +639,7 @@ supply if the command inquires which events were used to invoke it. */) args[i] = Fread_key_sequence (build_string (callint_message), Qnil, Qt, Qnil, Qnil); teml = args[i]; - visargs[i] = Fkey_description (teml); + visargs[i] = Fkey_description (teml, Qnil); unbind_to (speccount1, Qnil); /* If the key sequence ends with a down-event, diff --git a/src/callproc.c b/src/callproc.c index 2b610d53a1d..7632d491944 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1,5 +1,5 @@ /* Synchronous subprocess invocation for GNU Emacs. - Copyright (C) 1985,86,87,88,93,94,95,99, 2000, 2001 + Copyright (C) 1985,86,87,88,93,94,95,99, 2000,01,02,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -222,7 +222,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) register int pid; char buf[16384]; char *bufptr = buf; - int bufsize = 16384; + int bufsize = sizeof buf; int count = SPECPDL_INDEX (); register const unsigned char **new_argv diff --git a/src/casefiddle.c b/src/casefiddle.c index 341e3b313a3..4b38e441cf3 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c @@ -1,5 +1,6 @@ /* GNU Emacs case conversion functions. - Copyright (C) 1985, 1994, 1997 Free Software Foundation, Inc. + Copyright (C) 1985,94,97,98,99, 2001, 2002, 2004 + Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -53,11 +54,19 @@ casify_object (flag, obj) int flags = XINT (obj) & flagbits; int multibyte = ! NILP (current_buffer->enable_multibyte_characters); + /* If the character has higher bits set + above the flags, return it unchanged. + It is not a real character. */ + if ((unsigned) XFASTINT (obj) > (unsigned) flagbits) + return obj; + c1 = XFASTINT (obj) & ~flagbits; if (! multibyte) MAKE_CHAR_MULTIBYTE (c1); c = DOWNCASE (c1); - if (inword || c == c1) + if (inword) + XSETFASTINT (obj, c | flags); + else if (c == (XFASTINT (obj) & ~flagbits)) { if (! inword) c = UPCASE1 (c1); diff --git a/src/ccl.c b/src/ccl.c index 5eac485bf2c..71a08fdf7c7 100644 --- a/src/ccl.c +++ b/src/ccl.c @@ -634,14 +634,17 @@ do \ { \ ccl_prog = ccl_prog_stack_struct[0].ccl_prog; \ ic = ccl_prog_stack_struct[0].ic; \ + eof_ic = ccl_prog_stack_struct[0].eof_ic; \ } \ CCL_INVALID_CMD; \ } \ ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; \ ccl_prog_stack_struct[stack_idx].ic = (ret_ic); \ + ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; \ stack_idx++; \ ccl_prog = called_ccl.prog; \ ic = CCL_HEADER_MAIN; \ + eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); \ goto ccl_repeat; \ } \ while (0) @@ -718,14 +721,29 @@ while (0) /* Terminate CCL program because of invalid command. Should not occur in the normal case. */ +#ifndef CCL_DEBUG + +#define CCL_INVALID_CMD \ +do \ + { \ + ccl->status = CCL_STAT_INVALID_CMD; \ + goto ccl_error_handler; \ + } \ +while(0) + +#else + #define CCL_INVALID_CMD \ do \ { \ + ccl_debug_hook (this_ic); \ ccl->status = CCL_STAT_INVALID_CMD; \ goto ccl_error_handler; \ } \ while(0) +#endif + /* Encode one character CH to multibyte form and write to the current output buffer. If CH is less than 256, CH is written as is. */ #define CCL_WRITE_CHAR(ch) \ @@ -762,6 +780,7 @@ while(0) r = *src++; \ else if (ccl->last_block) \ { \ + r = -1; \ ic = ccl->eof_ic; \ goto ccl_repeat; \ } \ @@ -807,12 +826,20 @@ while(0) #define CCL_DEBUG_BACKTRACE_LEN 256 int ccl_backtrace_table[CCL_DEBUG_BACKTRACE_LEN]; int ccl_backtrace_idx; + +int +ccl_debug_hook (int ic) +{ + return ic; +} + #endif struct ccl_prog_stack { Lisp_Object *ccl_prog; /* Pointer to an array of CCL code. */ int ic; /* Instruction Counter. */ + int eof_ic; /* Instruction Counter to jump on EOF. */ }; /* For the moment, we only support depth 256 of stack. */ @@ -837,8 +864,10 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) /* Instruction counter of the current CCL code. */ int this_ic = 0; struct charset *charset; + int eof_ic = ccl->eof_ic; + int eof_hit = 0; - if (ic >= ccl->eof_ic) + if (ic >= eof_ic) ic = CCL_HEADER_MAIN; if (ccl->buf_magnification == 0) /* We can't read/produce any bytes. */ @@ -1042,15 +1071,18 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) { ccl_prog = ccl_prog_stack_struct[0].ccl_prog; ic = ccl_prog_stack_struct[0].ic; + eof_ic = ccl_prog_stack_struct[0].eof_ic; } CCL_INVALID_CMD; } ccl_prog_stack_struct[stack_idx].ccl_prog = ccl_prog; ccl_prog_stack_struct[stack_idx].ic = ic; + ccl_prog_stack_struct[stack_idx].eof_ic = eof_ic; stack_idx++; ccl_prog = XVECTOR (AREF (slot, 1))->contents; ic = CCL_HEADER_MAIN; + eof_ic = XFASTINT (ccl_prog[CCL_HEADER_EOF]); } break; @@ -1080,6 +1112,9 @@ ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) stack_idx--; ccl_prog = ccl_prog_stack_struct[stack_idx].ccl_prog; ic = ccl_prog_stack_struct[stack_idx].ic; + eof_ic = ccl_prog_stack_struct[stack_idx].eof_ic; + if (eof_hit) + ic = eof_ic; break; } if (src) diff --git a/src/charset.c b/src/charset.c index a4967c65a9a..97f1c701cf8 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1,8 +1,8 @@ /* Basic character set support. Copyright (C) 1995, 97, 98, 2000, 2001 Electrotechnical Laboratory, JAPAN. Licensed to the Free Software Foundation. - Copyright (C) 2001 Free Software Foundation, Inc. - Copyright (C) 2003 + Copyright (C) 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 2003, 2004 National Institute of Advanced Industrial Science and Technology (AIST) Registration Number H13PRO009 @@ -1267,7 +1267,7 @@ Optional third argument DEUNIFY, if non-nil, means to de-unify CHARSET. */) DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char, Sget_unused_iso_final_char, 2, 2, 0, doc: /* -Return an unsed ISO final char for a charset of DIMENISION and CHARS. +Return an unused ISO final char for a charset of DIMENISION and CHARS. DIMENSION is the number of bytes to represent a character: 1 or 2. CHARS is the number of characters in a dimension: 94 or 96. @@ -1873,7 +1873,7 @@ CHAR in the charset. */) DEFUN ("char-charset", Fchar_charset, Schar_charset, 1, 1, 0, - doc: /* Return the charset of highest priority that contains CHAR. */) + doc: /* Return the charset of highest priority that contains CH. */) (ch) Lisp_Object ch; { diff --git a/src/data.c b/src/data.c index 92e1c75dee4..935c4348bb7 100644 --- a/src/data.c +++ b/src/data.c @@ -761,6 +761,19 @@ function with `&rest' args, or `unevalled' for a special form. */) return Fcons (make_number (minargs), make_number (maxargs)); } +DEFUN ("subr-name", Fsubr_name, Ssubr_name, 1, 1, 0, + doc: /* Return name of subroutine SUBR. +SUBR must be a built-in function. */) + (subr) + Lisp_Object subr; +{ + const char *name; + if (!SUBRP (subr)) + wrong_type_argument (Qsubrp, subr); + name = XSUBR (subr)->symbol_name; + return make_string (name, strlen (name)); +} + DEFUN ("interactive-form", Finteractive_form, Sinteractive_form, 1, 1, 0, doc: /* Return the interactive form of CMD or nil if none. CMD must be a command. Value, if non-nil, is a list @@ -1394,7 +1407,7 @@ local bindings in certain buffers. */) } DEFUN ("set-default", Fset_default, Sset_default, 2, 2, 0, - doc: /* Set SYMBOL's default value to VAL. SYMBOL and VAL are evaluated. + doc: /* Set SYMBOL's default value to VALUE. SYMBOL and VALUE are evaluated. The default value is seen in buffers that do not have their own values for this variable. */) (symbol, value) @@ -1455,11 +1468,11 @@ The default value of a variable is seen in buffers that do not have their own values for the variable. More generally, you can use multiple variables and values, as in - (setq-default SYMBOL VALUE SYMBOL VALUE...) -This sets each SYMBOL's default value to the corresponding VALUE. -The VALUE for the Nth SYMBOL can refer to the new default values -of previous SYMs. -usage: (setq-default SYMBOL VALUE [SYMBOL VALUE...]) */) + (setq-default VAR VALUE VAR VALUE...) +This sets each VAR's default value to the corresponding VALUE. +The VALUE for the Nth VAR can refer to the new default values +of previous VARs. +usage: (setq-default VAR VALUE [VAR VALUE...]) */) (args) Lisp_Object args; { @@ -1946,8 +1959,8 @@ or a byte-code object. IDX starts at 0. */) if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size) args_out_of_range (array, idx); - val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR]; - return (val & (1 << (idxval % BITS_PER_CHAR)) ? Qt : Qnil); + val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR]; + return (val & (1 << (idxval % BOOL_VECTOR_BITS_PER_CHAR)) ? Qt : Qnil); } else if (CHAR_TABLE_P (array)) { @@ -2005,13 +2018,13 @@ bool-vector. IDX starts at 0. */) if (idxval < 0 || idxval >= XBOOL_VECTOR (array)->size) args_out_of_range (array, idx); - val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR]; + val = (unsigned char) XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR]; if (! NILP (newelt)) - val |= 1 << (idxval % BITS_PER_CHAR); + val |= 1 << (idxval % BOOL_VECTOR_BITS_PER_CHAR); else - val &= ~(1 << (idxval % BITS_PER_CHAR)); - XBOOL_VECTOR (array)->data[idxval / BITS_PER_CHAR] = val; + val &= ~(1 << (idxval % BOOL_VECTOR_BITS_PER_CHAR)); + XBOOL_VECTOR (array)->data[idxval / BOOL_VECTOR_BITS_PER_CHAR] = val; } else if (CHAR_TABLE_P (array)) { @@ -2581,6 +2594,10 @@ usage: (/ DIVIDEND DIVISOR &rest DIVISORS) */) int nargs; Lisp_Object *args; { + int argnum; + for (argnum = 2; argnum < nargs; argnum++) + if (FLOATP (args[argnum])) + return float_arith_driver (0, 0, Adiv, nargs, args); return arith_driver (Adiv, nargs, args); } @@ -3215,6 +3232,7 @@ syms_of_data () defsubr (&Slognot); defsubr (&Sbyteorder); defsubr (&Ssubr_arity); + defsubr (&Ssubr_name); XSYMBOL (Qwholenump)->function = XSYMBOL (Qnatnump)->function; diff --git a/src/dispextern.h b/src/dispextern.h index f2cd03e968a..11395cb7f00 100644 --- a/src/dispextern.h +++ b/src/dispextern.h @@ -1,5 +1,5 @@ /* Interface definitions for display code. - Copyright (C) 1985, 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Copyright (C) 1985,93,94,97,98,99, 2000,01,02,03, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -274,6 +274,17 @@ enum glyph_type }; +/* Structure describing how to use partial glyphs (images slicing) */ + +struct glyph_slice +{ + unsigned x : 16; + unsigned y : 16; + unsigned width : 16; + unsigned height : 16; +}; + + /* Glyphs. Be extra careful when changing this structure! Esp. make sure that @@ -352,6 +363,8 @@ struct glyph w32_char_font_type. Otherwise it equals FONT_TYPE_UNKNOWN. */ unsigned font_type : 3; + struct glyph_slice slice; + /* A union of sub-structures for different glyph types. */ union { @@ -390,11 +403,20 @@ struct glyph #define CHAR_GLYPH_SPACE_P(GLYPH) \ (GLYPH_FROM_CHAR_GLYPH ((GLYPH)) == SPACEGLYPH) +/* Are glyph slices of glyphs *X and *Y equal */ + +#define GLYPH_SLICE_EQUAL_P(X, Y) \ + ((X)->slice.x == (Y)->slice.x \ + && (X)->slice.y == (Y)->slice.y \ + && (X)->slice.width == (Y)->slice.width \ + && (X)->slice.height == (Y)->slice.height) + /* Are glyphs *X and *Y displayed equal? */ #define GLYPH_EQUAL_P(X, Y) \ ((X)->type == (Y)->type \ && (X)->u.val == (Y)->u.val \ + && GLYPH_SLICE_EQUAL_P (X, Y) \ && (X)->face_id == (Y)->face_id \ && (X)->padding_p == (Y)->padding_p \ && (X)->left_box_line_p == (Y)->left_box_line_p \ @@ -1143,6 +1165,9 @@ struct glyph_string /* Image, if any. */ struct image *img; + /* Slice */ + struct glyph_slice slice; + struct glyph_string *next, *prev; }; @@ -1604,7 +1629,7 @@ extern int face_change_count; width and height of the bitmap, DH is the height adjustment (if bitmap is periodic). X and Y are frame coordinates of the area to display the bitmap, DY is relative offset of the bitmap into that - area. BX, NX, BY, NY specifies the area to clear if the bitmap + area. BX, NX, BY, NY specifies the area to clear if the bitmap does not fill the entire area. FACE is the fringe face. */ struct draw_fringe_bitmap_params @@ -1716,6 +1741,15 @@ enum prop_idx }; +struct it_slice +{ + Lisp_Object x; + Lisp_Object y; + Lisp_Object width; + Lisp_Object height; +}; + + struct it { /* The window in which we iterate over current_buffer (or a string). */ @@ -1828,6 +1862,7 @@ struct it unsigned multibyte_p : 1; unsigned string_from_display_prop_p : 1; unsigned display_ellipsis_p : 1; + struct it_slice slice; Lisp_Object space_width; short voffset; Lisp_Object font_height; @@ -1882,6 +1917,10 @@ struct it skipped due to selective display. */ unsigned face_before_selective_p : 1; + /* If 1, adjust current glyph so it does not increase current row + descent/ascent (line-height property). Reset after this glyph. */ + unsigned constrain_row_ascent_descent_p : 1; + /* The ID of the default face to use. One of DEFAULT_FACE_ID, MODE_LINE_FACE_ID, etc, depending on what we are displaying. */ int base_face_id; @@ -1907,6 +1946,9 @@ struct it /* If what == IT_IMAGE, the id of the image to display. */ int image_id; + /* Values from `slice' property. */ + struct it_slice slice; + /* Value of the `space-width' property, if any; nil if none. */ Lisp_Object space_width; @@ -1945,6 +1987,10 @@ struct it only.) */ int extra_line_spacing; + /* Override font height information for this glyph. + Used if override_ascent >= 0. Cleared after this glyph. */ + int override_ascent, override_descent, override_boff; + /* If non-null, glyphs are produced in glyph_row with each call to produce_glyphs. */ struct glyph_row *glyph_row; @@ -2176,7 +2222,7 @@ struct redisplay_interface struct charset *charset, int *two_byte_p)); -/* Compute left and right overhang of glyph string S. +/* Compute left and right overhang of glyph string S. A NULL pointer if platform does not support this. */ void (*compute_glyph_string_overhangs) P_ ((struct glyph_string *s)); @@ -2204,7 +2250,7 @@ struct redisplay_interface void (*draw_vertical_window_border) P_ ((struct window *w, int x, int y0, int y1)); -/* Shift display of frame F to make room for inserted glyphs. +/* Shift display of frame F to make room for inserted glyphs. The area at pixel (X,Y) of width WIDTH and height HEIGHT is shifted right by SHIFT_BY pixels. */ void (*shift_glyphs_for_insert) P_ ((struct frame *f, @@ -2518,12 +2564,11 @@ extern Lisp_Object Qtool_bar; extern Lisp_Object Vshow_trailing_whitespace; extern int mode_line_in_non_selected_windows; extern int redisplaying_p; -extern Lisp_Object Vimage_types; extern void add_to_log P_ ((char *, Lisp_Object, Lisp_Object)); extern int help_echo_showing_p; extern int current_mode_line_height, current_header_line_height; extern Lisp_Object help_echo_string, help_echo_window; -extern Lisp_Object help_echo_object, previous_help_echo_string; +extern Lisp_Object help_echo_object, previous_help_echo_string; extern int help_echo_pos; extern struct frame *last_mouse_frame; extern int last_tool_bar_item; @@ -2633,6 +2678,8 @@ unsigned long image_background P_ ((struct image *, struct frame *, int image_background_transparent P_ ((struct image *, struct frame *, XImagePtr_or_DC mask)); +int image_ascent P_ ((struct image *, struct face *, struct glyph_slice *)); + #endif /* Defined in sysdep.c */ @@ -2741,7 +2788,7 @@ extern int required_matrix_height P_ ((struct window *)); extern Lisp_Object buffer_posn_from_coords P_ ((struct window *, int *, int *, struct display_pos *, - Lisp_Object *, + Lisp_Object *, int *, int *, int *, int *)); extern Lisp_Object mode_line_string P_ ((struct window *, enum window_part, int *, int *, int *, diff --git a/src/dispnew.c b/src/dispnew.c index f06a54164d6..8edc8993a05 100644 --- a/src/dispnew.c +++ b/src/dispnew.c @@ -5716,6 +5716,9 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) struct text_pos startp; Lisp_Object string; struct glyph_row *row; +#ifdef HAVE_WINDOW_SYSTEM + struct image *img = 0; +#endif int x0, x1; current_buffer = XBUFFER (w->buffer); @@ -5741,7 +5744,6 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) #ifdef HAVE_WINDOW_SYSTEM if (it.what == IT_IMAGE) { - struct image *img; if ((img = IMAGE_FROM_ID (it.f, it.image_id)) != NULL && !NILP (img->spec)) *object = img->spec; @@ -5754,12 +5756,22 @@ buffer_posn_from_coords (w, x, y, pos, object, dx, dy, width, height) if (it.hpos < row->used[TEXT_AREA]) { struct glyph *glyph = row->glyphs[TEXT_AREA] + it.hpos; - *width = glyph->pixel_width; - *height = glyph->ascent + glyph->descent; #ifdef HAVE_WINDOW_SYSTEM - if (glyph->type == IMAGE_GLYPH) - *dy -= row->ascent - glyph->ascent; + if (img) + { + *dy -= row->ascent - glyph->ascent; + *dx += glyph->slice.x; + *dy += glyph->slice.y; + /* Image slices positions are still relative to the entire image */ + *width = img->width; + *height = img->height; + } + else #endif + { + *width = glyph->pixel_width; + *height = glyph->ascent + glyph->descent; + } } else { @@ -5925,6 +5937,8 @@ marginal_area_string (w, part, x, y, charpos, object, dx, dy, width, height) if (img != NULL) *object = img->spec; y0 -= row->ascent - glyph->ascent; + x0 += glyph->slice.x; + y0 += glyph->slice.y; } #endif } diff --git a/src/doc.c b/src/doc.c index e670ad1797a..2e66c5cea46 100644 --- a/src/doc.c +++ b/src/doc.c @@ -808,7 +808,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int } else { /* function is on a key */ - tem = Fkey_description (tem); + tem = Fkey_description (tem, Qnil); goto subst_string; } } diff --git a/src/editfns.c b/src/editfns.c index e7a01b24b76..130dffa77de 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -73,7 +73,7 @@ static int tm_diff P_ ((struct tm *, struct tm *)); static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *)); static void update_buffer_properties P_ ((int, int)); static Lisp_Object region_limit P_ ((int)); -static int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); +int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); static size_t emacs_memftimeu P_ ((char *, size_t, const char *, size_t, const struct tm *, int)); static void general_insert_function P_ ((void (*) (const unsigned char *, int), @@ -1213,7 +1213,7 @@ If POS is out of range, the value is nil. */) DEFUN ("user-login-name", Fuser_login_name, Suser_login_name, 0, 1, 0, doc: /* Return the name under which the user logged in, as a string. This is based on the effective uid, not the real uid. -Also, if the environment variable LOGNAME or USER is set, +Also, if the environment variables LOGNAME or USER are set, that determines the value of this function. If optional argument UID is an integer, return the login name of the user @@ -1372,7 +1372,7 @@ resolution finer than a second. */) } -static int +int lisp_time_argument (specified_time, result, usec) Lisp_Object specified_time; time_t *result; @@ -1425,7 +1425,7 @@ lisp_time_argument (specified_time, result, usec) DEFUN ("float-time", Ffloat_time, Sfloat_time, 0, 1, 0, doc: /* Return the current time, as a float number of seconds since the epoch. -If an argument is given, it specifies a time to convert to float +If SPECIFIED-TIME is given, it is the time to convert to float instead of the current time. The argument should have the forms: (HIGH . LOW) or (HIGH LOW USEC) or (HIGH LOW . USEC). Thus, you can use times obtained from `current-time' @@ -1655,7 +1655,7 @@ are used as SECOND through YEAR, and the *last* argument is used as ZONE. The intervening arguments are ignored. This feature lets (apply 'encode-time (decode-time ...)) work. -Out-of-range values for SEC, MINUTE, HOUR, DAY, or MONTH are allowed; +Out-of-range values for SECOND, MINUTE, HOUR, DAY, or MONTH are allowed; for example, a DAY of 0 means the day preceding the given month. Year numbers less than 100 are treated just like other year numbers. If you want them to stand for years in this century, you must do that yourself. @@ -1740,8 +1740,8 @@ The format is `Sun Sep 16 01:03:52 1973'. However, see also the functions `decode-time' and `format-time-string' which provide a much more powerful and general facility. -If an argument is given, it specifies a time to format -instead of the current time. The argument should have the form: +If SPECIFIED-TIME is given, it is a time to format instead +of the current time. The argument should have the form: (HIGH . LOW) or the form: (HIGH LOW . IGNORED). @@ -1796,7 +1796,7 @@ This returns a list of the form (OFFSET NAME). OFFSET is an integer number of seconds ahead of UTC (east of Greenwich). A negative value means west of Greenwich. NAME is a string giving the name of the time zone. -If an argument is given, it specifies when the time zone offset is determined +If SPECIFIED-TIME is given, the time zone offset is determined from it instead of using the current time. The argument should have the form: (HIGH . LOW) or the form: @@ -2365,21 +2365,21 @@ of the buffer. */) DEFUN ("insert-buffer-substring", Finsert_buffer_substring, Sinsert_buffer_substring, 1, 3, 0, - doc: /* Insert before point a substring of the contents of buffer BUFFER. + doc: /* Insert before point a substring of the contents of BUFFER. BUFFER may be a buffer or a buffer name. -Arguments START and END are character numbers specifying the substring. -They default to the beginning and the end of BUFFER. */) - (buf, start, end) - Lisp_Object buf, start, end; +Arguments START and END are character positions specifying the substring. +They default to the values of (point-min) and (point-max) in BUFFER. */) + (buffer, start, end) + Lisp_Object buffer, start, end; { register int b, e, temp; register struct buffer *bp, *obuf; - Lisp_Object buffer; + Lisp_Object buf; - buffer = Fget_buffer (buf); - if (NILP (buffer)) - nsberror (buf); - bp = XBUFFER (buffer); + buf = Fget_buffer (buffer); + if (NILP (buf)) + nsberror (buffer); + bp = XBUFFER (buf); if (NILP (bp->name)) error ("Selecting deleted buffer"); @@ -2983,6 +2983,7 @@ It returns the number of characters changed. */) DEFUN ("delete-region", Fdelete_region, Sdelete_region, 2, 2, "r", doc: /* Delete the text between point and mark. + When called from a program, expects two arguments, positions (integers or markers) specifying the stretch to be deleted. */) (start, end) @@ -4043,11 +4044,11 @@ transpose_markers (start1, end1, start2, end2, } DEFUN ("transpose-regions", Ftranspose_regions, Stranspose_regions, 4, 5, 0, - doc: /* Transpose region START1 to END1 with START2 to END2. + doc: /* Transpose region STARTR1 to ENDR1 with STARTR2 to ENDR2. The regions may not be overlapping, because the size of the buffer is never changed in a transposition. -Optional fifth arg LEAVE_MARKERS, if non-nil, means don't update +Optional fifth arg LEAVE-MARKERS, if non-nil, means don't update any markers that happen to be located in the regions. Transposing beyond buffer boundaries is an error. */) diff --git a/src/emacs.c b/src/emacs.c index b27b460fba0..d348eb86d29 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -104,6 +104,7 @@ EMACS_INT gdb_data_seg_bits = DATA_SEG_BITS; EMACS_INT gdb_data_seg_bits = 0; #endif EMACS_INT PVEC_FLAG = PSEUDOVECTOR_FLAG; +EMACS_INT gdb_array_mark_flag = ARRAY_MARK_FLAG; /* Command line args from shell, as list of strings. */ Lisp_Object Vcommand_line_args; @@ -205,6 +206,8 @@ extern Lisp_Object Vwindow_system; extern Lisp_Object Vauto_save_list_file_name; +extern Lisp_Object Vinhibit_redisplay; + #ifdef USG_SHARED_LIBRARIES /* If nonzero, this is the place to put the end of the writable segment at startup. */ @@ -847,7 +850,7 @@ main (argc, argv else { printf ("GNU Emacs %s\n", SDATA (tem)); - printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n"); + printf ("Copyright (C) 2004 Free Software Foundation, Inc.\n"); printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); printf ("You may redistribute copies of Emacs\n"); printf ("under the terms of the GNU General Public License.\n"); @@ -894,7 +897,7 @@ main (argc, argv /* If -map specified, map the data file in. */ { char *file; - if (argmatch (argv, argc, "-map", "--map-data", 3, &mapin_file, &skip_args)) + if (argmatch (argv, argc, "-map", "--map-data", 3, &file, &skip_args)) mapin_data (file); } @@ -2016,6 +2019,9 @@ shut_down_emacs (sig, no_x, stuff) /* Prevent running of hooks from now on. */ Vrun_hooks = Qnil; + /* Don't update display from now on. */ + Vinhibit_redisplay = Qt; + /* If we are controlling the terminal, reset terminal modes. */ #ifdef EMACS_HAVE_TTY_PGRP { diff --git a/src/eval.c b/src/eval.c index 0326a828a81..096755f9c77 100644 --- a/src/eval.c +++ b/src/eval.c @@ -617,6 +617,7 @@ usage: (defun NAME ARGLIST [DOCSTRING] BODY...) */) register Lisp_Object defn; fn_name = Fcar (args); + CHECK_SYMBOL (fn_name); defn = Fcons (Qlambda, Fcdr (args)); if (!NILP (Vpurify_flag)) defn = Fpurecopy (defn); @@ -1220,7 +1221,7 @@ VAR may be nil; then you do not get access to the signal information. The value of the last BODY form is returned from the condition-case. See also the function `signal' for more info. -usage: (condition-case VAR BODYFORM HANDLERS...) */) +usage: (condition-case VAR BODYFORM &rest HANDLERS) */) (args) Lisp_Object args; { @@ -1235,10 +1236,10 @@ usage: (condition-case VAR BODYFORM HANDLERS...) */) handlers = Fcdr (Fcdr (args)); CHECK_SYMBOL (var); - for (val = handlers; ! NILP (val); val = Fcdr (val)) + for (val = handlers; CONSP (val); val = XCDR (val)) { Lisp_Object tem; - tem = Fcar (val); + tem = XCAR (val); if (! (NILP (tem) || (CONSP (tem) && (SYMBOLP (XCAR (tem)) @@ -3243,6 +3244,25 @@ If NFRAMES is more than the number of frames, the value is nil. */) void +mark_backtrace () +{ + register struct backtrace *backlist; + register int i; + + for (backlist = backtrace_list; backlist; backlist = backlist->next) + { + mark_object (*backlist->function); + + if (backlist->nargs == UNEVALLED || backlist->nargs == MANY) + i = 0; + else + i = backlist->nargs - 1; + for (; i >= 0; i--) + mark_object (backlist->args[i]); + } +} + +void syms_of_eval () { DEFVAR_INT ("max-specpdl-size", &max_specpdl_size, diff --git a/src/fileio.c b/src/fileio.c index 722370ea5ce..42f3949c917 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,5 +1,5 @@ /* File IO for GNU Emacs. - Copyright (C) 1985,86,87,88,93,94,95,96,97,98,99,2000,01,2003 + Copyright (C) 1985,86,87,88,93,94,95,96,97,98,99,2000,01,03,2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -324,6 +324,7 @@ Lisp_Object Qfile_regular_p; Lisp_Object Qfile_accessible_directory_p; Lisp_Object Qfile_modes; Lisp_Object Qset_file_modes; +Lisp_Object Qset_file_times; Lisp_Object Qfile_newer_than_file_p; Lisp_Object Qinsert_file_contents; Lisp_Object Qwrite_region; @@ -2349,7 +2350,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick) /* stat is a good way to tell whether the file exists, regardless of what access permissions it has. */ - if (stat (SDATA (encoded_filename), &statbuf) >= 0) + if (lstat (SDATA (encoded_filename), &statbuf) >= 0) { if (! interactive) Fsignal (Qfile_already_exists, @@ -2684,11 +2685,11 @@ This is what happens in interactive use with M-x. */) Lisp_Object args[2]; #endif Lisp_Object handler; - struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; - Lisp_Object encoded_file, encoded_newname; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; + Lisp_Object encoded_file, encoded_newname, symlink_target; - encoded_file = encoded_newname = Qnil; - GCPRO4 (file, newname, encoded_file, encoded_newname); + symlink_target = encoded_file = encoded_newname = Qnil; + GCPRO5 (file, newname, encoded_file, encoded_newname, symlink_target); CHECK_STRING (file); CHECK_STRING (newname); file = Fexpand_file_name (file, Qnil); @@ -2725,10 +2726,17 @@ This is what happens in interactive use with M-x. */) { if (errno == EXDEV) { - Fcopy_file (file, newname, - /* We have already prompted if it was an integer, - so don't have copy-file prompt again. */ - NILP (ok_if_already_exists) ? Qnil : Qt, Qt); +#ifdef S_IFLNK + symlink_target = Ffile_symlink_p (file); + if (! NILP (symlink_target)) + Fmake_symbolic_link (symlink_target, newname, + NILP (ok_if_already_exists) ? Qnil : Qt); + else +#endif + Fcopy_file (file, newname, + /* We have already prompted if it was an integer, + so don't have copy-file prompt again. */ + NILP (ok_if_already_exists) ? Qnil : Qt, Qt); Fdelete_file (file); } else @@ -3439,7 +3447,59 @@ The value is an integer. */) XSETINT (value, (~ realmask) & 0777); return value; } + +extern int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); + +DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0, + doc: /* Set times of file FILENAME to TIME. +Set both access and modification times. +Return t on success, else nil. +Use the current time if TIME is nil. TIME is in the format of +`current-time'. */) + (filename, time) + Lisp_Object filename, time; +{ + Lisp_Object absname, encoded_absname; + Lisp_Object handler; + time_t sec; + int usec; + + if (! lisp_time_argument (time, &sec, &usec)) + error ("Invalid time specification"); + + absname = Fexpand_file_name (filename, current_buffer->directory); + + /* If the file name has special constructs in it, + call the corresponding file handler. */ + handler = Ffind_file_name_handler (absname, Qset_file_times); + if (!NILP (handler)) + return call3 (handler, Qset_file_times, absname, time); + + encoded_absname = ENCODE_FILE (absname); + + { + EMACS_TIME t; + + EMACS_SET_SECS (t, sec); + EMACS_SET_USECS (t, usec); + + if (set_file_times (SDATA (encoded_absname), t, t)) + { +#ifdef DOS_NT + struct stat st; + + /* Setting times on a directory always fails. */ + if (stat (SDATA (encoded_absname), &st) == 0 + && (st.st_mode & S_IFMT) == S_IFDIR) + return Qnil; +#endif + report_file_error ("Setting file times", Fcons (absname, Qnil)); + return Qnil; + } + } + return Qt; +} #ifdef __NetBSD__ #define unix 42 @@ -6051,10 +6111,13 @@ provides a file dialog box. */) if (NILP (dir)) dir = current_buffer->directory; + if (NILP (Ffile_name_absolute_p (dir))) + dir = Fexpand_file_name (dir, Qnil); if (NILP (default_filename)) - default_filename = !NILP (initial) - ? Fexpand_file_name (initial, dir) - : current_buffer->filename; + default_filename + = (!NILP (initial) + ? Fexpand_file_name (initial, dir) + : current_buffer->filename); /* If dir starts with user's homedir, change that to ~. */ homedir = (char *) egetenv ("HOME"); @@ -6255,6 +6318,7 @@ syms_of_fileio () Qfile_accessible_directory_p = intern ("file-accessible-directory-p"); Qfile_modes = intern ("file-modes"); Qset_file_modes = intern ("set-file-modes"); + Qset_file_times = intern ("set-file-times"); Qfile_newer_than_file_p = intern ("file-newer-than-file-p"); Qinsert_file_contents = intern ("insert-file-contents"); Qwrite_region = intern ("write-region"); @@ -6288,6 +6352,7 @@ syms_of_fileio () staticpro (&Qfile_accessible_directory_p); staticpro (&Qfile_modes); staticpro (&Qset_file_modes); + staticpro (&Qset_file_times); staticpro (&Qfile_newer_than_file_p); staticpro (&Qinsert_file_contents); staticpro (&Qwrite_region); @@ -6511,6 +6576,7 @@ a non-nil value. */); defsubr (&Sfile_regular_p); defsubr (&Sfile_modes); defsubr (&Sset_file_modes); + defsubr (&Sset_file_times); defsubr (&Sset_default_file_modes); defsubr (&Sdefault_file_modes); defsubr (&Sfile_newer_than_file_p); diff --git a/src/fns.c b/src/fns.c index 017f8124013..5e20687494c 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1,5 +1,5 @@ /* Random utility Lisp functions. - Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 99, 2000, 2001, 02, 2003 + Copyright (C) 1985, 86, 87, 93, 94, 95, 97, 98, 99, 2000, 2001, 02, 03, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -473,7 +473,8 @@ with the original. */) { Lisp_Object val; int size_in_chars - = (XBOOL_VECTOR (arg)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; + = ((XBOOL_VECTOR (arg)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); val = Fmake_bool_vector (Flength (arg), Qnil); bcopy (XBOOL_VECTOR (arg)->data, XBOOL_VECTOR (val)->data, @@ -486,29 +487,6 @@ with the original. */) return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0); } -#if 0 /* unused */ -/* In string STR of length LEN, see if bytes before STR[I] combine - with bytes after STR[I] to form a single character. If so, return - the number of bytes after STR[I] which combine in this way. - Otherwize, return 0. */ - -static int -count_combining (str, len, i) - unsigned char *str; - int len, i; -{ - int j = i - 1, bytes; - - if (i == 0 || i == len || CHAR_HEAD_P (str[i])) - return 0; - while (j >= 0 && !CHAR_HEAD_P (str[j])) j--; - if (j < 0 || ! BASE_LEADING_CODE_P (str[j])) - return 0; - PARSE_MULTIBYTE_SEQ (str + j, len - j, bytes); - return (bytes <= i - j ? 0 : bytes - (i - j)); -} -#endif - /* This structure holds information of an argument of `concat' that is a string and has text properties to be copied. */ struct textprop_rec @@ -682,6 +660,7 @@ concat (nargs, args, target_type, last_special) } toindex_byte += thislen_byte; toindex += thisleni; + STRING_SET_CHARS (val, SCHARS (val)); } /* Copy a single-byte string to a multibyte string. */ else if (STRINGP (this) && STRINGP (val)) @@ -735,8 +714,8 @@ concat (nargs, args, target_type, last_special) else if (BOOL_VECTOR_P (this)) { int byte; - byte = XBOOL_VECTOR (this)->data[thisindex / BITS_PER_CHAR]; - if (byte & (1 << (thisindex % BITS_PER_CHAR))) + byte = XBOOL_VECTOR (this)->data[thisindex / BOOL_VECTOR_BITS_PER_CHAR]; + if (byte & (1 << (thisindex % BOOL_VECTOR_BITS_PER_CHAR))) elt = Qt; else elt = Qnil; @@ -993,16 +972,24 @@ string_make_unibyte (string) Lisp_Object string; { unsigned char *buf; + Lisp_Object ret; if (! STRING_MULTIBYTE (string)) return string; - buf = (unsigned char *) alloca (SCHARS (string)); + /* We can not use alloca here, because string might be very long. + For example when selecting megabytes of text and then pasting it to + another application. */ + buf = (unsigned char *) xmalloc (SCHARS (string)); copy_text (SDATA (string), buf, SBYTES (string), 1, 0); - return make_unibyte_string (buf, SCHARS (string)); + ret = make_unibyte_string (buf, SCHARS (string)); + + xfree (buf); + + return ret; } DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, @@ -1475,7 +1462,7 @@ assq_no_quit (key, list) DEFUN ("assoc", Fassoc, Sassoc, 2, 2, 0, doc: /* Return non-nil if KEY is `equal' to the car of an element of LIST. The value is actually the first element of LIST whose car equals KEY. */) - (key, list) + (key, list) Lisp_Object key, list; { Lisp_Object result, car; @@ -2050,6 +2037,18 @@ The PLIST is modified by side effects. */) return plist; } +DEFUN ("eql", Feql, Seql, 2, 2, 0, + doc: /* Return t if the two args are the same Lisp object. +Floating-point numbers of equal value are `eql', but they may not be `eq'. */) + (obj1, obj2) + Lisp_Object obj1, obj2; +{ + if (FLOATP (obj1)) + return internal_equal (obj1, obj2, 0, 0) ? Qt : Qnil; + else + return EQ (obj1, obj2) ? Qt : Qnil; +} + DEFUN ("equal", Fequal, Sequal, 2, 2, 0, doc: /* Return t if two Lisp objects have similar structure and contents. They must have the same data type. @@ -2148,7 +2147,8 @@ internal_equal (o1, o2, depth, props) if (BOOL_VECTOR_P (o1)) { int size_in_chars - = (XBOOL_VECTOR (o1)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; + = ((XBOOL_VECTOR (o1)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size) return 0; @@ -2260,7 +2260,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */) { register unsigned char *p = XBOOL_VECTOR (array)->data; int size_in_chars - = (XBOOL_VECTOR (array)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; + = ((XBOOL_VECTOR (array)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); charval = (! NILP (item) ? -1 : 0); for (index = 0; index < size_in_chars - 1; index++) @@ -2268,8 +2269,8 @@ ARRAY is a vector, string, char-table, or bool-vector. */) if (index < size_in_chars) { /* Mask out bits beyond the vector size. */ - if (XBOOL_VECTOR (array)->size % BITS_PER_CHAR) - charval &= (1 << (XBOOL_VECTOR (array)->size % BITS_PER_CHAR)) - 1; + if (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR) + charval &= (1 << (XBOOL_VECTOR (array)->size % BOOL_VECTOR_BITS_PER_CHAR)) - 1; p[index] = charval; } } @@ -2398,8 +2399,8 @@ mapcar1 (leni, vals, fn, seq) for (i = 0; i < leni; i++) { int byte; - byte = XBOOL_VECTOR (seq)->data[i / BITS_PER_CHAR]; - if (byte & (1 << (i % BITS_PER_CHAR))) + byte = XBOOL_VECTOR (seq)->data[i / BOOL_VECTOR_BITS_PER_CHAR]; + if (byte & (1 << (i % BOOL_VECTOR_BITS_PER_CHAR))) dummy = Qt; else dummy = Qnil; @@ -5203,6 +5204,7 @@ used if both `use-dialog-box' and this variable are non-nil. */); defsubr (&Sput); defsubr (&Slax_plist_get); defsubr (&Slax_plist_put); + defsubr (&Seql); defsubr (&Sequal); defsubr (&Sequal_including_properties); defsubr (&Sfillarray); diff --git a/src/fontset.c b/src/fontset.c index 4212a40541e..016c62f0e50 100644 --- a/src/fontset.c +++ b/src/fontset.c @@ -1712,7 +1712,10 @@ If the named font is not yet loaded, return nil. */) /* Return a cons (FONT-NAME . GLYPH-CODE). FONT-NAME is the font name for the character at POSITION in the current buffer. This is computed from all the text properties and overlays - that apply to POSITION. + that apply to POSITION. POSTION may be nil, in which case, + FONT-NAME is the font name for display the character CH with the + default face. + GLYPH-CODE is the glyph code in the font to use for the character. If the 2nd optional arg CH is non-nil, it is a character to check @@ -1725,7 +1728,8 @@ If the named font is not yet loaded, return nil. */) (2) The character code is invalid. - (3) The current buffer is not displayed in any window. + (3) If POSITION is not nil, and the current buffer is not displayed + in any window. In addition, the returned font name may not take into account of such redisplay engine hooks as what used in jit-lock-mode if @@ -1740,39 +1744,53 @@ DEFUN ("internal-char-font", Finternal_char_font, Sinternal_char_font, 1, 2, 0, int pos, pos_byte, dummy; int face_id; int c; - Lisp_Object window; - struct window *w; struct frame *f; struct face *face; Lisp_Object charset, rfont_def; - int charset_id; - - CHECK_NUMBER_COERCE_MARKER (position); - pos = XINT (position); - if (pos < BEGV || pos >= ZV) - args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); - pos_byte = CHAR_TO_BYTE (pos); - if (NILP (ch)) - c = FETCH_CHAR (pos_byte); - else + int id; + + if (NILP (position)) { CHECK_CHARACTER (ch); c = XINT (ch); + f = XFRAME (selected_frame); + face_id = DEFAULT_FACE_ID; + pos = -1; + } + else + { + Lisp_Object window; + struct window *w; + + CHECK_NUMBER_COERCE_MARKER (position); + pos = XINT (position); + if (pos < BEGV || pos >= ZV) + args_out_of_range_3 (position, make_number (BEGV), make_number (ZV)); + pos_byte = CHAR_TO_BYTE (pos); + if (NILP (ch)) + c = FETCH_CHAR (pos_byte); + else + { + CHECK_NATNUM (ch); + c = XINT (ch); + } + window = Fget_buffer_window (Fcurrent_buffer (), Qnil); + if (NILP (window)) + return Qnil; + w = XWINDOW (window); + f = XFRAME (w->frame); + face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0); } - window = Fget_buffer_window (Fcurrent_buffer (), Qnil); - if (NILP (window)) + if (! CHAR_VALID_P (c, 0)) return Qnil; - w = XWINDOW (window); - f = XFRAME (w->frame); - face_id = face_at_buffer_position (w, pos, -1, -1, &dummy, pos + 100, 0); + face_id = FACE_FOR_CHAR (f, FACE_FROM_ID (f, face_id), c, pos, Qnil); face = FACE_FROM_ID (f, face_id); charset = Fget_char_property (position, Qcharset, Qnil); if (CHARSETP (charset)) - charset_id = XINT (CHARSET_SYMBOL_ID (charset)); + id = XINT (CHARSET_SYMBOL_ID (charset)); else - charset_id = -1; - rfont_def = fontset_font (FONTSET_FROM_ID (face->fontset), - c, face, charset_id); + id = -1; + rfont_def = fontset_font (FONTSET_FROM_ID (face->fontset), c, face, id); if (VECTORP (rfont_def) && STRINGP (AREF (rfont_def, 3))) { Lisp_Object font_def; diff --git a/src/gtkutil.c b/src/gtkutil.c index 4d0b50573f7..84aa9f46d4d 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -229,23 +229,100 @@ xg_create_default_cursor (dpy) return gdk_cursor_new_for_display (gdpy, GDK_LEFT_PTR); } -/* For the image defined in IMG, make and return a GdkPixmap for - the pixmap in *GPIX, and a GdkBitmap for the mask in *GMASK. - If IMG has no mask, *GMASK is set to NULL. - The image is defined on the display where frame F is. */ -static void -xg_get_gdk_pixmap_and_mask (f, img, gpix, gmask) +/* For the image defined in IMG, make and return a GtkImage. For displays with + 8 planes or less we must make a GdkPixbuf and apply the mask manually. + Otherwise the highlightning and dimming the tool bar code in GTK does + will look bad. For display with more than 8 planes we just use the + pixmap and mask directly. For monochrome displays, GTK doesn't seem + able to use external pixmaps, it looks bad whatever we do. + The image is defined on the display where frame F is. + WIDGET is used to find the GdkColormap to use for the GdkPixbuf. + If OLD_WIDGET is NULL, a new widget is constructed and returned. + If OLD_WIDGET is not NULL, that widget is modified. */ +static GtkWidget * +xg_get_image_for_pixmap (f, img, widget, old_widget) FRAME_PTR f; struct image *img; - GdkPixmap **gpix; - GdkBitmap **gmask; + GtkWidget *widget; + GtkImage *old_widget; { + GdkPixmap *gpix; + GdkPixmap *gmask; GdkDisplay *gdpy = gdk_x11_lookup_xdisplay (FRAME_X_DISPLAY (f)); - *gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); - *gmask = img->mask ? - (GdkBitmap*) gdk_pixmap_foreign_new_for_display (gdpy, img->mask) - : 0; + gpix = gdk_pixmap_foreign_new_for_display (gdpy, img->pixmap); + gmask = img->mask ? gdk_pixmap_foreign_new_for_display (gdpy, img->mask) : 0; + + if (x_screen_planes (f) > 8 || x_screen_planes (f) == 1) + { + if (! old_widget) + old_widget = GTK_IMAGE (gtk_image_new_from_pixmap (gpix, gmask)); + else + gtk_image_set_from_pixmap (old_widget, gpix, gmask); + } + else + { + int x, y, width, height, rowstride, mask_rowstride; + GdkPixbuf *icon_buf, *tmp_buf; + guchar *pixels; + guchar *mask_pixels; + + gdk_drawable_get_size (gpix, &width, &height); + tmp_buf = gdk_pixbuf_get_from_drawable (NULL, + gpix, + gtk_widget_get_colormap (widget), + 0, 0, 0, 0, width, height); + icon_buf = gdk_pixbuf_add_alpha (tmp_buf, FALSE, 0, 0, 0); + g_object_unref (G_OBJECT (tmp_buf)); + + if (gmask) + { + GdkPixbuf *mask_buf = gdk_pixbuf_get_from_drawable (NULL, + gmask, + NULL, + 0, 0, 0, 0, + width, height); + guchar *pixels = gdk_pixbuf_get_pixels (icon_buf); + guchar *mask_pixels = gdk_pixbuf_get_pixels (mask_buf); + int rowstride = gdk_pixbuf_get_rowstride (icon_buf); + int mask_rowstride = gdk_pixbuf_get_rowstride (mask_buf); + int y; + + for (y = 0; y < height; ++y) + { + guchar *iconptr, *maskptr; + int x; + + iconptr = pixels + y * rowstride; + maskptr = mask_pixels + y * mask_rowstride; + + for (x = 0; x < width; ++x) + { + /* In a bitmap, RGB is either 255/255/255 or 0/0/0. Checking + just R is sufficient. */ + if (maskptr[0] == 0) + iconptr[3] = 0; /* 0, 1, 2 is R, G, B. 3 is alpha. */ + + iconptr += rowstride/width; + maskptr += mask_rowstride/width; + } + } + + g_object_unref (G_OBJECT (gmask)); + g_object_unref (G_OBJECT (mask_buf)); + } + + g_object_unref (G_OBJECT (gpix)); + + if (! old_widget) + old_widget = GTK_IMAGE (gtk_image_new_from_pixbuf (icon_buf)); + else + gtk_image_set_from_pixbuf (old_widget, icon_buf); + + g_object_unref (G_OBJECT (icon_buf)); + } + + return GTK_WIDGET (old_widget); } @@ -2760,18 +2837,16 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, if (wscroll) { GtkWidget *wfixed = f->output_data.x->edit_widget; - int winextra = canon_width > width ? (canon_width - width) / 2 : 0; - int bottom = top + height; - gint slider_width; - int oldtop, oldleft, oldbottom; - GtkRequisition req; + gtk_container_set_reallocate_redraws (GTK_CONTAINER (wfixed), TRUE); - /* Get old values. */ - xg_find_top_left_in_fixed (wscroll, wfixed, &oldleft, &oldtop); - gtk_widget_size_request (wscroll, &req); - oldbottom = oldtop + req.height; + /* Move and resize to new values. */ + gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top); + gtk_widget_set_size_request (wscroll, width, height); + /* Must force out update so changed scroll bars gets redrawn. */ + gdk_window_process_all_updates (); + /* Scroll bars in GTK has a fixed width, so if we say width 16, it will only be its fixed width (14 is default) anyway, the rest is blank. We are drawing the mode line across scroll bars when @@ -2799,62 +2874,7 @@ xg_update_scrollbar_pos (f, scrollbar_id, top, left, width, height, the scroll bar and the edge of the window and between the scroll bar and the fringe. */ - if (oldtop != -1 && oldleft != -1) - { - int gtkextral, gtkextrah; - int xl, xr, wbl, wbr; - int bottomdiff, topdiff; - - gtk_widget_style_get (wscroll, "slider_width", &slider_width, NULL); - gtkextral = width > slider_width ? (width - slider_width) / 2 : 0; - gtkextrah = gtkextral ? (width - slider_width - gtkextral) : 0; - - xl = real_left; - wbl = gtkextral + winextra; - wbr = gtkextrah + winextra; - xr = left + gtkextral + slider_width; - bottomdiff = abs (oldbottom - bottom); - topdiff = abs (oldtop - top); - - if (oldleft != left) - { - gdk_window_clear_area (wfixed->window, xl, top, wbl, height); - gdk_window_clear_area (wfixed->window, xr, top, wbr, height); - } - - if (oldtop > top) - { - gdk_window_clear_area (wfixed->window, xl, top, wbl, topdiff); - gdk_window_clear_area (wfixed->window, xr, top, wbr, topdiff); - } - else if (oldtop < top) - { - gdk_window_clear_area (wfixed->window, xl, oldtop, wbl, topdiff); - gdk_window_clear_area (wfixed->window, xr, oldtop, wbr, topdiff); - } - - if (oldbottom > bottom) - { - gdk_window_clear_area (wfixed->window, xl, bottom, wbl, - bottomdiff); - gdk_window_clear_area (wfixed->window, xr, bottom, wbr, - bottomdiff); - } - else if (oldbottom < bottom) - { - gdk_window_clear_area (wfixed->window, xl, oldbottom, wbl, - bottomdiff); - gdk_window_clear_area (wfixed->window, xr, oldbottom, wbr, - bottomdiff); - } - } - - /* Move and resize to new values. */ - gtk_fixed_move (GTK_FIXED (wfixed), wscroll, left, top); - gtk_widget_set_size_request (wscroll, width, height); - - /* Must force out update so changed scroll bars gets redrawn. */ - gdk_window_process_all_updates (); + XClearWindow (FRAME_X_DISPLAY (f), GTK_WIDGET_TO_X_WIN (wscroll)); SET_FRAME_GARBAGED (f); cancel_mouse_face (f); @@ -3262,12 +3282,8 @@ update_frame_tool_bar (f) if (! wicon) { - GdkPixmap *gpix; - GdkBitmap *gmask; - GtkWidget *w; + GtkWidget *w = xg_get_image_for_pixmap (f, img, x->widget, NULL); - xg_get_gdk_pixmap_and_mask (f, img, &gpix, &gmask); - w = gtk_image_new_from_pixmap (gpix, gmask); gtk_toolbar_append_item (GTK_TOOLBAR (x->toolbar_widget), 0, 0, 0, w, @@ -3324,13 +3340,7 @@ update_frame_tool_bar (f) g_list_free (chlist); if (old_img != img->pixmap) - { - GdkPixmap *gpix; - GdkBitmap *gmask; - - xg_get_gdk_pixmap_and_mask (f, img, &gpix, &gmask); - gtk_image_set_from_pixmap (wimage, gpix, gmask); - } + (void) xg_get_image_for_pixmap (f, img, x->widget, wimage); g_object_set_data (G_OBJECT (wimage), XG_TOOL_BAR_IMAGE_DATA, (gpointer)img->pixmap); diff --git a/src/image.c b/src/image.c index 34db5e53367..438e132807f 100644 --- a/src/image.c +++ b/src/image.c @@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */ #include <signal.h> #include <stdio.h> #include <math.h> +#include <ctype.h> #ifdef HAVE_UNISTD_H #include <unistd.h> @@ -51,7 +52,6 @@ Boston, MA 02111-1307, USA. */ typedef struct x_bitmap_record Bitmap_Record; #define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y) #define NO_PIXMAP None -#define PNG_BG_COLOR_SHIFT 0 #define RGB_PIXEL_COLOR unsigned long @@ -69,7 +69,6 @@ typedef struct x_bitmap_record Bitmap_Record; typedef struct w32_bitmap_record Bitmap_Record; #define GET_PIXEL(ximg, x, y) GetPixel(ximg, x, y) #define NO_PIXMAP 0 -#define PNG_BG_COLOR_SHIFT 0 #define RGB_PIXEL_COLOR COLORREF @@ -104,7 +103,6 @@ typedef struct mac_bitmap_record Bitmap_Record; #define GET_PIXEL(ximg, x, y) XGetPixel(ximg, x, y) #define NO_PIXMAP 0 -#define PNG_BG_COLOR_SHIFT 8 #define RGB_PIXEL_COLOR unsigned long @@ -177,14 +175,19 @@ XPutPixel (ximage, x, y, pixel) int x, y; unsigned long pixel; { + CGrafPtr old_port; + GDHandle old_gdh; RGBColor color; + GetGWorld (&old_port, &old_gdh); SetGWorld (ximage, NULL); color.red = RED16_FROM_ULONG (pixel); color.green = GREEN16_FROM_ULONG (pixel); color.blue = BLUE16_FROM_ULONG (pixel); SetCPixel (x, y, &color); + + SetGWorld (old_port, old_gdh); } static unsigned long @@ -192,11 +195,16 @@ XGetPixel (ximage, x, y) XImagePtr ximage; int x, y; { + CGrafPtr old_port; + GDHandle old_gdh; RGBColor color; + GetGWorld (&old_port, &old_gdh); SetGWorld (ximage, NULL); GetCPixel (x, y, &color); + + SetGWorld (old_port, old_gdh); return RGB_TO_ULONG (color.red >> 8, color.green >> 8, color.blue >> 8); } @@ -206,7 +214,7 @@ XDestroyImage (ximg) { UnlockPixels (GetGWorldPixMap (ximg)); } -#endif +#endif /* MAC_OS */ /* Functions to access the contents of a bitmap, given an id. */ @@ -598,6 +606,14 @@ x_create_bitmap_mask (f, id) static struct image_type *image_types; +/* A list of symbols, one for each supported image type. */ + +Lisp_Object Vimage_types; + +/* Cache for delayed-loading image types. */ + +static Lisp_Object Vimage_type_cache; + /* The symbol `xbm' which is used as the type symbol for XBM images. */ Lisp_Object Qxbm; @@ -622,7 +638,7 @@ Lisp_Object Vimage_cache_eviction_delay; /* Function prototypes. */ -static void define_image_type P_ ((struct image_type *type)); +static Lisp_Object define_image_type P_ ((struct image_type *type, int loaded)); static struct image_type *lookup_image_type P_ ((Lisp_Object symbol)); static void image_error P_ ((char *format, Lisp_Object, Lisp_Object)); static void x_laplace P_ ((struct frame *, struct image *)); @@ -630,21 +646,37 @@ static void x_emboss P_ ((struct frame *, struct image *)); static int x_build_heuristic_mask P_ ((struct frame *, struct image *, Lisp_Object)); +#define CACHE_IMAGE_TYPE(type, status) \ + do { Vimage_type_cache = Fcons (Fcons (type, status), Vimage_type_cache); } while (0) + +#define ADD_IMAGE_TYPE(type) \ + do { Vimage_types = Fcons (type, Vimage_types); } while (0) /* Define a new image type from TYPE. This adds a copy of TYPE to - image_types and adds the symbol *TYPE->type to Vimage_types. */ + image_types and caches the loading status of TYPE. */ -static void -define_image_type (type) +static Lisp_Object +define_image_type (type, loaded) struct image_type *type; + int loaded; { - /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. - The initialized data segment is read-only. */ - struct image_type *p = (struct image_type *) xmalloc (sizeof *p); - bcopy (type, p, sizeof *p); - p->next = image_types; - image_types = p; - Vimage_types = Fcons (*p->type, Vimage_types); + Lisp_Object success; + + if (!loaded) + success = Qnil; + else + { + /* Make a copy of TYPE to avoid a bus error in a dumped Emacs. + The initialized data segment is read-only. */ + struct image_type *p = (struct image_type *) xmalloc (sizeof *p); + bcopy (type, p, sizeof *p); + p->next = image_types; + image_types = p; + success = Qt; + } + + CACHE_IMAGE_TYPE(*type->type, success); + return success; } @@ -657,6 +689,10 @@ lookup_image_type (symbol) { struct image_type *type; + /* We must initialize the image-type if it hasn't been already. */ + if (NILP (Finit_image_library (symbol))) + return 0; /* unimplemented */ + for (type = image_types; type; type = type->next) if (EQ (symbol, *type->type)) break; @@ -1079,13 +1115,21 @@ prepare_image_for_display (f, img) drawn in face FACE. */ int -image_ascent (img, face) +image_ascent (img, face, slice) struct image *img; struct face *face; + struct glyph_slice *slice; { - int height = img->height + img->vmargin; + int height; int ascent; + if (slice->height == img->height) + height = img->height + img->vmargin; + else if (slice->y == 0) + height = slice->height + img->vmargin; + else + height = slice->height; + if (img->ascent == CENTERED_IMAGE_ASCENT) { if (face->font) @@ -1172,7 +1216,7 @@ four_corners_best (ximg, width, height) /* Return the `background' field of IMG. If IMG doesn't have one yet, it is guessed heuristically. If non-zero, XIMG is an existing XImage object (or device context with the image selected on W32) to - use for the heuristic. */ + use for the heuristic. */ RGB_PIXEL_COLOR image_background (img, f, ximg) @@ -1205,7 +1249,7 @@ image_background (img, f, ximg) if (free_ximg) Destroy_Image (ximg, prev); - + img->background_valid = 1; } @@ -1581,6 +1625,11 @@ lookup_image (f, spec) Lisp_Object spec; { struct image_cache *c = FRAME_X_IMAGE_CACHE (f); +#ifdef _MSC_VER + /* Work around a problem with MinGW builds of graphics libraries + not honoring calling conventions. */ + static +#endif struct image *img; int i; unsigned hash; @@ -1768,6 +1817,33 @@ forall_images_in_image_cache (f, fn) if (!fn_##func) return 0; \ } +/* Load a DLL implementing an image type. + The `image-library-alist' variable associates a symbol, + identifying an image type, to a list of possible filenames. + The function returns NULL if no library could be loaded for + the given image type, or if the library was previously loaded; + else the handle of the DLL. */ +static HMODULE +w32_delayed_load (Lisp_Object libraries, Lisp_Object type) +{ + HMODULE library = NULL; + + if (CONSP (libraries) && NILP (Fassq (type, Vimage_type_cache))) + { + Lisp_Object dlls = Fassq (type, libraries); + + if (CONSP (dlls)) + for (dlls = XCDR (dlls); CONSP (dlls); dlls = XCDR (dlls)) + { + CHECK_STRING_CAR (dlls); + if (library = LoadLibrary (SDATA (XCAR (dlls)))) + break; + } + } + + return library; +} + #endif /* HAVE_NTGUI */ static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int, @@ -2191,6 +2267,10 @@ image_load_qt_1 (f, img, type, fss, dh) goto error; if (draw_all_pixels != graphicsImporterDrawsAllPixels) { + CGrafPtr old_port; + GDHandle old_gdh; + + GetGWorld (&old_port, &old_gdh); SetGWorld (ximg, NULL); bg_color.red = color.red; bg_color.green = color.green; @@ -2202,6 +2282,7 @@ image_load_qt_1 (f, img, type, fss, dh) #else EraseRect (&(ximg->portRect)); #endif + SetGWorld (old_port, old_gdh); } GraphicsImportSetGWorld (gi, ximg, NULL); GraphicsImportDraw (gi); @@ -2990,7 +3071,7 @@ xbm_load_image (f, img, contents, end) non_default_colors = 1; } - Create_Pixmap_From_Bitmap_Data (f, img, data, + Create_Pixmap_From_Bitmap_Data (f, img, data, foreground, background, non_default_colors); xfree (data); @@ -3164,28 +3245,36 @@ xbm_load (f, img) XPM images ***********************************************************************/ -#ifdef HAVE_XPM +#if defined (HAVE_XPM) || defined (MAC_OS) static int xpm_image_p P_ ((Lisp_Object object)); static int xpm_load P_ ((struct frame *f, struct image *img)); static int xpm_valid_color_symbols_p P_ ((Lisp_Object)); +#endif /* HAVE_XPM || MAC_OS */ + +#ifdef HAVE_XPM #ifdef HAVE_NTGUI /* Indicate to xpm.h that we don't have Xlib. */ #define FOR_MSW /* simx.h in xpm defines XColor and XImage differently than Emacs. */ +/* It also defines Display the same way as Emacs, but gcc 3.3 still barfs. */ #define XColor xpm_XColor #define XImage xpm_XImage +#define Display xpm_Display #define PIXEL_ALREADY_TYPEDEFED #include "X11/xpm.h" #undef FOR_MSW #undef XColor #undef XImage +#undef Display #undef PIXEL_ALREADY_TYPEDEFED #else #include "X11/xpm.h" #endif /* HAVE_NTGUI */ +#endif /* HAVE_XPM */ +#if defined (HAVE_XPM) || defined (MAC_OS) /* The symbol `xpm' identifying XPM-format images. */ Lisp_Object Qxpm; @@ -3455,13 +3544,12 @@ DEF_IMGLIB_FN (XpmCreateImageFromBuffer); DEF_IMGLIB_FN (XpmReadFileToImage); DEF_IMGLIB_FN (XImageFree); - static int -init_xpm_functions (void) +init_xpm_functions (Lisp_Object libraries) { HMODULE library; - if (!(library = LoadLibrary ("libXpm.dll"))) + if (!(library = w32_delayed_load (libraries, Qxpm))) return 0; LOAD_IMGLIB_FN (library, XpmFreeAttributes); @@ -3513,10 +3601,13 @@ xpm_image_p (object) || xpm_valid_color_symbols_p (fmt[XPM_COLOR_SYMBOLS].value))); } +#endif /* HAVE_XPM || MAC_OS */ /* Load image IMG which will be displayed on frame F. Value is non-zero if successful. */ +#ifdef HAVE_XPM + static int xpm_load (f, img) struct frame *f; @@ -3748,6 +3839,467 @@ xpm_load (f, img) #endif /* HAVE_XPM */ +#ifdef MAC_OS + +/* XPM support functions for Mac OS where libxpm is not available. + Only XPM version 3 (without any extensions) is supported. */ + +static int xpm_scan P_ ((unsigned char **, unsigned char *, + unsigned char **, int *)); +static Lisp_Object xpm_make_color_table_v + P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), + Lisp_Object (**) (Lisp_Object, unsigned char *, int))); +static void xpm_put_color_table_v P_ ((Lisp_Object, unsigned char *, + int, Lisp_Object)); +static Lisp_Object xpm_get_color_table_v P_ ((Lisp_Object, + unsigned char *, int)); +static Lisp_Object xpm_make_color_table_h + P_ ((void (**) (Lisp_Object, unsigned char *, int, Lisp_Object), + Lisp_Object (**) (Lisp_Object, unsigned char *, int))); +static void xpm_put_color_table_h P_ ((Lisp_Object, unsigned char *, + int, Lisp_Object)); +static Lisp_Object xpm_get_color_table_h P_ ((Lisp_Object, + unsigned char *, int)); +static int xpm_str_to_color_key P_ ((char *)); +static int xpm_load_image P_ ((struct frame *, struct image *, + unsigned char *, unsigned char *)); + +/* Tokens returned from xpm_scan. */ + +enum xpm_token +{ + XPM_TK_IDENT = 256, + XPM_TK_STRING, + XPM_TK_EOF +}; + +/* Scan an XPM data and return a character (< 256) or a token defined + by enum xpm_token above. *S and END are the start (inclusive) and + the end (exclusive) addresses of the data, respectively. Advance + *S while scanning. If token is either XPM_TK_IDENT or + XPM_TK_STRING, *BEG and *LEN are set to the start address and the + length of the corresponding token, respectively. */ + +static int +xpm_scan (s, end, beg, len) + unsigned char **s, *end, **beg; + int *len; +{ + int c; + + while (*s < end) + { + /* Skip white-space. */ + while (*s < end && (c = *(*s)++, isspace (c))) + ; + + /* gnus-pointer.xpm uses '-' in its identifier. + sb-dir-plus.xpm uses '+' in its identifier. */ + if (isalpha (c) || c == '_' || c == '-' || c == '+') + { + *beg = *s - 1; + while (*s < end && + (c = **s, isalnum (c) || c == '_' || c == '-' || c == '+')) + ++*s; + *len = *s - *beg; + return XPM_TK_IDENT; + } + else if (c == '"') + { + *beg = *s; + while (*s < end && **s != '"') + ++*s; + *len = *s - *beg; + if (*s < end) + ++*s; + return XPM_TK_STRING; + } + else if (c == '/') + { + if (*s < end && **s == '*') + { + /* C-style comment. */ + ++*s; + do + { + while (*s < end && *(*s)++ != '*') + ; + } + while (*s < end && **s != '/'); + if (*s < end) + ++*s; + } + else + return c; + } + else + return c; + } + + return XPM_TK_EOF; +} + +/* Functions for color table lookup in XPM data. A Key is a string + specifying the color of each pixel in XPM data. A value is either + an integer that specifies a pixel color, Qt that specifies + transparency, or Qnil for the unspecified color. If the length of + the key string is one, a vector is used as a table. Otherwise, a + hash table is used. */ + +static Lisp_Object +xpm_make_color_table_v (put_func, get_func) + void (**put_func) (Lisp_Object, unsigned char *, int, Lisp_Object); + Lisp_Object (**get_func) (Lisp_Object, unsigned char *, int); +{ + *put_func = xpm_put_color_table_v; + *get_func = xpm_get_color_table_v; + return Fmake_vector (make_number (256), Qnil); +} + +static void +xpm_put_color_table_v (color_table, chars_start, chars_len, color) + Lisp_Object color_table; + unsigned char *chars_start; + int chars_len; + Lisp_Object color; +{ + XVECTOR (color_table)->contents[*chars_start] = color; +} + +static Lisp_Object +xpm_get_color_table_v (color_table, chars_start, chars_len) + Lisp_Object color_table; + unsigned char *chars_start; + int chars_len; +{ + return XVECTOR (color_table)->contents[*chars_start]; +} + +static Lisp_Object +xpm_make_color_table_h (put_func, get_func) + void (**put_func) (Lisp_Object, unsigned char *, int, Lisp_Object); + Lisp_Object (**get_func) (Lisp_Object, unsigned char *, int); +{ + *put_func = xpm_put_color_table_h; + *get_func = xpm_get_color_table_h; + return make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE), + make_float (DEFAULT_REHASH_SIZE), + make_float (DEFAULT_REHASH_THRESHOLD), + Qnil, Qnil, Qnil); +} + +static void +xpm_put_color_table_h (color_table, chars_start, chars_len, color) + Lisp_Object color_table; + unsigned char *chars_start; + int chars_len; + Lisp_Object color; +{ + struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); + unsigned hash_code; + Lisp_Object chars = make_unibyte_string (chars_start, chars_len); + + hash_lookup (table, chars, &hash_code); + hash_put (table, chars, color, hash_code); +} + +static Lisp_Object +xpm_get_color_table_h (color_table, chars_start, chars_len) + Lisp_Object color_table; + unsigned char *chars_start; + int chars_len; +{ + struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); + int i = hash_lookup (table, make_unibyte_string (chars_start, chars_len), + NULL); + + return i >= 0 ? HASH_VALUE (table, i) : Qnil; +} + +enum xpm_color_key { + XPM_COLOR_KEY_S, + XPM_COLOR_KEY_M, + XPM_COLOR_KEY_G4, + XPM_COLOR_KEY_G, + XPM_COLOR_KEY_C +}; + +static char xpm_color_key_strings[][4] = {"s", "m", "g4", "g", "c"}; + +static int +xpm_str_to_color_key (s) + char *s; +{ + int i; + + for (i = 0; + i < sizeof xpm_color_key_strings / sizeof xpm_color_key_strings[0]; + i++) + if (strcmp (xpm_color_key_strings[i], s) == 0) + return i; + return -1; +} + +static int +xpm_load_image (f, img, contents, end) + struct frame *f; + struct image *img; + unsigned char *contents, *end; +{ + unsigned char *s = contents, *beg, *str; + unsigned char buffer[BUFSIZ]; + int width, height, x, y; + int num_colors, chars_per_pixel; + int len, LA1; + void (*put_color_table) (Lisp_Object, unsigned char *, int, Lisp_Object); + Lisp_Object (*get_color_table) (Lisp_Object, unsigned char *, int); + Lisp_Object frame, color_symbols, color_table; + int best_key, have_mask = 0; + XImagePtr ximg = NULL, mask_img = NULL; + +#define match() \ + LA1 = xpm_scan (&s, end, &beg, &len) + +#define expect(TOKEN) \ + if (LA1 != (TOKEN)) \ + goto failure; \ + else \ + match () + +#define expect_ident(IDENT) \ + if (LA1 == XPM_TK_IDENT \ + && strlen ((IDENT)) == len && memcmp ((IDENT), beg, len) == 0) \ + match (); \ + else \ + goto failure + + if (!(end - s >= 9 && memcmp (s, "/* XPM */", 9) == 0)) + goto failure; + s += 9; + match(); + expect_ident ("static"); + expect_ident ("char"); + expect ('*'); + expect (XPM_TK_IDENT); + expect ('['); + expect (']'); + expect ('='); + expect ('{'); + expect (XPM_TK_STRING); + if (len >= BUFSIZ) + goto failure; + memcpy (buffer, beg, len); + buffer[len] = '\0'; + if (sscanf (buffer, "%d %d %d %d", &width, &height, + &num_colors, &chars_per_pixel) != 4 + || width <= 0 || height <= 0 + || num_colors <= 0 || chars_per_pixel <= 0) + goto failure; + expect (','); + + XSETFRAME (frame, f); + if (!NILP (Fxw_display_color_p (frame))) + best_key = XPM_COLOR_KEY_C; + else if (!NILP (Fx_display_grayscale_p (frame))) + best_key = (XFASTINT (Fx_display_planes (frame)) > 2 + ? XPM_COLOR_KEY_G : XPM_COLOR_KEY_G4); + else + best_key = XPM_COLOR_KEY_M; + + color_symbols = image_spec_value (img->spec, QCcolor_symbols, NULL); + if (chars_per_pixel == 1) + color_table = xpm_make_color_table_v (&put_color_table, + &get_color_table); + else + color_table = xpm_make_color_table_h (&put_color_table, + &get_color_table); + + while (num_colors-- > 0) + { + unsigned char *color, *max_color; + int key, next_key, max_key = 0; + Lisp_Object symbol_color = Qnil, color_val; + XColor cdef; + + expect (XPM_TK_STRING); + if (len <= chars_per_pixel || len >= BUFSIZ + chars_per_pixel) + goto failure; + memcpy (buffer, beg + chars_per_pixel, len - chars_per_pixel); + buffer[len - chars_per_pixel] = '\0'; + + str = strtok (buffer, " \t"); + if (str == NULL) + goto failure; + key = xpm_str_to_color_key (str); + if (key < 0) + goto failure; + do + { + color = strtok (NULL, " \t"); + if (color == NULL) + goto failure; + + while (str = strtok (NULL, " \t")) + { + next_key = xpm_str_to_color_key (str); + if (next_key >= 0) + break; + color[strlen (color)] = ' '; + } + + if (key == XPM_COLOR_KEY_S) + { + if (NILP (symbol_color)) + symbol_color = build_string (color); + } + else if (max_key < key && key <= best_key) + { + max_key = key; + max_color = color; + } + key = next_key; + } + while (str); + + color_val = Qnil; + if (!NILP (color_symbols) && !NILP (symbol_color)) + { + Lisp_Object specified_color = Fassoc (symbol_color, color_symbols); + + if (CONSP (specified_color) && STRINGP (XCDR (specified_color))) + if (xstricmp (SDATA (XCDR (specified_color)), "None") == 0) + color_val = Qt; + else if (x_defined_color (f, SDATA (XCDR (specified_color)), + &cdef, 0)) + color_val = make_number (cdef.pixel); + } + if (NILP (color_val) && max_key > 0) + if (xstricmp (max_color, "None") == 0) + color_val = Qt; + else if (x_defined_color (f, max_color, &cdef, 0)) + color_val = make_number (cdef.pixel); + if (!NILP (color_val)) + (*put_color_table) (color_table, beg, chars_per_pixel, color_val); + + expect (','); + } + + if (!x_create_x_image_and_pixmap (f, width, height, 0, + &ximg, &img->pixmap) + || !x_create_x_image_and_pixmap (f, width, height, 1, + &mask_img, &img->mask)) + { + image_error ("Out of memory (%s)", img->spec, Qnil); + goto error; + } + + for (y = 0; y < height; y++) + { + expect (XPM_TK_STRING); + str = beg; + if (len < width * chars_per_pixel) + goto failure; + for (x = 0; x < width; x++, str += chars_per_pixel) + { + Lisp_Object color_val = + (*get_color_table) (color_table, str, chars_per_pixel); + + XPutPixel (ximg, x, y, + (INTEGERP (color_val) ? XINT (color_val) + : FRAME_FOREGROUND_PIXEL (f))); + XPutPixel (mask_img, x, y, + (!EQ (color_val, Qt) ? PIX_MASK_DRAW (f) + : (have_mask = 1, PIX_MASK_RETAIN (f)))); + } + if (y + 1 < height) + expect (','); + } + + img->width = width; + img->height = height; + + x_put_x_image (f, ximg, img->pixmap, width, height); + x_destroy_x_image (ximg); + if (have_mask) + { + x_put_x_image (f, mask_img, img->mask, width, height); + x_destroy_x_image (mask_img); + } + else + { + x_destroy_x_image (mask_img); + Free_Pixmap (FRAME_X_DISPLAY (f), img->mask); + img->mask = NO_PIXMAP; + } + + return 1; + + failure: + image_error ("Invalid XPM file (%s)", img->spec, Qnil); + error: + x_destroy_x_image (ximg); + x_destroy_x_image (mask_img); + x_clear_image (f, img); + return 0; + +#undef match +#undef expect +#undef expect_ident +} + +static int +xpm_load (f, img) + struct frame *f; + struct image *img; +{ + int success_p = 0; + Lisp_Object file_name; + + /* If IMG->spec specifies a file name, create a non-file spec from it. */ + file_name = image_spec_value (img->spec, QCfile, NULL); + if (STRINGP (file_name)) + { + Lisp_Object file; + unsigned char *contents; + int size; + struct gcpro gcpro1; + + file = x_find_image_file (file_name); + GCPRO1 (file); + if (!STRINGP (file)) + { + image_error ("Cannot find image file `%s'", file_name, Qnil); + UNGCPRO; + return 0; + } + + contents = slurp_file (SDATA (file), &size); + if (contents == NULL) + { + image_error ("Error loading XPM image `%s'", img->spec, Qnil); + UNGCPRO; + return 0; + } + + success_p = xpm_load_image (f, img, contents, contents + size); + xfree (contents); + UNGCPRO; + } + else + { + Lisp_Object data; + + data = image_spec_value (img->spec, QCdata, NULL); + success_p = xpm_load_image (f, img, SDATA (data), + SDATA (data) + SBYTES (data)); + } + + return success_p; +} + +#endif /* MAC_OS */ + + /*********************************************************************** Color table @@ -3857,7 +4409,7 @@ lookup_rgb_color (f, r, g, b) /* Assemble the pixel color. */ return pr | pg | pb; } - + for (p = ct_table[i]; p; p = p->next) if (p->r == r && p->g == g && p->b == b) break; @@ -4968,7 +5520,7 @@ pbm_load (f, img) x_destroy_x_image (ximg); /* X and W32 versions did it here, MAC version above. ++kfs - img->width = width; + img->width = width; img->height = height; */ UNGCPRO; @@ -5091,21 +5643,12 @@ DEF_IMGLIB_FN (png_read_end); DEF_IMGLIB_FN (png_error); static int -init_png_functions (void) +init_png_functions (Lisp_Object libraries) { HMODULE library; - /* Ensure zlib is loaded. Try debug version first. */ - if (!LoadLibrary ("zlibd.dll") - && !LoadLibrary ("zlib.dll")) - return 0; - /* Try loading libpng under probable names. */ - if (!(library = LoadLibrary ("libpng13d.dll")) - && !(library = LoadLibrary ("libpng13.dll")) - && !(library = LoadLibrary ("libpng12d.dll")) - && !(library = LoadLibrary ("libpng12.dll")) - && !(library = LoadLibrary ("libpng.dll"))) + if (!(library = w32_delayed_load (libraries, Qpng))) return 0; LOAD_IMGLIB_FN (library, png_get_io_ptr); @@ -5196,6 +5739,12 @@ struct png_memory_storage PNG_PTR is a pointer to the PNG control structure. Copy LENGTH bytes from the input to DATA. */ +#ifdef _MSC_VER + /* Work around a problem with MinGW builds of graphics libraries + not honoring calling conventions. */ +#pragma optimize("g", off) +#endif + static void png_read_from_memory (png_ptr, data, length) png_structp png_ptr; @@ -5212,6 +5761,11 @@ png_read_from_memory (png_ptr, data, length) tbr->index = tbr->index + length; } +#ifdef _MSC_VER +/* Restore normal optimization, as specified on the command line. */ +#pragma optimize("", on) +#endif + /* Load PNG image IMG for use on frame F. Value is non-zero if successful. */ @@ -5412,9 +5966,9 @@ png_load (f, img) png_color_16 user_bg; bzero (&user_bg, sizeof user_bg); - user_bg.red = color.red >> PNG_BG_COLOR_SHIFT; - user_bg.green = color.green >> PNG_BG_COLOR_SHIFT; - user_bg.blue = color.blue >> PNG_BG_COLOR_SHIFT; + user_bg.red = color.red >> 8; + user_bg.green = color.green >> 8; + user_bg.blue = color.blue >> 8; fn_png_set_background (png_ptr, &user_bg, PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); @@ -5438,9 +5992,9 @@ png_load (f, img) x_query_color (f, &color); bzero (&frame_background, sizeof frame_background); - frame_background.red = color.red; - frame_background.green = color.green; - frame_background.blue = color.blue; + frame_background.red = color.red >> 8; + frame_background.green = color.green >> 8; + frame_background.blue = color.blue >> 8; #endif /* HAVE_X_WINDOWS */ #ifdef HAVE_NTGUI @@ -5451,9 +6005,9 @@ png_load (f, img) x_query_color (f, &color); #endif bzero (&frame_background, sizeof frame_background); - frame_background.red = 256 * GetRValue (color); - frame_background.green = 256 * GetGValue (color); - frame_background.blue = 256 * GetBValue (color); + frame_background.red = GetRValue (color); + frame_background.green = GetGValue (color); + frame_background.blue = GetBValue (color); #endif /* HAVE_NTGUI */ #ifdef MAC_OS @@ -5738,13 +6292,11 @@ DEF_IMGLIB_FN (jpeg_std_error); DEF_IMGLIB_FN (jpeg_resync_to_restart); static int -init_jpeg_functions (void) +init_jpeg_functions (Lisp_Object libraries) { HMODULE library; - if (!(library = LoadLibrary ("libjpeg.dll")) - && !(library = LoadLibrary ("jpeg-62.dll")) - && !(library = LoadLibrary ("jpeg.dll"))) + if (!(library = w32_delayed_load (libraries, Qjpeg))) return 0; LOAD_IMGLIB_FN (library, jpeg_finish_decompress); @@ -6175,11 +6727,11 @@ DEF_IMGLIB_FN (TIFFReadRGBAImage); DEF_IMGLIB_FN (TIFFClose); static int -init_tiff_functions (void) +init_tiff_functions (Lisp_Object libraries) { HMODULE library; - if (!(library = LoadLibrary ("libtiff.dll"))) + if (!(library = w32_delayed_load (libraries, Qtiff))) return 0; LOAD_IMGLIB_FN (library, TIFFSetErrorHandler); @@ -6595,11 +7147,11 @@ DEF_IMGLIB_FN (DGifOpen); DEF_IMGLIB_FN (DGifOpenFileName); static int -init_gif_functions (void) +init_gif_functions (Lisp_Object libraries) { HMODULE library; - if (!(library = LoadLibrary ("libungif.dll"))) + if (!(library = w32_delayed_load (libraries, Qgif))) return 0; LOAD_IMGLIB_FN (library, DGifCloseFile); @@ -6875,6 +7427,8 @@ gif_load (f, img) TimeValue time; struct gcpro gcpro1; int ino; + CGrafPtr old_port; + GDHandle old_gdh; specified_file = image_spec_value (img->spec, QCfile, NULL); specified_data = image_spec_value (img->spec, QCdata, NULL); @@ -6992,11 +7546,13 @@ gif_load (f, img) if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) goto error; + GetGWorld (&old_port, &old_gdh); SetGWorld (ximg, NULL); bg_color.red = color.red; bg_color.green = color.green; bg_color.blue = color.blue; RGBBackColor (&bg_color); + SetGWorld (old_port, old_gdh); SetMovieActive (movie, TRUE); SetMovieGWorld (movie, ximg, NULL); SampleNumToMediaTime (media, ino + 1, &time, NULL); @@ -7368,9 +7924,81 @@ DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") Initialization ***********************************************************************/ +#ifdef HAVE_NTGUI +/* Image types that rely on external libraries are loaded dynamically + if the library is available. */ +#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn) \ + define_image_type (image_type, init_lib_fn (libraries)) +#else +#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn) \ + define_image_type (image_type, TRUE) +#endif /* HAVE_NTGUI */ + +DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 2, 2, 0, + doc: /* Initialize image library implementing image type TYPE. +Return non-nil if TYPE is a supported image type. + +Image types pbm and xbm are prebuilt; other types are loaded here. +Libraries to load are specified in alist LIBRARIES (usually, the value +of `image-library-alist', which see. */) + (type, libraries) +{ + Lisp_Object tested; + + /* Don't try to reload the library. */ + tested = Fassq (type, Vimage_type_cache); + if (CONSP (tested)) + return XCDR (tested); + +#if defined (HAVE_XPM) || defined (MAC_OS) + if (EQ (type, Qxpm)) + return CHECK_LIB_AVAILABLE(&xpm_type, init_xpm_functions); +#endif + +#if defined (HAVE_JPEG) || defined (MAC_OS) + if (EQ (type, Qjpeg)) + return CHECK_LIB_AVAILABLE(&jpeg_type, init_jpeg_functions); +#endif + +#if defined (HAVE_TIFF) || defined (MAC_OS) + if (EQ (type, Qtiff)) + return CHECK_LIB_AVAILABLE(&tiff_type, init_tiff_functions); +#endif + +#if defined (HAVE_GIF) || defined (MAC_OS) + if (EQ (type, Qgif)) + return CHECK_LIB_AVAILABLE(&gif_type, init_gif_functions); +#endif + +#if defined (HAVE_PNG) || defined (MAC_OS) + if (EQ (type, Qpng)) + return CHECK_LIB_AVAILABLE(&png_type, init_png_functions); +#endif + +#ifdef HAVE_GHOSTSCRIPT + if (EQ (type, Qpostscript)) + return CHECK_LIB_AVAILABLE(&gs_type, init_gs_functions); +#endif + + /* If the type is not recognized, avoid testing it ever again. */ + CACHE_IMAGE_TYPE(type, Qnil); + return Qnil; +} + void syms_of_image () { + /* Must be defined now becase we're going to update it below, while + defining the supported image types. */ + DEFVAR_LISP ("image-types", &Vimage_types, + doc: /* List of potentially supported image types. +Each element of the list is a symbol for a image type, like 'jpeg or 'png. +To check whether it is really supported, use `image-type-available-p'. */); + Vimage_types = Qnil; + + Vimage_type_cache = Qnil; + staticpro (&Vimage_type_cache); + QCascent = intern (":ascent"); staticpro (&QCascent); QCmargin = intern (":margin"); @@ -7404,6 +8032,7 @@ syms_of_image () Qpostscript = intern ("postscript"); staticpro (&Qpostscript); #ifdef HAVE_GHOSTSCRIPT + ADD_IMAGE_TYPE(Qpostscript); QCloader = intern (":loader"); staticpro (&QCloader); QCbounding_box = intern (":bounding-box"); @@ -7416,35 +8045,43 @@ syms_of_image () Qpbm = intern ("pbm"); staticpro (&Qpbm); + ADD_IMAGE_TYPE(Qpbm); Qxbm = intern ("xbm"); staticpro (&Qxbm); + ADD_IMAGE_TYPE(Qxbm); -#ifdef HAVE_XPM +#if defined (HAVE_XPM) || defined (MAC_OS) Qxpm = intern ("xpm"); staticpro (&Qxpm); + ADD_IMAGE_TYPE(Qxpm); #endif #if defined (HAVE_JPEG) || defined (MAC_OS) Qjpeg = intern ("jpeg"); staticpro (&Qjpeg); + ADD_IMAGE_TYPE(Qjpeg); #endif #if defined (HAVE_TIFF) || defined (MAC_OS) Qtiff = intern ("tiff"); staticpro (&Qtiff); + ADD_IMAGE_TYPE(Qtiff); #endif #if defined (HAVE_GIF) || defined (MAC_OS) Qgif = intern ("gif"); staticpro (&Qgif); + ADD_IMAGE_TYPE(Qgif); #endif #if defined (HAVE_PNG) || defined (MAC_OS) Qpng = intern ("png"); staticpro (&Qpng); + ADD_IMAGE_TYPE(Qpng); #endif + defsubr (&Sinit_image_library); defsubr (&Sclear_image_cache); defsubr (&Simage_size); defsubr (&Simage_mask_p); @@ -7472,52 +8109,13 @@ meaning don't clear the cache. */); Vimage_cache_eviction_delay = make_number (30 * 60); } - -#ifdef HAVE_NTGUI -/* Image types that rely on external libraries are loaded dynamically - if the library is available. */ -#define IF_LIB_AVAILABLE(init_lib_fn) if (init_lib_fn()) -#else -#define IF_LIB_AVAILABLE(init_func) /* Load unconditionally */ -#endif /* HAVE_NTGUI */ - void init_image () { image_types = NULL; - Vimage_types = Qnil; - - define_image_type (&xbm_type); - define_image_type (&pbm_type); -#ifdef HAVE_XPM - IF_LIB_AVAILABLE(init_xpm_functions) - define_image_type (&xpm_type); -#endif - -#if defined (HAVE_JPEG) || defined (MAC_OS) - IF_LIB_AVAILABLE(init_jpeg_functions) - define_image_type (&jpeg_type); -#endif - -#if defined (HAVE_TIFF) || defined (MAC_OS) - IF_LIB_AVAILABLE(init_tiff_functions) - define_image_type (&tiff_type); -#endif - -#if defined (HAVE_GIF) || defined (MAC_OS) - IF_LIB_AVAILABLE(init_gif_functions) - define_image_type (&gif_type); -#endif - -#if defined (HAVE_PNG) || defined (MAC_OS) - IF_LIB_AVAILABLE(init_png_functions) - define_image_type (&png_type); -#endif - -#ifdef HAVE_GHOSTSCRIPT - define_image_type (&gs_type); -#endif + define_image_type (&xbm_type, TRUE); + define_image_type (&pbm_type, TRUE); #ifdef MAC_OS /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */ diff --git a/src/indent.c b/src/indent.c index 15e433b03d9..a5de1431e4b 100644 --- a/src/indent.c +++ b/src/indent.c @@ -1,5 +1,5 @@ /* Indentation functions. - Copyright (C) 1985,86,87,88,93,94,95,98,2000,01,02,2003 + Copyright (C) 1985,86,87,88,93,94,95,98,2000,01,02,03,2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -1407,6 +1407,7 @@ compute_motion (from, fromvpos, fromhpos, did_motion, to, tovpos, tohpos, width, vpos++; contin_hpos = prev_hpos; prev_hpos = 0; + prev_vpos = vpos; } } diff --git a/src/insdel.c b/src/insdel.c index b1ba5a554a8..5a4dc5b64a8 100644 --- a/src/insdel.c +++ b/src/insdel.c @@ -1589,7 +1589,7 @@ replace_range (from, to, new, prepare, inherit, markers) Z_BYTE -= nbytes_del; GPT = from; GPT_BYTE = from_byte; - *(GPT_ADDR) = 0; /* Put an anchor. */ + if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ if (GPT_BYTE < GPT) abort (); @@ -1872,7 +1872,7 @@ del_range_2 (from, from_byte, to, to_byte, ret_string) Z -= nchars_del; GPT = from; GPT_BYTE = from_byte; - *(GPT_ADDR) = 0; /* Put an anchor. */ + if (GAP_SIZE > 0) *(GPT_ADDR) = 0; /* Put an anchor. */ if (GPT_BYTE < GPT) abort (); diff --git a/src/intervals.c b/src/intervals.c index d87b361a223..ade15360c9f 100644 --- a/src/intervals.c +++ b/src/intervals.c @@ -1899,11 +1899,13 @@ lookup_char_property (plist, prop, textprop) return fallback; /* Check for alternative properties */ tail = Fassq (prop, Vchar_property_alias_alist); - if (NILP (tail)) - return tail; - tail = XCDR (tail); - for (; NILP (fallback) && CONSP (tail); tail = XCDR (tail)) - fallback = Fplist_get (plist, XCAR (tail)); + if (! NILP (tail)) + { + tail = XCDR (tail); + for (; NILP (fallback) && CONSP (tail); tail = XCDR (tail)) + fallback = Fplist_get (plist, XCAR (tail)); + } + if (textprop && NILP (fallback) && CONSP (Vdefault_text_properties)) fallback = Fplist_get (Vdefault_text_properties, prop); return fallback; diff --git a/src/keyboard.c b/src/keyboard.c index 62017cec7b3..469b15fb683 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -117,6 +117,8 @@ struct backtrace args points to slot holding list of unevalled args */ char evalargs; + /* Nonzero means call value of debugger when done with this operation. */ + char debug_on_exit; }; #ifdef MULTI_KBOARD @@ -679,6 +681,8 @@ static SIGTYPE interrupt_signal P_ ((int signalnum)); to support it. */ static int cannot_suspend; +extern Lisp_Object Qidentity, Qonly; + /* Install the string STR as the beginning of the string of echoing, so that it serves as a prompt for the next character. Also start echoing. */ @@ -996,6 +1000,11 @@ This function is called by the editor initialization to begin editing. */) int count = SPECPDL_INDEX (); Lisp_Object buffer; + /* If we enter while input is blocked, don't lock up here. + This may happen through the debugger during redisplay. */ + if (INPUT_BLOCKED_P) + return Qnil; + command_loop_level++; update_mode_lines = 1; @@ -1151,7 +1160,8 @@ cmd_error (data) Vinhibit_quit = Qnil; #ifdef MULTI_KBOARD - any_kboard_state (); + if (command_loop_level == 0 && minibuf_level == 0) + any_kboard_state (); #endif return make_number (0); @@ -1240,6 +1250,10 @@ command_loop () while (1) { internal_catch (Qtop_level, top_level_1, Qnil); + /* Reset single_kboard in case top-level set it while + evaluating an -f option, or we are stuck there for some + other reason. */ + any_kboard_state (); internal_catch (Qtop_level, command_loop_2, Qnil); executing_macro = Qnil; @@ -1294,6 +1308,12 @@ DEFUN ("top-level", Ftop_level, Stop_level, 0, 0, "", if (display_hourglass_p) cancel_hourglass (); #endif + + /* Unblock input if we enter with input blocked. This may happen if + redisplay traps e.g. during tool-bar update with input blocked. */ + while (INPUT_BLOCKED_P) + UNBLOCK_INPUT; + return Fthrow (Qtop_level, Qnil); } @@ -1804,6 +1824,16 @@ command_loop_1 () call1 (Vrun_hooks, intern ("activate-mark-hook")); } + /* Setting transient-mark-mode to `only' is a way of + turning it on for just one command. */ + if (!NILP (current_buffer->mark_active) && !NILP (Vrun_hooks)) + { + if (EQ (Vtransient_mark_mode, Qidentity)) + Vtransient_mark_mode = Qnil; + if (EQ (Vtransient_mark_mode, Qonly)) + Vtransient_mark_mode = Qidentity; + } + finalize: if (current_buffer == prev_buffer @@ -3967,9 +3997,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu) else if (event->kind == LANGUAGE_CHANGE_EVENT) { /* Make an event (language-change (FRAME CHARSET LCID)). */ - obj = Fcons (event->modifiers, Qnil); - obj = Fcons (event->code, obj); - obj = Fcons (event->frame_or_window, obj); + obj = Fcons (event->frame_or_window, Qnil); obj = Fcons (Qlanguage_change, Fcons (obj, Qnil)); kbd_fetch_ptr = event + 1; } @@ -6245,14 +6273,8 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem, { int len = SBYTES (name_alist_or_stem); char *buf = (char *) alloca (len + 50); - if (sizeof (int) == sizeof (EMACS_INT)) - sprintf (buf, "%s-%d", SDATA (name_alist_or_stem), - XINT (symbol_int) + 1); - else if (sizeof (long) == sizeof (EMACS_INT)) - sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem), - XINT (symbol_int) + 1); - else - abort (); + sprintf (buf, "%s-%ld", SDATA (name_alist_or_stem), + (long) XINT (symbol_int) + 1); value = intern (buf); } else if (name_table != 0 && name_table[symbol_num]) @@ -7409,7 +7431,7 @@ parse_menu_item (item, notreal, inmenubar) newcache = chkcache; if (chkcache) { - tem = Fkey_description (tem); + tem = Fkey_description (tem, Qnil); if (CONSP (prefix)) { if (STRINGP (XCAR (prefix))) @@ -9667,6 +9689,7 @@ a special event, so ignore the prefix argument and don't clear it. */) backtrace.args = &cmd; backtrace.nargs = 1; backtrace.evalargs = 0; + backtrace.debug_on_exit = 0; tem = Fcall_interactively (cmd, record_flag, keys); @@ -9703,23 +9726,9 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ else if (CONSP (prefixarg) && XINT (XCAR (prefixarg)) == 4) strcpy (buf, "C-u "); else if (CONSP (prefixarg) && INTEGERP (XCAR (prefixarg))) - { - if (sizeof (int) == sizeof (EMACS_INT)) - sprintf (buf, "%d ", XINT (XCAR (prefixarg))); - else if (sizeof (long) == sizeof (EMACS_INT)) - sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg))); - else - abort (); - } + sprintf (buf, "%ld ", (long) XINT (XCAR (prefixarg))); else if (INTEGERP (prefixarg)) - { - if (sizeof (int) == sizeof (EMACS_INT)) - sprintf (buf, "%d ", XINT (prefixarg)); - else if (sizeof (long) == sizeof (EMACS_INT)) - sprintf (buf, "%ld ", (long) XINT (prefixarg)); - else - abort (); - } + sprintf (buf, "%ld ", (long) XINT (prefixarg)); /* This isn't strictly correct if execute-extended-command is bound to anything else. Perhaps it should use @@ -9807,7 +9816,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ int count = SPECPDL_INDEX (); record_unwind_protect (pop_message_unwind, Qnil); - binding = Fkey_description (bindings); + binding = Fkey_description (bindings, Qnil); newmessage = (char *) alloca (SCHARS (SYMBOL_NAME (function)) @@ -10490,6 +10499,61 @@ The elements of this list correspond to the arguments of return Flist (sizeof (val) / sizeof (val[0]), val); } +DEFUN ("posn-at-x-y", Fposn_at_x_y, Sposn_at_x_y, 2, 3, 0, + doc: /* Return position information for pixel coordinates X and Y. +By default, X and Y are relative to text area of the selected window. +Optional third arg FRAME_OR_WINDOW non-nil specifies frame or window. + +The return value is similar to a mouse click position: + (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) + IMAGE (DX . DY) (WIDTH . HEIGHT)) +The `posn-' functions access elements of such lists. */) + (x, y, frame_or_window) + Lisp_Object x, y, frame_or_window; +{ + if (NILP (frame_or_window)) + frame_or_window = selected_window; + + if (WINDOWP (frame_or_window)) + { + struct window *w; + + CHECK_LIVE_WINDOW (frame_or_window); + + w = XWINDOW (frame_or_window); + XSETINT (x, (WINDOW_TO_FRAME_PIXEL_X (w, XINT (x)) + + window_box_left_offset (w, TEXT_AREA))); + XSETINT (y, WINDOW_TO_FRAME_PIXEL_Y (w, XINT (y))); + frame_or_window = w->frame; + } + + CHECK_LIVE_FRAME (frame_or_window); + + return make_lispy_position (XFRAME (frame_or_window), &x, &y, 0); +} + +DEFUN ("posn-at-point", Fposn_at_point, Sposn_at_point, 0, 2, 0, + doc: /* Return position information for buffer POS in WINDOW. +POS defaults to point in WINDOW; WINDOW defaults to the selected window. + +Return nil if position is not visible in window. Otherwise, +the return value is similar to that returned by `event-start' for +a mouse click at the upper left corner of the glyph corresponding +to the given buffer position: + (WINDOW AREA-OR-POS (X . Y) TIMESTAMP OBJECT POS (COL . ROW) + IMAGE (DX . DY) (WIDTH . HEIGHT)) +The `posn-' functions access elements of such lists. */*/) + (pos, window) + Lisp_Object pos, window; +{ + Lisp_Object tem; + + tem = Fpos_visible_in_window_p (pos, window, Qt); + if (!NILP (tem)) + tem = Fposn_at_x_y (XCAR (tem), XCAR (XCDR (tem)), window); + return tem; +} + /* * Set up a new kboard object with reasonable initial values. @@ -10913,6 +10977,8 @@ syms_of_keyboard () defsubr (&Sset_input_mode); defsubr (&Scurrent_input_mode); defsubr (&Sexecute_extended_command); + defsubr (&Sposn_at_point); + defsubr (&Sposn_at_x_y); DEFVAR_LISP ("last-command-char", &last_command_char, doc: /* Last input event that was part of a command. */); @@ -11357,8 +11423,11 @@ mark_kboards () { if (event == kbd_buffer + KBD_BUFFER_SIZE) event = kbd_buffer; - mark_object (event->x); - mark_object (event->y); + if (event->kind != SELECTION_REQUEST_EVENT) + { + mark_object (event->x); + mark_object (event->y); + } mark_object (event->frame_or_window); mark_object (event->arg); } diff --git a/src/keymap.c b/src/keymap.c index 62ea237b85c..fbf1263a71b 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -122,6 +122,9 @@ static void describe_translation P_ ((Lisp_Object, Lisp_Object)); static void describe_map P_ ((Lisp_Object, Lisp_Object, void (*) P_ ((Lisp_Object, Lisp_Object)), int, Lisp_Object, Lisp_Object*, int)); +static void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object, + void (*) (Lisp_Object, Lisp_Object), int, + Lisp_Object, Lisp_Object, int *, int, int)); static void silly_event_symbol_error P_ ((Lisp_Object)); /* Keymap object support - constructors and predicates. */ @@ -1098,15 +1101,15 @@ event type that has no other definition in this keymap. DEF is anything that can be a key's definition: nil (means key is undefined in this keymap), - a command (a Lisp function suitable for interactive calling) + a command (a Lisp function suitable for interactive calling), a string (treated as a keyboard macro), a keymap (to define a prefix key), - a symbol. When the key is looked up, the symbol will stand for its + a symbol (when the key is looked up, the symbol will stand for its function definition, which should at that time be one of the above, - or another symbol whose function definition is used, etc. + or another symbol whose function definition is used, etc.), a cons (STRING . DEFN), meaning that DEFN is the definition (DEFN should be a valid definition in its own right), - or a cons (KEYMAP . CHAR), meaning use definition of CHAR in map KEYMAP. + or a cons (MAP . CHAR), meaning use definition of CHAR in keymap MAP. If KEYMAP is a sparse keymap with a binding for KEY, the existing binding is altered. If there is no binding for KEY, the new pair @@ -1193,7 +1196,7 @@ binding KEY to DEF is added at the front of KEYMAP. */) /* We must use Fkey_description rather than just passing key to error; key might be a vector, not a string. */ error ("Key sequence %s uses invalid prefix characters", - SDATA (Fkey_description (key))); + SDATA (Fkey_description (key, Qnil))); } } @@ -1653,7 +1656,7 @@ DEFUN ("global-key-binding", Fglobal_key_binding, Sglobal_key_binding, 1, 2, 0, doc: /* Return the binding for command KEYS in current global keymap only. KEYS is a string, a sequence of keystrokes. The binding is probably a symbol with a function definition. -This function's return values are the same as those of lookup-key +This function's return values are the same as those of `lookup-key' \(which see). If optional argument ACCEPT-DEFAULT is non-nil, recognize default @@ -1974,78 +1977,109 @@ Lisp_Object Qsingle_key_description, Qkey_description; /* This function cannot GC. */ -DEFUN ("key-description", Fkey_description, Skey_description, 1, 1, 0, +DEFUN ("key-description", Fkey_description, Skey_description, 1, 2, 0, doc: /* Return a pretty description of key-sequence KEYS. -Control characters turn into "C-foo" sequences, meta into "M-foo" +Optional arg PREFIX is the sequence of keys leading up to KEYS. +Control characters turn into "C-foo" sequences, meta into "M-foo", spaces are put between sequence elements, etc. */) - (keys) - Lisp_Object keys; + (keys, prefix) + Lisp_Object keys, prefix; { int len = 0; int i, i_byte; - Lisp_Object sep; - Lisp_Object *args = NULL; + Lisp_Object *args; + int size = XINT (Flength (keys)); + Lisp_Object list; + Lisp_Object sep = build_string (" "); + Lisp_Object key; + int add_meta = 0; + + if (!NILP (prefix)) + size += XINT (Flength (prefix)); + + /* This has one extra element at the end that we don't pass to Fconcat. */ + args = (Lisp_Object *) alloca (size * 4 * sizeof (Lisp_Object)); - if (STRINGP (keys)) + /* In effect, this computes + (mapconcat 'single-key-description keys " ") + but we shouldn't use mapconcat because it can do GC. */ + + next_list: + if (!NILP (prefix)) + list = prefix, prefix = Qnil; + else if (!NILP (keys)) + list = keys, keys = Qnil; + else { - Lisp_Object vector; - vector = Fmake_vector (Flength (keys), Qnil); - for (i = 0, i_byte = 0; i < SCHARS (keys); ) + if (add_meta) { - int c; - int i_before = i; - - FETCH_STRING_CHAR_ADVANCE (c, keys, i, i_byte); - if (SINGLE_BYTE_CHAR_P (c) && (c & 0200)) - c ^= 0200 | meta_modifier; - XSETFASTINT (AREF (vector, i_before), c); + args[len] = Fsingle_key_description (meta_prefix_char, Qnil); + len += 2; } - keys = vector; + else if (len == 0) + return empty_string; + return Fconcat (len - 1, args); } - if (VECTORP (keys)) - { - /* In effect, this computes - (mapconcat 'single-key-description keys " ") - but we shouldn't use mapconcat because it can do GC. */ + if (STRINGP (list)) + size = SCHARS (list); + else if (VECTORP (list)) + size = XVECTOR (list)->size; + else if (CONSP (list)) + size = XINT (Flength (list)); + else + wrong_type_argument (Qarrayp, list); - len = XVECTOR (keys)->size; - sep = build_string (" "); - /* This has one extra element at the end that we don't pass to Fconcat. */ - args = (Lisp_Object *) alloca (len * 2 * sizeof (Lisp_Object)); + i = i_byte = 0; - for (i = 0; i < len; i++) + while (i < size) + { + if (STRINGP (list)) { - args[i * 2] = Fsingle_key_description (AREF (keys, i), Qnil); - args[i * 2 + 1] = sep; + int c; + FETCH_STRING_CHAR_ADVANCE (c, list, i, i_byte); + if (SINGLE_BYTE_CHAR_P (c) && (c & 0200)) + c ^= 0200 | meta_modifier; + XSETFASTINT (key, c); + } + else if (VECTORP (list)) + { + key = AREF (list, i++); + } + else + { + key = XCAR (list); + list = XCDR (list); + i++; } - } - else if (CONSP (keys)) - { - /* In effect, this computes - (mapconcat 'single-key-description keys " ") - but we shouldn't use mapconcat because it can do GC. */ - - len = XFASTINT (Flength (keys)); - sep = build_string (" "); - /* This has one extra element at the end that we don't pass to Fconcat. */ - args = (Lisp_Object *) alloca (len * 2 * sizeof (Lisp_Object)); - for (i = 0; i < len; i++) + if (add_meta) + { + if (!INTEGERP (key) + || EQ (key, meta_prefix_char) + || (XINT (key) & meta_modifier)) + { + args[len++] = Fsingle_key_description (meta_prefix_char, Qnil); + args[len++] = sep; + if (EQ (key, meta_prefix_char)) + continue; + } + else + XSETINT (key, (XINT (key) | meta_modifier) & ~0x80); + add_meta = 0; + } + else if (EQ (key, meta_prefix_char)) { - args[i * 2] = Fsingle_key_description (XCAR (keys), Qnil); - args[i * 2 + 1] = sep; - keys = XCDR (keys); + add_meta = 1; + continue; } + args[len++] = Fsingle_key_description (key, Qnil); + args[len++] = sep; } - else - keys = wrong_type_argument (Qarrayp, keys); - - if (len == 0) - return empty_string; - return Fconcat (len * 2 - 1, args); + goto next_list; } + char * push_key_description (c, p, force_multibyte) register unsigned int c; @@ -2926,7 +2960,7 @@ key binding\n\ if (!NILP (prefix)) { insert_string (" Starting With "); - insert1 (Fkey_description (prefix)); + insert1 (Fkey_description (prefix, Qnil)); } insert_string (":\n"); } @@ -3051,7 +3085,7 @@ describe_translation (definition, args) } else if (STRINGP (definition) || VECTORP (definition)) { - insert1 (Fkey_description (definition)); + insert1 (Fkey_description (definition, Qnil)); insert_string ("\n"); } else if (KEYMAPP (definition)) @@ -3061,20 +3095,19 @@ describe_translation (definition, args) } /* Describe the contents of map MAP, assuming that this map itself is - reached by the sequence of prefix keys KEYS (a string or vector). + reached by the sequence of prefix keys PREFIX (a string or vector). PARTIAL, SHADOW, NOMENU are as in `describe_map_tree' above. */ static void -describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu) +describe_map (map, prefix, elt_describer, partial, shadow, seen, nomenu) register Lisp_Object map; - Lisp_Object keys; + Lisp_Object prefix; void (*elt_describer) P_ ((Lisp_Object, Lisp_Object)); int partial; Lisp_Object shadow; Lisp_Object *seen; int nomenu; { - Lisp_Object elt_prefix; Lisp_Object tail, definition, event; Lisp_Object tem; Lisp_Object suppress; @@ -3084,15 +3117,6 @@ describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu) suppress = Qnil; - if (!NILP (keys) && XFASTINT (Flength (keys)) > 0) - { - /* Call Fkey_description first, to avoid GC bug for the other string. */ - tem = Fkey_description (keys); - elt_prefix = concat2 (tem, build_string (" ")); - } - else - elt_prefix = Qnil; - if (partial) suppress = intern ("suppress-keymap"); @@ -3102,7 +3126,7 @@ describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu) kludge = Fmake_vector (make_number (1), Qnil); definition = Qnil; - GCPRO3 (elt_prefix, definition, kludge); + GCPRO3 (prefix, definition, kludge); for (tail = map; CONSP (tail); tail = XCDR (tail)) { @@ -3111,13 +3135,13 @@ describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu) if (VECTORP (XCAR (tail)) || CHAR_TABLE_P (XCAR (tail))) describe_vector (XCAR (tail), - elt_prefix, Qnil, elt_describer, partial, shadow, map, - (int *)0, 0); + prefix, Qnil, elt_describer, partial, shadow, map, + (int *)0, 0, 1); else if (CONSP (XCAR (tail))) { event = XCAR (XCAR (tail)); - /* Ignore bindings whose "keys" are not really valid events. + /* Ignore bindings whose "prefix" are not really valid events. (We get these in the frames and buffers menu.) */ if (!(SYMBOLP (event) || INTEGERP (event))) continue; @@ -3156,11 +3180,8 @@ describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu) first = 0; } - if (!NILP (elt_prefix)) - insert1 (elt_prefix); - /* THIS gets the string to describe the character EVENT. */ - insert1 (Fsingle_key_description (event, Qnil)); + insert1 (Fkey_description (kludge, prefix)); /* Print a description of the definition of this character. elt_describer will take care of spacing out far enough @@ -3173,9 +3194,9 @@ describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu) using an inherited keymap. So skip anything we've already encountered. */ tem = Fassq (tail, *seen); - if (CONSP (tem) && !NILP (Fequal (XCAR (tem), keys))) + if (CONSP (tem) && !NILP (Fequal (XCAR (tem), prefix))) break; - *seen = Fcons (Fcons (tail, keys), *seen); + *seen = Fcons (Fcons (tail, prefix), *seen); } } @@ -3193,7 +3214,8 @@ describe_vector_princ (elt, fun) DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0, doc: /* Insert a description of contents of VECTOR. -This is text showing the elements of vector matched against indices. */) +This is text showing the elements of vector matched against indices. +DESCRIBER is the output function used; nil means use `princ'. */) (vector, describer) Lisp_Object vector, describer; { @@ -3203,7 +3225,7 @@ This is text showing the elements of vector matched against indices. */) specbind (Qstandard_output, Fcurrent_buffer ()); CHECK_VECTOR_OR_CHAR_TABLE (vector); describe_vector (vector, Qnil, describer, describe_vector_princ, 0, - Qnil, Qnil, (int *)0, 0); + Qnil, Qnil, (int *)0, 0, 0); return unbind_to (count, Qnil); } @@ -3237,42 +3259,60 @@ This is text showing the elements of vector matched against indices. */) ARGS is simply passed as the second argument to ELT_DESCRIBER. INDICES and CHAR_TABLE_DEPTH are ignored. They will be removed in - the near future. */ + the near future. -void -describe_vector (vector, elt_prefix, args, elt_describer, + KEYMAP_P is 1 if vector is known to be a keymap, so map ESC to M-. + + ARGS is simply passed as the second argument to ELT_DESCRIBER. */ + +static void +describe_vector (vector, prefix, args, elt_describer, partial, shadow, entire_map, - indices, char_table_depth) + indices, char_table_depth, keymap_p) register Lisp_Object vector; - Lisp_Object elt_prefix, args; + Lisp_Object prefix, args; void (*elt_describer) P_ ((Lisp_Object, Lisp_Object)); int partial; Lisp_Object shadow; Lisp_Object entire_map; int *indices; int char_table_depth; + int keymap_p; { Lisp_Object definition; Lisp_Object tem2; + Lisp_Object elt_prefix = Qnil; int i; Lisp_Object suppress; Lisp_Object kludge; - struct gcpro gcpro1, gcpro2, gcpro3; + int first = 1; + struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; /* Range of elements to be handled. */ int from, to; Lisp_Object character; int starting_i; - int first = 1; suppress = Qnil; definition = Qnil; + if (!keymap_p) + { + /* Call Fkey_description first, to avoid GC bug for the other string. */ + if (!NILP (prefix) && XFASTINT (Flength (prefix)) > 0) + { + Lisp_Object tem; + tem = Fkey_description (prefix, Qnil); + elt_prefix = concat2 (tem, build_string (" ")); + } + prefix = Qnil; + } + /* This vector gets used to present single keys to Flookup_key. Since that is done once per vector element, we don't want to cons up a fresh vector every time. */ kludge = Fmake_vector (make_number (1), Qnil); - GCPRO3 (elt_prefix, definition, kludge); + GCPRO4 (elt_prefix, prefix, definition, kludge); if (partial) suppress = intern ("suppress-keymap"); @@ -3308,13 +3348,13 @@ describe_vector (vector, elt_prefix, args, elt_describer, } character = make_number (starting_i); + ASET (kludge, 0, character); /* If this binding is shadowed by some other map, ignore it. */ if (!NILP (shadow)) { Lisp_Object tem; - ASET (kludge, 0, character); tem = shadow_lookup (shadow, kludge, Qt); if (!NILP (tem)) continue; @@ -3326,7 +3366,6 @@ describe_vector (vector, elt_prefix, args, elt_describer, { Lisp_Object tem; - ASET (kludge, 0, character); tem = Flookup_key (entire_map, kludge, Qt); if (!EQ (tem, definition)) @@ -3343,7 +3382,7 @@ describe_vector (vector, elt_prefix, args, elt_describer, if (!NILP (elt_prefix)) insert1 (elt_prefix); - insert1 (Fsingle_key_description (character, Qnil)); + insert1 (Fkey_description (kludge, prefix)); /* Find all consecutive characters or rows that have the same definition. But, for elements of a top level char table, if @@ -3371,10 +3410,12 @@ describe_vector (vector, elt_prefix, args, elt_describer, { insert (" .. ", 4); + ASET (kludge, 0, make_number (i)); + if (!NILP (elt_prefix)) insert1 (elt_prefix); - insert1 (Fsingle_key_description (make_number (i), Qnil)); + insert1 (Fkey_description (kludge, prefix)); } /* Print a description of the definition of this character. diff --git a/src/keymap.h b/src/keymap.h index 2a34061593f..214ba605c76 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -30,15 +30,12 @@ EXFUN (Fdefine_key, 3); EXFUN (Flookup_key, 3); EXFUN (Fcommand_remapping, 1); EXFUN (Fkey_binding, 3); -EXFUN (Fkey_description, 1); +EXFUN (Fkey_description, 2); EXFUN (Fsingle_key_description, 2); EXFUN (Fwhere_is_internal, 5); extern Lisp_Object access_keymap P_ ((Lisp_Object, Lisp_Object, int, int, int)); extern Lisp_Object get_keyelt P_ ((Lisp_Object, int)); extern Lisp_Object get_keymap P_ ((Lisp_Object, int, int)); -extern void describe_vector P_ ((Lisp_Object, Lisp_Object, Lisp_Object, - void (*) (Lisp_Object, Lisp_Object), int, - Lisp_Object, Lisp_Object, int *, int)); extern void describe_map_tree P_ ((Lisp_Object, int, Lisp_Object, Lisp_Object, char *, int, int, int)); extern int current_minor_maps P_ ((Lisp_Object **, Lisp_Object **)); diff --git a/src/lisp.h b/src/lisp.h index 6f248df0a3c..7e39313a7fc 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -279,26 +279,57 @@ enum pvec_type /* For convenience, we also store the number of elements in these bits. */ #define PSEUDOVECTOR_SIZE_MASK 0x1ff + +/* Number of bits to put in each character in the internal representation + of bool vectors. This should not vary across implementations. */ +#define BOOL_VECTOR_BITS_PER_CHAR 8 /***** Select the tagging scheme. *****/ +/* There are basically two options that control the tagging scheme: + - NO_UNION_TYPE says that Lisp_Object should be an integer instead + of a union. + - USE_LSB_TAG means that we can assume the least 3 bits of pointers are + always 0, and we can thus use them to hold tag bits, without + restricting our addressing space. + + If USE_LSB_TAG is not set, then we use the top 3 bits for tagging, thus + restricting our possible address range. Currently USE_LSB_TAG is not + allowed together with a union. This is not due to any fundamental + technical (or political ;-) problem: nobody wrote the code to do it yet. + + USE_LSB_TAG not only requires the least 3 bits of pointers returned by + malloc to be 0 but also needs to be able to impose a mult-of-8 alignment + on the few static Lisp_Objects used: all the defsubr as well + as the two special buffers buffer_defaults and buffer_local_symbols. */ /* First, try and define DECL_ALIGN(type,var) which declares a static variable VAR of type TYPE with the added requirement that it be TYPEBITS-aligned. */ -#if defined USE_LSB_TAG && !defined DECL_ALIGN +#ifndef DECL_ALIGN /* What compiler directive should we use for non-gcc compilers? -stef */ # if defined (__GNUC__) # define DECL_ALIGN(type, var) \ type __attribute__ ((__aligned__ (1 << GCTYPEBITS))) var -# else -# error "USE_LSB_TAG used without defining DECL_ALIGN" # endif #endif -#ifndef USE_LSB_TAG +/* Let's USE_LSB_TAG on systems where we know malloc returns mult-of-8. */ +#if defined GNU_MALLOC || defined DOUG_LEA_MALLOC || defined __GLIBC__ || defined MAC_OSX +/* We also need to be able to specify mult-of-8 alignment on static vars. */ +# if defined DECL_ALIGN +/* We currently do not support USE_LSB_TAG with a union Lisp_Object. */ +# if defined NO_UNION_TYPE +# define USE_LSB_TAG +# endif +# endif +#endif + /* Just remove the alignment annotation if we don't use it. */ -#undef DECL_ALIGN -#define DECL_ALIGN(type, var) type var +#ifndef DECL_ALIGN +# ifdef USE_LSB_TAG +# error "USE_LSB_TAG used without defining DECL_ALIGN" +# endif +# define DECL_ALIGN(type, var) type var #endif @@ -383,7 +414,7 @@ enum pvec_type #ifdef EXPLICIT_SIGN_EXTEND /* Make sure we sign-extend; compilers have been known to fail to do so. */ -#define XINT(a) (((a).i << (BITS_PER_EMACS_INT - VALBITS)) \ +#define XINT(a) (((a).s.val << (BITS_PER_EMACS_INT - VALBITS)) \ >> (BITS_PER_EMACS_INT - VALBITS)) #else #define XINT(a) ((a).s.val) @@ -401,7 +432,7 @@ enum pvec_type extern Lisp_Object make_number (); #endif -#define EQ(x, y) ((x).s.val == (y).s.val) +#define EQ(x, y) ((x).s.val == (y).s.val && (x).s.type == (y).s.type) #endif /* NO_UNION_TYPE */ @@ -2408,7 +2439,8 @@ void set_frame_cursor_types P_ ((struct frame *, Lisp_Object)); extern void syms_of_xdisp P_ ((void)); extern void init_xdisp P_ ((void)); extern Lisp_Object safe_eval P_ ((Lisp_Object)); -extern int pos_visible_p P_ ((struct window *, int, int *, int)); +extern int pos_visible_p P_ ((struct window *, int, int *, + int *, int *, int)); /* Defined in vm-limit.c. */ extern void memory_warnings P_ ((POINTER_TYPE *, void (*warnfun) ())); @@ -2779,6 +2811,7 @@ extern void syms_of_fileio P_ ((void)); EXFUN (Fmake_temp_name, 1); extern void init_fileio_once P_ ((void)); extern Lisp_Object make_temp_name P_ ((Lisp_Object, int)); +EXFUN (Fmake_symbolic_link, 3); /* Defined in abbrev.c */ @@ -2892,6 +2925,10 @@ extern int indented_beyond_p P_ ((int, int, double)); extern void syms_of_indent P_ ((void)); /* defined in frame.c */ +#ifdef HAVE_WINDOW_SYSTEM +extern Lisp_Object Vx_resource_name; +extern Lisp_Object Vx_resource_class; +#endif /* HAVE_WINDOW_SYSTEM */ extern Lisp_Object Qvisible; extern void store_frame_param P_ ((struct frame *, Lisp_Object, Lisp_Object)); extern void store_in_alist P_ ((Lisp_Object *, Lisp_Object, Lisp_Object)); @@ -3013,7 +3050,7 @@ extern void syms_of_macros P_ ((void)); /* defined in undo.c */ extern Lisp_Object Qinhibit_read_only; EXFUN (Fundo_boundary, 0); -extern Lisp_Object truncate_undo_list P_ ((Lisp_Object, int, int)); +extern Lisp_Object truncate_undo_list P_ ((Lisp_Object, int, int, int)); extern void record_marker_adjustment P_ ((Lisp_Object, int)); extern void record_insert P_ ((int, int)); extern void record_delete P_ ((int, Lisp_Object)); @@ -3115,11 +3152,12 @@ extern int getloadavg P_ ((double *, int)); #ifdef HAVE_X_WINDOWS /* Defined in xfns.c */ extern void syms_of_xfns P_ ((void)); -extern Lisp_Object Vx_resource_name; -extern Lisp_Object Vx_resource_class; +#endif /* HAVE_X_WINDOWS */ +#ifdef HAVE_WINDOW_SYSTEM +/* Defined in xfns.c, w32fns.c, or macfns.c */ EXFUN (Fxw_display_color_p, 1); EXFUN (Fx_file_dialog, 4); -#endif /* HAVE_X_WINDOWS */ +#endif /* HAVE_WINDOW_SYSTEM */ /* Defined in xsmfns.c */ extern void syms_of_xsmfns P_ ((void)); @@ -3145,9 +3183,7 @@ extern void xfree P_ ((POINTER_TYPE *)); extern char *xstrdup P_ ((const char *)); -#ifndef USE_CRT_DLL extern char *egetenv P_ ((char *)); -#endif /* Set up the name of the machine we're running on. */ extern void init_system_name P_ ((void)); @@ -3228,6 +3264,32 @@ extern Lisp_Object Vdirectory_sep_char; ? make_float (val) \ : make_number ((EMACS_INT)(val))) + +/* Checks the `cycle check' variable CHECK to see if it indicates that + EL is part of a cycle; CHECK must be either Qnil or a value returned + by an earlier use of CYCLE_CHECK. SUSPICIOUS is the number of + elements after which a cycle might be suspected; after that many + elements, this macro begins consing in order to keep more precise + track of elements. + + Returns nil if a cycle was detected, otherwise a new value for CHECK + that includes EL. + + CHECK is evaluated multiple times, EL and SUSPICIOUS 0 or 1 times, so + the caller should make sure that's ok. */ + +#define CYCLE_CHECK(check, el, suspicious) \ + (NILP (check) \ + ? make_number (0) \ + : (INTEGERP (check) \ + ? (XFASTINT (check) < (suspicious) \ + ? make_number (XFASTINT (check) + 1) \ + : Fcons (el, Qnil)) \ + : (!NILP (Fmemq ((el), (check))) \ + ? Qnil \ + : Fcons ((el), (check))))) + + #endif /* EMACS_LISP_H */ /* arch-tag: 9b2ed020-70eb-47ac-94ee-e1c2a5107d5e diff --git a/src/lread.c b/src/lread.c index dd6e3f322a6..d3014eb7eb6 100644 --- a/src/lread.c +++ b/src/lread.c @@ -2122,8 +2122,9 @@ read1 (readcharfun, pch, first_in_list) if (c == '"') { Lisp_Object tmp, val; - int size_in_chars = ((XFASTINT (length) + BITS_PER_CHAR - 1) - / BITS_PER_CHAR); + int size_in_chars + = ((XFASTINT (length) + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); UNREAD (c); tmp = read1 (readcharfun, pch, first_in_list); @@ -2134,7 +2135,7 @@ read1 (readcharfun, pch, first_in_list) Accept such input in case it came from an old version. */ && ! (XFASTINT (length) - == (SCHARS (tmp) - 1) * BITS_PER_CHAR))) + == (SCHARS (tmp) - 1) * BOOL_VECTOR_BITS_PER_CHAR))) Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5), Qnil)); @@ -2142,9 +2143,9 @@ read1 (readcharfun, pch, first_in_list) bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, size_in_chars); /* Clear the extraneous bits in the last byte. */ - if (XINT (length) != size_in_chars * BITS_PER_CHAR) + if (XINT (length) != size_in_chars * BOOL_VECTOR_BITS_PER_CHAR) XBOOL_VECTOR (val)->data[size_in_chars - 1] - &= (1 << (XINT (length) % BITS_PER_CHAR)) - 1; + &= (1 << (XINT (length) % BOOL_VECTOR_BITS_PER_CHAR)) - 1; return val; } Fsignal (Qinvalid_read_syntax, Fcons (make_string ("#&...", 5), @@ -3814,11 +3815,15 @@ init_lread () } #endif -#ifndef WINDOWSNT +#if (!(defined(WINDOWSNT) || (defined(HAVE_CARBON)))) /* When Emacs is invoked over network shares on NT, PATH_LOADSEARCH is almost never correct, thereby causing a warning to be printed out that confuses users. Since PATH_LOADSEARCH is always overridden by the - EMACSLOADPATH environment variable below, disable the warning on NT. */ + EMACSLOADPATH environment variable below, disable the warning on NT. + Also, when using the "self-contained" option for Carbon Emacs for MacOSX, + the "standard" paths may not exist and would be overridden by + EMACSLOADPATH as on NT. Since this depends on how the executable + was build and packaged, turn off the warnings in general */ /* Warn if dirs in the *standard* path don't exist. */ if (!turn_off_warning) @@ -3840,7 +3845,7 @@ init_lread () } } } -#endif /* WINDOWSNT */ +#endif /* !(WINDOWSNT || HAVE_CARBON) */ /* If the EMACSLOADPATH environment variable is set, use its value. This doesn't apply if we're dumping. */ diff --git a/src/macfns.c b/src/macfns.c index dbb8adb3fe1..ec014e772e3 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -1,5 +1,5 @@ /* Graphical user interface functions for Mac OS. - Copyright (C) 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -42,7 +42,6 @@ Boston, MA 02111-1307, USA. */ #include "epaths.h" #include "termhooks.h" #include "coding.h" -#include "ccl.h" #include "systime.h" /* #include "bitmaps/gray.xbm" */ @@ -59,17 +58,6 @@ static unsigned char gray_bits[] = { #include <stdlib.h> #include <string.h> -#ifndef MAC_OSX -#include <alloca.h> -#endif - -#ifdef MAC_OSX -#include <QuickTime/QuickTime.h> -#else /* not MAC_OSX */ -#include <Windows.h> -#include <Gestalt.h> -#include <TextUtils.h> -#endif /* not MAC_OSX */ /*extern void free_frame_menubar (); extern double atof (); @@ -2580,8 +2568,6 @@ This function is an internal primitive--use `make-frame' instead. */) f->output_data.mac = (struct mac_output *) xmalloc (sizeof (struct mac_output)); bzero (f->output_data.mac, sizeof (struct mac_output)); FRAME_FONTSET (f) = -1; - f->output_data.mac->scroll_bar_foreground_pixel = -1; - f->output_data.mac->scroll_bar_background_pixel = -1; record_unwind_protect (unwind_create_frame, frame); f->icon_name @@ -2598,7 +2584,7 @@ This function is an internal primitive--use `make-frame' instead. */) if (!NILP (parent)) { - f->output_data.mac->parent_desc = (Window) parent; + f->output_data.mac->parent_desc = (Window) XFASTINT (parent); f->output_data.mac->explicit_parent = 1; } else @@ -2708,7 +2694,7 @@ This function is an internal primitive--use `make-frame' instead. */) x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), "menuBar", "MenuBar", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qtool_bar_lines, make_number (0), + x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), "toolBar", "ToolBar", RES_TYPE_NUMBER); x_default_parameter (f, parms, Qbuffer_predicate, Qnil, "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); @@ -2717,25 +2703,32 @@ This function is an internal primitive--use `make-frame' instead. */) f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; - /* MAC_TODO: specify 1 below when toolbars are implemented. */ - window_prompting = x_figure_window_size (f, parms, 0); +#if TARGET_API_MAC_CARBON + f->output_data.mac->text_cursor = kThemeIBeamCursor; + f->output_data.mac->nontext_cursor = kThemeArrowCursor; + f->output_data.mac->modeline_cursor = kThemeArrowCursor; + f->output_data.mac->hand_cursor = kThemePointingHandCursor; + f->output_data.mac->hourglass_cursor = kThemeWatchCursor; + f->output_data.mac->horizontal_drag_cursor = kThemeResizeLeftRightCursor; +#else + f->output_data.mac->text_cursor = GetCursor (iBeamCursor); + f->output_data.mac->nontext_cursor = &arrow_cursor; + f->output_data.mac->modeline_cursor = &arrow_cursor; + f->output_data.mac->hand_cursor = &arrow_cursor; + f->output_data.mac->hourglass_cursor = GetCursor (watchCursor); + f->output_data.mac->horizontal_drag_cursor = &arrow_cursor; +#endif + + /* Compute the size of the window. */ + window_prompting = x_figure_window_size (f, parms, 1); tem = mac_get_arg (parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); f->no_split = minibuffer_only || EQ (tem, Qt); - /* Create the window. Add the tool-bar height to the initial frame - height so that the user gets a text display area of the size he - specified with -g or via the registry. Later changes of the - tool-bar height don't change the frame size. This is done so that - users can create tall Emacs frames without having to guess how - tall the tool-bar will get. */ - FRAME_LINES (f) += FRAME_TOOL_BAR_LINES (f); - /* mac_window (f, window_prompting, minibuffer_only); */ make_mac_frame (f); x_icon (f, parms); - x_make_gc (f); /* Now consider the frame official. */ @@ -2754,7 +2747,8 @@ This function is an internal primitive--use `make-frame' instead. */) x_default_parameter (f, parms, Qcursor_type, Qbox, "cursorType", "CursorType", RES_TYPE_SYMBOL); x_default_parameter (f, parms, Qscroll_bar_width, Qnil, - "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); + "scrollBarWidth", "ScrollBarWidth", + RES_TYPE_NUMBER); /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. Change will not be effected unless different from the current @@ -2762,13 +2756,10 @@ This function is an internal primitive--use `make-frame' instead. */) width = FRAME_COLS (f); height = FRAME_LINES (f); - FRAME_LINES (f) = 0; SET_FRAME_COLS (f, 0); + FRAME_LINES (f) = 0; change_frame_size (f, height, width, 1, 0, 0); - /* Set up faces after all frame parameters are known. */ - call1 (Qface_set_after_frame_default, frame); - #if 0 /* MAC_TODO: when we have window manager hints */ /* Tell the server what size and position, etc, we want, and how badly we want them. This should be done after we have the menu @@ -2948,8 +2939,8 @@ If omitted or nil, that stands for the selected frame's display. */) { struct mac_display_info *dpyinfo = check_x_display_info (display); - /* MAC_TODO: check whether this is right */ - return make_number (dpyinfo->n_planes >= 8 ? 256 : 1 << dpyinfo->n_planes - 1); + /* We force 24+ bit depths to 24-bit to prevent an overflow. */ + return make_number (1 << min (dpyinfo->n_planes, 24)); } DEFUN ("x-server-max-request-size", Fx_server_max_request_size, @@ -3025,11 +3016,8 @@ If omitted or nil, that stands for the selected frame's display. */) /* MAC_TODO: this is an approximation, and only of the main display */ struct mac_display_info *dpyinfo = check_x_display_info (display); - short h, v; - ScreenRes (&h, &v); - - return make_number ((int) (v / 72.0 * 25.4)); + return make_number ((int) (dpyinfo->height * 25.4 / dpyinfo->resy)); } DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0, @@ -3043,11 +3031,8 @@ If omitted or nil, that stands for the selected frame's display. */) /* MAC_TODO: this is an approximation, and only of the main display */ struct mac_display_info *dpyinfo = check_x_display_info (display); - short h, v; - - ScreenRes (&h, &v); - return make_number ((int) (h / 72.0 * 25.4)); + return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx)); } DEFUN ("x-display-backing-store", Fx_display_backing_store, @@ -3595,9 +3580,11 @@ hide_hourglass () ***********************************************************************/ static Lisp_Object x_create_tip_frame P_ ((struct mac_display_info *, - Lisp_Object)); + Lisp_Object, Lisp_Object)); +static void compute_tip_xy P_ ((struct frame *, Lisp_Object, Lisp_Object, + Lisp_Object, int, int, int *, int *)); -/* The frame of a currently visible tooltip, or null. */ +/* The frame of a currently visible tooltip. */ Lisp_Object tip_frame; @@ -3612,15 +3599,42 @@ Window tip_window; Lisp_Object last_show_tip_args; +/* Maximum size for tooltips; a cons (COLUMNS . ROWS). */ + +Lisp_Object Vx_max_tooltip_size; + + +static Lisp_Object +unwind_create_tip_frame (frame) + Lisp_Object frame; +{ + Lisp_Object deleted; + + deleted = unwind_create_frame (frame); + if (EQ (deleted, Qt)) + { + tip_window = NULL; + tip_frame = Qnil; + } + + return deleted; +} + + /* Create a frame for a tooltip on the display described by DPYINFO. - PARMS is a list of frame parameters. Value is the frame. */ + PARMS is a list of frame parameters. TEXT is the string to + display in the tip frame. Value is the frame. + + Note that functions called here, esp. x_default_parameter can + signal errors, for instance when a specified color name is + undefined. We have to make sure that we're in a consistent state + when this happens. */ static Lisp_Object -x_create_tip_frame (dpyinfo, parms) +x_create_tip_frame (dpyinfo, parms, text) struct mac_display_info *dpyinfo; - Lisp_Object parms; + Lisp_Object parms, text; { -#if 0 /* MAC_TODO : Mac version */ struct frame *f; Lisp_Object frame, tem; Lisp_Object name; @@ -3629,8 +3643,11 @@ x_create_tip_frame (dpyinfo, parms) int count = SPECPDL_INDEX (); struct gcpro gcpro1, gcpro2, gcpro3; struct kboard *kb; + int face_change_count_before = face_change_count; + Lisp_Object buffer; + struct buffer *old_buffer; - check_x (); + check_mac (); /* Use this general default value to start with until we know if this frame has a specified name. */ @@ -3643,7 +3660,7 @@ x_create_tip_frame (dpyinfo, parms) #endif /* Get the name of the frame to use for resource lookup. */ - name = w32_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING); + name = mac_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING); if (!STRINGP (name) && !EQ (name, Qunbound) && !NILP (name)) @@ -3652,31 +3669,50 @@ x_create_tip_frame (dpyinfo, parms) frame = Qnil; GCPRO3 (parms, name, frame); - tip_frame = f = make_frame (1); + f = make_frame (1); XSETFRAME (frame, f); + + buffer = Fget_buffer_create (build_string (" *tip*")); + Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); + old_buffer = current_buffer; + set_buffer_internal_1 (XBUFFER (buffer)); + current_buffer->truncate_lines = Qnil; + specbind (Qinhibit_read_only, Qt); + specbind (Qinhibit_modification_hooks, Qt); + Ferase_buffer (); + Finsert (1, &text); + set_buffer_internal_1 (old_buffer); + FRAME_CAN_HAVE_SCROLL_BARS (f) = 0; + record_unwind_protect (unwind_create_tip_frame, frame); - f->output_method = output_w32; - f->output_data.w32 = - (struct w32_output *) xmalloc (sizeof (struct w32_output)); - bzero (f->output_data.w32, sizeof (struct w32_output)); -#if 0 - f->output_data.w32->icon_bitmap = -1; -#endif - FRAME_FONTSET (f) = -1; + /* By setting the output method, we're essentially saying that + the frame is live, as per FRAME_LIVE_P. If we get a signal + from this point on, x_destroy_window might screw up reference + counts etc. */ + f->output_method = output_mac; + f->output_data.mac = + (struct mac_output *) xmalloc (sizeof (struct mac_output)); + bzero (f->output_data.mac, sizeof (struct mac_output)); + + FRAME_FONTSET (f) = -1; f->icon_name = Qnil; +#if 0 /* GLYPH_DEBUG TODO: image support. */ + image_cache_refcount = FRAME_X_IMAGE_CACHE (f)->refcount; + dpyinfo_refcount = dpyinfo->reference_count; +#endif /* GLYPH_DEBUG */ #ifdef MULTI_KBOARD FRAME_KBOARD (f) = kb; #endif - f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; - f->output_data.w32->explicit_parent = 0; + f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; + f->output_data.mac->explicit_parent = 0; /* Set the name; the functions to which we pass f expect the name to be set. */ if (EQ (name, Qunbound) || NILP (name)) { - f->name = build_string (dpyinfo->x_id_name); + f->name = build_string (dpyinfo->mac_id_name); f->explicit_name = 0; } else @@ -3687,12 +3723,12 @@ x_create_tip_frame (dpyinfo, parms) specbind (Qx_resource_name, name); } - /* Extract the window parameters from the supplied values - that are needed to determine window geometry. */ + /* Extract the window parameters from the supplied values that are + needed to determine window geometry. */ { Lisp_Object font; - font = w32_get_arg (parms, Qfont, "font", "Font", RES_TYPE_STRING); + font = mac_get_arg (parms, Qfont, "font", "Font", RES_TYPE_STRING); BLOCK_INPUT; /* First, try whatever font the caller has specified. */ @@ -3706,22 +3742,16 @@ x_create_tip_frame (dpyinfo, parms) } /* Try out a font which we hope has bold and italic variations. */ - if (!STRINGP (font)) - font = x_new_font (f, "-adobe-courier-medium-r-*-*-*-120-*-*-*-*-iso8859-1"); - if (!STRINGP (font)) - font = x_new_font (f, "-misc-fixed-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); - if (! STRINGP (font)) - font = x_new_font (f, "-*-*-medium-r-normal-*-*-140-*-*-c-*-iso8859-1"); if (! STRINGP (font)) - /* This was formerly the first thing tried, but it finds too many fonts - and takes too long. */ - font = x_new_font (f, "-*-*-medium-r-*-*-*-*-*-*-c-*-iso8859-1"); + font = x_new_font (f, "-ETL-fixed-medium-r-*--*-160-*-*-*-*-iso8859-1"); /* If those didn't work, look for something which will at least work. */ if (! STRINGP (font)) - font = x_new_font (f, "-*-fixed-*-*-*-*-*-140-*-*-c-*-iso8859-1"); + font = x_new_font (f, "-*-monaco-*-12-*-mac-roman"); + if (! STRINGP (font)) + font = x_new_font (f, "-*-courier-*-10-*-mac-roman"); UNBLOCK_INPUT; if (! STRINGP (font)) - font = build_string ("fixed"); + error ("Cannot find any usable font"); x_default_parameter (f, parms, Qfont, font, "font", "Font", RES_TYPE_STRING); @@ -3737,7 +3767,7 @@ x_create_tip_frame (dpyinfo, parms) { Lisp_Object value; - value = w32_get_arg (parms, Qinternal_border_width, + value = mac_get_arg (parms, Qinternal_border_width, "internalBorder", "internalBorder", RES_TYPE_NUMBER); if (! EQ (value, Qunbound)) parms = Fcons (Fcons (Qinternal_border_width, value), @@ -3768,34 +3798,28 @@ x_create_tip_frame (dpyinfo, parms) happen. */ init_frame_faces (f); - f->output_data.w32->parent_desc = FRAME_W32_DISPLAY_INFO (f)->root_window; + f->output_data.mac->parent_desc = FRAME_MAC_DISPLAY_INFO (f)->root_window; window_prompting = x_figure_window_size (f, parms, 0); { - XSetWindowAttributes attrs; - unsigned long mask; + Rect r; BLOCK_INPUT; - mask = CWBackPixel | CWOverrideRedirect | CWSaveUnder | CWEventMask; - /* Window managers looks at the override-redirect flag to - determine whether or net to give windows a decoration (Xlib - 3.2.8). */ - attrs.override_redirect = True; - attrs.save_under = True; - attrs.background_pixel = FRAME_BACKGROUND_PIXEL (f); - /* Arrange for getting MapNotify and UnmapNotify events. */ - attrs.event_mask = StructureNotifyMask; - tip_window - = FRAME_W32_WINDOW (f) - = XCreateWindow (FRAME_W32_DISPLAY (f), - FRAME_W32_DISPLAY_INFO (f)->root_window, - /* x, y, width, height */ - 0, 0, 1, 1, - /* Border. */ - 1, - CopyFromParent, InputOutput, CopyFromParent, - mask, &attrs); + SetRect (&r, 0, 0, 1, 1); + if (CreateNewWindow (kHelpWindowClass, +#ifdef MAC_OS_X_VERSION_10_2 + kWindowIgnoreClicksAttribute | +#endif + kWindowNoActivatesAttribute, + &r, &tip_window) == noErr) + { + FRAME_MAC_WINDOW (f) = tip_window; + SetWRefCon (tip_window, (long) f->output_data.mac); + /* so that update events can find this mac_output struct */ + f->output_data.mac->mFP = f; + ShowWindow (tip_window); + } UNBLOCK_INPUT; } @@ -3813,8 +3837,8 @@ x_create_tip_frame (dpyinfo, parms) FRAME_LINES (f). */ width = FRAME_COLS (f); height = FRAME_LINES (f); - FRAME_LINES (f) = 0; SET_FRAME_COLS (f, 0); + FRAME_LINES (f) = 0; change_frame_size (f, height, width, 1, 0, 0); /* Add `tooltip' frame parameter's default value. */ @@ -3822,6 +3846,26 @@ x_create_tip_frame (dpyinfo, parms) Fmodify_frame_parameters (frame, Fcons (Fcons (intern ("tooltip"), Qt), Qnil)); + /* Set up faces after all frame parameters are known. This call + also merges in face attributes specified for new frames. + + Frame parameters may be changed if .Xdefaults contains + specifications for the default font. For example, if there is an + `Emacs.default.attributeBackground: pink', the `background-color' + attribute of the frame get's set, which let's the internal border + of the tooltip frame appear in pink. Prevent this. */ + { + Lisp_Object bg = Fframe_parameter (frame, Qbackground_color); + + /* Set tip_frame here, so that */ + tip_frame = frame; + call1 (Qface_set_after_frame_default, frame); + + if (!EQ (bg, Fframe_parameter (frame, Qbackground_color))) + Fmodify_frame_parameters (frame, Fcons (Fcons (Qbackground_color, bg), + Qnil)); + } + f->no_split = 1; UNGCPRO; @@ -3833,17 +3877,80 @@ x_create_tip_frame (dpyinfo, parms) /* Now that the frame is official, it counts as a reference to its display. */ - FRAME_W32_DISPLAY_INFO (f)->reference_count++; + FRAME_MAC_DISPLAY_INFO (f)->reference_count++; + /* Setting attributes of faces of the tooltip frame from resources + and similar will increment face_change_count, which leads to the + clearing of all current matrices. Since this isn't necessary + here, avoid it by resetting face_change_count to the value it + had before we created the tip frame. */ + face_change_count = face_change_count_before; + + /* Discard the unwind_protect. */ return unbind_to (count, frame); -#endif /* MAC_TODO */ - return Qnil; +} + + +/* Compute where to display tip frame F. PARMS is the list of frame + parameters for F. DX and DY are specified offsets from the current + location of the mouse. WIDTH and HEIGHT are the width and height + of the tooltip. Return coordinates relative to the root window of + the display in *ROOT_X, and *ROOT_Y. */ + +static void +compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) + struct frame *f; + Lisp_Object parms, dx, dy; + int width, height; + int *root_x, *root_y; +{ + Lisp_Object left, top; + + /* User-specified position? */ + left = Fcdr (Fassq (Qleft, parms)); + top = Fcdr (Fassq (Qtop, parms)); + + /* Move the tooltip window where the mouse pointer is. Resize and + show it. */ + if (!INTEGERP (left) || !INTEGERP (top)) + { + Point mouse_pos; + + BLOCK_INPUT; + GetMouse (&mouse_pos); + LocalToGlobal (&mouse_pos); + *root_x = mouse_pos.h; + *root_y = mouse_pos.v; + UNBLOCK_INPUT; + } + + if (INTEGERP (top)) + *root_y = XINT (top); + else if (*root_y + XINT (dy) - height < 0) + *root_y -= XINT (dy); + else + { + *root_y -= height; + *root_y += XINT (dy); + } + + if (INTEGERP (left)) + *root_x = XINT (left); + else if (*root_x + XINT (dx) + width <= FRAME_MAC_DISPLAY_INFO (f)->width) + /* It fits to the right of the pointer. */ + *root_x += XINT (dx); + else if (width + XINT (dx) <= *root_x) + /* It fits to the left of the pointer. */ + *root_x -= width + XINT (dx); + else + /* Put it left-justified on the screen -- it ought to fit that way. */ + *root_x = 0; } DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, - doc : /* Show STRING in a "tooltip" window on frame FRAME. -A tooltip window is a small window displaying a string. + doc: /* Show STRING in a "tooltip" window on frame FRAME. +A tooltip window is a small X window displaying a string. FRAME nil or omitted means use the selected frame. @@ -3859,19 +3966,19 @@ displayed at the mouse position, with offset DX added (default is 5 if DX isn't specified). Likewise for the y-position; if a `top' frame parameter is specified, it determines the y-position of the tooltip window, otherwise it is displayed at the mouse position, with offset -DY added (default is 10). */) - (string, frame, parms, timeout, dx, dy) +DY added (default is -10). + +A tooltip's maximum size is specified by `x-max-tooltip-size'. +Text larger than the specified size is clipped. */) + (string, frame, parms, timeout, dx, dy) Lisp_Object string, frame, parms, timeout, dx, dy; { struct frame *f; struct window *w; - Window root, child; - Lisp_Object buffer, top, left; + int root_x, root_y; struct buffer *old_buffer; struct text_pos pos; int i, width, height; - int root_x, root_y, win_x, win_y; - unsigned pmask; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; int old_windows_or_buffers_changed = windows_or_buffers_changed; int count = SPECPDL_INDEX (); @@ -3920,13 +4027,11 @@ DY added (default is 10). */) call1 (Qcancel_timer, timer); } -#if 0 /* MAC_TODO : Mac specifics */ BLOCK_INPUT; - compute_tip_xy (f, parms, dx, dy, &root_x, &root_y); - XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - root_x, root_y - FRAME_PIXEL_HEIGHT (f)); + compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f), + FRAME_PIXEL_HEIGHT (f), &root_x, &root_y); + MoveWindow (FRAME_MAC_WINDOW (f), root_x, root_y, false); UNBLOCK_INPUT; -#endif /* MAC_TODO */ goto start_timer; } } @@ -3953,26 +4058,36 @@ DY added (default is 10). */) /* Create a frame for the tooltip, and record it in the global variable tip_frame. */ - frame = x_create_tip_frame (FRAME_MAC_DISPLAY_INFO (f), parms); + frame = x_create_tip_frame (FRAME_MAC_DISPLAY_INFO (f), parms, string); f = XFRAME (frame); - /* Set up the frame's root window. Currently we use a size of 80 - columns x 40 lines. If someone wants to show a larger tip, he - will loose. I don't think this is a realistic case. */ + /* Set up the frame's root window. */ w = XWINDOW (FRAME_ROOT_WINDOW (f)); w->left_col = w->top_line = make_number (0); - w->total_cols = make_number (80); - w->total_lines = make_number (40); + + if (CONSP (Vx_max_tooltip_size) + && INTEGERP (XCAR (Vx_max_tooltip_size)) + && XINT (XCAR (Vx_max_tooltip_size)) > 0 + && INTEGERP (XCDR (Vx_max_tooltip_size)) + && XINT (XCDR (Vx_max_tooltip_size)) > 0) + { + w->total_cols = XCAR (Vx_max_tooltip_size); + w->total_lines = XCDR (Vx_max_tooltip_size); + } + else + { + w->total_cols = make_number (80); + w->total_lines = make_number (40); + } + + FRAME_TOTAL_COLS (f) = XINT (w->total_cols); adjust_glyphs (f); w->pseudo_window_p = 1; /* Display the tooltip text in a temporary buffer. */ - buffer = Fget_buffer_create (build_string (" *tip*")); - Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil); old_buffer = current_buffer; - set_buffer_internal_1 (XBUFFER (buffer)); - Ferase_buffer (); - Finsert (1, &string); + set_buffer_internal_1 (XBUFFER (XWINDOW (FRAME_ROOT_WINDOW (f))->buffer)); + current_buffer->truncate_lines = Qnil; clear_glyph_matrix (w->desired_matrix); clear_glyph_matrix (w->current_matrix); SET_TEXT_POS (pos, BEGV, BEGV_BYTE); @@ -3993,7 +4108,7 @@ DY added (default is 10). */) /* Let the row go over the full width of the frame. */ row->full_width_p = 1; - /* There's a glyph at the end of rows that is use to place + /* There's a glyph at the end of rows that is used to place the cursor there. Don't include the width of this glyph. */ if (row->used[TEXT_AREA]) { @@ -4014,17 +4129,13 @@ DY added (default is 10). */) /* Move the tooltip window where the mouse pointer is. Resize and show it. */ -#if 0 /* TODO : Mac specifics */ - compute_tip_xy (f, parms, dx, dy, &root_x, &root_y); + compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y); BLOCK_INPUT; - XQueryPointer (FRAME_W32_DISPLAY (f), FRAME_W32_DISPLAY_INFO (f)->root_window, - &root, &child, &root_x, &root_y, &win_x, &win_y, &pmask); - XMoveResizeWindow (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), - root_x + 5, root_y - height - 5, width, height); - XMapRaised (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f)); + MoveWindow (FRAME_MAC_WINDOW (f), root_x, root_y, false); + SizeWindow (FRAME_MAC_WINDOW (f), width, height, true); + BringToFront (FRAME_MAC_WINDOW (f)); UNBLOCK_INPUT; -#endif /* MAC_TODO */ /* Draw into the window. */ w->must_be_updated_p = 1; @@ -4046,8 +4157,8 @@ DY added (default is 10). */) DEFUN ("x-hide-tip", Fx_hide_tip, Sx_hide_tip, 0, 0, 0, doc: /* Hide the current tooltip window, if there is any. -Value is t is tooltip was open, nil otherwise. */) - () +Value is t if tooltip was open, nil otherwise. */) + () { int count; Lisp_Object deleted, frame, timer; @@ -4249,7 +4360,8 @@ syms_of_macfns () staticpro (&Qsuppress_icon); Qundefined_color = intern ("undefined-color"); staticpro (&Qundefined_color); - /* This is the end of symbol initialization. */ + Qcancel_timer = intern ("cancel-timer"); + staticpro (&Qcancel_timer); Qhyper = intern ("hyper"); staticpro (&Qhyper); @@ -4265,6 +4377,7 @@ syms_of_macfns () staticpro (&Qcontrol); Qshift = intern ("shift"); staticpro (&Qshift); + /* This is the end of symbol initialization. */ /* Text property `display' should be nonsticky by default. */ Vtext_property_default_nonsticky @@ -4314,6 +4427,11 @@ or when you set the mouse color. */); doc: /* A string indicating the foreground color of the cursor box. */); Vx_cursor_fore_pixel = Qnil; + DEFVAR_LISP ("x-max-tooltip-size", &Vx_max_tooltip_size, + doc: /* Maximum size for tooltips. Value is a pair (COLUMNS . ROWS). +Text larger than this is clipped. */); + Vx_max_tooltip_size = Fcons (make_number (80), make_number (40)); + DEFVAR_LISP ("x-no-window-manager", &Vx_no_window_manager, doc: /* Non-nil if no window manager is in use. Emacs doesn't try to figure this out; this is always nil @@ -4386,6 +4504,9 @@ Chinese, Japanese, and Korean. */); tip_frame = Qnil; staticpro (&tip_frame); + last_show_tip_args = Qnil; + staticpro (&last_show_tip_args); + #if 0 /* MAC_TODO */ defsubr (&Sx_file_dialog); #endif diff --git a/src/macgui.h b/src/macgui.h index 2bb346e9d30..58081df52b4 100644 --- a/src/macgui.h +++ b/src/macgui.h @@ -57,16 +57,27 @@ typedef unsigned long Time; #undef init_process #define init_process emacs_init_process #undef INFINITY -typedef struct OpaqueWindowPtr* Window; #else #include <QuickDraw.h> /* for WindowPtr */ #include <QDOffscreen.h> /* for GWorldPtr */ #include <Controls.h> /* for ControlHandle in xdisp.c */ -typedef WindowPtr Window; +#include <Gestalt.h> #endif typedef GWorldPtr Pixmap; +#if TARGET_API_MAC_CARBON +typedef struct OpaqueWindowPtr *Window; +#define Cursor ThemeCursor +#define No_Cursor (-1) +#else +typedef WindowPtr Window; +#define SetPortWindowPort(w) SetPort(w) +#define Cursor CursHandle +#define No_Cursor (0) +extern CursPtr arrow_cursor; +#endif + #define FACE_DEFAULT (~0) diff --git a/src/macmenu.c b/src/macmenu.c index 06b1b16cf41..d205ee3b877 100644 --- a/src/macmenu.c +++ b/src/macmenu.c @@ -1424,7 +1424,8 @@ set_frame_menubar (f, first_time, deep_p) for (i = 0; i < previous_menu_items_used; i++) if (menu_items_used == i - || (!Fequal (previous_items[i], XVECTOR (menu_items)->contents[i]))) + || (NILP (Fequal (previous_items[i], + XVECTOR (menu_items)->contents[i])))) break; if (i == menu_items_used && i == previous_menu_items_used && i != 0) { @@ -1783,11 +1784,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) pos.h = x; pos.v = y; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (FRAME_MAC_WINDOW (f))); -#else - SetPort (FRAME_MAC_WINDOW (f)); -#endif + SetPortWindowPort (FRAME_MAC_WINDOW (f)); LocalToGlobal (&pos); @@ -1941,11 +1938,7 @@ mac_dialog (widget_value *wv) window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1); -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (window_ptr)); -#else - SetPort (window_ptr); -#endif + SetPortWindowPort (window_ptr); TextFont (0); /* Left and right margins in the dialog are 13 pixels each.*/ @@ -1963,11 +1956,7 @@ mac_dialog (widget_value *wv) SizeWindow (window_ptr, dialog_width, 78, 0); ShowWindow (window_ptr); -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (window_ptr)); -#else - SetPort (window_ptr); -#endif + SetPortWindowPort (window_ptr); TextFont (0); diff --git a/src/macterm.c b/src/macterm.c index 44029032bbd..360dccd4f16 100644 --- a/src/macterm.c +++ b/src/macterm.c @@ -53,7 +53,6 @@ Boston, MA 02111-1307, USA. */ #if defined (__MRC__) || (__MSL__ >= 0x6000) #include <ControlDefinitions.h> #endif -#include <Gestalt.h> #if __profile__ #include <profiler.h> @@ -196,14 +195,6 @@ static Lisp_Object last_mouse_scroll_bar; static Time last_mouse_movement_time; -enum mouse_tracking_type { - mouse_tracking_none, - mouse_tracking_mouse_movement, - mouse_tracking_scroll_bar -}; - -enum mouse_tracking_type mouse_tracking_in_progress = mouse_tracking_none; - struct scroll_bar *tracked_scroll_bar = NULL; /* Incremented by XTread_socket whenever it really tries to read @@ -294,7 +285,6 @@ void deactivate_scroll_bars (FRAME_PTR); static int is_emacs_window (WindowPtr); -extern int image_ascent (struct image *, struct face *); int x_bitmap_icon (struct frame *, Lisp_Object); void x_make_frame_visible (struct frame *); @@ -311,7 +301,7 @@ XFreePixmap (display, pixmap) Display *display; /* not used */ Pixmap pixmap; { - DisposeGWorld (pixmap); + DisposeGWorld (pixmap); } @@ -365,11 +355,7 @@ XDrawLine (display, w, gc, x1, y1, x2, y2) GC gc; int x1, y1, x2, y2; { -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (gc); @@ -384,6 +370,10 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) GC gc; int x1, y1, x2, y2; { + CGrafPtr old_port; + GDHandle old_gdh; + + GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); mac_set_colors (gc); @@ -392,6 +382,8 @@ mac_draw_line_to_pixmap (display, p, gc, x1, y1, x2, y2) MoveTo (x1, y1); LineTo (x2, y2); UnlockPixels (GetGWorldPixMap (p)); + + SetGWorld (old_port, old_gdh); } /* Mac version of XClearArea. */ @@ -411,11 +403,7 @@ XClearArea (display, w, x, y, width, height, exposures) xgc.foreground = mwp->x_compatible.foreground_pixel; xgc.background = mwp->x_compatible.background_pixel; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (&xgc); SetRect (&r, x, y, x + width, y + height); @@ -436,11 +424,7 @@ XClearWindow (display, w) xgc.foreground = mwp->x_compatible.foreground_pixel; xgc.background = mwp->x_compatible.background_pixel; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (&xgc); @@ -475,11 +459,7 @@ mac_draw_bitmap (display, w, gc, x, y, width, height, bits, overlay_p) bitmap.baseAddr = (char *)bits; SetRect (&(bitmap.bounds), 0, 0, width, height); -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (gc); SetRect (&r, x, y, x + width, y + height); @@ -504,11 +484,7 @@ mac_set_clip_rectangle (display, w, r) WindowPtr w; Rect *r; { -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); ClipRect (r); } @@ -523,11 +499,7 @@ mac_reset_clipping (display, w) { Rect r; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); SetRect (&r, -32767, -32767, 32767, 32767); ClipRect (&r); @@ -596,11 +568,7 @@ XCreatePixmap (display, w, width, height, depth) Rect r; QDErr err; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); SetRect (&r, 0, 0, width, height); err = NewGWorld (&pixmap, depth, &r, NULL, NULL, 0); @@ -621,11 +589,14 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth) { Pixmap pixmap; BitMap bitmap; + CGrafPtr old_port; + GDHandle old_gdh; pixmap = XCreatePixmap (display, w, width, height, depth); if (pixmap == NULL) return NULL; + GetGWorld (&old_port, &old_gdh); SetGWorld (pixmap, NULL); mac_create_bitmap_from_bitmap_data (&bitmap, data, width, height); mac_set_forecolor (fg); @@ -639,6 +610,7 @@ XCreatePixmapFromBitmapData (display, w, data, width, height, fg, bg, depth) &bitmap.bounds, &bitmap.bounds, srcCopy, 0); #endif /* not TARGET_API_MAC_CARBON */ UnlockPixels (GetGWorldPixMap (pixmap)); + SetGWorld (old_port, old_gdh); mac_free_bitmap (&bitmap); return pixmap; @@ -657,11 +629,7 @@ XFillRectangle (display, w, gc, x, y, width, height) { Rect r; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (gc); SetRect (&r, x, y, x + width, y + height); @@ -678,8 +646,11 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) int x, y; unsigned int width, height; { + CGrafPtr old_port; + GDHandle old_gdh; Rect r; + GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); mac_set_colors (gc); SetRect (&r, x, y, x + width, y + height); @@ -687,6 +658,8 @@ mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) LockPixels (GetGWorldPixMap (p)); PaintRect (&r); /* using foreground color of gc */ UnlockPixels (GetGWorldPixMap (p)); + + SetGWorld (old_port, old_gdh); } @@ -702,11 +675,7 @@ mac_draw_rectangle (display, w, gc, x, y, width, height) { Rect r; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (gc); SetRect (&r, x, y, x + width + 1, y + height + 1); @@ -725,8 +694,11 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height) int x, y; unsigned int width, height; { + CGrafPtr old_port; + GDHandle old_gdh; Rect r; + GetGWorld (&old_port, &old_gdh); SetGWorld (p, NULL); mac_set_colors (gc); SetRect (&r, x, y, x + width + 1, y + height + 1); @@ -734,6 +706,8 @@ mac_draw_rectangle_to_pixmap (display, p, gc, x, y, width, height) LockPixels (GetGWorldPixMap (p)); FrameRect (&r); /* using foreground color of gc */ UnlockPixels (GetGWorldPixMap (p)); + + SetGWorld (old_port, old_gdh); } @@ -747,11 +721,7 @@ mac_draw_string_common (display, w, gc, x, y, buf, nchars, mode, char *buf; int nchars, mode, bytes_per_char; { -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); mac_set_colors (gc); @@ -842,11 +812,7 @@ mac_copy_area (display, src, dest, gc, src_x, src_y, width, height, dest_x, { Rect src_r, dest_r; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (dest)); -#else - SetPort (dest); -#endif + SetPortWindowPort (dest); SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); @@ -882,11 +848,7 @@ mac_copy_area_with_mask (display, src, mask, dest, gc, src_x, src_y, { Rect src_r, dest_r; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (dest)); -#else - SetPort (dest); -#endif + SetPortWindowPort (dest); SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); @@ -946,7 +908,7 @@ mac_scroll_area (display, w, gc, src_x, src_y, width, height, dest_x, dest_y) SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); - SetPort (GetWindowPort (w)); + SetPortWindowPort (w); ForeColor (blackColor); BackColor (whiteColor); @@ -1004,8 +966,11 @@ mac_copy_area_to_pixmap (display, src, dest, gc, src_x, src_y, width, height, unsigned int width, height; int dest_x, dest_y; { + CGrafPtr old_port; + GDHandle old_gdh; Rect src_r, dest_r; + GetGWorld (&old_port, &old_gdh); SetGWorld (dest, NULL); ForeColor (blackColor); BackColor (whiteColor); @@ -1024,6 +989,8 @@ mac_copy_area_to_pixmap (display, src, dest, gc, src_x, src_y, width, height, #endif /* not TARGET_API_MAC_CARBON */ UnlockPixels (GetGWorldPixMap (dest)); UnlockPixels (GetGWorldPixMap (src)); + + SetGWorld (old_port, old_gdh); } @@ -1037,8 +1004,11 @@ mac_copy_area_with_mask_to_pixmap (display, src, mask, dest, gc, src_x, src_y, unsigned int width, height; int dest_x, dest_y; { + CGrafPtr old_port; + GDHandle old_gdh; Rect src_r, dest_r; + GetGWorld (&old_port, &old_gdh); SetGWorld (dest, NULL); ForeColor (blackColor); BackColor (whiteColor); @@ -1059,6 +1029,8 @@ mac_copy_area_with_mask_to_pixmap (display, src, mask, dest, gc, src_x, src_y, UnlockPixels (GetGWorldPixMap (dest)); UnlockPixels (GetGWorldPixMap (mask)); UnlockPixels (GetGWorldPixMap (src)); + + SetGWorld (old_port, old_gdh); } @@ -1181,7 +1153,7 @@ x_flush (f) FOR_EACH_FRAME (rest, frame) x_flush (XFRAME (frame)); } - else if (FRAME_X_P (f)) + else if (FRAME_MAC_P (f)) XFlush (FRAME_MAC_DISPLAY (f)); UNBLOCK_INPUT; #endif /* TARGET_API_MAC_CARBON */ @@ -1261,7 +1233,7 @@ x_update_window_begin (w) { int i; - for (i = 0; i < w->desired_matrix->nrows; ++i) + for (i = 0; i < w->desired_matrix->nrows; ++i) if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i)) break; @@ -1283,7 +1255,7 @@ mac_draw_vertical_window_border (w, x, y0, y1) int x, y0, y1; { struct frame *f = XFRAME (WINDOW_FRAME (w)); - + XDrawLine (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), f->output_data.mac->normal_gc, x, y0, x, y1); } @@ -1356,11 +1328,7 @@ x_update_end (f) /* Reset the background color of Mac OS Window to that of the frame after update so that it is used by Mac Toolbox to clear the update region before an update event is generated. */ -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (FRAME_MAC_WINDOW (f))); -#else - SetPort (FRAME_MAC_WINDOW (f)); -#endif + SetPortWindowPort (FRAME_MAC_WINDOW (f)); mac_set_backcolor (FRAME_BACKGROUND_PIXEL (f)); @@ -1381,7 +1349,7 @@ static void XTframe_up_to_date (f) struct frame *f; { - if (FRAME_X_P (f)) + if (FRAME_MAC_P (f)) { struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); @@ -1525,7 +1493,7 @@ x_draw_fringe_bitmap (w, row, p) : face->foreground); gcv.background = face->background; - mac_draw_bitmap (display, window, &gcv, p->x, p->y, + mac_draw_bitmap (display, window, &gcv, p->x, p->y, p->wd, p->h, bits, p->overlay_p); } @@ -1759,7 +1727,8 @@ static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap)); static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, int, int, int)); static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, - int, int, int, int, Rect *)); + int, int, int, int, int, int, + Rect *)); static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, int, int, int, Rect *)); @@ -2483,9 +2452,10 @@ x_setup_relief_colors (s) static void x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, - raised_p, left_p, right_p, clip_rect) + raised_p, top_p, bot_p, left_p, right_p, clip_rect) struct frame *f; - int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; + int left_x, top_y, right_x, bottom_y, width; + int top_p, bot_p, left_p, right_p, raised_p; Rect *clip_rect; { Display *dpy = FRAME_MAC_DISPLAY (f); @@ -2500,10 +2470,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, mac_set_clip_rectangle (dpy, window, clip_rect); /* Top. */ - for (i = 0; i < width; ++i) - XDrawLine (dpy, window, gc, - left_x + i * left_p, top_y + i, - right_x - i * right_p, top_y + i); + if (top_p) + for (i = 0; i < width; ++i) + XDrawLine (dpy, window, gc, + left_x + i * left_p, top_y + i, + right_x - i * right_p, top_y + i); /* Left. */ if (left_p) @@ -2520,10 +2491,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, clip_rect); /* Bottom. */ - for (i = 0; i < width; ++i) - XDrawLine (dpy, window, gc, - left_x + i * left_p, bottom_y - i, - right_x - i * right_p, bottom_y - i); + if (bot_p) + for (i = 0; i < width; ++i) + XDrawLine (dpy, window, gc, + left_x + i * left_p, bottom_y - i, + right_x - i * right_p, bottom_y - i); /* Right. */ if (right_p) @@ -2629,7 +2601,7 @@ x_draw_glyph_string_box (s) { x_setup_relief_colors (s); x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, - width, raised_p, left_p, right_p, &clip_rect); + width, raised_p, 1, 1, left_p, right_p, &clip_rect); } } @@ -2640,21 +2612,22 @@ static void x_draw_image_foreground (s) struct glyph_string *s; { - int x; - int y = s->ybase - image_ascent (s->img, s->face); + int x = s->x; + int y = s->ybase - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = s->x + abs (s->face->box_line_width); - else - x = s->x; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->img->pixmap) { @@ -2667,11 +2640,12 @@ x_draw_image_foreground (s) CONVERT_TO_XRECT (clip_rect, nr); image_rect.x = x; image_rect.y = y; - image_rect.width = s->img->width; - image_rect.height = s->img->height; + image_rect.width = s->slice.width; + image_rect.height = s->slice.height; if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, - s->window, s->gc, r.x - x, r.y - y, + s->window, s->gc, + s->slice.x + r.x - x, s->slice.y + r.y - y, r.width, r.height, r.x, r.y); } else @@ -2683,11 +2657,12 @@ x_draw_image_foreground (s) CONVERT_TO_XRECT (clip_rect, nr); image_rect.x = x; image_rect.y = y; - image_rect.width = s->img->width; - image_rect.height = s->img->height; + image_rect.width = s->slice.width; + image_rect.height = s->slice.height; if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) mac_copy_area (s->display, s->img->pixmap, s->window, s->gc, - r.x - x, r.y - y, r.width, r.height, r.x, r.y); + s->slice.x + r.x - x, s->slice.y + r.y - y, + r.width, r.height, r.x, r.y); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will @@ -2699,15 +2674,17 @@ x_draw_image_foreground (s) { int r = s->img->relief; if (r < 0) r = -r; - mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r, - s->img->width + r*2 - 1, s->img->height + r*2 - 1); + mac_draw_rectangle (s->display, s->window, s->gc, + x - r, y - r, + s->slice.width + r*2 - 1, + s->slice.height + r*2 - 1); } } } else /* Draw a rectangle if image could not be loaded. */ mac_draw_rectangle (s->display, s->window, s->gc, x, y, - s->img->width - 1, s->img->height - 1); + s->slice.width - 1, s->slice.height - 1); } @@ -2719,21 +2696,22 @@ x_draw_image_relief (s) { int x0, y0, x1, y1, thick, raised_p; Rect r; - int x; - int y = s->ybase - image_ascent (s->img, s->face); + int x = s->x; + int y = s->ybase - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = s->x + abs (s->face->box_line_width); - else - x = s->x; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->hl == DRAW_IMAGE_SUNKEN || s->hl == DRAW_IMAGE_RAISED) @@ -2749,12 +2727,17 @@ x_draw_image_relief (s) x0 = x - thick; y0 = y - thick; - x1 = x + s->img->width + thick - 1; - y1 = y + s->img->height + thick - 1; + x1 = x + s->slice.width + thick - 1; + y1 = y + s->slice.height + thick - 1; x_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); - x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); + x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, + s->slice.y == 0, + s->slice.y + s->slice.height == s->img->height, + s->slice.x == 0, + s->slice.x + s->slice.width == s->img->width, + &r); } @@ -2765,33 +2748,37 @@ x_draw_image_foreground_1 (s, pixmap) struct glyph_string *s; Pixmap pixmap; { - int x; - int y = s->ybase - s->y - image_ascent (s->img, s->face); + int x = 0; + int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = abs (s->face->box_line_width); - else - x = 0; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->img->pixmap) { if (s->img->mask) mac_copy_area_with_mask_to_pixmap (s->display, s->img->pixmap, s->img->mask, pixmap, s->gc, - 0, 0, s->img->width, s->img->height, + s->slice.x, s->slice.y, + s->slice.width, s->slice.height, x, y); else { mac_copy_area_to_pixmap (s->display, s->img->pixmap, pixmap, s->gc, - 0, 0, s->img->width, s->img->height, x, y); + s->slice.x, s->slice.y, + s->slice.width, s->slice.height, + x, y); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will @@ -2804,15 +2791,15 @@ x_draw_image_foreground_1 (s, pixmap) int r = s->img->relief; if (r < 0) r = -r; mac_draw_rectangle (s->display, s->window, s->gc, x - r, y - r, - s->img->width + r*2 - 1, - s->img->height + r*2 - 1); + s->slice.width + r*2 - 1, + s->slice.height + r*2 - 1); } } } else /* Draw a rectangle if image could not be loaded. */ mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, - s->img->width - 1, s->img->height - 1); + s->slice.width - 1, s->slice.height - 1); } @@ -2869,19 +2856,21 @@ x_draw_image_glyph_string (s) taller than image or if image has a clip mask to reduce flickering. */ s->stippled_p = s->face->stipple != 0; - if (height > s->img->height + if (height > s->slice.height || s->img->hmargin || s->img->vmargin || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) { - if (box_line_hwidth && s->first_glyph->left_box_line_p) - x = s->x + box_line_hwidth; - else - x = s->x; + x = s->x; + if (s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += box_line_hwidth; - y = s->y + box_line_vwidth; + y = s->y; + if (s->slice.y == 0) + y += box_line_vwidth; if (s->img->mask) { @@ -3695,11 +3684,7 @@ construct_mouse_click (result, event, f) mouseLoc = event->where; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (FRAME_MAC_WINDOW (f))); -#else - SetPort (FRAME_MAC_WINDOW (f)); -#endif + SetPortWindowPort (FRAME_MAC_WINDOW (f)); GlobalToLocal (&mouseLoc); XSETINT (result->x, mouseLoc.h); @@ -3728,6 +3713,7 @@ note_mouse_movement (frame, pos) FRAME_PTR frame; Point *pos; { + struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (frame); #if TARGET_API_MAC_CARBON Rect r; #endif @@ -3742,9 +3728,17 @@ note_mouse_movement (frame, pos) if (!PtInRect (*pos, &FRAME_MAC_WINDOW (frame)->portRect)) #endif { - frame->mouse_moved = 1; - last_mouse_scroll_bar = Qnil; - note_mouse_highlight (frame, -1, -1); + if (frame == dpyinfo->mouse_face_mouse_frame) + /* This case corresponds to LeaveNotify in X11. */ + { + /* If we move outside the frame, then we're certainly no + longer on any text in the frame. */ + clear_mouse_face (dpyinfo); + dpyinfo->mouse_face_mouse_frame = 0; + if (!dpyinfo->grabbed) + rif->define_frame_cursor (frame, + frame->output_data.mac->nontext_cursor); + } } /* Has the mouse moved off the glyph it was on at the last sighting? */ else if (pos->h < last_mouse_glyph.left @@ -3842,7 +3836,7 @@ glyph_rect (f, x, y, rect) /* x is to the right of the last glyph in the row. */ rect->left = WINDOW_TO_FRAME_PIXEL_X (w, gx); - /* Shouldn't this be a pixel value? + /* Shouldn't this be a pixel value? WINDOW_RIGHT_EDGE_X (w) seems to be the right value. ++KFS */ rect->right = WINDOW_RIGHT_EDGE_COL (w); @@ -3892,6 +3886,23 @@ remember_mouse_glyph (f1, gx, gy) } +static WindowPtr +mac_front_window () +{ +#if TARGET_API_MAC_CARBON + return GetFrontWindowOfClass (kDocumentWindowClass, true); +#else + WindowPtr front_window = FrontWindow (); + + if (tip_window && front_window == tip_window) + return GetNextWindow (front_window); + else + return front_window; +#endif +} + +#define mac_window_to_frame(wp) (((mac_output *) GetWRefCon (wp))->mFP) + /* Return the current position of the mouse. *fp should be a frame which indicates which display to ask about. @@ -3923,12 +3934,12 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) { Point mouse_pos; int ignore1, ignore2; - WindowPtr wp = FrontWindow (); + WindowPtr wp = mac_front_window (); struct frame *f; Lisp_Object frame, tail; if (is_emacs_window(wp)) - f = ((mac_output *) GetWRefCon (wp))->mFP; + f = mac_window_to_frame (wp); BLOCK_INPUT; @@ -3942,11 +3953,7 @@ XTmouse_position (fp, insist, bar_window, part, x, y, time) last_mouse_scroll_bar = Qnil; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (wp)); -#else - SetPort (wp); -#endif + SetPortWindowPort (wp); GetMouse (&mouse_pos); @@ -3984,7 +3991,7 @@ mac_handle_tool_bar_click (f, button_event) if (button_event->what == mouseDown) handle_tool_bar_click (f, x, y, 1, 0); else - handle_tool_bar_click (f, x, y, 0, + handle_tool_bar_click (f, x, y, 0, x_mac_to_emacs_modifiers (FRAME_MAC_DISPLAY_INFO (f), button_event->modifiers)); } @@ -4441,6 +4448,8 @@ x_scroll_bar_handle_click (bar, part_code, er, bufp) EventRecord *er; struct input_event *bufp; { + int win_y, top_range; + if (! GC_WINDOWP (bar->window)) abort (); @@ -4475,6 +4484,24 @@ x_scroll_bar_handle_click (bar, part_code, er, bufp) bufp->part = scroll_bar_handle; break; } + + win_y = XINT (bufp->y) - XINT (bar->top); + top_range = VERTICAL_SCROLL_BAR_TOP_RANGE (0/*dummy*/, XINT (bar->height)); + + win_y -= VERTICAL_SCROLL_BAR_TOP_BORDER; + + win_y -= 24; + + if (! NILP (bar->dragging)) + win_y -= XINT (bar->dragging); + + if (win_y < 0) + win_y = 0; + if (win_y > top_range) + win_y = top_range; + + XSETINT (bufp->x, win_y); + XSETINT (bufp->y, top_range); } @@ -4524,16 +4551,12 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time) unsigned long *time; { struct scroll_bar *bar = XSCROLL_BAR (last_mouse_scroll_bar); - WindowPtr wp = FrontWindow (); + WindowPtr wp = mac_front_window (); Point mouse_pos; - struct frame *f = ((mac_output *) GetWRefCon (wp))->mFP; + struct frame *f = mac_window_to_frame (wp); int win_y, top_range; -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (wp)); -#else - SetPort (wp); -#endif + SetPortWindowPort (wp); GetMouse (&mouse_pos); @@ -4645,7 +4668,8 @@ x_draw_hollow_cursor (w, row) /* Compute the proper height and ascent of the rectangle, based on the actual glyph. Using the full height of the row looks bad when there are tall images on that row. */ - h = max (FRAME_LINE_HEIGHT (f), cursor_glyph->ascent + cursor_glyph->descent); + h = max (min (FRAME_LINE_HEIGHT (f), row->height), + cursor_glyph->ascent + cursor_glyph->descent); if (h < row->height) y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; h--; @@ -4759,7 +4783,11 @@ mac_define_frame_cursor (f, cursor) struct frame *f; Cursor cursor; { - /* MAC TODO */ +#if TARGET_API_MAC_CARBON + SetThemeCursor (cursor); +#else + SetCursor (*cursor); +#endif } @@ -4933,7 +4961,7 @@ x_new_font (f, fontname) if (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) > 0) { int wid = FRAME_COLUMN_WIDTH (f); - FRAME_CONFIG_SCROLL_BAR_COLS (f) + FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) + wid-1) / wid; } else @@ -5027,11 +5055,7 @@ x_calc_absolute_position (f) GrafPtr savePort; GetPort (&savePort); -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (FRAME_MAC_WINDOW (f))); -#else - SetPort (FRAME_MAC_WINDOW (f)); -#endif + SetPortWindowPort (FRAME_MAC_WINDOW (f)); #if TARGET_API_MAC_CARBON { @@ -5406,10 +5430,15 @@ x_free_frame_resources (f) struct frame *f; { struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f); + WindowPtr wp = FRAME_MAC_WINDOW (f); BLOCK_INPUT; - DisposeWindow (FRAME_MAC_WINDOW (f)); + DisposeWindow (wp); + if (wp == tip_window) + /* Neither WaitNextEvent nor ReceiveNextEvent receives `window + closed' event. So we reset tip_window here. */ + tip_window = NULL; free_frame_menubar (f); @@ -5826,7 +5855,7 @@ decode_mac_font_name (char *name, int size, short scriptcode) break; case smKorean: coding_system = Qeuc_kr; - break; + break; default: return; } @@ -6277,7 +6306,7 @@ mac_do_list_fonts (pattern, maxnames) if (fast_string_match (pattern_regex, fontname) >= 0) { font_list = Fcons (fontname, font_list); - + n_fonts++; if (maxnames > 0 && n_fonts >= maxnames) break; @@ -6933,6 +6962,11 @@ Lisp_Object drag_and_drop_file_list; Point saved_menu_event_location; +#if !TARGET_API_MAC_CARBON +/* Place holder for the default arrow cursor. */ +CursPtr arrow_cursor; +#endif + /* Apple Events */ static void init_required_apple_events (void); static pascal OSErr @@ -6982,12 +7016,12 @@ static int mac_get_emulated_btn ( UInt32 modifiers ) { int result = 0; - if (Vmac_emulate_three_button_mouse != Qnil) { - int cmdIs3 = (Vmac_emulate_three_button_mouse != Qreverse); + if (!NILP (Vmac_emulate_three_button_mouse)) { + int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse); if (modifiers & controlKey) result = cmdIs3 ? 2 : 1; else if (modifiers & optionKey) - result = cmdIs3 ? 1 : 2; + result = cmdIs3 ? 1 : 2; } return result; } @@ -7001,7 +7035,7 @@ mac_event_to_emacs_modifiers (EventRef eventRef) UInt32 mods = 0; GetEventParameter (eventRef, kEventParamKeyModifiers, typeUInt32, NULL, sizeof (UInt32), NULL, &mods); - if (Vmac_emulate_three_button_mouse != Qnil && + if (!NILP (Vmac_emulate_three_button_mouse) && GetEventClass(eventRef) == kEventClassMouse) { mods &= ~(optionKey & cmdKey); @@ -7020,7 +7054,7 @@ mac_get_mouse_btn (EventRef ref) switch (result) { case kEventMouseButtonPrimary: - if (Vmac_emulate_three_button_mouse == Qnil) + if (NILP (Vmac_emulate_three_button_mouse)) return 0; else { UInt32 mods = 0; @@ -7119,6 +7153,8 @@ do_init_managers (void) InitCursor (); #if !TARGET_API_MAC_CARBON + arrow_cursor = &qd.arrow; + /* set up some extra stack space for use by emacs */ SetApplLimit ((Ptr) ((long) GetApplLimit () - EXTRA_STACK_ALLOC)); @@ -7147,8 +7183,12 @@ do_check_ram_size (void) static void do_window_update (WindowPtr win) { - struct mac_output *mwp = (mac_output *) GetWRefCon (win); - struct frame *f = mwp->mFP; + struct frame *f = mac_window_to_frame (win); + + if (win == tip_window) + /* The tooltip has been drawn already. Avoid the + SET_FRAME_GARBAGED below. */ + return; if (f) { @@ -7199,13 +7239,11 @@ is_emacs_window (WindowPtr win) static void do_window_activate (WindowPtr win) { - mac_output *mwp; struct frame *f; if (is_emacs_window (win)) { - mwp = (mac_output *) GetWRefCon (win); - f = mwp->mFP; + f = mac_window_to_frame (win); if (f) { @@ -7218,13 +7256,11 @@ do_window_activate (WindowPtr win) static void do_window_deactivate (WindowPtr win) { - mac_output *mwp; struct frame *f; if (is_emacs_window (win)) { - mwp = (mac_output *) GetWRefCon (win); - f = mwp->mFP; + f = mac_window_to_frame (win); if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame) { @@ -7238,14 +7274,12 @@ static void do_app_resume () { WindowPtr wp; - mac_output *mwp; struct frame *f; - wp = FrontWindow(); + wp = mac_front_window (); if (is_emacs_window (wp)) { - mwp = (mac_output *) GetWRefCon (wp); - f = mwp->mFP; + f = mac_window_to_frame (wp); if (f) { @@ -7262,14 +7296,12 @@ static void do_app_suspend () { WindowPtr wp; - mac_output *mwp; struct frame *f; - wp = FrontWindow(); + wp = mac_front_window (); if (is_emacs_window (wp)) { - mwp = (mac_output *) GetWRefCon (wp); - f = mwp->mFP; + f = mac_window_to_frame (wp); if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame) { @@ -7284,67 +7316,38 @@ do_app_suspend () static void -do_mouse_moved (Point mouse_pos) +do_mouse_moved (mouse_pos, f) + Point mouse_pos; + FRAME_PTR *f; { - WindowPtr wp = FrontWindow (); - struct frame *f; + WindowPtr wp = mac_front_window (); + struct x_display_info *dpyinfo; if (is_emacs_window (wp)) { - f = ((mac_output *) GetWRefCon (wp))->mFP; + *f = mac_window_to_frame (wp); + dpyinfo = FRAME_MAC_DISPLAY_INFO (*f); -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (wp)); -#else - SetPort (wp); -#endif + if (dpyinfo->mouse_face_hidden) + { + dpyinfo->mouse_face_hidden = 0; + clear_mouse_face (dpyinfo); + } - GlobalToLocal (&mouse_pos); - - note_mouse_movement (f, &mouse_pos); - } -} + SetPortWindowPort (wp); + GlobalToLocal (&mouse_pos); -static void -do_os_event (EventRecord *erp) -{ - switch((erp->message >> 24) & 0x000000FF) - { - case suspendResumeMessage: - if((erp->message & resumeFlag) == 1) - do_app_resume (); + if (dpyinfo->grabbed && tracked_scroll_bar) + x_scroll_bar_note_movement (tracked_scroll_bar, + mouse_pos.v + - XINT (tracked_scroll_bar->top), + TickCount() * (1000 / 60)); else - do_app_suspend (); - break; - - case mouseMovedMessage: - do_mouse_moved (erp->where); - break; + note_mouse_movement (*f, &mouse_pos); } } -static void -do_events (EventRecord *erp) -{ - switch (erp->what) - { - case updateEvt: - do_window_update ((WindowPtr) erp->message); - break; - - case osEvt: - do_os_event (erp); - break; - - case activateEvt: - if ((erp->modifiers & activeFlag) != 0) - do_window_activate ((WindowPtr) erp->message); - else - do_window_deactivate ((WindowPtr) erp->message); - break; - } -} static void do_apple_menu (SInt16 menu_item) @@ -7382,8 +7385,7 @@ do_menu_choice (SInt32 menu_choice) default: { - WindowPtr wp = FrontWindow (); - struct frame *f = ((mac_output *) GetWRefCon (wp))->mFP; + struct frame *f = mac_window_to_frame (mac_front_window ()); MenuHandle menu = GetMenuHandle (menu_id); if (menu) { @@ -7408,8 +7410,7 @@ do_grow_window (WindowPtr w, EventRecord *e) long grow_size; Rect limit_rect; int rows, columns; - mac_output *mwp = (mac_output *) GetWRefCon (w); - struct frame *f = mwp->mFP; + struct frame *f = mac_window_to_frame (w); SetRect(&limit_rect, MIN_DOC_SIZE, MIN_DOC_SIZE, MAX_DOC_SIZE, MAX_DOC_SIZE); @@ -7438,16 +7439,11 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out) Rect zoom_rect, port_rect; Point top_left; int w_title_height, columns, rows, width, height, dummy, x, y; - mac_output *mwp = (mac_output *) GetWRefCon (w); - struct frame *f = mwp->mFP; + struct frame *f = mac_window_to_frame (w); GetPort (&save_port); -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (w)); -#else - SetPort (w); -#endif + SetPortWindowPort (w); /* Clear window to avoid flicker. */ #if TARGET_API_MAC_CARBON @@ -7500,7 +7496,7 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out) } #endif /* not TARGET_API_MAC_CARBON */ - ZoomWindow (w, zoom_in_or_out, w == FrontWindow ()); + ZoomWindow (w, zoom_in_or_out, w == mac_front_window ()); /* retrieve window size and update application values */ #if TARGET_API_MAC_CARBON @@ -7510,7 +7506,7 @@ do_zoom_window (WindowPtr w, int zoom_in_or_out) #endif rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, port_rect.bottom - port_rect.top); columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, port_rect.right - port_rect.left); - x_set_window_size (mwp->mFP, 0, columns, rows); + x_set_window_size (f, 0, columns, rows); SetPort (save_port); } @@ -7841,8 +7837,8 @@ mac_do_receive_drag (WindowPtr window, void *handlerRefCon, { struct input_event event; Lisp_Object frame; - struct frame *f = ((mac_output *) GetWRefCon(window))->mFP; - SetPort (GetWindowPort (window)); + struct frame *f = mac_window_to_frame (window); + SetPortWindowPort (window); GlobalToLocal (&mouse); event.kind = DRAG_N_DROP_EVENT; @@ -8016,26 +8012,26 @@ keycode_to_xkeysym (int keyCode, int *xKeySym) /* Emacs calls this whenever it wants to read an input event from the user. */ int -XTread_socket (int sd, int expected, struct input_event *hold_quit) +XTread_socket (sd, expected, hold_quit) + int sd, expected; + struct input_event *hold_quit; { struct input_event inev; int count = 0; #if USE_CARBON_EVENTS - OSStatus rneResult; EventRef eventRef; - EventMouseButton mouseBtn; + EventTargetRef toolbox_dispatcher = GetEventDispatcherTarget (); +#else + EventMask event_mask; #endif EventRecord er; - int the_modifiers; - EventMask event_mask; + struct mac_display_info *dpyinfo = &one_mac_display_info; -#if 0 if (interrupt_input_blocked) { interrupt_input_pending = 1; return -1; } -#endif interrupt_input_pending = 0; BLOCK_INPUT; @@ -8057,26 +8053,33 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) if (terminate_flag) Fkill_emacs (make_number (1)); - /* It is necessary to set this (additional) argument slot of an - event to nil because keyboard.c protects incompletely processed - event from being garbage collected by placing them in the - kbd_buffer_gcpro vector. */ - EVENT_INIT (inev); - inev.kind = NO_EVENT; - inev.arg = Qnil; - +#if !USE_CARBON_EVENTS event_mask = everyEvent; if (NILP (Fboundp (Qmac_ready_for_drag_n_drop))) event_mask -= highLevelEventMask; -#if USE_CARBON_EVENTS - rneResult = ReceiveNextEvent (0, NULL, - expected - ? TicksToEventTime (app_sleep_time) - : 0, - kEventRemoveFromQueue, &eventRef); - if (!rneResult) + while (WaitNextEvent (event_mask, &er, + (expected ? app_sleep_time : 0L), NULL)) +#else + while (!ReceiveNextEvent (0, NULL, + (expected ? TicksToEventTime (app_sleep_time) : 0), + kEventRemoveFromQueue, &eventRef)) +#endif /* !USE_CARBON_EVENTS */ { + int do_help = 0; + struct frame *f; + + expected = 0; + + /* It is necessary to set this (additional) argument slot of an + event to nil because keyboard.c protects incompletely + processed event from being garbage collected by placing them + in the kbd_buffer_gcpro vector. */ + EVENT_INIT (inev); + inev.kind = NO_EVENT; + inev.arg = Qnil; + +#if USE_CARBON_EVENTS /* Handle new events */ if (!mac_convert_event_ref (eventRef, &er)) switch (GetEventClass (eventRef)) @@ -8086,13 +8089,12 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) { SInt32 delta; Point point; - WindowPtr window_ptr = FrontNonFloatingWindow (); - struct mac_output *mwp = (mac_output *) GetWRefCon (window_ptr); + WindowPtr window_ptr = mac_front_window (); + if (!IsValidWindowPtr (window_ptr)) { SysBeep(1); - UNBLOCK_INPUT; - return 0; + break; } GetEventParameter(eventRef, kEventParamMouseWheelDelta, @@ -8103,457 +8105,557 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) NULL, &point); inev.kind = WHEEL_EVENT; inev.code = 0; - inev.modifiers = (mac_event_to_emacs_modifiers(eventRef) + inev.modifiers = (mac_event_to_emacs_modifiers (eventRef) | ((delta < 0) ? down_modifier : up_modifier)); - SetPort (GetWindowPort (window_ptr)); + SetPortWindowPort (window_ptr); GlobalToLocal (&point); XSETINT (inev.x, point.h); XSETINT (inev.y, point.v); - XSETFRAME (inev.frame_or_window, mwp->mFP); + XSETFRAME (inev.frame_or_window, + mac_window_to_frame (window_ptr)); inev.timestamp = EventTimeToTicks (GetEventTime (eventRef))*(1000/60); } else - SendEventToEventTarget (eventRef, GetEventDispatcherTarget ()); + SendEventToEventTarget (eventRef, toolbox_dispatcher); break; default: /* Send the event to the appropriate receiver. */ - SendEventToEventTarget (eventRef, GetEventDispatcherTarget ()); + SendEventToEventTarget (eventRef, toolbox_dispatcher); } else -#else - if (WaitNextEvent (event_mask, &er, (expected ? app_sleep_time : 0L), NULL)) #endif /* USE_CARBON_EVENTS */ - switch (er.what) - { - case mouseDown: - case mouseUp: + switch (er.what) { - WindowPtr window_ptr = FrontWindow (); - SInt16 part_code; + case mouseDown: + case mouseUp: + { + WindowPtr window_ptr; + SInt16 part_code; + int tool_bar_p = 0; + + if (dpyinfo->grabbed && last_mouse_frame + && FRAME_LIVE_P (last_mouse_frame)) + { + window_ptr = FRAME_MAC_WINDOW (last_mouse_frame); + part_code = inContent; + } + else + { + window_ptr = FrontWindow (); + if (tip_window && window_ptr == tip_window) + { + HideWindow (tip_window); + window_ptr = FrontWindow (); + } #if USE_CARBON_EVENTS - /* This is needed to send mouse events like aqua window buttons - to the correct handler. */ - if (eventNotHandledErr != SendEventToEventTarget (eventRef, GetEventDispatcherTarget ())) { - break; - } + /* This is needed to send mouse events like aqua + window buttons to the correct handler. */ + if (SendEventToEventTarget (eventRef, toolbox_dispatcher) + != eventNotHandledErr) + break; - if (!is_emacs_window(window_ptr)) - break; + if (!is_emacs_window (window_ptr)) + break; #endif + part_code = FindWindow (er.where, &window_ptr); + } + + switch (part_code) + { + case inMenuBar: + if (er.what == mouseDown) + { + f = mac_window_to_frame (mac_front_window ()); + saved_menu_event_location = er.where; + inev.kind = MENU_BAR_ACTIVATE_EVENT; + XSETFRAME (inev.frame_or_window, f); + } + break; - if (mouse_tracking_in_progress == mouse_tracking_scroll_bar - && er.what == mouseUp) - { - struct mac_output *mwp = (mac_output *) GetWRefCon (window_ptr); - Point mouse_loc = er.where; + case inContent: + if (window_ptr != mac_front_window ()) + SelectWindow (window_ptr); + else + { + SInt16 control_part_code; + ControlHandle ch; + Point mouse_loc = er.where; - /* Convert to local coordinates of new window. */ + f = mac_window_to_frame (window_ptr); + /* convert to local coordinates of new window */ + SetPortWindowPort (window_ptr); + + GlobalToLocal (&mouse_loc); #if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (window_ptr)); + ch = FindControlUnderMouse (mouse_loc, window_ptr, + &control_part_code); #else - SetPort (window_ptr); + control_part_code = FindControl (mouse_loc, window_ptr, + &ch); #endif - GlobalToLocal (&mouse_loc); - #if USE_CARBON_EVENTS - inev.code = mac_get_mouse_btn (eventRef); + inev.code = mac_get_mouse_btn (eventRef); + inev.modifiers = mac_event_to_emacs_modifiers (eventRef); #else - inev.code = mac_get_emulate_btn (er.modifiers); + inev.code = mac_get_emulated_btn (er.modifiers); + inev.modifiers = mac_to_emacs_modifiers (er.modifiers); #endif - inev.kind = SCROLL_BAR_CLICK_EVENT; - inev.frame_or_window = tracked_scroll_bar->window; - inev.part = scroll_bar_handle; -#if USE_CARBON_EVENTS - inev.modifiers = mac_event_to_emacs_modifiers (eventRef); + XSETINT (inev.x, mouse_loc.h); + XSETINT (inev.y, mouse_loc.v); + inev.timestamp = er.when * (1000 / 60); + /* ticks to milliseconds */ + + if (dpyinfo->grabbed && tracked_scroll_bar +#if TARGET_API_MAC_CARBON + || ch != 0 #else - inev.modifiers = mac_to_emacs_modifiers (er.modifiers); + || control_part_code != 0 #endif - inev.modifiers |= up_modifier; - inev.timestamp = er.when * (1000 / 60); - /* ticks to milliseconds */ + ) + { + struct scroll_bar *bar; + + if (dpyinfo->grabbed && tracked_scroll_bar) + { + bar = tracked_scroll_bar; + control_part_code = kControlIndicatorPart; + } + else + bar = (struct scroll_bar *) GetControlReference (ch); + x_scroll_bar_handle_click (bar, control_part_code, + &er, &inev); + if (er.what == mouseDown + && control_part_code == kControlIndicatorPart) + tracked_scroll_bar = bar; + else + tracked_scroll_bar = NULL; + } + else + { + Lisp_Object window; + int x = mouse_loc.h; + int y = mouse_loc.v; + + window = window_from_coordinates (f, x, y, 0, 0, 0, 1); + if (EQ (window, f->tool_bar_window)) + { + if (er.what == mouseDown) + handle_tool_bar_click (f, x, y, 1, 0); + else + handle_tool_bar_click (f, x, y, 0, + inev.modifiers); + tool_bar_p = 1; + } + else + { + XSETFRAME (inev.frame_or_window, f); + inev.kind = MOUSE_CLICK_EVENT; + } + } + + if (er.what == mouseDown) + { + dpyinfo->grabbed |= (1 << inev.code); + last_mouse_frame = f; + /* Ignore any mouse motion that happened + before this event; any subsequent + mouse-movement Emacs events should reflect + only motion after the ButtonPress. */ + if (f != 0) + f->mouse_moved = 0; + + if (!tool_bar_p) + last_tool_bar_item = -1; + } + else + { + if (dpyinfo->grabbed & (1 << inev.code) == 0) + /* If a button is released though it was not + previously pressed, that would be because + of multi-button emulation. */ + dpyinfo->grabbed = 0; + else + dpyinfo->grabbed &= ~(1 << inev.code); + } + + switch (er.what) + { + case mouseDown: + inev.modifiers |= down_modifier; + break; + case mouseUp: + inev.modifiers |= up_modifier; + break; + } + } + break; - XSETINT (inev.x, tracked_scroll_bar->left + 2); - XSETINT (inev.y, mouse_loc.v - 24); - tracked_scroll_bar->dragging = Qnil; - mouse_tracking_in_progress = mouse_tracking_none; - tracked_scroll_bar = NULL; - break; - } + case inDrag: +#if TARGET_API_MAC_CARBON + if (er.what == mouseDown) + { + BitMap bm; - part_code = FindWindow (er.where, &window_ptr); + GetQDGlobalsScreenBits (&bm); + DragWindow (window_ptr, er.where, &bm.bounds); + } +#else /* not TARGET_API_MAC_CARBON */ + DragWindow (window_ptr, er.where, &qd.screenBits.bounds); +#endif /* not TARGET_API_MAC_CARBON */ + break; - switch (part_code) - { - case inMenuBar: - if (er.what == mouseDown) - { - struct frame *f = ((mac_output *) - GetWRefCon (FrontWindow ()))->mFP; - saved_menu_event_location = er.where; - inev.kind = MENU_BAR_ACTIVATE_EVENT; - XSETFRAME (inev.frame_or_window, f); - } - break; + case inGoAway: + if (TrackGoAway (window_ptr, er.where)) + { + inev.kind = DELETE_WINDOW_EVENT; + XSETFRAME (inev.frame_or_window, + mac_window_to_frame (window_ptr)); + } + break; - case inContent: - if (window_ptr != FrontWindow ()) - SelectWindow (window_ptr); - else - { - SInt16 control_part_code; - ControlHandle ch; - struct mac_output *mwp = (mac_output *) - GetWRefCon (window_ptr); - Point mouse_loc = er.where; - - /* convert to local coordinates of new window */ -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (window_ptr)); -#else - SetPort (window_ptr); -#endif + /* window resize handling added --ben */ + case inGrow: + if (er.what == mouseDown) + { + do_grow_window(window_ptr, &er); + break; + } - GlobalToLocal (&mouse_loc); -#if TARGET_API_MAC_CARBON - ch = FindControlUnderMouse (mouse_loc, window_ptr, - &control_part_code); -#else - control_part_code = FindControl (mouse_loc, window_ptr, &ch); -#endif + /* window zoom handling added --ben */ + case inZoomIn: + case inZoomOut: + if (TrackBox (window_ptr, er.where, part_code)) + do_zoom_window (window_ptr, part_code); + break; -#if USE_CARBON_EVENTS - inev.code = mac_get_mouse_btn (eventRef); -#else - inev.code = mac_get_emulate_btn (er.modifiers); -#endif - XSETINT (inev.x, mouse_loc.h); - XSETINT (inev.y, mouse_loc.v); - inev.timestamp = er.when * (1000 / 60); - /* ticks to milliseconds */ + default: + break; + } + } + break; -#if TARGET_API_MAC_CARBON - if (ch != 0) -#else - if (control_part_code != 0) -#endif - { - struct scroll_bar *bar = (struct scroll_bar *) - GetControlReference (ch); - x_scroll_bar_handle_click (bar, control_part_code, &er, - &inev); - if (er.what == mouseDown - && control_part_code == kControlIndicatorPart) - { - mouse_tracking_in_progress - = mouse_tracking_scroll_bar; - tracked_scroll_bar = bar; - } - else - { - mouse_tracking_in_progress = mouse_tracking_none; - tracked_scroll_bar = NULL; - } - } - else - { - Lisp_Object window; - - XSETFRAME (inev.frame_or_window, mwp->mFP); - if (er.what == mouseDown) - mouse_tracking_in_progress - = mouse_tracking_mouse_movement; - else - mouse_tracking_in_progress = mouse_tracking_none; - window = window_from_coordinates (mwp->mFP, inev.x, inev.y, 0, 0, 0, 1); - - if (EQ (window, mwp->mFP->tool_bar_window)) - { - if (er.what == mouseDown) - handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 1, 0); - else - handle_tool_bar_click (mwp->mFP, inev.x, inev.y, 0, + case updateEvt: #if USE_CARBON_EVENTS - mac_event_to_emacs_modifiers (eventRef) -#else - er.modifiers + if (SendEventToEventTarget (eventRef, toolbox_dispatcher) + != eventNotHandledErr) + break; #endif - ); - break; - } - else - inev.kind = MOUSE_CLICK_EVENT; - } + do_window_update ((WindowPtr) er.message); + break; + case osEvt: #if USE_CARBON_EVENTS - inev.modifiers = mac_event_to_emacs_modifiers (eventRef); -#else - inev.modifiers = mac_to_emacs_modifiers (er.modifiers); + if (SendEventToEventTarget (eventRef, toolbox_dispatcher) + != eventNotHandledErr) + break; #endif - - switch (er.what) - { - case mouseDown: - inev.modifiers |= down_modifier; - break; - case mouseUp: - inev.modifiers |= up_modifier; - break; - } - } - break; - - case inDrag: -#if TARGET_API_MAC_CARBON - if (er.what == mouseDown) - { - BitMap bm; - - GetQDGlobalsScreenBits (&bm); - DragWindow (window_ptr, er.where, &bm.bounds); - } -#else /* not TARGET_API_MAC_CARBON */ - DragWindow (window_ptr, er.where, &qd.screenBits.bounds); -#endif /* not TARGET_API_MAC_CARBON */ + switch ((er.message >> 24) & 0x000000FF) + { + case suspendResumeMessage: + if ((er.message & resumeFlag) == 1) + do_app_resume (); + else + do_app_suspend (); break; - case inGoAway: - if (TrackGoAway (window_ptr, er.where)) - { - inev.kind = DELETE_WINDOW_EVENT; - XSETFRAME (inev.frame_or_window, - ((mac_output *) GetWRefCon (window_ptr))->mFP); - } - break; + case mouseMovedMessage: + previous_help_echo_string = help_echo_string; + help_echo_string = help_echo_object = help_echo_window = Qnil; + help_echo_pos = -1; - /* window resize handling added --ben */ - case inGrow: - if (er.what == mouseDown) - { - do_grow_window(window_ptr, &er); - break; - } - - /* window zoom handling added --ben */ - case inZoomIn: - case inZoomOut: - if (TrackBox (window_ptr, er.where, part_code)) - do_zoom_window (window_ptr, part_code); - break; + do_mouse_moved (er.where, &f); - default: + /* If the contents of the global variable + help_echo_string has changed, generate a + HELP_EVENT. */ + if (!NILP (help_echo_string) || !NILP (previous_help_echo_string)) + do_help = 1; break; } - } - break; + break; + + case activateEvt: + { + WindowPtr window_ptr = (WindowPtr) er.message; - case updateEvt: - case osEvt: - case activateEvt: #if USE_CARBON_EVENTS - if (eventNotHandledErr == SendEventToEventTarget (eventRef, GetEventDispatcherTarget ())) + if (SendEventToEventTarget (eventRef, toolbox_dispatcher) + != eventNotHandledErr) + break; #endif - do_events (&er); - break; + if (window_ptr == tip_window) + { + HideWindow (tip_window); + break; + } - case keyDown: - case autoKey: - { - int keycode = (er.message & keyCodeMask) >> 8; - int xkeysym; + if ((er.modifiers & activeFlag) != 0) + { + Point mouse_loc = er.where; -#if USE_CARBON_EVENTS - /* When using Carbon Events, we need to pass raw keyboard events - to the TSM ourselves. If TSM handles it, it will pass back - noErr, otherwise it will pass back "eventNotHandledErr" and - we can process it normally. */ - if ((!NILP (Vmac_pass_command_to_system) - || !(er.modifiers & cmdKey)) - && (!NILP (Vmac_pass_control_to_system) - || !(er.modifiers & controlKey))) - { - OSStatus err; - err = SendEventToEventTarget (eventRef, - GetEventDispatcherTarget ()); - if (err != eventNotHandledErr) - break; - } -#endif + do_window_activate (window_ptr); - if (!IsValidWindowPtr (FrontNonFloatingWindow ())) - { - SysBeep (1); - UNBLOCK_INPUT; - return 0; - } + SetPortWindowPort (window_ptr); + GlobalToLocal (&mouse_loc); + /* activateEvt counts as mouse movement, + so update things that depend on mouse position. */ + note_mouse_movement (mac_window_to_frame (window_ptr), + &mouse_loc); + } + else + { + do_window_deactivate (window_ptr); - ObscureCursor (); + f = mac_window_to_frame (window_ptr); + if (f == dpyinfo->mouse_face_mouse_frame) + { + /* If we move outside the frame, then we're + certainly no longer on any text in the + frame. */ + clear_mouse_face (dpyinfo); + dpyinfo->mouse_face_mouse_frame = 0; + } - if (keycode_to_xkeysym (keycode, &xkeysym)) - { - inev.code = 0xff00 | xkeysym; - inev.kind = NON_ASCII_KEYSTROKE_EVENT; - } - else - { - if (er.modifiers & (controlKey | - (NILP (Vmac_command_key_is_meta) ? optionKey - : cmdKey))) - { - /* This code comes from Keyboard Resource, Appendix - C of IM - Text. This is necessary since shift is - ignored in KCHR table translation when option or - command is pressed. It also does not translate - correctly control-shift chars like C-% so mask off - shift here also */ - int new_modifiers = er.modifiers & 0xe600; - /* mask off option and command */ - int new_keycode = keycode | new_modifiers; - Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); - unsigned long some_state = 0; - inev.code = KeyTranslate (kchr_ptr, new_keycode, - &some_state) & 0xff; - } - else - inev.code = er.message & charCodeMask; - inev.kind = ASCII_KEYSTROKE_EVENT; - } - } + /* Generate a nil HELP_EVENT to cancel a help-echo. + Do it only if there's something to cancel. + Otherwise, the startup message is cleared when the + mouse leaves the frame. */ + if (any_help_event_p) + do_help = -1; + } + } + break; - /* If variable mac-convert-keyboard-input-to-latin-1 is non-nil, - convert non-ASCII characters typed at the Mac keyboard - (presumed to be in the Mac Roman encoding) to iso-latin-1 - encoding before they are passed to Emacs. This enables the - Mac keyboard to be used to enter non-ASCII iso-latin-1 - characters directly. */ - if (mac_keyboard_text_encoding != kTextEncodingMacRoman - && inev.kind == ASCII_KEYSTROKE_EVENT && inev.code >= 128) + case keyDown: + case autoKey: { - static TECObjectRef converter = NULL; - OSStatus the_err = noErr; - OSStatus convert_status = noErr; + int keycode = (er.message & keyCodeMask) >> 8; + int xkeysym; - if (converter == NULL) +#if USE_CARBON_EVENTS + /* When using Carbon Events, we need to pass raw keyboard + events to the TSM ourselves. If TSM handles it, it + will pass back noErr, otherwise it will pass back + "eventNotHandledErr" and we can process it + normally. */ + if ((!NILP (Vmac_pass_command_to_system) + || !(er.modifiers & cmdKey)) + && (!NILP (Vmac_pass_control_to_system) + || !(er.modifiers & controlKey))) + if (SendEventToEventTarget (eventRef, toolbox_dispatcher) + != eventNotHandledErr) + break; +#endif + +#if TARGET_API_MAC_CARBON + if (!IsValidWindowPtr (mac_front_window ())) { - the_err = TECCreateConverter (&converter, - kTextEncodingMacRoman, - mac_keyboard_text_encoding); - current_mac_keyboard_text_encoding - = mac_keyboard_text_encoding; + SysBeep (1); + break; } - else if (mac_keyboard_text_encoding - != current_mac_keyboard_text_encoding) +#endif + + ObscureCursor (); + + if (!dpyinfo->mouse_face_hidden && INTEGERP (Vmouse_highlight)) { - /* Free the converter for the current encoding before - creating a new one. */ - TECDisposeConverter (converter); - the_err = TECCreateConverter (&converter, - kTextEncodingMacRoman, - mac_keyboard_text_encoding); - current_mac_keyboard_text_encoding - = mac_keyboard_text_encoding; + clear_mouse_face (dpyinfo); + dpyinfo->mouse_face_hidden = 1; } - if (the_err == noErr) + if (keycode_to_xkeysym (keycode, &xkeysym)) { - unsigned char ch = inev.code; - ByteCount actual_input_length, actual_output_length; - unsigned char outch; - - convert_status = TECConvertText (converter, &ch, 1, - &actual_input_length, - &outch, 1, - &actual_output_length); - if (convert_status == noErr - && actual_input_length == 1 - && actual_output_length == 1) - inev.code = outch; + inev.code = 0xff00 | xkeysym; + inev.kind = NON_ASCII_KEYSTROKE_EVENT; + } + else + { + if (er.modifiers & (controlKey | + (NILP (Vmac_command_key_is_meta) ? optionKey + : cmdKey))) + { + /* This code comes from Keyboard Resource, + Appendix C of IM - Text. This is necessary + since shift is ignored in KCHR table + translation when option or command is pressed. + It also does not translate correctly + control-shift chars like C-% so mask off shift + here also */ + int new_modifiers = er.modifiers & 0xe600; + /* mask off option and command */ + int new_keycode = keycode | new_modifiers; + Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache); + unsigned long some_state = 0; + inev.code = KeyTranslate (kchr_ptr, new_keycode, + &some_state) & 0xff; + } + else + inev.code = er.message & charCodeMask; + inev.kind = ASCII_KEYSTROKE_EVENT; } } + /* If variable mac-convert-keyboard-input-to-latin-1 is + non-nil, convert non-ASCII characters typed at the Mac + keyboard (presumed to be in the Mac Roman encoding) to + iso-latin-1 encoding before they are passed to Emacs. + This enables the Mac keyboard to be used to enter + non-ASCII iso-latin-1 characters directly. */ + if (mac_keyboard_text_encoding != kTextEncodingMacRoman + && inev.kind == ASCII_KEYSTROKE_EVENT && inev.code >= 128) + { + static TECObjectRef converter = NULL; + OSStatus the_err = noErr; + OSStatus convert_status = noErr; + + if (converter == NULL) + { + the_err = TECCreateConverter (&converter, + kTextEncodingMacRoman, + mac_keyboard_text_encoding); + current_mac_keyboard_text_encoding + = mac_keyboard_text_encoding; + } + else if (mac_keyboard_text_encoding + != current_mac_keyboard_text_encoding) + { + /* Free the converter for the current encoding + before creating a new one. */ + TECDisposeConverter (converter); + the_err = TECCreateConverter (&converter, + kTextEncodingMacRoman, + mac_keyboard_text_encoding); + current_mac_keyboard_text_encoding + = mac_keyboard_text_encoding; + } + + if (the_err == noErr) + { + unsigned char ch = inev.code; + ByteCount actual_input_length, actual_output_length; + unsigned char outch; + + convert_status = TECConvertText (converter, &ch, 1, + &actual_input_length, + &outch, 1, + &actual_output_length); + if (convert_status == noErr + && actual_input_length == 1 + && actual_output_length == 1) + inev.code = outch; + } + } + #if USE_CARBON_EVENTS - inev.modifiers = mac_event_to_emacs_modifiers (eventRef); + inev.modifiers = mac_event_to_emacs_modifiers (eventRef); #else - inev.modifiers = mac_to_emacs_modifiers (er.modifiers); + inev.modifiers = mac_to_emacs_modifiers (er.modifiers); #endif + XSETFRAME (inev.frame_or_window, + mac_window_to_frame (mac_front_window ())); + inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ + break; - { - mac_output *mwp - = (mac_output *) GetWRefCon (FrontNonFloatingWindow ()); - XSETFRAME (inev.frame_or_window, mwp->mFP); - } - - inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ - break; - - case kHighLevelEvent: - drag_and_drop_file_list = Qnil; + case kHighLevelEvent: + drag_and_drop_file_list = Qnil; - AEProcessAppleEvent(&er); + AEProcessAppleEvent(&er); - /* Build a DRAG_N_DROP_EVENT type event as is done in - constuct_drag_n_drop in w32term.c. */ - if (!NILP (drag_and_drop_file_list)) - { - struct frame *f = NULL; - WindowPtr wp; - Lisp_Object frame; + /* Build a DRAG_N_DROP_EVENT type event as is done in + constuct_drag_n_drop in w32term.c. */ + if (!NILP (drag_and_drop_file_list)) + { + struct frame *f = NULL; + WindowPtr wp; + Lisp_Object frame; - wp = FrontNonFloatingWindow (); + wp = mac_front_window (); - if (!wp) - { - struct frame *f = XFRAME (XCAR (Vframe_list)); - CollapseWindow (FRAME_MAC_WINDOW (f), false); - wp = FrontNonFloatingWindow (); - } + if (!wp) + { + struct frame *f = XFRAME (XCAR (Vframe_list)); + CollapseWindow (FRAME_MAC_WINDOW (f), false); + wp = mac_front_window (); + } - if (wp && is_emacs_window(wp)) - f = ((mac_output *) GetWRefCon (wp))->mFP; + if (wp && is_emacs_window (wp)) + f = mac_window_to_frame (wp); - inev.kind = DRAG_N_DROP_EVENT; - inev.code = 0; - inev.timestamp = er.when * (1000 / 60); + inev.kind = DRAG_N_DROP_EVENT; + inev.code = 0; + inev.timestamp = er.when * (1000 / 60); /* ticks to milliseconds */ #if USE_CARBON_EVENTS - inev.modifiers = mac_event_to_emacs_modifiers (eventRef); + inev.modifiers = mac_event_to_emacs_modifiers (eventRef); #else - inev.modifiers = mac_to_emacs_modifiers (er.modifiers); + inev.modifiers = mac_to_emacs_modifiers (er.modifiers); #endif - XSETINT (inev.x, 0); - XSETINT (inev.y, 0); + XSETINT (inev.x, 0); + XSETINT (inev.y, 0); - XSETFRAME (frame, f); - inev.frame_or_window = Fcons (frame, drag_and_drop_file_list); + XSETFRAME (frame, f); + inev.frame_or_window = Fcons (frame, drag_and_drop_file_list); - /* Regardless of whether Emacs was suspended or in the - foreground, ask it to redraw its entire screen. - Otherwise parts of the screen can be left in an - inconsistent state. */ - if (wp) + /* Regardless of whether Emacs was suspended or in the + foreground, ask it to redraw its entire screen. + Otherwise parts of the screen can be left in an + inconsistent state. */ + if (wp) #if TARGET_API_MAC_CARBON - { - Rect r; + { + Rect r; - GetWindowPortBounds (wp, &r); - InvalWindowRect (wp, &r); - } + GetWindowPortBounds (wp, &r); + InvalWindowRect (wp, &r); + } #else /* not TARGET_API_MAC_CARBON */ - InvalRect (&(wp->portRect)); + InvalRect (&(wp->portRect)); #endif /* not TARGET_API_MAC_CARBON */ - } - default: - break; - } + } + default: + break; + } #if USE_CARBON_EVENTS ReleaseEvent (eventRef); - } #endif + if (inev.kind != NO_EVENT) + { + kbd_buffer_store_event_hold (&inev, hold_quit); + count++; + } + + if (do_help + && !(hold_quit && hold_quit->kind != NO_EVENT)) + { + Lisp_Object frame; + + if (f) + XSETFRAME (frame, f); + else + frame = Qnil; + + if (do_help > 0) + { + any_help_event_p = 1; + gen_help_event (help_echo_string, frame, help_echo_window, + help_echo_object, help_echo_pos); + } + else + { + help_echo_string = Qnil; + gen_help_event (Qnil, frame, Qnil, Qnil, 0); + } + count++; + } + + } + /* If the focus was just given to an autoraising frame, raise it now. */ /* ??? This ought to be able to handle more than one such frame. */ @@ -8567,58 +8669,6 @@ XTread_socket (int sd, int expected, struct input_event *hold_quit) check_alarm (); /* simulate the handling of a SIGALRM */ #endif - { - static Point old_mouse_pos = { -1, -1 }; - - if (app_is_suspended) - { - old_mouse_pos.h = -1; - old_mouse_pos.v = -1; - } - else - { - Point mouse_pos; - WindowPtr wp; - struct frame *f; - Lisp_Object bar; - struct scroll_bar *sb; - - wp = FrontWindow (); - if (is_emacs_window (wp)) - { - f = ((mac_output *) GetWRefCon (wp))->mFP; - -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (wp)); -#else - SetPort (wp); -#endif - - GetMouse (&mouse_pos); - - if (!EqualPt (mouse_pos, old_mouse_pos)) - { - if (mouse_tracking_in_progress == mouse_tracking_scroll_bar - && tracked_scroll_bar) - x_scroll_bar_note_movement (tracked_scroll_bar, - mouse_pos.v - - XINT (tracked_scroll_bar->top), - TickCount() * (1000 / 60)); - else - note_mouse_movement (f, &mouse_pos); - - old_mouse_pos = mouse_pos; - } - } - } - } - - if (inev.kind != NO_EVENT) - { - kbd_buffer_store_event_hold (&inev, hold_quit); - count++; - } - UNBLOCK_INPUT; return count; } @@ -8647,7 +8697,7 @@ __convert_from_newlines (unsigned char * p, size_t * n) ROWS Macintosh window, using font with name FONTNAME and size FONTSIZE. */ void -NewMacWindow (FRAME_PTR fp) +make_mac_frame (FRAME_PTR fp) { mac_output *mwp; #if TARGET_API_MAC_CARBON @@ -8666,33 +8716,52 @@ NewMacWindow (FRAME_PTR fp) making_terminal_window = 0; } else - if (!(mwp->mWP = GetNewCWindow (WINDOW_RESOURCE, NULL, (WindowPtr) -1))) - abort (); + { +#if TARGET_API_MAC_CARBON + Rect r; + + SetRect (&r, 0, 0, 1, 1); + if (CreateNewWindow (kDocumentWindowClass, + kWindowStandardDocumentAttributes + /* | kWindowToolbarButtonAttribute */, + &r, &mwp->mWP) != noErr) +#else + if (!(mwp->mWP = GetNewCWindow (WINDOW_RESOURCE, NULL, (WindowPtr) -1))) +#endif + abort (); + } SetWRefCon (mwp->mWP, (long) mwp); /* so that update events can find this mac_output struct */ mwp->mFP = fp; /* point back to emacs frame */ -#if TARGET_API_MAC_CARBON - SetPort (GetWindowPort (mwp->mWP)); -#else - SetPort (mwp->mWP); -#endif - - mwp->fontset = -1; + SetPortWindowPort (mwp->mWP); SizeWindow (mwp->mWP, FRAME_PIXEL_WIDTH (fp), FRAME_PIXEL_HEIGHT (fp), false); - ShowWindow (mwp->mWP); - } void -make_mac_frame (struct frame *f) +make_mac_terminal_frame (struct frame *f) { - FRAME_DESIRED_CURSOR (f) = FILLED_BOX_CURSOR; + Lisp_Object frame; - NewMacWindow(f); + XSETFRAME (frame, f); + + f->output_method = output_mac; + f->output_data.mac = (struct mac_output *) + xmalloc (sizeof (struct mac_output)); + bzero (f->output_data.mac, sizeof (struct mac_output)); + + XSETFRAME (FRAME_KBOARD (f)->Vdefault_minibuffer_frame, f); + + FRAME_COLS (f) = 96; + FRAME_LINES (f) = 4; + + FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; + FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right; + + FRAME_DESIRED_CURSOR (f) = FILLED_BOX_CURSOR; f->output_data.mac->cursor_pixel = 0; f->output_data.mac->border_pixel = 0x00ff00; @@ -8700,8 +8769,6 @@ make_mac_frame (struct frame *f) f->output_data.mac->cursor_foreground_pixel = 0x0000ff; FRAME_FONTSET (f) = -1; - f->output_data.mac->scroll_bar_foreground_pixel = -1; - f->output_data.mac->scroll_bar_background_pixel = -1; f->output_data.mac->explicit_parent = 0; f->left_pos = 4; f->top_pos = 4; @@ -8709,37 +8776,11 @@ make_mac_frame (struct frame *f) f->internal_border_width = 0; - f->output_method = output_mac; - f->auto_raise = 1; f->auto_lower = 1; f->new_text_cols = 0; f->new_text_lines = 0; -} - -void -make_mac_terminal_frame (struct frame *f) -{ - Lisp_Object frame; - - XSETFRAME (frame, f); - - f->output_method = output_mac; - f->output_data.mac = (struct mac_output *) - xmalloc (sizeof (struct mac_output)); - bzero (f->output_data.mac, sizeof (struct mac_output)); - FRAME_FONTSET (f) = -1; - f->output_data.mac->scroll_bar_foreground_pixel = -1; - f->output_data.mac->scroll_bar_background_pixel = -1; - - XSETFRAME (FRAME_KBOARD (f)->Vdefault_minibuffer_frame, f); - - FRAME_COLS (f) = 96; - FRAME_LINES (f) = 4; - - FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; - FRAME_VERTICAL_SCROLL_BAR_TYPE (f) = vertical_scroll_bar_right; make_mac_frame (f); @@ -8757,6 +8798,8 @@ make_mac_terminal_frame (struct frame *f) Fmodify_frame_parameters (frame, Fcons (Fcons (Qbackground_color, build_string ("white")), Qnil)); + + ShowWindow (f->output_data.mac->mWP); } @@ -8797,10 +8840,16 @@ mac_initialize_display_info () dpyinfo->resx = 75.0; dpyinfo->resy = 75.0; dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); +#ifdef MAC_OSX + /* HasDepth returns true if it is possible to have a 32 bit display, + but this may not be what is actually used. Mac OSX can do better. */ + dpyinfo->n_planes = CGDisplayBitsPerPixel (CGMainDisplayID ()); +#else for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1) if (HasDepth (main_device_handle, dpyinfo->n_planes, gdDevType, dpyinfo->color_p)) break; +#endif dpyinfo->height = (**main_device_handle).gdRect.bottom; dpyinfo->width = (**main_device_handle).gdRect.right; dpyinfo->grabbed = 0; @@ -8811,6 +8860,8 @@ mac_initialize_display_info () dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_end_col = -1; dpyinfo->mouse_face_face_id = DEFAULT_FACE_ID; dpyinfo->mouse_face_window = Qnil; + dpyinfo->mouse_face_overlay = Qnil; + dpyinfo->mouse_face_hidden = 0; } struct mac_display_info * @@ -8959,22 +9010,23 @@ mac_check_for_quit_char () mac_determine_quit_char_modifiers (); /* Fill the queue with events */ + BLOCK_INPUT; ReceiveNextEvent (0, NULL, kEventDurationNoWait, false, &event); event = FindSpecificEventInQueue (GetMainEventQueue (), quit_char_comp, NULL); + UNBLOCK_INPUT; if (event) { struct input_event e; - struct mac_output *mwp = - (mac_output *) GetWRefCon (FrontNonFloatingWindow ()); + /* Use an input_event to emulate what the interrupt handler does. */ EVENT_INIT (e); e.kind = ASCII_KEYSTROKE_EVENT; e.code = quit_char; - e.arg = NULL; + e.arg = Qnil; e.modifiers = NULL; e.timestamp = EventTimeToTicks (GetEventTime (event)) * (1000/60); - XSETFRAME (e.frame_or_window, mwp->mFP); + XSETFRAME (e.frame_or_window, mac_window_to_frame (mac_front_window ())); /* Remove event from queue to prevent looping. */ RemoveEventFromQueue (GetMainEventQueue (), event); ReleaseEvent (event); @@ -9185,10 +9237,10 @@ Otherwise the option key is used. */); useful for non-standard keyboard layouts. */); Vmac_reverse_ctrl_meta = Qnil; - DEFVAR_LISP ("mac-emulate-three-button-mouse", + DEFVAR_LISP ("mac-emulate-three-button-mouse", &Vmac_emulate_three_button_mouse, doc: /* t means that when the option-key is held down while pressing the - mouse button, the click will register as mouse-2 and while the + mouse button, the click will register as mouse-2 and while the command-key is held down, the click will register as mouse-3. 'reverse means that the the option-key will register for mouse-3 and the command-key will register for mouse-2. nil means that diff --git a/src/macterm.h b/src/macterm.h index 868ce88318c..f9bde772fcd 100644 --- a/src/macterm.h +++ b/src/macterm.h @@ -565,8 +565,18 @@ struct scroll_bar { text from glomming up against the scroll bar */ #define VERTICAL_SCROLL_BAR_WIDTH_TRIM (0) - -struct frame * check_x_frame (Lisp_Object); +struct frame; +struct face; +struct image; + +Lisp_Object display_x_get_resource P_ ((struct x_display_info *, + Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object)); +struct frame *check_x_frame P_ ((Lisp_Object)); +EXFUN (Fx_display_color_p, 1); +EXFUN (Fx_display_grayscale_p, 1); +EXFUN (Fx_display_planes, 1); +extern void x_free_gcs P_ ((struct frame *)); void activate_scroll_bars (FRAME_PTR); void deactivate_scroll_bars (FRAME_PTR); diff --git a/src/makefile.nt b/src/makefile.nt deleted file mode 100644 index 0cf08f37105..00000000000 --- a/src/makefile.nt +++ /dev/null @@ -1,1232 +0,0 @@ -# Makefile for GNU Emacs on the Microsoft W32 API. -# Copyright (c) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. -# Tim Fleehart (apollo@online.com) 17-Apr-92 -# Geoff Voelker (voelker@cs.washington.edu) 11-20-93 -# -# This file is part of GNU Emacs. -# -# GNU Emacs is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Emacs is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Emacs; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. -# - -# -# Sets up the system dependent macros. -# -!include ..\nt\makefile.def - -SUBSYSTEM=console - -# -# HAVE_CONFIG_H is required by some generic gnu sources stuck into -# the emacs source tree. -# -LOCAL_FLAGS = -Demacs=1 -DWINDOWSNT -DDOS_NT -DHAVE_CONFIG_H -I..\nt\inc -!ifdef NTGUI -LOCAL_FLAGS = $(LOCAL_FLAGS) -DHAVE_NTGUI=1 -!endif -!ifdef USE_CRT_DLL -LOCAL_FLAGS = $(LOCAL_FLAGS) -DUSE_CRT_DLL=1 -MD -libc = msvcrt.lib -LINK_FLAGS = -nodefaultlib -!endif - -# From MSVC 5.0 onwards, it seem base relocation information is not included, -# at least in release builds. We need to ensure the reloc info is included -# in order to use the MSVC profiler. -!IF ("$(_NMAKE_VER)" == "$(_NMAKE_VER_4)") -EXTRA_LINK = -!ELSE -EXTRA_LINK = -profile -!ENDIF - -EMACS = $(BLD)\emacs.exe -TEMACS = $(BLD)\temacs.exe -TEMACS_TMP = $(BLD)\temacs.bin -TLIB0 = $(BLD)\temacs0.lib -TLIB1 = $(BLD)\temacs1.lib -TLIB2 = $(BLD)\temacs2.lib -!IFDEF NTGUI -TLIBW32 = $(BLD)\temacw32.lib -!ELSE -TLIBW32 = -!ENDIF -TOBJ = $(BLD)\firstfile.obj -!if $(MSVCNT11) -TRES = $(BLD)\emacs.res -!else -TRES = $(BLD)\emacs.rbj -!endif -TLASTLIB = $(BLD)\lastfile.lib - -# see comments in allocate_heap in w32heap.c before changing any of the -# -stack, -heap, or -base settings. -!if "$(BUILD_TYPE)" == "spd" -LINK_FLAGS = $(LINK_FLAGS) $(ARCH_LDFLAGS) -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -debug:full -debugtype:both -pdb:$(BLD)\temacs.pdb -machine:$(ARCH) -subsystem:$(SUBSYSTEM) -entry:_start -map:$(BLD)\temacs.map -swaprun:net -swaprun:cd -!else -LINK_FLAGS = $(LINK_FLAGS) $(ARCH_LDFLAGS) -stack:0x00800000 -heap:0x00100000 -base:0x01000000 -debug:full -debugtype:both -pdb:none -machine:$(ARCH) -subsystem:$(SUBSYSTEM) -entry:_start -map:$(BLD)\temacs.map -swaprun:net -swaprun:cd $(EXTRA_LINK) -!endif - -# -# Split up the objects into two sets so that we don't run out of -# command line space when we link them into a library. -# -# Put emacs.obj in a separate lib, since we need to have firstfile.obj -# as the "main" object file when linking. -# -OBJ0 = $(BLD)\emacs.obj - -OBJ1 = $(BLD)\abbrev.obj \ - $(BLD)\alloc.obj \ - $(BLD)\alloca.obj \ - $(BLD)\atimer.obj \ - $(BLD)\buffer.obj \ - $(BLD)\bytecode.obj \ - $(BLD)\callint.obj \ - $(BLD)\callproc.obj \ - $(BLD)\casefiddle.obj \ - $(BLD)\cm.obj \ - $(BLD)\cmds.obj \ - $(BLD)\data.obj \ - $(BLD)\dired.obj \ - $(BLD)\dispnew.obj \ - $(BLD)\doc.obj \ - $(BLD)\doprnt.obj \ - $(BLD)\editfns.obj \ - $(BLD)\eval.obj \ - $(BLD)\fileio.obj \ - $(BLD)\filelock.obj \ - $(BLD)\filemode.obj \ - $(BLD)\fns.obj \ - $(BLD)\indent.obj \ - $(BLD)\insdel.obj \ - $(BLD)\keyboard.obj \ - $(BLD)\keymap.obj \ - $(BLD)\lread.obj \ - $(BLD)\macros.obj \ - $(BLD)\marker.obj \ - $(BLD)\md5.obj \ - $(BLD)\minibuf.obj - -OBJ2 = $(BLD)\w32.obj \ - $(BLD)\w32heap.obj \ - $(BLD)\w32inevt.obj \ - $(BLD)\w32proc.obj \ - $(BLD)\w32console.obj \ - $(BLD)\print.obj \ - $(BLD)\process.obj \ - $(BLD)\regex.obj \ - $(BLD)\scroll.obj \ - $(BLD)\search.obj \ - $(BLD)\syntax.obj \ - $(BLD)\sysdep.obj \ - $(BLD)\term.obj \ - $(BLD)\termcap.obj \ - $(BLD)\tparam.obj \ - $(BLD)\undo.obj \ - $(BLD)\unexw32.obj \ - $(BLD)\window.obj \ - $(BLD)\xdisp.obj \ - $(BLD)\casetab.obj \ - $(BLD)\floatfns.obj \ - $(BLD)\frame.obj \ - $(BLD)\gmalloc.obj \ - $(BLD)\intervals.obj \ - $(BLD)\composite.obj \ - $(BLD)\ralloc.obj \ - $(BLD)\textprop.obj \ - $(BLD)\vm-limit.obj \ - $(BLD)\region-cache.obj \ - $(BLD)\strftime.obj \ - $(BLD)\charset.obj \ - $(BLD)\coding.obj \ - $(BLD)\category.obj \ - $(BLD)\ccl.obj \ - $(BLD)\fontset.obj - -WIN32OBJ = $(BLD)\w32term.obj \ - $(BLD)\w32xfns.obj \ - $(BLD)\w32fns.obj \ - $(BLD)\xfaces.obj \ - $(BLD)\w32select.obj \ - $(BLD)\w32menu.obj \ - $(BLD)\w32reg.obj \ - $(BLD)\w32bdf.obj - -LIBS = $(TLIB0) \ - $(TLIB1) \ - $(TLIB2) \ -!IFDEF NTGUI - $(TLIBW32) \ -!ENDIF - $(TLASTLIB) \ -!IFDEF NTGUI - gdi32.lib \ - comdlg32.lib \ -!ENDIF -# libcmt.lib \ - $(BASE_LIBS) \ - $(ADVAPI32) \ - user32.lib \ - mpr.lib \ - shell32.lib \ - setargv.obj - -# -# Build the executable and dump it. -# -all: $(BLD) $(EMACS) - -# -# Headers we would preprocess if we could. -# -PREPARED_HEADERS = config.h epaths.h -config.h: ..\nt\$(CONFIG_H) - $(CP) $** $@ -epaths.h: ..\nt\paths.h - $(CP) $** $@ - -# -# Make sure we have the DOC file in the right place. -# -DOC = $(OBJDIR)\etc\DOC-X -$(DOC):; cd ..\lib-src - - $(DEL) DOC-X - $(MAKE) $(MFLAGS) -f makefile.nt all - cd ..\src - -# -# The dumped executable -# -emacs: $(EMACS) -$(EMACS): $(DOC) $(TEMACS) - $(MAKEDIR)\$(BLD)\temacs.exe -batch -l loadup dump - -# -# The undumped executable -# Note the extra post-link step to insert a static preload heap section. -# If preload runs out of memory, increase the last argument to addsection -# (it is the preload heap size in MB). -# -temacs: $(BLD) $(TEMACS) -$(TEMACS): $(PREPARED_HEADERS) $(TLIB0) $(TLIB1) $(TLIB2) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) - $(LINK) -out:$(TEMACS_TMP) $(LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) - ..\nt\$(BLD)\addsection $(TEMACS_TMP) $(TEMACS) EMHEAP 16 - -bootstrap: bootstrap-emacs - -# -# Build a temacs with a sufficiently large PURESIZE to load the -# Lisp files from loadup.el in source form. -# -bootstrap-temacs: bootstrap-clean - $(MAKE) $(MFLAGS) -f makefile.nt temacs CFLAGS="$(CFLAGS) -DPURESIZE=5000000" - -# -# Dump an Emacs executable named bootstrap-emacs containing the -# files from loadup.el in source form. -# -bootstrap-emacs: bootstrap-temacs - $(MAKEDIR)\$(BLD)\temacs.exe -batch -l loadup bootstrap - - mkdir ..\bin - $(CP) $(EMACS) ..\bin - -# -# Force recompile of files that depend on PURESIZE -# -bootstrap-clean: - - $(DEL) $(BLD)\alloc.obj - - $(DEL) $(BLD)\data.obj - - $(DEL) $(BLD)\intervals.obj - - $(DEL) $(BLD)\keyboard.obj - - $(DEL) $(BLD)\keymap.obj - -# -# The resource file. NT 3.10 requires the use of cvtres; even though -# it is not necessary on later versions, it is still ok to use it. -# -$(TRES): ..\nt\emacs.rc - $(RC) -i..\nt -Fo$(BLD)\emacs.res $** -!if !$(MSVCNT11) - $(CVTRES) -r -$(ARCH) -o $@ $(BLD)\emacs.res -!endif - -# -# Build the library. Split up the build into two phases...otherwise we -# run out of command line space. -# -$(TLIB0): $(OBJ0) - @- $(AR) -out:$@ $** -$(TLIB1): $(OBJ1) - @- $(AR) -out:$@ $** -$(TLIB2): $(OBJ2) - @- $(AR) -out:$@ $** -!IFDEF NTGUI -$(TLIBW32): $(WIN32OBJ) - @- $(AR) -out:$@ $** -!ENDIF - -# -# Place lastfile.obj in its own library so that it can be loaded after -# the source libraries but before any system libraries. Doing so defines -# the end of Emacs' data section portably across compilers and systems. -# -$(TLASTLIB): $(BLD)\lastfile.obj - @- $(AR) -out:$@ $** - -# -# Assuming INSTALL_DIR is defined, build and install emacs in it. -# -install: all - - mkdir $(INSTALL_DIR)\bin - $(CP) $(EMACS) $(INSTALL_DIR)\bin - -# -# Maintenance -# -clean:; - $(DEL) *~ s\*~ - - $(DEL) *.pdb config.h epaths.h - - $(DEL) *.orig *.rej *.crlf - - $(DEL) s\*.orig s\*.rej s\*.crlf - - $(DEL_TREE) deleted - - $(DEL_TREE) obj - - $(DEL_TREE) obj-spd - -# -# These files are the ones that compile conditionally on CANNOT_DUMP... -# this target is mostly used for debugging. -# -cleandump:; cd $(BLD) - - $(DEL) callproc.obj data.obj dispnew.obj doc.obj editfns.obj emacs.obj lread.obj process.obj sysdep.obj term.obj w32heap.obj unexw32.obj - cd ..\.. - - -### DEPENDENCIES ### - -EMACS_ROOT = .. -SRC = . - -$(BLD)\abbrev.obj : \ - $(SRC)\abbrev.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h - -$(BLD)\alloc.obj : \ - $(SRC)\alloc.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\puresize.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h \ - $(SRC)\frame.h \ - $(SRC)\blockinput.h \ - $(SRC)\syssignal.h - -$(BLD)\alloca.obj : \ - $(SRC)\alloca.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(SRC)\blockinput.h - -$(BLD)\atimer.obj : \ - $(SRC)\atimer.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(SRC)\atimer.h \ - $(SRC)\syssignal.h \ - $(SRC)\systime.h \ - $(SRC)\blockinput.h - -$(BLD)\buffer.obj : \ - $(SRC)\buffer.c \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\indent.h \ - $(SRC)\blockinput.h \ - $(SRC)\region-cache.h - -$(BLD)\bytecode.obj : \ - $(SRC)\bytecode.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\syntax.h - -$(BLD)\callint.obj : \ - $(SRC)\callint.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\commands.h \ - $(SRC)\keyboard.h \ - $(SRC)\window.h - -$(BLD)\callproc.obj : \ - $(SRC)\callproc.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\msdos.h \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\process.h \ - $(SRC)\syssignal.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systty.h - -$(BLD)\casefiddle.obj : \ - $(SRC)\casefiddle.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\commands.h \ - $(SRC)\syntax.h - $(CC) $(CFLAGS) -Fo$@ casefiddle.c - -$(BLD)\casetab.obj : \ - $(SRC)\casetab.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h - -$(BLD)\cm.obj : \ - $(SRC)\cm.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\cm.h \ - $(SRC)\termhooks.h - -$(BLD)\cmds.obj : \ - $(SRC)\cmds.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\syntax.h - -$(BLD)\composite.obj : \ - $(SRC)\composite.c \ - $(SRC)\buffer.h \ - $(SRC)\charset.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\data.obj : \ - $(SRC)\data.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\puresize.h \ - $(SRC)\buffer.h \ - $(SRC)\syssignal.h - -$(BLD)\dired.obj : \ - $(SRC)\dired.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\ndir.h \ - $(SRC)\buffer.h \ - $(SRC)\commands.h \ - $(SRC)\regex.h - -$(BLD)\dispnew.obj : \ - $(SRC)\dispnew.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\termchar.h \ - $(SRC)\termopts.h \ - $(SRC)\termhooks.h \ - $(SRC)\cm.h \ - $(SRC)\buffer.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\commands.h \ - $(SRC)\disptab.h \ - $(SRC)\indent.h \ - $(SRC)\dispextern.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systty.h \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\xterm.h \ - $(SRC)\systime.h - -$(BLD)\doc.obj : \ - $(SRC)\doc.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\buffer.h \ - $(SRC)\keyboard.h - -$(BLD)\doprnt.obj : \ - $(SRC)\doprnt.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\dosfns.obj : \ - $(SRC)\dosfns.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\termchar.h \ - $(SRC)\termhooks.h \ - $(SRC)\frame.h \ - $(SRC)\dosfns.h \ - $(SRC)\msdos.h - -$(BLD)\editfns.obj : \ - $(SRC)\editfns.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\uaf.h \ - $(EMACS_ROOT)\nt\inc\pwd.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h \ - $(SRC)\systime.h - -$(BLD)\emacs.obj : \ - $(SRC)\emacs.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systty.h \ - $(SRC)\syssignal.h \ - $(SRC)\process.h - -$(BLD)\eval.obj : \ - $(SRC)\eval.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\blockinput.h \ - $(SRC)\commands.h \ - $(SRC)\keyboard.h - -$(BLD)\fileio.obj : \ - $(SRC)\fileio.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\uaf.h \ - $(EMACS_ROOT)\nt\inc\pwd.h \ - $(SRC)\msdos.h \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systime.h - -$(BLD)\filelock.obj : \ - $(SRC)\filelock.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\uaf.h \ - $(EMACS_ROOT)\nt\inc\pwd.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(EMACS_ROOT)\src\epaths.h \ - $(SRC)\buffer.h \ - $(SRC)\ndir.h - -$(BLD)\filemode.obj : \ - $(SRC)\filemode.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h - -$(BLD)\firstfile.obj : \ - $(SRC)\firstfile.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\floatfns.obj : \ - $(SRC)\floatfns.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\syssignal.h - -$(BLD)\fns.obj : \ - $(SRC)\fns.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\keyboard.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\md5.h - -$(BLD)\frame.obj : \ - $(SRC)\frame.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\frame.h \ - $(SRC)\termhooks.h \ - $(SRC)\window.h \ - $(SRC)\buffer.h \ - $(SRC)\commands.h \ - $(SRC)\keyboard.h - -$(BLD)\getloadavg.obj : \ - $(SRC)\getloadavg.c \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h - -$(BLD)\gmalloc.obj : \ - $(SRC)\gmalloc.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(SRC)\getpagesize.h - $(CC) $(CFLAGS) -D__STDC__ -Fo$@ gmalloc.c - -$(BLD)\hftctl.obj : \ - $(SRC)\hftctl.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h - -$(BLD)\indent.obj : \ - $(SRC)\indent.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\indent.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\termchar.h \ - $(SRC)\termopts.h \ - $(SRC)\disptab.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\region-cache.h \ - $(SRC)\composite.h - -$(BLD)\insdel.obj : \ - $(SRC)\insdel.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h \ - $(SRC)\blockinput.h - -$(BLD)\intervals.obj : \ - $(SRC)\intervals.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\keyboard.h \ - $(SRC)\buffer.h \ - $(SRC)\puresize.h - -$(BLD)\keyboard.obj : \ - $(SRC)\keyboard.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\termchar.h \ - $(SRC)\termopts.h \ - $(SRC)\termhooks.h \ - $(SRC)\macros.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\disptab.h \ - $(SRC)\keyboard.h \ - $(SRC)\dispextern.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\blockinput.h \ - $(SRC)\msdos.h \ - $(SRC)\syssignal.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systty.h \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\xterm.h \ - $(SRC)\systime.h \ - $(SRC)\atimer.h - -$(BLD)\keymap.obj : \ - $(SRC)\keymap.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\keyboard.h \ - $(SRC)\termhooks.h \ - $(SRC)\blockinput.h - -$(BLD)\lastfile.obj : \ - $(SRC)\lastfile.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\lread.obj : \ - $(SRC)\lread.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\buffer.h \ - $(EMACS_ROOT)\src\epaths.h \ - $(SRC)\commands.h \ - $(SRC)\keyboard.h \ - $(SRC)\termhooks.h \ - $(SRC)\msdos.h - -$(BLD)\macros.obj : \ - $(SRC)\macros.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\macros.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h - -$(BLD)\marker.obj : \ - $(SRC)\marker.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h - -$(BLD)\md5.obj : \ - $(SRC)\md5.c \ - $(SRC)\md5.h - -$(BLD)\minibuf.obj : \ - $(SRC)\minibuf.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\syntax.h - -$(BLD)\w32.obj : \ - $(SRC)\w32.c \ - $(SRC)\w32.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(EMACS_ROOT)\nt\inc\pwd.h \ - $(SRC)\w32heap.h - -$(BLD)\w32heap.obj : \ - $(SRC)\w32heap.c \ - $(SRC)\w32heap.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h - -$(BLD)\w32inevt.obj : \ - $(SRC)\w32inevt.c \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(SRC)\frame.h \ - $(SRC)\blockinput.h \ - $(SRC)\termhooks.h \ - $(SRC)\w32heap.h \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h - -$(BLD)\w32proc.obj : \ - $(SRC)\w32proc.c \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(SRC)\w32.h \ - $(SRC)\w32heap.h \ - $(SRC)\systime.h - -$(BLD)\w32console.obj : \ - $(SRC)\w32console.c \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(SRC)\frame.h \ - $(SRC)\disptab.h \ - $(SRC)\termhooks.h \ - $(SRC)\w32inevt.h - -$(BLD)\prefix-args.obj : \ - $(SRC)\prefix-args.c - -$(BLD)\print.obj : \ - $(SRC)\print.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\process.h \ - $(SRC)\termchar.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h - -$(BLD)\process.obj : \ - $(SRC)\process.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systty.h \ - $(SRC)\window.h \ - $(SRC)\buffer.h \ - $(SRC)\process.h \ - $(SRC)\termhooks.h \ - $(SRC)\commands.h \ - $(SRC)\frame.h \ - $(SRC)\syssignal.h \ - $(SRC)\syswait.h \ - $(SRC)\systime.h \ - $(SRC)\termopts.h \ - $(SRC)\composite.h \ - $(SRC)\atimer.h - -$(BLD)\ralloc.obj : \ - $(SRC)\ralloc.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(SRC)\getpagesize.h - -$(BLD)\regex.obj : \ - $(SRC)\regex.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\s\ms-w32.h \ - $(SRC)\m\intel386.h \ - $(SRC)\config.h \ - $(SRC)\buffer.h \ - $(SRC)\syntax.h \ - $(SRC)\regex.h - -$(BLD)\region-cache.obj : \ - $(SRC)\region-cache.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\region-cache.h - -$(BLD)\scroll.obj : \ - $(SRC)\scroll.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\termchar.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\frame.h - -$(BLD)\search.obj : \ - $(SRC)\search.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\syntax.h \ - $(SRC)\buffer.h \ - $(SRC)\commands.h \ - $(SRC)\blockinput.h \ - $(SRC)\regex.h \ - $(SRC)\region-cache.h \ - $(SRC)\composite.h - -$(BLD)\strftime.obj : \ - $(SRC)\strftime.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\syntax.obj : \ - $(SRC)\syntax.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\commands.h \ - $(SRC)\buffer.h \ - $(SRC)\syntax.h \ - $(SRC)\composite.h - -$(BLD)\sysdep.obj : \ - $(SRC)\sysdep.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\blockinput.h \ - $(SRC)\dosfns.h \ - $(SRC)\msdos.h \ - $(EMACS_ROOT)\nt\inc\sys\param.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(EMACS_ROOT)\nt\inc\sys\ioctl.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h \ - $(SRC)\systty.h \ - $(SRC)\syswait.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\termhooks.h \ - $(SRC)\termchar.h \ - $(SRC)\termopts.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\process.h \ - $(SRC)\ndir.h \ - $(SRC)\syssignal.h \ - $(SRC)\systime.h \ - $(SRC)\uaf.h \ - $(EMACS_ROOT)\src\acldef.h \ - $(EMACS_ROOT)\src\chpdef.h - -$(BLD)\term.obj : \ - $(SRC)\term.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\termchar.h \ - $(SRC)\termopts.h \ - $(SRC)\cm.h \ - $(SRC)\frame.h \ - $(SRC)\disptab.h \ - $(SRC)/dispextern.h \ - $(SRC)\termhooks.h \ - $(SRC)\keyboard.h - -$(BLD)\termcap.obj : \ - $(SRC)\termcap.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(EMACS_ROOT)\nt\inc\sys\file.h - -$(BLD)\terminfo.obj : \ - $(SRC)\terminfo.c - -$(BLD)\textprop.obj : \ - $(SRC)\textprop.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h - -$(BLD)\tparam.obj : \ - $(SRC)\tparam.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h - -$(BLD)\undo.obj : \ - $(SRC)\undo.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\commands.h - -$(BLD)\unexw32.obj : \ - $(SRC)\unexw32.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32heap.h - -$(BLD)\vm-limit.obj : \ - $(SRC)\vm-limit.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\mem-limits.h - -$(BLD)\widget.obj : \ - $(SRC)\widget.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\xterm.h \ - $(SRC)\frame.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\widget.h \ - $(SRC)\widgetprv.h - -$(BLD)\window.obj : \ - $(SRC)\window.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\buffer.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\commands.h \ - $(SRC)\indent.h \ - $(SRC)\termchar.h \ - $(SRC)\disptab.h \ - $(SRC)\keyboard.h \ - $(SRC)\composite.h - -$(BLD)\xdisp.obj : \ - $(SRC)\xdisp.c \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\termchar.h \ - $(SRC)\buffer.h \ - $(SRC)\indent.h \ - $(SRC)\commands.h \ - $(SRC)\macros.h \ - $(SRC)\disptab.h \ - $(SRC)\termhooks.h \ - $(SRC)\dispextern.h \ - $(SRC)\w32gui.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h - -$(BLD)\xfaces.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\xfaces.c \ - $(SRC)\charset.h \ - $(SRC)\fontset.h \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\buffer.h \ - $(SRC)\dispextern.h \ - $(SRC)\frame.h \ - $(SRC)\blockinput.h \ - $(SRC)\window.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h - -$(BLD)\w32fns.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32fns.c \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\buffer.h \ - $(SRC)\charset.h \ - $(SRC)\coding.h \ - $(SRC)\dispextern.h \ - $(SRC)\keyboard.h \ - $(SRC)\blockinput.h \ - $(SRC)\epaths.h \ - $(SRC)\w32heap.h \ - $(SRC)\termhooks.h - -$(BLD)\w32menu.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32menu.c \ - $(SRC)\termhooks.h \ - $(SRC)\frame.h \ - $(SRC)\window.h \ - $(SRC)\keyboard.h \ - $(SRC)\blockinput.h \ - $(SRC)\buffer.h \ - $(SRC)\charset.h \ - $(SRC)\coding.h - -$(BLD)\w32term.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32term.c \ - $(SRC)\blockinput.h \ - $(SRC)\w32heap.h \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\systty.h \ - $(SRC)\systime.h \ - $(SRC)\frame.h \ - $(SRC)\dispextern.h \ - $(SRC)\termhooks.h \ - $(SRC)\termopts.h \ - $(SRC)\termchar.h \ - $(SRC)\gnu.h \ - $(SRC)\disptab.h \ - $(SRC)\buffer.h \ - $(SRC)\window.h \ - $(SRC)\keyboard.h \ - $(SRC)\intervals.h \ - $(SRC)\composite.h \ - $(SRC)\atimer.h - -$(BLD)\w32select.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32select.c \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\dispextern.h \ - $(SRC)\frame.h \ - $(SRC)\blockinput.h - -$(BLD)\w32reg.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32reg.c \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\blockinput.h - -$(BLD)\w32xfns.obj: \ - $(EMACS_ROOT)\src\s\ms-w32.h \ - $(EMACS_ROOT)\src\m\intel386.h \ - $(EMACS_ROOT)\src\config.h \ - $(SRC)\w32xfns.c \ - -$(BLD)\w32bdf.obj: \ - $(EMACS_ROOT)\src/s\ms-w32.h \ - $(EMACS_ROOT)\src/m\intel386.h \ - $(EMACS_ROOT)\src/config.h \ - $(SRC)\w32bdf.c \ - $(SRC)\charset.h \ - $(SRC)\frame.h \ - $(SRC)\dispextern.h \ - $(SRC)\fontset.h \ - $(SRC)\blockinput.h \ - $(SRC)\w32gui.h \ - $(SRC)\w32term.h \ - $(SRC)\w32gui.h \ - $(SRC)\w32bdf.h \ - $(SRC)\w32.h \ - $(SRC)\frame.h \ - $(SRC)\blockinput.h - -# arch-tag: ee9a97ba-19b7-4b50-a127-aaf4efe494dc diff --git a/src/makefile.w32-in b/src/makefile.w32-in index 99a04ecc17d..a7efcc4cae5 100644 --- a/src/makefile.w32-in +++ b/src/makefile.w32-in @@ -1,5 +1,5 @@ -# Makefile for GNU Emacs on the Microsoft W32 API. -# Copyright (c) 2000-2001 Free Software Foundation, Inc. +# -*- Makefile -*- for GNU Emacs on the Microsoft W32 API. +# Copyright (c) 2000-2001, 2004 Free Software Foundation, Inc. # # This file is part of GNU Emacs. # @@ -115,8 +115,6 @@ OBJ1 = $(BLD)/abbrev.$(O) \ $(BLD)/region-cache.$(O) \ $(BLD)/strftime.$(O) \ $(BLD)/charset.$(O) \ - $(BLD)/character.$(O) \ - $(BLD)/chartab.$(O) \ $(BLD)/coding.$(O) \ $(BLD)/category.$(O) \ $(BLD)/ccl.$(O) \ @@ -124,7 +122,6 @@ OBJ1 = $(BLD)/abbrev.$(O) \ $(BLD)/fringe.$(O) \ $(BLD)/image.$(O) - WIN32OBJ = $(BLD)/w32term.$(O) \ $(BLD)/w32xfns.$(O) \ $(BLD)/w32fns.$(O) \ @@ -170,7 +167,7 @@ $(EMACS): $(DOC) $(TEMACS) temacs: $(BLD) $(TEMACS) $(TEMACS): $(TLIB0) $(TLIB1) $(TLIBW32) $(TLASTLIB) $(TOBJ) $(TRES) $(LINK) $(LINK_OUT)$(TEMACS_TMP) $(FULL_LINK_FLAGS) $(TOBJ) $(TRES) $(LIBS) - "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 20 + "../nt/$(BLD)/addsection" "$(TEMACS_TMP)" "$(TEMACS)" EMHEAP 16 bootstrap: bootstrap-emacs @@ -265,7 +262,6 @@ $(BLD)/abbrev.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/dispextern.h \ @@ -281,7 +277,6 @@ $(BLD)/alloc.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ @@ -364,7 +359,6 @@ $(BLD)/callproc.$(O) : \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -381,7 +375,6 @@ $(BLD)/casefiddle.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ @@ -403,7 +396,6 @@ $(BLD)/category.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/keymap.h @@ -413,22 +405,9 @@ $(BLD)/ccl.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h -$(BLD)/character.$(O) : \ - $(SRC)/character.c \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h \ - $(SRC)/buffer.h \ - $(SRC)/character.h \ - $(SRC)/charset.h \ - $(SRC)/coding.h \ - $(SRC)/composite.h \ - $(SRC)/disptab.h - $(BLD)/charset.$(O) : \ $(SRC)/charset.c \ $(EMACS_ROOT)/src/s/ms-w32.h \ @@ -436,20 +415,11 @@ $(BLD)/charset.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/composite.h \ $(SRC)/disptab.h -$(BLD)/chartab.$(O) : \ - $(SRC)/chartab.c \ - $(EMACS_ROOT)/src/s/ms-w32.h \ - $(EMACS_ROOT)/src/m/intel386.h \ - $(EMACS_ROOT)/src/config.h \ - $(SRC)/charset.h \ - $(SRC)/character.h - $(BLD)/cm.$(O) : \ $(SRC)/cm.c \ $(EMACS_ROOT)/src/s/ms-w32.h \ @@ -464,7 +434,6 @@ $(BLD)/cmds.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/dispextern.h \ @@ -482,7 +451,6 @@ $(BLD)/coding.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/composite.h \ @@ -498,7 +466,6 @@ $(BLD)/composite.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ @@ -512,7 +479,6 @@ $(BLD)/data.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/frame.h \ $(SRC)/keyboard.h \ @@ -526,7 +492,6 @@ $(BLD)/dired.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -544,7 +509,6 @@ $(BLD)/dispnew.$(O) : \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/cm.h \ $(SRC)/commands.h \ @@ -573,7 +537,6 @@ $(BLD)/doc.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/keyboard.h \ $(SRC)/keymap.h @@ -583,7 +546,6 @@ $(BLD)/doprnt.$(O) : \ $(EMACS_ROOT)/src/s/ms-w32.h \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ - $(SRC)/character.h \ $(SRC)/charset.c $(BLD)/editfns.$(O) : \ @@ -594,7 +556,6 @@ $(BLD)/editfns.$(O) : \ $(EMACS_ROOT)/nt/inc/pwd.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/composite.h \ @@ -655,7 +616,6 @@ $(BLD)/fileio.$(O) : \ $(EMACS_ROOT)/nt/inc/sys/file.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -677,7 +637,6 @@ $(BLD)/filelock.$(O) : \ $(EMACS_ROOT)/src/epaths.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/systime.h @@ -713,7 +672,6 @@ $(BLD)/fns.$(O) : \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -736,7 +694,6 @@ $(BLD)/fontset.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/dispextern.h \ $(SRC)/fontset.h \ @@ -754,7 +711,6 @@ $(BLD)/frame.$(O) : \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/dispextern.h \ @@ -816,7 +772,6 @@ $(BLD)/indent.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ @@ -840,7 +795,6 @@ $(BLD)/insdel.$(O) : \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ @@ -876,7 +830,6 @@ $(BLD)/keyboard.$(O) : \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ @@ -908,7 +861,6 @@ $(BLD)/keymap.$(O) : \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ @@ -937,7 +889,6 @@ $(BLD)/lread.$(O) : \ $(EMACS_ROOT)/src/epaths.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -969,7 +920,6 @@ $(BLD)/marker.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h $(BLD)/md5.$(O) : \ @@ -982,7 +932,6 @@ $(BLD)/minibuf.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ @@ -1050,7 +999,6 @@ $(BLD)/w32console.$(O) : \ $(SRC)/s/ms-w32.h \ $(SRC)/m/intel386.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/config.h \ @@ -1068,7 +1016,6 @@ $(BLD)/print.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ @@ -1092,7 +1039,6 @@ $(BLD)/process.$(O) : \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -1132,7 +1078,6 @@ $(BLD)/regex.$(O) : \ $(SRC)/m/intel386.h \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/config.h \ $(SRC)/regex.h \ @@ -1168,7 +1113,6 @@ $(BLD)/search.$(O) : \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ @@ -1201,7 +1145,6 @@ $(BLD)/syntax.$(O) : \ $(EMACS_ROOT)/src/config.h \ $(SRC)/buffer.h \ $(SRC)/category.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/commands.h \ $(SRC)/composite.h \ @@ -1246,7 +1189,6 @@ $(BLD)/term.$(O) : \ $(EMACS_ROOT)/src/m/intel386.h \ $(EMACS_ROOT)/src/config.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/cm.h \ $(SRC)/coding.h \ @@ -1343,7 +1285,6 @@ $(BLD)/xdisp.$(O) : \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/commands.h \ @@ -1375,7 +1316,6 @@ $(BLD)/xfaces.$(O): \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/composite.h \ $(SRC)/dispextern.h \ @@ -1398,7 +1338,6 @@ $(BLD)/w32fns.$(O): \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/composite.h \ @@ -1424,7 +1363,6 @@ $(BLD)/w32menu.$(O): \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/dispextern.h \ @@ -1447,7 +1385,6 @@ $(BLD)/w32term.$(O): \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/composite.h \ @@ -1479,7 +1416,6 @@ $(BLD)/w32select.$(O): \ $(SRC)/blockinput.h \ $(SRC)/buffer.h \ $(SRC)/ccl.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/coding.h \ $(SRC)/composite.h \ @@ -1510,7 +1446,6 @@ $(BLD)/w32xfns.$(O): \ $(EMACS_ROOT)/src/config.h \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/fontset.h \ $(SRC)/frame.h \ @@ -1527,7 +1462,6 @@ $(BLD)/w32bdf.$(O): \ $(EMACS_ROOT)/src/config.h \ $(SRC)/atimer.h \ $(SRC)/blockinput.h \ - $(SRC)/character.h \ $(SRC)/charset.h \ $(SRC)/dispextern.h \ $(SRC)/fontset.h \ @@ -1537,5 +1471,3 @@ $(BLD)/w32bdf.$(O): \ $(SRC)/w32bdf.h \ $(SRC)/w32gui.h \ $(SRC)/w32term.h - -# arch-tag: 9fd7aba8-f826-4111-b3c0-497a8e7db9a0 diff --git a/src/mem-limits.h b/src/mem-limits.h index 578cf59f12e..57a79863a1b 100644 --- a/src/mem-limits.h +++ b/src/mem-limits.h @@ -1,5 +1,5 @@ /* Includes for memory limit warnings. - Copyright (C) 1990, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1990, 93, 94, 95, 1996, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -81,7 +81,9 @@ typedef unsigned long SIZE; #define NULL ((POINTER) 0) extern POINTER start_of_data (); -#ifdef DATA_SEG_BITS +#if defined USE_LSB_TAG +#define EXCEEDS_LISP_PTR(ptr) 0 +#elif defined DATA_SEG_BITS #define EXCEEDS_LISP_PTR(ptr) \ (((EMACS_UINT) (ptr) & ~DATA_SEG_BITS) >> VALBITS) #else diff --git a/src/minibuf.c b/src/minibuf.c index 2feac10f2b7..a313016154e 100644 --- a/src/minibuf.c +++ b/src/minibuf.c @@ -1,5 +1,5 @@ /* Minibuffer input and completion. - Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03 + Copyright (C) 1985,86,93,94,95,96,97,98,99,2000,01,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -209,6 +209,7 @@ without invoking the usual minibuffer commands. */) /* Actual minibuffer invocation. */ static Lisp_Object read_minibuf_unwind P_ ((Lisp_Object)); +static Lisp_Object run_exit_minibuf_hook P_ ((Lisp_Object)); static Lisp_Object read_minibuf P_ ((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object, int, Lisp_Object, @@ -563,6 +564,12 @@ read_minibuf (map, initial, prompt, backup_n, expflag, record_unwind_protect (read_minibuf_unwind, Qnil); minibuf_level++; + /* We are exiting the minibuffer one way or the other, so run the hook. + It should be run before unwinding the minibuf settings. Do it + separately from read_minibuf_unwind because we need to make sure that + read_minibuf_unwind is fully executed even if exit-minibuffer-hook + signals an error. --Stef */ + record_unwind_protect (run_exit_minibuf_hook, Qnil); /* Now that we can restore all those variables, start changing them. */ @@ -822,6 +829,17 @@ get_minibuffer (depth) return buf; } +static Lisp_Object +run_exit_minibuf_hook (data) + Lisp_Object data; +{ + if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) + && !NILP (Vrun_hooks)) + safe_run_hooks (Qminibuffer_exit_hook); + + return Qnil; +} + /* This function is called on exiting minibuffer, whether normally or not, and it restores the current window, buffer, etc. */ @@ -832,12 +850,6 @@ read_minibuf_unwind (data) Lisp_Object old_deactivate_mark; Lisp_Object window; - /* We are exiting the minibuffer one way or the other, - so run the hook. */ - if (!NILP (Vminibuffer_exit_hook) && !EQ (Vminibuffer_exit_hook, Qunbound) - && !NILP (Vrun_hooks)) - safe_run_hooks (Qminibuffer_exit_hook); - /* If this was a recursive minibuffer, tie the minibuffer window back to the outer level minibuffer buffer. */ minibuf_level--; @@ -1195,6 +1207,7 @@ is used to further constrain the set of candidates. */) || NILP (XCAR (alist)))); int index = 0, obsize = 0; int matchcount = 0; + int bindcount = -1; Lisp_Object bucket, zero, end, tem; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -1274,16 +1287,18 @@ is used to further constrain the set of candidates. */) /* Ignore this element if it fails to match all the regexps. */ { - int count = SPECPDL_INDEX (); - specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); for (regexps = Vcompletion_regexp_list; CONSP (regexps); regexps = XCDR (regexps)) { + if (bindcount < 0) { + bindcount = SPECPDL_INDEX (); + specbind (Qcase_fold_search, + completion_ignore_case ? Qt : Qnil); + } tem = Fstring_match (XCAR (regexps), eltstring, zero); if (NILP (tem)) break; } - unbind_to (count, Qnil); if (CONSP (regexps)) continue; } @@ -1297,6 +1312,10 @@ is used to further constrain the set of candidates. */) tem = Fcommandp (elt, Qnil); else { + if (bindcount >= 0) { + unbind_to (bindcount, Qnil); + bindcount = -1; + } GCPRO4 (tail, string, eltstring, bestmatch); tem = type == 3 ? call2 (predicate, elt, @@ -1378,6 +1397,11 @@ is used to further constrain the set of candidates. */) } } + if (bindcount >= 0) { + unbind_to (bindcount, Qnil); + bindcount = -1; + } + if (NILP (bestmatch)) return Qnil; /* No completions found */ /* If we are ignoring case, and there is no exact match, @@ -1440,6 +1464,7 @@ are ignored unless STRING itself starts with a space. */) && (!SYMBOLP (XCAR (alist)) || NILP (XCAR (alist)))); int index = 0, obsize = 0; + int bindcount = -1; Lisp_Object bucket, tem; struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; @@ -1525,16 +1550,18 @@ are ignored unless STRING itself starts with a space. */) /* Ignore this element if it fails to match all the regexps. */ { - int count = SPECPDL_INDEX (); - specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); for (regexps = Vcompletion_regexp_list; CONSP (regexps); regexps = XCDR (regexps)) { + if (bindcount < 0) { + bindcount = SPECPDL_INDEX (); + specbind (Qcase_fold_search, + completion_ignore_case ? Qt : Qnil); + } tem = Fstring_match (XCAR (regexps), eltstring, zero); if (NILP (tem)) break; } - unbind_to (count, Qnil); if (CONSP (regexps)) continue; } @@ -1548,6 +1575,10 @@ are ignored unless STRING itself starts with a space. */) tem = Fcommandp (elt, Qnil); else { + if (bindcount >= 0) { + unbind_to (bindcount, Qnil); + bindcount = -1; + } GCPRO4 (tail, eltstring, allmatches, string); tem = type == 3 ? call2 (predicate, elt, @@ -1562,6 +1593,11 @@ are ignored unless STRING itself starts with a space. */) } } + if (bindcount >= 0) { + unbind_to (bindcount, Qnil); + bindcount = -1; + } + return Fnreverse (allmatches); } @@ -1602,7 +1638,7 @@ HIST, if non-nil, specifies a history list and optionally the initial is the initial position (the position in the list used by the minibuffer history commands). For consistency, you should also specify that element of the history as the value of - INITIAL-CONTENTS. (This is the only case in which you should use + INITIAL-INPUT. (This is the only case in which you should use INITIAL-INPUT instead of DEF.) Positions are counted starting from 1 at the beginning of the list. The variable `history-length' controls the maximum length of a history list. @@ -1772,19 +1808,20 @@ the values STRING, PREDICATE and `lambda'. */) return call3 (alist, string, predicate, Qlambda); /* Reject this element if it fails to match all the regexps. */ - { - int count = SPECPDL_INDEX (); - specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); - for (regexps = Vcompletion_regexp_list; CONSP (regexps); - regexps = XCDR (regexps)) - { - if (NILP (Fstring_match (XCAR (regexps), - SYMBOLP (tem) ? string : tem, - Qnil))) - return unbind_to (count, Qnil); - } - unbind_to (count, Qnil); - } + if (CONSP (Vcompletion_regexp_list)) + { + int count = SPECPDL_INDEX (); + specbind (Qcase_fold_search, completion_ignore_case ? Qt : Qnil); + for (regexps = Vcompletion_regexp_list; CONSP (regexps); + regexps = XCDR (regexps)) + { + if (NILP (Fstring_match (XCAR (regexps), + SYMBOLP (tem) ? string : tem, + Qnil))) + return unbind_to (count, Qnil); + } + unbind_to (count, Qnil); + } /* Finally, check the predicate. */ if (!NILP (predicate)) diff --git a/src/msdos.c b/src/msdos.c index c4e9197ab49..d0de02aba3f 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -40,6 +40,7 @@ Boston, MA 02111-1307, USA. */ #include <unistd.h> /* for chdir, dup, dup2, etc. */ #include <dir.h> /* for getdisk */ #if __DJGPP__ >= 2 +#pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */ #include <fcntl.h> #include <io.h> /* for setmode */ #include <dpmi.h> /* for __dpmi_xxx stuff */ @@ -950,8 +951,8 @@ static void IT_write_glyphs (struct glyph *str, int str_len) { unsigned char *screen_buf, *screen_bp, *screen_buf_end, *bp; - int unsupported_face = FAST_GLYPH_FACE (Vdos_unsupported_char_glyph); - unsigned unsupported_char= FAST_GLYPH_CHAR (Vdos_unsupported_char_glyph); + int unsupported_face = 0; + unsigned unsupported_char = '\177'; int offset = 2 * (new_pos_X + screen_size_X * new_pos_Y); register int sl = str_len; register int tlen = GLYPH_TABLE_LENGTH; @@ -977,6 +978,13 @@ IT_write_glyphs (struct glyph *str, int str_len) if (str_len <= 0) return; + /* Set up the unsupported character glyph */ + if (!NILP (Vdos_unsupported_char_glyph)) + { + unsupported_char = FAST_GLYPH_CHAR (XINT (Vdos_unsupported_char_glyph)); + unsupported_face = FAST_GLYPH_FACE (XINT (Vdos_unsupported_char_glyph)); + } + screen_buf = screen_bp = alloca (str_len * 2); screen_buf_end = screen_buf + str_len * 2; sf = SELECTED_FRAME(); @@ -1041,7 +1049,7 @@ IT_write_glyphs (struct glyph *str, int str_len) if (! CHAR_VALID_P (ch, 0)) { g = !NILP (Vdos_unsupported_char_glyph) - ? Vdos_unsupported_char_glyph + ? XINT (Vdos_unsupported_char_glyph) : MAKE_GLYPH (sf, '\177', GLYPH_FACE (sf, g)); ch = FAST_GLYPH_CHAR (g); } @@ -1571,7 +1579,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y) { extern Lisp_Object Qmouse_face; Lisp_Object mouse_face, overlay, position, *overlay_vec; - int len, noverlays, obegv, ozv;; + int noverlays, obegv, ozv;; struct buffer *obuf; /* If we get an out-of-range value, return now; avoid an error. */ @@ -1590,20 +1598,8 @@ IT_note_mouse_highlight (struct frame *f, int x, int y) /* Is this char mouse-active or does it have help-echo? */ XSETINT (position, pos); - /* Put all the overlays we want in a vector in overlay_vec. - Store the length in len. If there are more than 10, make - enough space for all, and try again. */ - len = 10; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL, 0); - if (noverlays > len) - { - len = noverlays; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (pos, - 0, &overlay_vec, &len, NULL, NULL, 0); - } - + /* Put all the overlays we want in a vector in overlay_vec. */ + GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0); /* Sort overlays into increasing priority order. */ noverlays = sort_overlays (overlay_vec, noverlays, w); @@ -4408,9 +4404,28 @@ init_environment (argc, argv, skip_args) for (i = 0; i < imax ; i++) { const char *tmp = tempdirs[i]; + char buf[FILENAME_MAX]; if (*tmp == '$') - tmp = getenv (tmp + 1); + { + int tmp_len; + + tmp = getenv (tmp + 1); + if (!tmp) + continue; + + /* Some lusers set TMPDIR=e:, probably because some losing + programs cannot handle multiple slashes if they use e:/. + e: fails in `access' below, so we interpret e: as e:/. */ + tmp_len = strlen(tmp); + if (tmp[tmp_len - 1] != '/' && tmp[tmp_len - 1] != '\\') + { + strcpy(buf, tmp); + buf[tmp_len++] = '/', buf[tmp_len] = 0; + tmp = buf; + } + } + /* Note that `access' can lie to us if the directory resides on a read-only filesystem, like CD-ROM or a write-protected floppy. The only way to be really sure is to actually create a file and @@ -5272,7 +5287,7 @@ syms_of_msdos () DEFVAR_LISP ("dos-unsupported-char-glyph", &Vdos_unsupported_char_glyph, doc: /* *Glyph to display instead of chars not supported by current codepage. This variable is used only by MSDOS terminals. */); - Vdos_unsupported_char_glyph = '\177'; + Vdos_unsupported_char_glyph = make_number ('\177'); #endif #ifndef subprocesses diff --git a/src/print.c b/src/print.c index 8d0a5e2bb3b..4b94d77e876 100644 --- a/src/print.c +++ b/src/print.c @@ -1,5 +1,5 @@ /* Lisp object printing and output streams. - Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 2003 + Copyright (C) 1985, 86, 88, 93, 94, 95, 97, 98, 1999, 2000, 01, 03, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -601,6 +601,8 @@ temp_output_buffer_setup (bufname) eassert (current_buffer->overlays_after == NULL); current_buffer->enable_multibyte_characters = buffer_defaults.enable_multibyte_characters; + specbind (Qinhibit_read_only, Qt); + specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); XSETBUFFER (buf, current_buffer); @@ -789,7 +791,7 @@ A printed representation of an object is text which describes that object. */) if (SBYTES (object) == SCHARS (object)) STRING_SET_UNIBYTE (object); - /* Note that this won't make prepare_to_modify_buffer call + /* Note that this won't make prepare_to_modify_buffer call ask-user-about-supersession-threat because this buffer does not visit a file. */ Ferase_buffer (); @@ -927,7 +929,7 @@ DEFUN ("redirect-debugging-output", Fredirect_debugging_output, Sredirect_debugg doc: /* Redirect debugging output (stderr stream) to file FILE. If FILE is nil, reset target to the initial stderr stream. Optional arg APPEND non-nil (interactively, with prefix arg) means -append to existing target file. */) +append to existing target file. */) (file, append) Lisp_Object file, append; { @@ -1218,7 +1220,6 @@ print (obj, printcharfun, escapeflag) register Lisp_Object printcharfun; int escapeflag; { - print_depth = 0; old_backquote_output = 0; /* Reset print_number_index and Vprint_number_table only when @@ -1238,6 +1239,7 @@ print (obj, printcharfun, escapeflag) start = index = print_number_index; /* Construct Vprint_number_table. This increments print_number_index for the objects added. */ + print_depth = 0; print_preprocess (obj); /* Remove unnecessary objects, which appear only once in OBJ; @@ -1262,6 +1264,7 @@ print (obj, printcharfun, escapeflag) print_number_index = index; } + print_depth = 0; print_object (obj, printcharfun, escapeflag); } @@ -1278,6 +1281,26 @@ print_preprocess (obj) { int i; EMACS_INT size; + int loop_count = 0; + Lisp_Object halftail; + + /* Avoid infinite recursion for circular nested structure + in the case where Vprint_circle is nil. */ + if (NILP (Vprint_circle)) + { + for (i = 0; i < print_depth; i++) + if (EQ (obj, being_printed[i])) + return; + being_printed[print_depth] = obj; + } + + /* Give up if we go so deep that print_object will get an error. */ + /* See similar code in print_object. */ + if (print_depth >= PRINT_CIRCLE) + return; + + print_depth++; + halftail = obj; loop: if (STRINGP (obj) || CONSP (obj) || VECTORP (obj) @@ -1338,8 +1361,15 @@ print_preprocess (obj) break; case Lisp_Cons: + /* Use HALFTAIL and LOOP_COUNT to detect circular lists, + just as in print_object. */ + if (loop_count && EQ (obj, halftail)) + break; print_preprocess (XCAR (obj)); obj = XCDR (obj); + loop_count++; + if (!(loop_count & 1)) + halftail = XCDR (halftail); goto loop; case Lisp_Vectorlike: @@ -1354,6 +1384,7 @@ print_preprocess (obj) break; } } + print_depth--; } static void @@ -1457,7 +1488,7 @@ print_object (obj, printcharfun, escapeflag) register Lisp_Object printcharfun; int escapeflag; { - char buf[30]; + char buf[40]; QUIT; @@ -1511,6 +1542,7 @@ print_object (obj, printcharfun, escapeflag) print_depth++; + /* See similar code in print_preprocess. */ if (print_depth > PRINT_CIRCLE) error ("Apparently circular structure being printed"); #ifdef MAX_PRINT_CHARS @@ -1876,18 +1908,14 @@ print_object (obj, printcharfun, escapeflag) register unsigned char c; struct gcpro gcpro1; int size_in_chars - = (XBOOL_VECTOR (obj)->size + BITS_PER_CHAR - 1) / BITS_PER_CHAR; + = ((XBOOL_VECTOR (obj)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR); GCPRO1 (obj); PRINTCHAR ('#'); PRINTCHAR ('&'); - if (sizeof (int) == sizeof (EMACS_INT)) - sprintf (buf, "%d", XBOOL_VECTOR (obj)->size); - else if (sizeof (long) == sizeof (EMACS_INT)) - sprintf (buf, "%ld", XBOOL_VECTOR (obj)->size); - else - abort (); + sprintf (buf, "%ld", (long) XBOOL_VECTOR (obj)->size); strout (buf, -1, -1, printcharfun, 0); PRINTCHAR ('\"'); @@ -1917,6 +1945,14 @@ print_object (obj, printcharfun, escapeflag) PRINTCHAR ('\\'); PRINTCHAR ('f'); } + else if (c > '\177') + { + /* Use octal escapes to avoid encoding issues. */ + PRINTCHAR ('\\'); + PRINTCHAR ('0' + ((c >> 6) & 3)); + PRINTCHAR ('0' + ((c >> 3) & 7)); + PRINTCHAR ('0' + (c & 7)); + } else { if (c == '\"' || c == '\\') @@ -1937,7 +1973,7 @@ print_object (obj, printcharfun, escapeflag) else if (WINDOWP (obj)) { strout ("#<window ", -1, -1, printcharfun, 0); - sprintf (buf, "%d", XFASTINT (XWINDOW (obj)->sequence_number)); + sprintf (buf, "%ld", (long) XFASTINT (XWINDOW (obj)->sequence_number)); strout (buf, -1, -1, printcharfun, 0); if (!NILP (XWINDOW (obj)->buffer)) { @@ -1958,8 +1994,8 @@ print_object (obj, printcharfun, escapeflag) PRINTCHAR (' '); strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0); PRINTCHAR (' '); - sprintf (buf, "%d/%d", XFASTINT (h->count), - XVECTOR (h->next)->size); + sprintf (buf, "%ld/%ld", (long) XFASTINT (h->count), + (long) XVECTOR (h->next)->size); strout (buf, -1, -1, printcharfun, 0); } sprintf (buf, " 0x%lx", (unsigned long) h); @@ -2082,7 +2118,7 @@ print_object (obj, printcharfun, escapeflag) break; case Lisp_Misc_Intfwd: - sprintf (buf, "#<intfwd to %d>", *XINTFWD (obj)->intvar); + sprintf (buf, "#<intfwd to %ld>", (long) *XINTFWD (obj)->intvar); strout (buf, -1, -1, printcharfun, 0); break; diff --git a/src/process.c b/src/process.c index 4999aebf723..b810b027737 100644 --- a/src/process.c +++ b/src/process.c @@ -445,10 +445,11 @@ decode_status (l, symbol, code, coredump) /* Return a string describing a process status list. */ -Lisp_Object -status_message (status) - Lisp_Object status; +static Lisp_Object +status_message (p) + struct Lisp_Process *p; { + Lisp_Object status = p->status; Lisp_Object symbol; int code, coredump; Lisp_Object string, string2; @@ -469,6 +470,8 @@ status_message (status) } else if (EQ (symbol, Qexit)) { + if (NETCONN1_P (p)) + return build_string (code == 0 ? "deleted\n" : "connection broken by remote peer\n"); if (code == 0) return build_string ("finished\n"); string = Fnumber_to_string (make_number (code)); @@ -532,7 +535,7 @@ allocate_pty () three failures in a row before deciding that we've reached the end of the ptys. */ int failed_count = 0; - + if (stat (pty_name, &stb) < 0) { failed_count++; @@ -765,6 +768,7 @@ nil, indicating the current buffer's process. */) { XPROCESS (process)->status = Fcons (Qexit, Fcons (make_number (0), Qnil)); XSETINT (XPROCESS (process)->tick, ++process_tick); + status_notify (); } else if (XINT (XPROCESS (process)->infd) >= 0) { @@ -843,7 +847,7 @@ If PROCESS has not yet exited or died, return 0. */) DEFUN ("process-id", Fprocess_id, Sprocess_id, 1, 1, 0, doc: /* Return the process id of PROCESS. -This is the pid of the Unix process which PROCESS uses or talks to. +This is the pid of the external process which PROCESS uses or talks to. For a network connection, this value is nil. */) (process) register Lisp_Object process; @@ -1082,7 +1086,7 @@ DEFUN ("set-process-query-on-exit-flag", Fset_process_query_on_exit_flag, Sset_process_query_on_exit_flag, 2, 2, 0, doc: /* Specify if query is needed for PROCESS when Emacs is exited. -If the second argument FLAG is non-nil, emacs will query the user before +If the second argument FLAG is non-nil, Emacs will query the user before exiting if PROCESS is running. */) (process, flag) register Lisp_Object process, flag; @@ -1095,7 +1099,7 @@ exiting if PROCESS is running. */) DEFUN ("process-query-on-exit-flag", Fprocess_query_on_exit_flag, Sprocess_query_on_exit_flag, 1, 1, 0, - doc: /* Return the current value of query on exit flag for PROCESS. */) + doc: /* Return the current value of query-on-exit flag for PROCESS. */) (process) register Lisp_Object process; { @@ -1458,12 +1462,12 @@ static Lisp_Object start_process_unwind (); DEFUN ("start-process", Fstart_process, Sstart_process, 3, MANY, 0, doc: /* Start a program in a subprocess. Return the process object for it. NAME is name for process. It is modified if necessary to make it unique. -BUFFER is the buffer or (buffer-name) to associate with the process. +BUFFER is the buffer (or buffer name) to associate with the process. Process output goes at end of that buffer, unless you specify an output stream or filter function to handle the output. BUFFER may be also nil, meaning that this process is not associated with any buffer. -Third arg is program file name. It is searched for in PATH. +PROGRAM is the program file name. It is searched for in PATH. Remaining arguments are strings to give program as arguments. usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) @@ -2609,7 +2613,7 @@ successful) or "failed" when the connect completes. Default is to use a blocking connect (i.e. wait) for stream type connections. :noquery BOOL -- Query the user unless BOOL is non-nil, and process is -running when emacs is exited. +running when Emacs is exited. :stop BOOL -- Start process in the `stopped' state if BOOL non-nil. In the stopped state, a server process does not accept new @@ -2955,7 +2959,7 @@ usage: (make-network-process &rest ARGS) */) struct hostent *host_info_ptr; /* gethostbyname may fail with TRY_AGAIN, but we don't honour that, - as it may `hang' emacs for a very long time. */ + as it may `hang' Emacs for a very long time. */ immediate_quit = 1; QUIT; host_info_ptr = gethostbyname (SDATA (host)); @@ -3616,6 +3620,8 @@ FLAGS is the current flags of the interface. */) #endif #endif /* HAVE_SOCKETS */ +/* Turn off input and output for process PROC. */ + void deactivate_process (proc) Lisp_Object proc; @@ -3635,7 +3641,7 @@ deactivate_process (proc) p->read_output_skip = Qnil; } #endif - + if (inchannel >= 0) { /* Beware SIGCHLD hereabouts. */ @@ -3965,7 +3971,7 @@ server_accept_connection (server, channel) /* This variable is different from waiting_for_input in keyboard.c. It is used to communicate to a lisp process-filter/sentinel (via the - function Fwaiting_for_user_input_p below) whether emacs was waiting + function Fwaiting_for_user_input_p below) whether Emacs was waiting for user-input when that process-filter was called. waiting_for_input cannot be used as that is by definition 0 when lisp code is being evalled. @@ -4019,8 +4025,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) int do_display; { register int channel, nfds; - static SELECT_TYPE Available; - static SELECT_TYPE Connecting; + SELECT_TYPE Available; + SELECT_TYPE Connecting; int check_connect, check_delay, no_avail; int xerrno; Lisp_Object proc; @@ -4031,6 +4037,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) /* Either nil or a cons cell, the car of which is of interest and may be changed outside of this routine. */ Lisp_Object wait_for_cell = Qnil; + int saved_waiting_for_user_input_p = waiting_for_user_input_p; FD_ZERO (&Available); FD_ZERO (&Connecting); @@ -4581,7 +4588,8 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) } } #ifdef NON_BLOCKING_CONNECT - if (check_connect && FD_ISSET (channel, &Connecting)) + if (check_connect && FD_ISSET (channel, &Connecting) + && FD_ISSET (channel, &connect_wait_mask)) { struct Lisp_Process *p; @@ -4644,7 +4652,7 @@ wait_reading_process_input (time_limit, microsecs, read_kbd, do_display) } /* end for each file descriptor */ } /* end while exit conditions not met */ - waiting_for_user_input_p = 0; + waiting_for_user_input_p = saved_waiting_for_user_input_p; /* If calling from keyboard input, do not quit since we want to return C-g as an input character. @@ -4691,7 +4699,7 @@ read_process_output_error_handler (error) starting with our buffered-ahead character if we have one. Yield number of decoded characters read. - This function reads at most 1024 characters. + This function reads at most 4096 characters. If you want to read all available subprocess output, you must call it repeatedly until it returns zero. @@ -4711,7 +4719,7 @@ read_process_output (proc, channel) register int opoint; struct coding_system *coding = proc_decode_coding_system[channel]; int carryover = XINT (p->decoding_carryover); - int readmax = 1024; + int readmax = 4096; #ifdef VMS VMS_PROC_STUFF *vs, *get_vms_process_pointer(); @@ -4744,16 +4752,6 @@ read_process_output (proc, channel) } #else /* not VMS */ -#ifdef DATAGRAM_SOCKETS - /* A datagram is one packet; allow at least 1500+ bytes of data - corresponding to the typical Ethernet frame size. */ - if (DATAGRAM_CHAN_P (channel)) - { - /* carryover = 0; */ /* Does carryover make sense for datagrams? */ - readmax += 1024; - } -#endif - chars = (char *) alloca (carryover + readmax); if (carryover) /* See the comment above. */ @@ -5069,7 +5067,7 @@ read_process_output (proc, channel) DEFUN ("waiting-for-user-input-p", Fwaiting_for_user_input_p, Swaiting_for_user_input_p, 0, 0, 0, - doc: /* Returns non-nil if emacs is waiting for input from the user. + doc: /* Returns non-nil if Emacs is waiting for input from the user. This is intended for use by asynchronous process output filters and sentinels. */) () { @@ -5446,7 +5444,7 @@ emacs_get_tty_pgrp (p) { int gid = -1; -#ifdef TIOCGPGRP +#ifdef TIOCGPGRP if (ioctl (XINT (p->infd), TIOCGPGRP, &gid) == -1 && ! NILP (p->tty_name)) { int fd; @@ -5643,7 +5641,7 @@ process_send_signal (process, signo, current_group, nomsg) we should just assume that p->pid is also the process group id. */ gid = emacs_get_tty_pgrp (p); - + if (gid == -1) /* If we can't get the information, assume the shell owns the tty. */ @@ -5726,7 +5724,7 @@ process_send_signal (process, signo, current_group, nomsg) DEFUN ("interrupt-process", Finterrupt_process, Sinterrupt_process, 0, 2, 0, doc: /* Interrupt process PROCESS. PROCESS may be a process, a buffer, or the name of a process or buffer. -nil or no arg means current buffer's process. +No arg or nil means current buffer's process. Second arg CURRENT-GROUP non-nil means send signal to the current process-group of the process's controlling terminal rather than to the process's own process group. @@ -6385,7 +6383,7 @@ status_notify () /* Get the text to use for the message. */ if (!NILP (p->raw_status_low)) update_status (p); - msg = status_message (p->status); + msg = status_message (p); /* If process is terminated, deactivate it or delete it. */ symbol = p->status; @@ -6471,13 +6469,13 @@ DEFUN ("set-process-coding-system", Fset_process_coding_system, doc: /* Set coding systems of PROCESS to DECODING and ENCODING. DECODING will be used to decode subprocess output and ENCODING to encode subprocess input. */) - (proc, decoding, encoding) - register Lisp_Object proc, decoding, encoding; + (process, decoding, encoding) + register Lisp_Object process, decoding, encoding; { register struct Lisp_Process *p; - CHECK_PROCESS (proc); - p = XPROCESS (proc); + CHECK_PROCESS (process); + p = XPROCESS (process); if (XINT (p->infd) < 0) error ("Input file descriptor of %s closed", SDATA (p->name)); if (XINT (p->outfd) < 0) @@ -6487,7 +6485,7 @@ encode subprocess input. */) p->decode_coding_system = decoding; p->encode_coding_system = encoding; - setup_process_coding_systems (proc); + setup_process_coding_systems (process); return Qnil; } @@ -6495,12 +6493,12 @@ encode subprocess input. */) DEFUN ("process-coding-system", Fprocess_coding_system, Sprocess_coding_system, 1, 1, 0, doc: /* Return a cons of coding systems for decoding and encoding of PROCESS. */) - (proc) - register Lisp_Object proc; + (process) + register Lisp_Object process; { - CHECK_PROCESS (proc); - return Fcons (XPROCESS (proc)->decode_coding_system, - XPROCESS (proc)->encode_coding_system); + CHECK_PROCESS (process); + return Fcons (XPROCESS (process)->decode_coding_system, + XPROCESS (process)->encode_coding_system); } DEFUN ("set-process-filter-multibyte", Fset_process_filter_multibyte, @@ -6510,15 +6508,15 @@ If FLAG is non-nil, the filter is given multibyte strings. If FLAG is nil, the filter is given unibyte strings. In this case, all character code conversion except for end-of-line conversion is suppressed. */) - (proc, flag) - Lisp_Object proc, flag; + (process, flag) + Lisp_Object process, flag; { register struct Lisp_Process *p; - CHECK_PROCESS (proc); - p = XPROCESS (proc); + CHECK_PROCESS (process); + p = XPROCESS (process); p->filter_multibyte = flag; - setup_process_coding_systems (proc); + setup_process_coding_systems (process); return Qnil; } @@ -6526,13 +6524,13 @@ suppressed. */) DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p, Sprocess_filter_multibyte_p, 1, 1, 0, doc: /* Return t if a multibyte string is given to PROCESS's filter.*/) - (proc) - Lisp_Object proc; + (process) + Lisp_Object process; { register struct Lisp_Process *p; - CHECK_PROCESS (proc); - p = XPROCESS (proc); + CHECK_PROCESS (process); + p = XPROCESS (process); return (NILP (p->filter_multibyte) ? Qnil : Qt); } @@ -6753,11 +6751,11 @@ The value takes effect when `start-process' is called. */); #ifdef ADAPTIVE_READ_BUFFERING DEFVAR_LISP ("process-adaptive-read-buffering", &Vprocess_adaptive_read_buffering, doc: /* If non-nil, improve receive buffering by delaying after short reads. -On some systems, when emacs reads the output from a subprocess, the output data +On some systems, when Emacs reads the output from a subprocess, the output data is read in very small blocks, potentially resulting in very poor performance. This behaviour can be remedied to some extent by setting this variable to a non-nil value, as it will automatically delay reading from such processes, to -allowing them to produce more output before emacs tries to read it. +allowing them to produce more output before Emacs tries to read it. If the value is t, the delay is reset after each write to the process; any other non-nil value means that the delay is not reset on write. The variable takes effect when `start-process' is called. */); diff --git a/src/regex.c b/src/regex.c index e1479e64c9f..006b79acba8 100644 --- a/src/regex.c +++ b/src/regex.c @@ -2,7 +2,7 @@ 0.12. (Implements POSIX draft P1003.2/D11.2, except for some of the internationalization features.) - Copyright (C) 1993,94,95,96,97,98,99,2000 Free Software Foundation, Inc. + Copyright (C) 1993,94,95,96,97,98,99,2000,04 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -233,7 +233,7 @@ char *realloc (); /* Define the syntax stuff for \<, \>, etc. */ /* Sword must be nonzero for the wordchar pattern commands in re_match_2. */ -enum syntaxcode { Swhitespace = 0, Sword = 1 }; +enum syntaxcode { Swhitespace = 0, Sword = 1, Ssymbol = 2 }; # ifdef SWITCH_ENUM_BUG # define SWITCH_ENUM_CAST(x) ((int)(x)) @@ -423,7 +423,7 @@ init_syntax_once () if (ISALNUM (c)) re_syntax_table[c] = Sword; - re_syntax_table['_'] = Sword; + re_syntax_table['_'] = Ssymbol; done = 1; } @@ -680,6 +680,9 @@ typedef enum wordbound, /* Succeeds if at a word boundary. */ notwordbound, /* Succeeds if not at a word boundary. */ + symbeg, /* Succeeds if at symbol beginning. */ + symend, /* Succeeds if at symbol end. */ + /* Matches any character whose syntax is specified. Followed by a byte which contains a syntax code, e.g., Sword. */ syntaxspec, @@ -1118,6 +1121,15 @@ print_partial_compiled_pattern (start, end) case wordend: fprintf (stderr, "/wordend"); + break; + + case symbeg: + fprintf (stderr, "/symbeg"); + break; + + case symend: + fprintf (stderr, "/symend"); + break; case syntaxspec: fprintf (stderr, "/syntaxspec"); @@ -2003,41 +2015,10 @@ struct range_table_work_area } \ } while (0) -#if WIDE_CHAR_SUPPORT -/* The GNU C library provides support for user-defined character classes - and the functions from ISO C amendement 1. */ -# ifdef CHARCLASS_NAME_MAX -# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX -# else -/* This shouldn't happen but some implementation might still have this - problem. Use a reasonable default value. */ -# define CHAR_CLASS_MAX_LENGTH 256 -# endif -typedef wctype_t re_wctype_t; -typedef wchar_t re_wchar_t; -# define re_wctype wctype -# define re_iswctype iswctype -# define re_wctype_to_bit(cc) 0 -#else -# define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */ -# define btowc(c) c - -/* Character classes. */ -typedef enum { RECC_ERROR = 0, - RECC_ALNUM, RECC_ALPHA, RECC_WORD, - RECC_GRAPH, RECC_PRINT, - RECC_LOWER, RECC_UPPER, - RECC_PUNCT, RECC_CNTRL, - RECC_DIGIT, RECC_XDIGIT, - RECC_BLANK, RECC_SPACE, - RECC_MULTIBYTE, RECC_NONASCII, - RECC_ASCII, RECC_UNIBYTE -} re_wctype_t; - -typedef int re_wchar_t; +#if ! WIDE_CHAR_SUPPORT /* Map a string to the char class it names (if any). */ -static re_wctype_t +re_wctype_t re_wctype (str) re_char *str; { @@ -2063,7 +2044,7 @@ re_wctype (str) } /* True iff CH is in the char class CC. */ -static boolean +boolean re_iswctype (ch, cc) int ch; re_wctype_t cc; @@ -3464,6 +3445,19 @@ regex_compile (pattern, size, syntax, bufp) BUF_PUSH (wordend); break; + case '_': + if (syntax & RE_NO_GNU_OPS) + goto normal_char; + laststart = b; + PATFETCH (c); + if (c == '<') + BUF_PUSH (symbeg); + else if (c == '>') + BUF_PUSH (symend); + else + FREE_STACK_RETURN (REG_BADPAT); + break; + case 'b': if (syntax & RE_NO_GNU_OPS) goto normal_char; @@ -3980,6 +3974,8 @@ analyse_first (p, pend, fastmap, multibyte) case notwordbound: case wordbeg: case wordend: + case symbeg: + case symend: continue; @@ -4768,14 +4764,20 @@ mutually_exclusive_p (bufp, p1, p2) break; case wordend: - case notsyntaxspec: + return ((re_opcode_t) *p1 == syntaxspec && p1[1] == Sword); + case symend: return ((re_opcode_t) *p1 == syntaxspec - && p1[1] == (op2 == wordend ? Sword : p2[1])); + && (p1[1] == Ssymbol || p1[1] == Sword)); + case notsyntaxspec: + return ((re_opcode_t) *p1 == syntaxspec && p1[1] == p2[1]); case wordbeg: - case syntaxspec: + return ((re_opcode_t) *p1 == notsyntaxspec && p1[1] == Sword); + case symbeg: return ((re_opcode_t) *p1 == notsyntaxspec - && p1[1] == (op2 == wordend ? Sword : p2[1])); + && (p1[1] == Ssymbol || p1[1] == Sword)); + case syntaxspec: + return ((re_opcode_t) *p1 == notsyntaxspec && p1[1] == p2[1]); case wordbound: return (((re_opcode_t) *p1 == notsyntaxspec @@ -5952,6 +5954,92 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) } break; + case symbeg: + DEBUG_PRINT1 ("EXECUTING symbeg.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the end of string. */ + if (AT_STRINGS_END (d)) + goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + re_wchar_t c1, c2; + int s1, s2; +#ifdef emacs + int offset = PTR_TO_OFFSET (d); + int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + UPDATE_SYNTAX_TABLE (charpos); +#endif + PREFETCH (); + c2 = RE_STRING_CHAR (d, dend - d); + s2 = SYNTAX (c2); + + /* Case 2: S2 is neither Sword nor Ssymbol. */ + if (s2 != Sword && s2 != Ssymbol) + goto fail; + + /* Case 3: D is not at the beginning of string ... */ + if (!AT_STRINGS_BEG (d)) + { + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); +#ifdef emacs + UPDATE_SYNTAX_TABLE_BACKWARD (charpos - 1); +#endif + s1 = SYNTAX (c1); + + /* ... and S1 is Sword or Ssymbol. */ + if (s1 == Sword || s1 == Ssymbol) + goto fail; + } + } + break; + + case symend: + DEBUG_PRINT1 ("EXECUTING symend.\n"); + + /* We FAIL in one of the following cases: */ + + /* Case 1: D is at the beginning of string. */ + if (AT_STRINGS_BEG (d)) + goto fail; + else + { + /* C1 is the character before D, S1 is the syntax of C1, C2 + is the character at D, and S2 is the syntax of C2. */ + re_wchar_t c1, c2; + int s1, s2; +#ifdef emacs + int offset = PTR_TO_OFFSET (d) - 1; + int charpos = SYNTAX_TABLE_BYTE_TO_CHAR (offset); + UPDATE_SYNTAX_TABLE (charpos); +#endif + GET_CHAR_BEFORE_2 (c1, d, string1, end1, string2, end2); + s1 = SYNTAX (c1); + + /* Case 2: S1 is neither Ssymbol nor Sword. */ + if (s1 != Sword && s1 != Ssymbol) + goto fail; + + /* Case 3: D is not at the end of string ... */ + if (!AT_STRINGS_END (d)) + { + PREFETCH_NOLIMIT (); + c2 = RE_STRING_CHAR (d, dend - d); +#ifdef emacs + UPDATE_SYNTAX_TABLE_FORWARD (charpos); +#endif + s2 = SYNTAX (c2); + + /* ... and S2 is Sword or Ssymbol. */ + if (s2 == Sword || s2 == Ssymbol) + goto fail; + } + } + break; + case syntaxspec: case notsyntaxspec: not = (re_opcode_t) *(p - 1) == notsyntaxspec; diff --git a/src/regex.h b/src/regex.h index be7634bb8de..26c589bde92 100644 --- a/src/regex.h +++ b/src/regex.h @@ -568,6 +568,49 @@ extern void regfree _RE_ARGS ((regex_t *__preg)); } #endif /* C++ */ +/* For platform which support the ISO C amendement 1 functionality we + support user defined character classes. */ +#if WIDE_CHAR_SUPPORT +/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */ +# include <wchar.h> +# include <wctype.h> +#endif + +#if WIDE_CHAR_SUPPORT +/* The GNU C library provides support for user-defined character classes + and the functions from ISO C amendement 1. */ +# ifdef CHARCLASS_NAME_MAX +# define CHAR_CLASS_MAX_LENGTH CHARCLASS_NAME_MAX +# else +/* This shouldn't happen but some implementation might still have this + problem. Use a reasonable default value. */ +# define CHAR_CLASS_MAX_LENGTH 256 +# endif +typedef wctype_t re_wctype_t; +typedef wchar_t re_wchar_t; +# define re_wctype wctype +# define re_iswctype iswctype +# define re_wctype_to_bit(cc) 0 +#else +# define CHAR_CLASS_MAX_LENGTH 9 /* Namely, `multibyte'. */ +# define btowc(c) c + +/* Character classes. */ +typedef enum { RECC_ERROR = 0, + RECC_ALNUM, RECC_ALPHA, RECC_WORD, + RECC_GRAPH, RECC_PRINT, + RECC_LOWER, RECC_UPPER, + RECC_PUNCT, RECC_CNTRL, + RECC_DIGIT, RECC_XDIGIT, + RECC_BLANK, RECC_SPACE, + RECC_MULTIBYTE, RECC_NONASCII, + RECC_ASCII, RECC_UNIBYTE +} re_wctype_t; + +typedef int re_wchar_t; + +#endif /* not WIDE_CHAR_SUPPORT */ + #endif /* regex.h */ /* diff --git a/src/search.c b/src/search.c index f9b45c8eca6..eba74f418ce 100644 --- a/src/search.c +++ b/src/search.c @@ -924,7 +924,7 @@ trivial_regexp_p (regexp) { case '|': case '(': case ')': case '`': case '\'': case 'b': case 'B': case '<': case '>': case 'w': case 'W': case 's': - case 'S': case '=': case '{': case '}': + case 'S': case '=': case '{': case '}': case '_': case 'c': case 'C': /* for categoryspec and notcategoryspec */ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -2576,9 +2576,11 @@ match_limit (num, beginningp) CHECK_NUMBER (num); n = XINT (num); - if (n < 0 || n >= search_regs.num_regs) - args_out_of_range (num, make_number (search_regs.num_regs)); - if (search_regs.num_regs <= 0 + if (n < 0) + args_out_of_range (num, 0); + if (search_regs.num_regs <= 0) + error ("No match data, because no search succeeded"); + if (n >= search_regs.num_regs || search_regs.start[n] < 0) return Qnil; return (make_number ((beginningp) ? search_regs.start[n] diff --git a/src/syntax.c b/src/syntax.c index 22a34c40fb3..57606f314d6 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */ #include "buffer.h" #include "character.h" #include "keymap.h" +#include "regex.h" /* Make syntax table lookup grant data in gl_state. */ #define SYNTAX_ENTRY_VIA_PROPERTY @@ -97,12 +98,13 @@ static int find_start_modiff; static int find_defun_start P_ ((int, int)); static int back_comment P_ ((int, int, int, int, int, int *, int *)); static int char_quoted P_ ((int, int)); -static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object)); +static Lisp_Object skip_chars P_ ((int, Lisp_Object, Lisp_Object, int)); static Lisp_Object skip_syntaxes P_ ((int, Lisp_Object, Lisp_Object)); static Lisp_Object scan_lists P_ ((int, int, int, int)); static void scan_sexps_forward P_ ((struct lisp_parse_state *, int, int, int, int, int, Lisp_Object, int)); +static int in_classes P_ ((int, Lisp_Object)); struct gl_state_s gl_state; /* Global state of syntax parser. */ @@ -293,8 +295,11 @@ char_quoted (charpos, bytepos) while (bytepos >= beg) { + int c; + UPDATE_SYNTAX_TABLE_BACKWARD (charpos); - code = SYNTAX (FETCH_CHAR_AS_MULTIBYTE (bytepos)); + c = FETCH_CHAR_AS_MULTIBYTE (bytepos); + code = SYNTAX (c); if (! (code == Scharquote || code == Sescape)) break; @@ -381,12 +386,16 @@ find_defun_start (pos, pos_byte) gl_state.use_global = 0; while (PT > BEGV) { + int c; + /* Open-paren at start of line means we may have found our defun-start. */ - if (SYNTAX (FETCH_CHAR_AS_MULTIBYTE (PT_BYTE)) == Sopen) + c = FETCH_CHAR_AS_MULTIBYTE (PT_BYTE); + if (SYNTAX (c) == Sopen) { SETUP_SYNTAX_TABLE (PT + 1, -1); /* Try again... */ - if (SYNTAX (FETCH_CHAR_AS_MULTIBYTE (PT_BYTE)) == Sopen) + c = FETCH_CHAR_AS_MULTIBYTE (PT_BYTE); + if (SYNTAX (c) == Sopen) break; /* Now fallback to the default value. */ gl_state.current_syntax_table = current_buffer->syntax_table; @@ -955,7 +964,7 @@ text property. */) DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3, "cSet syntax for character: \nsSet syntax for %s to: ", doc: /* Set syntax for character CHAR according to string NEWENTRY. -The syntax is changed only for table SYNTAX_TABLE, which defaults to +The syntax is changed only for table SYNTAX-TABLE, which defaults to the current buffer's syntax table. CHAR may be a cons (MIN . MAX), in which case, syntaxes of all characters in the range MIN and MAX are changed. @@ -1339,13 +1348,13 @@ except that `]' is never special and `\\' quotes `^', `-' or `\\' (but not as the end of a range; quoting is never needed there). Thus, with arg "a-zA-Z", this skips letters stopping before first nonletter. With arg "^a-zA-Z", skips nonletters stopping before first letter. -Returns the distance traveled, either zero or positive. -Note that char classes, e.g. `[:alpha:]', are not currently supported; -they will be treated as literals. */) +Char classes, e.g. `[:alpha:]', are supported. + +Returns the distance traveled, either zero or positive. */) (string, lim) Lisp_Object string, lim; { - return skip_chars (1, string, lim); + return skip_chars (1, string, lim, 1); } DEFUN ("skip-chars-backward", Fskip_chars_backward, Sskip_chars_backward, 1, 2, 0, @@ -1355,7 +1364,7 @@ Returns the distance traveled, either zero or negative. */) (string, lim) Lisp_Object string, lim; { - return skip_chars (0, string, lim); + return skip_chars (0, string, lim, 1); } DEFUN ("skip-syntax-forward", Fskip_syntax_forward, Sskip_syntax_forward, 1, 2, 0, @@ -1383,9 +1392,10 @@ This function returns the distance traveled, either zero or negative. */) } static Lisp_Object -skip_chars (forwardp, string, lim) +skip_chars (forwardp, string, lim, handle_iso_classes) int forwardp; Lisp_Object string, lim; + int handle_iso_classes; { register unsigned int c; unsigned char fastmap[0400]; @@ -1403,8 +1413,10 @@ skip_chars (forwardp, string, lim) int size_byte; const unsigned char *str; int len; + Lisp_Object iso_classes; CHECK_STRING (string); + iso_classes = Qnil; if (NILP (lim)) XSETINT (lim, forwardp ? ZV : BEGV); @@ -1448,6 +1460,42 @@ skip_chars (forwardp, string, lim) { c = str[i_byte++]; + if (handle_iso_classes && c == '[' + && i_byte < size_byte + && str[i_byte] == ':') + { + const unsigned char *class_beg = str + i_byte + 1; + const unsigned char *class_end = class_beg; + const unsigned char *class_limit = str + size_byte - 2; + /* Leave room for the null. */ + unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1]; + re_wctype_t cc; + + if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH) + class_limit = class_beg + CHAR_CLASS_MAX_LENGTH; + + while (class_end < class_limit + && *class_end >= 'a' && *class_end <= 'z') + class_end++; + + if (class_end == class_beg + || *class_end != ':' || class_end[1] != ']') + goto not_a_class_name; + + bcopy (class_beg, class_name, class_end - class_beg); + class_name[class_end - class_beg] = 0; + + cc = re_wctype (class_name); + if (cc == 0) + error ("Invalid ISO C character class"); + + iso_classes = Fcons (make_number (cc), iso_classes); + + i_byte = class_end + 2 - str; + continue; + } + + not_a_class_name: if (c == '\\') { if (i_byte == size_byte) @@ -1534,6 +1582,42 @@ skip_chars (forwardp, string, lim) c = STRING_CHAR_AND_LENGTH (str + i_byte, size_byte-i_byte, len); i_byte += len; + if (handle_iso_classes && c == '[' + && i_byte < size_byte + && STRING_CHAR (str + i_byte, size_byte - i_byte) == ':') + { + const unsigned char *class_beg = str + i_byte + 1; + const unsigned char *class_end = class_beg; + const unsigned char *class_limit = str + size_byte - 2; + /* Leave room for the null. */ + unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1]; + re_wctype_t cc; + + if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH) + class_limit = class_beg + CHAR_CLASS_MAX_LENGTH; + + while (class_end < class_limit + && *class_end >= 'a' && *class_end <= 'z') + class_end++; + + if (class_end == class_beg + || *class_end != ':' || class_end[1] != ']') + goto not_a_class_name_multibyte; + + bcopy (class_beg, class_name, class_end - class_beg); + class_name[class_end - class_beg] = 0; + + cc = re_wctype (class_name); + if (cc == 0) + error ("Invalid ISO C character class"); + + iso_classes = Fcons (make_number (cc), iso_classes); + + i_byte = class_end + 2 - str; + continue; + } + + not_a_class_name_multibyte: if (c == '\\') { if (i_byte == size_byte) @@ -1643,13 +1727,13 @@ skip_chars (forwardp, string, lim) if (forwardp) { - endp = (XINT (lim) == GPT) ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim)); - stop = (pos < GPT && GPT < XINT (lim)) ? GPT_ADDR : endp; + endp = (XINT (lim) == GPT) ? GPT_ADDR : CHAR_POS_ADDR (XINT (lim)); + stop = (pos < GPT && GPT < XINT (lim)) ? GPT_ADDR : endp; } else { - endp = CHAR_POS_ADDR (XINT (lim)); - stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp; + endp = CHAR_POS_ADDR (XINT (lim)); + stop = (pos >= GPT && GPT > XINT (lim)) ? GAP_END_ADDR : endp; } immediate_quit = 1; @@ -1667,9 +1751,17 @@ skip_chars (forwardp, string, lim) p = GAP_END_ADDR; stop = endp; } + c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes); + if (! NILP (iso_classes) && in_classes (c, iso_classes)) + { + if (negate) + break; + else + goto fwd_ok; + } + if (! fastmap[*p]) break; - c = STRING_CHAR_AND_LENGTH (p, MAX_MULTIBYTE_LENGTH, nbytes); if (! ASCII_CHAR_P (c)) { /* As we are looking at a multibyte character, we @@ -1686,6 +1778,7 @@ skip_chars (forwardp, string, lim) if (!(negate ^ (i < n_char_ranges))) break; } + fwd_ok: p += nbytes, pos++, pos_byte += nbytes; } else @@ -1698,8 +1791,18 @@ skip_chars (forwardp, string, lim) p = GAP_END_ADDR; stop = endp; } + + if (!NILP (iso_classes) && in_classes (*p, iso_classes)) + { + if (negate) + break; + else + goto fwd_unibyte_ok; + } + if (!fastmap[*p]) break; + fwd_unibyte_ok: p++, pos++, pos_byte++; } } @@ -1719,9 +1822,18 @@ skip_chars (forwardp, string, lim) } prev_p = p; while (--p >= stop && ! CHAR_HEAD_P (*p)); + c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH); + + if (! NILP (iso_classes) && in_classes (c, iso_classes)) + { + if (negate) + break; + else + goto back_ok; + } + if (! fastmap[*p]) break; - c = STRING_CHAR (p, MAX_MULTIBYTE_LENGTH); if (! ASCII_CHAR_P (c)) { /* See the comment in the previous similar code. */ @@ -1731,6 +1843,7 @@ skip_chars (forwardp, string, lim) if (!(negate ^ (i < n_char_ranges))) break; } + back_ok: pos--, pos_byte -= prev_p - p; } else @@ -1743,8 +1856,18 @@ skip_chars (forwardp, string, lim) p = GPT_ADDR; stop = endp; } + + if (! NILP (iso_classes) && in_classes (p[-1], iso_classes)) + { + if (negate) + break; + else + goto back_unibyte_ok; + } + if (!fastmap[p[-1]]) break; + back_unibyte_ok: p--, pos--, pos_byte--; } } @@ -1927,6 +2050,30 @@ skip_syntaxes (forwardp, string, lim) return make_number (PT - start_point); } } + +/* Return 1 if character C belongs to one of the ISO classes + in the list ISO_CLASSES. Each class is represented by an + integer which is its type according to re_wctype. */ + +static int +in_classes (c, iso_classes) + int c; + Lisp_Object iso_classes; +{ + int fits_class = 0; + + while (! NILP (iso_classes)) + { + Lisp_Object elt; + elt = XCAR (iso_classes); + iso_classes = XCDR (iso_classes); + + if (re_iswctype (c, XFASTINT (elt))) + fits_class = 1; + } + + return fits_class; +} /* Jump over a comment, assuming we are at the beginning of one. FROM is the current position. @@ -2310,7 +2457,8 @@ scan_lists (from, count, depth, sexpflag) INC_BOTH (from, from_byte); UPDATE_SYNTAX_TABLE_FORWARD (from); if (from < stop && comstart_first - && SYNTAX_COMSTART_SECOND (FETCH_CHAR_AS_MULTIBYTE (from_byte)) + && (c = FETCH_CHAR_AS_MULTIBYTE (from_byte), + SYNTAX_COMSTART_SECOND (c)) && parse_sexp_ignore_comments) { /* we have encountered a comment start sequence and we @@ -2636,7 +2784,7 @@ scan_lists (from, count, depth, sexpflag) Fcons (build_string ("Unbalanced parentheses"), Fcons (make_number (last_good), Fcons (make_number (from), Qnil)))); - + abort (); /* NOTREACHED */ } @@ -2776,8 +2924,8 @@ scan_sexps_forward (stateptr, from, from_byte, end, targetdepth, #define INC_FROM \ do { prev_from = from; \ prev_from_byte = from_byte; \ - prev_from_syntax \ - = SYNTAX_WITH_FLAGS (FETCH_CHAR_AS_MULTIBYTE (prev_from_byte)); \ + temp = FETCH_CHAR_AS_MULTIBYTE (prev_from_byte); \ + prev_from_syntax = SYNTAX_WITH_FLAGS (temp); \ INC_BOTH (from, from_byte); \ if (from < end) \ UPDATE_SYNTAX_TABLE_FORWARD (from); \ @@ -2852,7 +3000,8 @@ do { prev_from = from; \ curlevel->last = -1; SETUP_SYNTAX_TABLE (prev_from, 1); - prev_from_syntax = SYNTAX_WITH_FLAGS (FETCH_CHAR (prev_from_byte)); + temp = FETCH_CHAR (prev_from_byte); + prev_from_syntax = SYNTAX_WITH_FLAGS (temp); UPDATE_SYNTAX_TABLE_FORWARD (from); /* Enter the loop at a place appropriate for initial state. */ @@ -2931,7 +3080,8 @@ do { prev_from = from; \ while (from < end) { /* Some compilers can't handle this inside the switch. */ - temp = SYNTAX (FETCH_CHAR_AS_MULTIBYTE (from_byte)); + temp = FETCH_CHAR_AS_MULTIBYTE (from_byte); + temp = SYNTAX (temp); switch (temp) { case Scharquote: diff --git a/src/syntax.h b/src/syntax.h index 21f24dbd100..ba862655cfe 100644 --- a/src/syntax.h +++ b/src/syntax.h @@ -89,24 +89,24 @@ enum syntaxcode #ifdef __GNUC__ #define SYNTAX(c) \ - ({ Lisp_Object temp; \ - temp = SYNTAX_ENTRY (c); \ - (CONSP (temp) \ - ? (enum syntaxcode) (XINT (XCAR (temp)) & 0xff) \ + ({ Lisp_Object _syntax_temp; \ + _syntax_temp = SYNTAX_ENTRY (c); \ + (CONSP (_syntax_temp) \ + ? (enum syntaxcode) (XINT (XCAR (_syntax_temp)) & 0xff) \ : Swhitespace); }) #define SYNTAX_WITH_FLAGS(c) \ - ({ Lisp_Object temp; \ - temp = SYNTAX_ENTRY (c); \ - (CONSP (temp) \ - ? XINT (XCAR (temp)) \ + ({ Lisp_Object _syntax_temp; \ + _syntax_temp = SYNTAX_ENTRY (c); \ + (CONSP (_syntax_temp) \ + ? XINT (XCAR (_syntax_temp)) \ : (int) Swhitespace); }) #define SYNTAX_MATCH(c) \ - ({ Lisp_Object temp; \ - temp = SYNTAX_ENTRY (c); \ - (CONSP (temp) \ - ? XCDR (temp) \ + ({ Lisp_Object _syntax_temp; \ + _syntax_temp = SYNTAX_ENTRY (c); \ + (CONSP (_syntax_temp) \ + ? XCDR (_syntax_temp) \ : Qnil); }) #else extern Lisp_Object syntax_temp; diff --git a/src/syssignal.h b/src/syssignal.h index 2b536758e27..cef71f7459a 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -18,6 +18,8 @@ along with GNU Emacs; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +extern void init_signals P_ ((void)); + #ifdef POSIX_SIGNALS /* Don't #include <signal.h>. That header should always be #included @@ -31,7 +33,6 @@ Boston, MA 02111-1307, USA. */ #define SIGEMPTYMASK (empty_mask) #define SIGFULLMASK (full_mask) extern sigset_t empty_mask, full_mask; -extern void init_signals P_ ((void)); /* POSIX pretty much destroys any possibility of writing sigmask as a macro in standard C. We always define our own version because the diff --git a/src/textprop.c b/src/textprop.c index 4f13aefb1be..c8ec008dcbd 100644 --- a/src/textprop.c +++ b/src/textprop.c @@ -637,30 +637,13 @@ get_char_property_and_overlay (position, prop, object, overlay) } if (BUFFERP (object)) { - int posn = XINT (position); int noverlays; - Lisp_Object *overlay_vec, tem; - int len; + Lisp_Object *overlay_vec; struct buffer *obuf = current_buffer; set_buffer_temp (XBUFFER (object)); - /* First try with room for 40 overlays. */ - len = 40; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - - noverlays = overlays_at (posn, 0, &overlay_vec, &len, - NULL, NULL, 0); - - /* If there are more than 40, - make enough space for all, and try again. */ - if (noverlays > len) - { - len = noverlays; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (posn, 0, &overlay_vec, &len, - NULL, NULL, 0); - } + GET_OVERLAYS_AT (XINT (position), overlay_vec, noverlays, NULL, 0); noverlays = sort_overlays (overlay_vec, noverlays, w); set_buffer_temp (obuf); @@ -668,7 +651,7 @@ get_char_property_and_overlay (position, prop, object, overlay) /* Now check the overlays in order of decreasing priority. */ while (--noverlays >= 0) { - tem = Foverlay_get (overlay_vec[noverlays], prop); + Lisp_Object tem = Foverlay_get (overlay_vec[noverlays], prop); if (!NILP (tem)) { if (overlay) diff --git a/src/undo.c b/src/undo.c index dd086db6c40..9fdc46a3b13 100644 --- a/src/undo.c +++ b/src/undo.c @@ -292,14 +292,15 @@ but another undo command will undo to the previous boundary. */) /* At garbage collection time, make an undo list shorter at the end, returning the truncated list. - MINSIZE and MAXSIZE are the limits on size allowed, as described below. - In practice, these are the values of undo-limit and - undo-strong-limit. */ + MINSIZE, MAXSIZE and LIMITSIZE are the limits on size allowed, + as described below. + In practice, these are the values of undo-limit, + undo-strong-limit, and undo-outer-limit. */ Lisp_Object -truncate_undo_list (list, minsize, maxsize) +truncate_undo_list (list, minsize, maxsize, limitsize) Lisp_Object list; - int minsize, maxsize; + int minsize, maxsize, limitsize; { Lisp_Object prev, next, last_boundary; int size_so_far = 0; @@ -308,7 +309,8 @@ truncate_undo_list (list, minsize, maxsize) next = list; last_boundary = Qnil; - /* Always preserve at least the most recent undo record. + /* Always preserve at least the most recent undo record + unless it is really horribly big. If the first element is an undo boundary, skip past it. Skip, skip, skip the undo, skip, skip, skip the undo, @@ -323,6 +325,7 @@ truncate_undo_list (list, minsize, maxsize) prev = next; next = XCDR (next); } + while (CONSP (next) && ! NILP (XCAR (next))) { Lisp_Object elt; @@ -338,13 +341,20 @@ truncate_undo_list (list, minsize, maxsize) + SCHARS (XCAR (elt))); } + /* If we reach LIMITSIZE before the first boundary, + we're heading for memory full, so truncate the list to nothing. */ + if (size_so_far > limitsize) + return Qnil; + /* Advance to next element. */ prev = next; next = XCDR (next); } + if (CONSP (next)) last_boundary = prev; + /* Keep more if it fits. */ while (CONSP (next)) { Lisp_Object elt; diff --git a/src/w32.c b/src/w32.c index 98d630529e6..12d1f21b091 100644 --- a/src/w32.c +++ b/src/w32.c @@ -105,7 +105,7 @@ void globals_of_w32 (); extern Lisp_Object Vw32_downcase_file_names; extern Lisp_Object Vw32_generate_fake_inodes; extern Lisp_Object Vw32_get_true_file_attributes; -extern Lisp_Object Vw32_num_mouse_buttons; +extern int w32_num_mouse_buttons; /* @@ -1094,7 +1094,7 @@ init_environment (char ** argv) /* Determine if there is a middle mouse button, to allow parse_button to decide whether right mouse events should be mouse-2 or mouse-3. */ - XSETINT (Vw32_num_mouse_buttons, GetSystemMetrics (SM_CMOUSEBUTTONS)); + w32_num_mouse_buttons = GetSystemMetrics (SM_CMOUSEBUTTONS); init_user_info (); } @@ -1627,7 +1627,7 @@ static WIN32_FIND_DATA dir_find_data; /* Support shares on a network resource as subdirectories of a read-only root directory. */ static HANDLE wnet_enum_handle = INVALID_HANDLE_VALUE; -HANDLE open_unc_volume (char *); +HANDLE open_unc_volume (const char *); char *read_unc_volume (HANDLE, char *, int); void close_unc_volume (HANDLE); @@ -1740,7 +1740,7 @@ readdir (DIR *dirp) } HANDLE -open_unc_volume (char *path) +open_unc_volume (const char *path) { NETRESOURCE nr; HANDLE henum; @@ -1797,7 +1797,7 @@ close_unc_volume (HANDLE henum) } DWORD -unc_volume_file_attributes (char *path) +unc_volume_file_attributes (const char *path) { HANDLE henum; DWORD attrs; @@ -3486,7 +3486,7 @@ sys_pipe (int * phandles) } /* From ntproc.c */ -extern Lisp_Object Vw32_pipe_read_delay; +extern int w32_pipe_read_delay; /* Function to do blocking read of one byte, needed to implement select. It is only allowed on sockets and pipes. */ @@ -3526,7 +3526,7 @@ _sys_read_ahead (int fd) shell on NT is very slow if we don't do this. */ if (rc > 0) { - int wait = XINT (Vw32_pipe_read_delay); + int wait = w32_pipe_read_delay; if (wait > 0) Sleep (wait); diff --git a/src/w32console.c b/src/w32console.c index 50cbfb281d3..cd71f0ba6ad 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -53,20 +53,20 @@ extern int read_input_pending (); extern struct frame * updating_frame; extern int meta_key; -static void move_cursor (int row, int col); -static void clear_to_end (void); -static void clear_frame (void); -static void clear_end_of_line (int); -static void ins_del_lines (int vpos, int n); -static void insert_glyphs (struct glyph *start, int len); -static void write_glyphs (struct glyph *string, int len); -static void delete_glyphs (int n); +static void w32con_move_cursor (int row, int col); +static void w32con_clear_to_end (void); +static void w32con_clear_frame (void); +static void w32con_clear_end_of_line (int); +static void w32con_ins_del_lines (int vpos, int n); +static void w32con_insert_glyphs (struct glyph *start, int len); +static void w32con_write_glyphs (struct glyph *string, int len); +static void w32con_delete_glyphs (int n); void w32_sys_ring_bell (void); -static void reset_terminal_modes (void); -static void set_terminal_modes (void); -static void set_terminal_window (int size); -static void update_begin (struct frame * f); -static void update_end (struct frame * f); +static void w32con_reset_terminal_modes (void); +static void w32con_set_terminal_modes (void); +static void w32con_set_terminal_window (int size); +static void w32con_update_begin (struct frame * f); +static void w32con_update_end (struct frame * f); static WORD w32_face_attributes (struct frame *f, int face_id); static COORD cursor_coords; @@ -103,8 +103,8 @@ ctrl_c_handler (unsigned long type) #define PICK_FRAME() (updating_frame ? updating_frame : SELECTED_FRAME ()) /* Move the cursor to (row, col). */ -void -move_cursor (int row, int col) +static void +w32con_move_cursor (int row, int col) { cursor_coords.X = col; cursor_coords.Y = row; @@ -116,18 +116,18 @@ move_cursor (int row, int col) } /* Clear from cursor to end of screen. */ -void -clear_to_end (void) +static void +w32con_clear_to_end (void) { struct frame * f = PICK_FRAME (); - clear_end_of_line (FRAME_COLS (f) - 1); - ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); + w32con_clear_end_of_line (FRAME_COLS (f) - 1); + w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); } /* Clear the frame. */ -void -clear_frame (void) +static void +w32con_clear_frame (void) { struct frame * f = PICK_FRAME (); COORD dest; @@ -144,7 +144,7 @@ clear_frame (void) FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); - move_cursor (0, 0); + w32con_move_cursor (0, 0); } @@ -152,8 +152,8 @@ static struct glyph glyph_base[256]; static BOOL ceol_initialized = FALSE; /* Clear from Cursor to end (what's "standout marker"?). */ -void -clear_end_of_line (int end) +static void +w32con_clear_end_of_line (int end) { if (!ceol_initialized) { @@ -164,12 +164,12 @@ clear_end_of_line (int end) } ceol_initialized = TRUE; } - write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ + w32con_write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ } /* Insert n lines at vpos. if n is negative delete -n lines. */ -void -ins_del_lines (int vpos, int n) +static void +w32con_ins_del_lines (int vpos, int n) { int i, nb; SMALL_RECT scroll; @@ -212,8 +212,8 @@ ins_del_lines (int vpos, int n) { for (i = scroll.Bottom; i < dest.Y; i++) { - move_cursor (i, 0); - clear_end_of_line (FRAME_COLS (f)); + w32con_move_cursor (i, 0); + w32con_clear_end_of_line (FRAME_COLS (f)); } } } @@ -225,8 +225,8 @@ ins_del_lines (int vpos, int n) { for (i = nb; i < scroll.Top; i++) { - move_cursor (i, 0); - clear_end_of_line (FRAME_COLS (f)); + w32con_move_cursor (i, 0); + w32con_clear_end_of_line (FRAME_COLS (f)); } } } @@ -240,7 +240,7 @@ ins_del_lines (int vpos, int n) #define LEFT 1 #define RIGHT 0 -void +static void scroll_line (int dist, int direction) { /* The idea here is to implement a horizontal scroll in one line to @@ -275,8 +275,8 @@ scroll_line (int dist, int direction) /* If start is zero insert blanks instead of a string at start ?. */ -void -insert_glyphs (register struct glyph *start, register int len) +static void +w32con_insert_glyphs (register struct glyph *start, register int len) { scroll_line (len, RIGHT); @@ -286,18 +286,18 @@ insert_glyphs (register struct glyph *start, register int len) /* Print the first len characters of start, cursor_coords.X adjusted by write_glyphs. */ - write_glyphs (start, len); + w32con_write_glyphs (start, len); } else { - clear_end_of_line (cursor_coords.X + len); + w32con_clear_end_of_line (cursor_coords.X + len); } } extern unsigned char *terminal_encode_buffer; -void -write_glyphs (register struct glyph *string, register int len) +static void +w32con_write_glyphs (register struct glyph *string, register int len) { int produced, consumed; DWORD r; @@ -350,7 +350,7 @@ write_glyphs (register struct glyph *string, register int len) } cursor_coords.X += produced; - move_cursor (cursor_coords.Y, cursor_coords.X); + w32con_move_cursor (cursor_coords.Y, cursor_coords.X); } len -= consumed; n -= consumed; @@ -393,8 +393,8 @@ write_glyphs (register struct glyph *string, register int len) } -void -delete_glyphs (int n) +static void +w32con_delete_glyphs (int n) { /* delete chars means scroll chars from cursor_coords.X + n to cursor_coords.X, anything beyond the edge of the screen should @@ -452,8 +452,8 @@ SOUND is nil to use the normal beep. */) return sound; } -void -reset_terminal_modes (void) +static void +w32con_reset_terminal_modes (void) { #ifdef USE_SEPARATE_SCREEN SetConsoleActiveScreenBuffer (prev_screen); @@ -463,8 +463,8 @@ reset_terminal_modes (void) SetConsoleMode (keyboard_handle, prev_console_mode); } -void -set_terminal_modes (void) +static void +w32con_set_terminal_modes (void) { CONSOLE_CURSOR_INFO cci; @@ -486,19 +486,19 @@ set_terminal_modes (void) clumps rather than one-character-at-a-time... we'll start with not moving the cursor while an update is in progress. */ -void -update_begin (struct frame * f) +static void +w32con_update_begin (struct frame * f) { } -void -update_end (struct frame * f) +static void +w32con_update_end (struct frame * f) { SetConsoleCursorPosition (cur_screen, cursor_coords); } -void -set_terminal_window (int size) +static void +w32con_set_terminal_window (int size) { } @@ -576,21 +576,21 @@ initialize_w32_display (void) { CONSOLE_SCREEN_BUFFER_INFO info; - cursor_to_hook = move_cursor; - raw_cursor_to_hook = move_cursor; - clear_to_end_hook = clear_to_end; - clear_frame_hook = clear_frame; - clear_end_of_line_hook = clear_end_of_line; - ins_del_lines_hook = ins_del_lines; - insert_glyphs_hook = insert_glyphs; - write_glyphs_hook = write_glyphs; - delete_glyphs_hook = delete_glyphs; + cursor_to_hook = w32con_move_cursor; + raw_cursor_to_hook = w32con_move_cursor; + clear_to_end_hook = w32con_clear_to_end; + clear_frame_hook = w32con_clear_frame; + clear_end_of_line_hook = w32con_clear_end_of_line; + ins_del_lines_hook = w32con_ins_del_lines; + insert_glyphs_hook = w32con_insert_glyphs; + write_glyphs_hook = w32con_write_glyphs; + delete_glyphs_hook = w32con_delete_glyphs; ring_bell_hook = w32_sys_ring_bell; - reset_terminal_modes_hook = reset_terminal_modes; - set_terminal_modes_hook = set_terminal_modes; - set_terminal_window_hook = set_terminal_window; - update_begin_hook = update_begin; - update_end_hook = update_end; + reset_terminal_modes_hook = w32con_reset_terminal_modes; + set_terminal_modes_hook = w32con_set_terminal_modes; + set_terminal_window_hook = w32con_set_terminal_window; + update_begin_hook = w32con_update_begin; + update_end_hook = w32con_update_end; read_socket_hook = w32_console_read_socket; mouse_position_hook = w32_console_mouse_position; diff --git a/src/w32fns.c b/src/w32fns.c index ebdf5c3ccca..a5f8c4b61f3 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -1,5 +1,5 @@ /* Graphical user interface functions for the Microsoft W32 API. - Copyright (C) 1989, 92, 93, 94, 95, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright (C) 1989, 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -89,7 +89,7 @@ Lisp_Object Vw32_pass_alt_to_system; Lisp_Object Vw32_alt_is_meta; /* If non-zero, the windows virtual key code for an alternative quit key. */ -Lisp_Object Vw32_quit_key; +int w32_quit_key; /* Non nil if left window key events are passed on to Windows (this only affects whether "tapping" the key opens the Start menu). */ @@ -133,11 +133,11 @@ Lisp_Object Vw32_enable_palette; /* Control how close left/right button down events must be to be converted to a middle button down event. */ -Lisp_Object Vw32_mouse_button_tolerance; +int w32_mouse_button_tolerance; /* Minimum interval between mouse movement (and scroll bar drag) events that are passed on to the event loop. */ -Lisp_Object Vw32_mouse_move_interval; +int w32_mouse_move_interval; /* Flag to indicate if XBUTTON events should be passed on to Windows. */ int w32_pass_extra_mouse_buttons_to_system; @@ -235,6 +235,9 @@ Lisp_Object Qw32_charset_mac; Lisp_Object Qw32_charset_unicode; #endif +/* The ANSI codepage. */ +int w32_ansi_code_page; + /* Prefix for system colors. */ #define SYSTEM_COLOR_PREFIX "System" #define SYSTEM_COLOR_PREFIX_LEN (sizeof (SYSTEM_COLOR_PREFIX) - 1) @@ -281,7 +284,7 @@ int image_cache_refcount, dpyinfo_refcount; /* From w32term.c. */ -extern Lisp_Object Vw32_num_mouse_buttons; +extern int w32_num_mouse_buttons; extern Lisp_Object Vw32_recognize_altgr; extern HWND w32_system_caret_hwnd; @@ -463,7 +466,7 @@ if the entry is new. */) CHECK_NUMBER (blue); CHECK_STRING (name); - XSET (rgb, Lisp_Int, RGB(XUINT (red), XUINT (green), XUINT (blue))); + XSETINT (rgb, RGB(XUINT (red), XUINT (green), XUINT (blue))); BLOCK_INPUT; @@ -826,7 +829,7 @@ w32_to_x_color (rgb) return Qnil; } -COLORREF +static Lisp_Object w32_color_map_lookup (colorname) char *colorname; { @@ -845,7 +848,7 @@ w32_color_map_lookup (colorname) if (lstrcmpi (SDATA (tem), colorname) == 0) { - ret = XUINT (Fcdr (elt)); + ret = Fcdr (elt); break; } @@ -908,7 +911,7 @@ add_system_logical_colors_to_map (system_colors) } -COLORREF +static Lisp_Object x_to_w32_color (colorname) char * colorname; { @@ -968,7 +971,8 @@ x_to_w32_color (colorname) if (i == 2) { UNBLOCK_INPUT; - return (colorval); + XSETINT (ret, colorval); + return ret; } color = end; } @@ -1021,7 +1025,8 @@ x_to_w32_color (colorname) if (*end != '\0') break; UNBLOCK_INPUT; - return (colorval); + XSETINT (ret, colorval); + return ret; } if (*end != '/') break; @@ -1062,7 +1067,8 @@ x_to_w32_color (colorname) if (*end != '\0') break; UNBLOCK_INPUT; - return (colorval); + XSETINT (ret, colorval); + return ret; } if (*end != '/') break; @@ -2416,6 +2422,10 @@ Lisp_Object w32_grabbed_keys; #define HOTKEY_VK_CODE(k) (XFASTINT (k) & 255) #define HOTKEY_MODIFIERS(k) (XFASTINT (k) >> 8) +#define RAW_HOTKEY_ID(k) ((k) & 0xbfff) +#define RAW_HOTKEY_VK_CODE(k) ((k) & 255) +#define RAW_HOTKEY_MODIFIERS(k) ((k) >> 8) + /* Register hot-keys for reserved key combinations when Emacs has keyboard focus, since this is the only way Emacs can receive key combinations like Alt-Tab which are used by the system. */ @@ -2497,20 +2507,20 @@ w32_msg_pump (deferred_msg * msg_buf) focus_window = GetFocus (); if (focus_window != NULL) RegisterHotKey (focus_window, - HOTKEY_ID (msg.wParam), - HOTKEY_MODIFIERS (msg.wParam), - HOTKEY_VK_CODE (msg.wParam)); + RAW_HOTKEY_ID (msg.wParam), + RAW_HOTKEY_MODIFIERS (msg.wParam), + RAW_HOTKEY_VK_CODE (msg.wParam)); /* Reply is not expected. */ break; case WM_EMACS_UNREGISTER_HOT_KEY: focus_window = GetFocus (); if (focus_window != NULL) - UnregisterHotKey (focus_window, HOTKEY_ID (msg.wParam)); + UnregisterHotKey (focus_window, RAW_HOTKEY_ID (msg.wParam)); /* Mark item as erased. NB: this code must be thread-safe. The next line is okay because the cons cell is never made into garbage and is not relocated by GC. */ - XSETCAR ((Lisp_Object) msg.lParam, Qnil); + XSETCAR ((Lisp_Object) ((EMACS_INT) msg.lParam), Qnil); if (!PostThreadMessage (dwMainThreadId, WM_EMACS_DONE, 0, 0)) abort (); break; @@ -2518,7 +2528,7 @@ w32_msg_pump (deferred_msg * msg_buf) { int vk_code = (int) msg.wParam; int cur_state = (GetKeyState (vk_code) & 1); - Lisp_Object new_state = (Lisp_Object) msg.lParam; + Lisp_Object new_state = (Lisp_Object) ((EMACS_INT) msg.lParam); /* NB: This code must be thread-safe. It is safe to call NILP because symbols are not relocated by GC, @@ -2708,7 +2718,7 @@ post_character_message (hwnd, msg, wParam, lParam, modifiers) c = make_ctrl_char (c) & 0377; if (c == quit_char || (wmsg.dwModifiers == 0 && - XFASTINT (Vw32_quit_key) && wParam == XFASTINT (Vw32_quit_key))) + w32_quit_key && wParam == w32_quit_key)) { Vquit_flag = Qt; @@ -3118,7 +3128,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) are used together, but only if user has two button mouse. */ case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: - if (XINT (Vw32_num_mouse_buttons) > 2) + if (w32_num_mouse_buttons > 2) goto handle_plain_button; { @@ -3168,7 +3178,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) /* Hold onto message for now. */ mouse_button_timer = SetTimer (hwnd, MOUSE_BUTTON_ID, - XINT (Vw32_mouse_button_tolerance), NULL); + w32_mouse_button_tolerance, NULL); saved_mouse_button_msg.msg.hwnd = hwnd; saved_mouse_button_msg.msg.message = msg; saved_mouse_button_msg.msg.wParam = wParam; @@ -3181,7 +3191,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) case WM_LBUTTONUP: case WM_RBUTTONUP: - if (XINT (Vw32_num_mouse_buttons) > 2) + if (w32_num_mouse_buttons > 2) goto handle_plain_button; { @@ -3277,7 +3287,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) track_mouse_window = hwnd; } case WM_VSCROLL: - if (XINT (Vw32_mouse_move_interval) <= 0 + if (w32_mouse_move_interval <= 0 || (msg == WM_MOUSEMOVE && button_state == 0)) { wmsg.dwModifiers = w32_get_modifiers (); @@ -3293,7 +3303,7 @@ w32_wnd_proc (hwnd, msg, wParam, lParam) if (saved_mouse_move_msg.msg.hwnd == 0) mouse_move_timer = SetTimer (hwnd, MOUSE_MOVE_ID, - XINT (Vw32_mouse_move_interval), NULL); + w32_mouse_move_interval, NULL); /* Hold onto message for now. */ saved_mouse_move_msg.msg.hwnd = hwnd; @@ -4036,15 +4046,15 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, 1, 1, 0, doc: /* Make a new window, which is called a \"frame\" in Emacs terms. Returns an Emacs frame object. -ALIST is an alist of frame parameters. +PARAMETERS is an alist of frame parameters. If the parameters specify that the frame should not have a minibuffer, and do not specify a specific minibuffer window to use, then `default-minibuffer-frame' must be a frame whose minibuffer can be shared by the new frame. This function is an internal primitive--use `make-frame' instead. */) - (parms) - Lisp_Object parms; + (parameters) + Lisp_Object parameters; { struct frame *f; Lisp_Object frame, tem; @@ -4065,7 +4075,7 @@ This function is an internal primitive--use `make-frame' instead. */) until we know if this frame has a specified name. */ Vx_resource_name = Vinvocation_name; - display = w32_get_arg (parms, Qdisplay, 0, 0, RES_TYPE_STRING); + display = w32_get_arg (parameters, Qdisplay, 0, 0, RES_TYPE_STRING); if (EQ (display, Qunbound)) display = Qnil; dpyinfo = check_x_display_info (display); @@ -4075,7 +4085,7 @@ This function is an internal primitive--use `make-frame' instead. */) kb = &the_only_kboard; #endif - name = w32_get_arg (parms, Qname, "name", "Name", RES_TYPE_STRING); + name = w32_get_arg (parameters, Qname, "name", "Name", RES_TYPE_STRING); if (!STRINGP (name) && ! EQ (name, Qunbound) && ! NILP (name)) @@ -4085,7 +4095,7 @@ This function is an internal primitive--use `make-frame' instead. */) Vx_resource_name = name; /* See if parent window is specified. */ - parent = w32_get_arg (parms, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); + parent = w32_get_arg (parameters, Qparent_id, NULL, NULL, RES_TYPE_NUMBER); if (EQ (parent, Qunbound)) parent = Qnil; if (! NILP (parent)) @@ -4095,8 +4105,8 @@ This function is an internal primitive--use `make-frame' instead. */) /* No need to protect DISPLAY because that's not used after passing it to make_frame_without_minibuffer. */ frame = Qnil; - GCPRO4 (parms, parent, name, frame); - tem = w32_get_arg (parms, Qminibuffer, "minibuffer", "Minibuffer", + GCPRO4 (parameters, parent, name, frame); + tem = w32_get_arg (parameters, Qminibuffer, "minibuffer", "Minibuffer", RES_TYPE_SYMBOL); if (EQ (tem, Qnone) || NILP (tem)) f = make_frame_without_minibuffer (Qnil, kb, display); @@ -4126,7 +4136,7 @@ This function is an internal primitive--use `make-frame' instead. */) record_unwind_protect (unwind_create_frame, frame); f->icon_name - = w32_get_arg (parms, Qicon_name, "iconName", "Title", RES_TYPE_STRING); + = w32_get_arg (parameters, Qicon_name, "iconName", "Title", RES_TYPE_STRING); if (! STRINGP (f->icon_name)) f->icon_name = Qnil; @@ -4168,7 +4178,7 @@ This function is an internal primitive--use `make-frame' instead. */) { Lisp_Object font; - font = w32_get_arg (parms, Qfont, "font", "Font", RES_TYPE_STRING); + font = w32_get_arg (parameters, Qfont, "font", "Font", RES_TYPE_STRING); BLOCK_INPUT; /* First, try whatever font the caller has specified. */ @@ -4192,49 +4202,49 @@ This function is an internal primitive--use `make-frame' instead. */) if (! STRINGP (font)) font = build_string ("Fixedsys"); - x_default_parameter (f, parms, Qfont, font, + x_default_parameter (f, parameters, Qfont, font, "font", "Font", RES_TYPE_STRING); } - x_default_parameter (f, parms, Qborder_width, make_number (2), + x_default_parameter (f, parameters, Qborder_width, make_number (2), "borderWidth", "BorderWidth", RES_TYPE_NUMBER); /* This defaults to 2 in order to match xterm. We recognize either internalBorderWidth or internalBorder (which is what xterm calls it). */ - if (NILP (Fassq (Qinternal_border_width, parms))) + if (NILP (Fassq (Qinternal_border_width, parameters))) { Lisp_Object value; - value = w32_get_arg (parms, Qinternal_border_width, - "internalBorder", "InternalBorder", RES_TYPE_NUMBER); + value = w32_get_arg (parameters, Qinternal_border_width, + "internalBorder", "InternalBorder", RES_TYPE_NUMBER); if (! EQ (value, Qunbound)) - parms = Fcons (Fcons (Qinternal_border_width, value), - parms); + parameters = Fcons (Fcons (Qinternal_border_width, value), + parameters); } /* Default internalBorderWidth to 0 on Windows to match other programs. */ - x_default_parameter (f, parms, Qinternal_border_width, make_number (0), + x_default_parameter (f, parameters, Qinternal_border_width, make_number (0), "internalBorderWidth", "InternalBorder", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qvertical_scroll_bars, Qright, + x_default_parameter (f, parameters, Qvertical_scroll_bars, Qright, "verticalScrollBars", "ScrollBars", RES_TYPE_SYMBOL); /* Also do the stuff which must be set before the window exists. */ - x_default_parameter (f, parms, Qforeground_color, build_string ("black"), + x_default_parameter (f, parameters, Qforeground_color, build_string ("black"), "foreground", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qbackground_color, build_string ("white"), + x_default_parameter (f, parameters, Qbackground_color, build_string ("white"), "background", "Background", RES_TYPE_STRING); - x_default_parameter (f, parms, Qmouse_color, build_string ("black"), + x_default_parameter (f, parameters, Qmouse_color, build_string ("black"), "pointerColor", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qcursor_color, build_string ("black"), + x_default_parameter (f, parameters, Qcursor_color, build_string ("black"), "cursorColor", "Foreground", RES_TYPE_STRING); - x_default_parameter (f, parms, Qborder_color, build_string ("black"), + x_default_parameter (f, parameters, Qborder_color, build_string ("black"), "borderColor", "BorderColor", RES_TYPE_STRING); - x_default_parameter (f, parms, Qscreen_gamma, Qnil, + x_default_parameter (f, parameters, Qscreen_gamma, Qnil, "screenGamma", "ScreenGamma", RES_TYPE_FLOAT); - x_default_parameter (f, parms, Qline_spacing, Qnil, + x_default_parameter (f, parameters, Qline_spacing, Qnil, "lineSpacing", "LineSpacing", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qleft_fringe, Qnil, + x_default_parameter (f, parameters, Qleft_fringe, Qnil, "leftFringe", "LeftFringe", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qright_fringe, Qnil, + x_default_parameter (f, parameters, Qright_fringe, Qnil, "rightFringe", "RightFringe", RES_TYPE_NUMBER); @@ -4246,16 +4256,16 @@ This function is an internal primitive--use `make-frame' instead. */) happen. */ init_frame_faces (f); - x_default_parameter (f, parms, Qmenu_bar_lines, make_number (1), + x_default_parameter (f, parameters, Qmenu_bar_lines, make_number (1), "menuBar", "MenuBar", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qtool_bar_lines, make_number (1), + x_default_parameter (f, parameters, Qtool_bar_lines, make_number (1), "toolBar", "ToolBar", RES_TYPE_NUMBER); - x_default_parameter (f, parms, Qbuffer_predicate, Qnil, + x_default_parameter (f, parameters, Qbuffer_predicate, Qnil, "bufferPredicate", "BufferPredicate", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qtitle, Qnil, + x_default_parameter (f, parameters, Qtitle, Qnil, "title", "Title", RES_TYPE_STRING); - x_default_parameter (f, parms, Qfullscreen, Qnil, + x_default_parameter (f, parameters, Qfullscreen, Qnil, "fullscreen", "Fullscreen", RES_TYPE_SYMBOL); f->output_data.w32->dwStyle = WS_OVERLAPPEDWINDOW; @@ -4268,13 +4278,13 @@ This function is an internal primitive--use `make-frame' instead. */) f->output_data.w32->hourglass_cursor = w32_load_cursor (IDC_WAIT); f->output_data.w32->horizontal_drag_cursor = w32_load_cursor (IDC_SIZEWE); - window_prompting = x_figure_window_size (f, parms, 1); + window_prompting = x_figure_window_size (f, parameters, 1); - tem = w32_get_arg (parms, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); + tem = w32_get_arg (parameters, Qunsplittable, 0, 0, RES_TYPE_BOOLEAN); f->no_split = minibuffer_only || EQ (tem, Qt); w32_window (f, window_prompting, minibuffer_only); - x_icon (f, parms); + x_icon (f, parameters); x_make_gc (f); @@ -4284,16 +4294,16 @@ This function is an internal primitive--use `make-frame' instead. */) /* We need to do this after creating the window, so that the icon-creation functions can say whose icon they're describing. */ - x_default_parameter (f, parms, Qicon_type, Qnil, + x_default_parameter (f, parameters, Qicon_type, Qnil, "bitmapIcon", "BitmapIcon", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qauto_raise, Qnil, + x_default_parameter (f, parameters, Qauto_raise, Qnil, "autoRaise", "AutoRaiseLower", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qauto_lower, Qnil, + x_default_parameter (f, parameters, Qauto_lower, Qnil, "autoLower", "AutoRaiseLower", RES_TYPE_BOOLEAN); - x_default_parameter (f, parms, Qcursor_type, Qbox, + x_default_parameter (f, parameters, Qcursor_type, Qbox, "cursorType", "CursorType", RES_TYPE_SYMBOL); - x_default_parameter (f, parms, Qscroll_bar_width, Qnil, + x_default_parameter (f, parameters, Qscroll_bar_width, Qnil, "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size. @@ -4331,7 +4341,7 @@ This function is an internal primitive--use `make-frame' instead. */) { Lisp_Object visibility; - visibility = w32_get_arg (parms, Qvisibility, 0, 0, RES_TYPE_SYMBOL); + visibility = w32_get_arg (parameters, Qvisibility, 0, 0, RES_TYPE_SYMBOL); if (EQ (visibility, Qunbound)) visibility = Qt; @@ -4775,46 +4785,46 @@ x_to_w32_charset (lpcs) w32_charset = Fcar (Fcdr (this_entry)); /* Translate Lisp symbol to number. */ - if (w32_charset == Qw32_charset_ansi) + if (EQ (w32_charset, Qw32_charset_ansi)) return ANSI_CHARSET; - if (w32_charset == Qw32_charset_symbol) + if (EQ (w32_charset, Qw32_charset_symbol)) return SYMBOL_CHARSET; - if (w32_charset == Qw32_charset_shiftjis) + if (EQ (w32_charset, Qw32_charset_shiftjis)) return SHIFTJIS_CHARSET; - if (w32_charset == Qw32_charset_hangeul) + if (EQ (w32_charset, Qw32_charset_hangeul)) return HANGEUL_CHARSET; - if (w32_charset == Qw32_charset_chinesebig5) + if (EQ (w32_charset, Qw32_charset_chinesebig5)) return CHINESEBIG5_CHARSET; - if (w32_charset == Qw32_charset_gb2312) + if (EQ (w32_charset, Qw32_charset_gb2312)) return GB2312_CHARSET; - if (w32_charset == Qw32_charset_oem) + if (EQ (w32_charset, Qw32_charset_oem)) return OEM_CHARSET; #ifdef JOHAB_CHARSET - if (w32_charset == Qw32_charset_johab) + if (EQ (w32_charset, Qw32_charset_johab)) return JOHAB_CHARSET; - if (w32_charset == Qw32_charset_easteurope) + if (EQ (w32_charset, Qw32_charset_easteurope)) return EASTEUROPE_CHARSET; - if (w32_charset == Qw32_charset_turkish) + if (EQ (w32_charset, Qw32_charset_turkish)) return TURKISH_CHARSET; - if (w32_charset == Qw32_charset_baltic) + if (EQ (w32_charset, Qw32_charset_baltic)) return BALTIC_CHARSET; - if (w32_charset == Qw32_charset_russian) + if (EQ (w32_charset, Qw32_charset_russian)) return RUSSIAN_CHARSET; - if (w32_charset == Qw32_charset_arabic) + if (EQ (w32_charset, Qw32_charset_arabic)) return ARABIC_CHARSET; - if (w32_charset == Qw32_charset_greek) + if (EQ (w32_charset, Qw32_charset_greek)) return GREEK_CHARSET; - if (w32_charset == Qw32_charset_hebrew) + if (EQ (w32_charset, Qw32_charset_hebrew)) return HEBREW_CHARSET; - if (w32_charset == Qw32_charset_vietnamese) + if (EQ (w32_charset, Qw32_charset_vietnamese)) return VIETNAMESE_CHARSET; - if (w32_charset == Qw32_charset_thai) + if (EQ (w32_charset, Qw32_charset_thai)) return THAI_CHARSET; - if (w32_charset == Qw32_charset_mac) + if (EQ (w32_charset, Qw32_charset_mac)) return MAC_CHARSET; #endif /* JOHAB_CHARSET */ #ifdef UNICODE_CHARSET - if (w32_charset == Qw32_charset_unicode) + if (EQ (w32_charset, Qw32_charset_unicode)) return UNICODE_CHARSET; #endif @@ -4956,8 +4966,8 @@ w32_to_x_charset (fncharset, matching) /* Look for Same charset and a valid codepage (or non-int which means ignore). */ - if (w32_charset == charset_type - && (!INTEGERP (codepage) || codepage == CP_DEFAULT + if (EQ (w32_charset, charset_type) + && (!INTEGERP (codepage) || XINT (codepage) == CP_DEFAULT || IsValidCodePage (XINT (codepage)))) { /* If we don't have a match already, then this is the @@ -5151,8 +5161,8 @@ w32_to_all_x_charsets (fncharset) /* Look for Same charset and a valid codepage (or non-int which means ignore). */ - if (w32_charset == charset_type - && (!INTEGERP (codepage) || codepage == CP_DEFAULT + if (EQ (w32_charset, charset_type) + && (!INTEGERP (codepage) || XINT (codepage) == CP_DEFAULT || IsValidCodePage (XINT (codepage)))) { retval = Fcons (x_charset, retval); @@ -6205,6 +6215,9 @@ w32_find_ccl_program (fontp) } } +/* directory-files from dired.c. */ +Lisp_Object Fdirectory_files P_((Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object)); + /* Find BDF files in a specified directory. (use GCPRO when calling, as this calls lisp to get a directory listing). */ @@ -6218,7 +6231,7 @@ w32_find_bdf_fonts_in_dir (Lisp_Object directory) return Qnil; filelist = Fdirectory_files (directory, Qt, - build_string (".*\\.[bB][dD][fF]"), Qt); + build_string (".*\\.[bB][dD][fF]"), Qt); for ( ; CONSP(filelist); filelist = XCDR (filelist)) { @@ -6231,10 +6244,10 @@ w32_find_bdf_fonts_in_dir (Lisp_Object directory) DEFUN ("w32-find-bdf-fonts", Fw32_find_bdf_fonts, Sw32_find_bdf_fonts, 1, 1, 0, - doc: /* Return a list of BDF fonts in DIR. -The list is suitable for appending to w32-bdf-filename-alist. Fonts -which do not contain an xlfd description will not be included in the -list. DIR may be a list of directories. */) + doc: /* Return a list of BDF fonts in DIRECTORY. +The list is suitable for appending to `w32-bdf-filename-alist'. +Fonts which do not contain an xlfd description will not be included +in the list. DIRECTORY may be a list of directories. */) (directory) Lisp_Object directory; { @@ -6315,7 +6328,7 @@ DEFUN ("xw-display-color-p", Fxw_display_color_p, Sxw_display_color_p, 0, 1, 0, DEFUN ("x-display-grayscale-p", Fx_display_grayscale_p, Sx_display_grayscale_p, 0, 1, 0, - doc: /* Return t if the X display supports shades of gray. + doc: /* Return t if DISPLAY supports shades of gray. Note that color displays do support shades of gray. The optional argument DISPLAY specifies which display to ask about. DISPLAY should be either a frame or a display name (a string). @@ -6388,9 +6401,9 @@ If omitted or nil, that stands for the selected frame's display. */) hdc = GetDC (dpyinfo->root_window); if (dpyinfo->has_palette) - cap = GetDeviceCaps (hdc,SIZEPALETTE); + cap = GetDeviceCaps (hdc, SIZEPALETTE); else - cap = GetDeviceCaps (hdc,NUMCOLORS); + cap = GetDeviceCaps (hdc, NUMCOLORS); /* We force 24+ bit depths to 24-bit, both to prevent an overflow and because probably is more meaningful on Windows anyway */ @@ -7175,6 +7188,8 @@ x_create_tip_frame (dpyinfo, parms, text) old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); current_buffer->truncate_lines = Qnil; + specbind (Qinhibit_read_only, Qt); + specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); Finsert (1, &text); set_buffer_internal_1 (old_buffer); @@ -7442,7 +7457,7 @@ used to change the tooltip's appearance. Automatically hide the tooltip after TIMEOUT seconds. TIMEOUT nil means use the default timeout of 5 seconds. -If the list of frame parameters PARAMS contains a `left' parameter, +If the list of frame parameters PARMS contains a `left' parameter, the tooltip is displayed at that x-position. Otherwise it is displayed at the mouse position, with offset DX added (default is 5 if DX isn't specified). Likewise for the y-position; if a `top' frame @@ -7923,7 +7938,7 @@ Returns an X font string corresponding to the selection. */) DEFUN ("w32-send-sys-command", Fw32_send_sys_command, Sw32_send_sys_command, 1, 2, 0, doc: /* Send frame a Windows WM_SYSCOMMAND message of type COMMAND. -Some useful values for command are #xf030 to maximise frame (#xf020 +Some useful values for COMMAND are #xf030 to maximize frame (#xf020 to minimize), #xf120 to restore frame to original size, and #xf100 to activate the menubar for keyboard access. #xf140 activates the screen saver if defined. @@ -8003,7 +8018,7 @@ lookup_vk_code (char *key) /* Convert a one-element vector style key sequence to a hot key definition. */ -static int +static Lisp_Object w32_parse_hot_key (key) Lisp_Object key; { @@ -8035,7 +8050,7 @@ w32_parse_hot_key (key) if (SYMBOLP (c)) { c = parse_modifiers (c); - lisp_modifiers = Fcar (Fcdr (c)); + lisp_modifiers = XINT (Fcar (Fcdr (c))); c = Fcar (c); if (!SYMBOLP (c)) abort (); @@ -8104,8 +8119,13 @@ The return value is the hotkey-id if registered, otherwise nil. */) /* Notify input thread about new hot-key definition, so that it takes effect without needing to switch focus. */ +#ifdef USE_LISP_UNION_TYPE + PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, + (WPARAM) key.i, 0); +#else PostThreadMessage (dwWindowsThreadId, WM_EMACS_REGISTER_HOT_KEY, (WPARAM) key, 0); +#endif } return key; @@ -8113,7 +8133,7 @@ The return value is the hotkey-id if registered, otherwise nil. */) DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key, Sw32_unregister_hot_key, 1, 1, 0, - doc: /* Unregister HOTKEY as a hot-key combination. */) + doc: /* Unregister KEY as a hot-key combination. */) (key) Lisp_Object key; { @@ -8128,8 +8148,14 @@ DEFUN ("w32-unregister-hot-key", Fw32_unregister_hot_key, { /* Notify input thread about hot-key definition being removed, so that it takes effect without needing focus switch. */ +#ifdef USE_LISP_UNION_TYPE + if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, + (WPARAM) XINT (XCAR (item)), (LPARAM) item.i)) +#else if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_UNREGISTER_HOT_KEY, (WPARAM) XINT (XCAR (item)), (LPARAM) item)) + +#endif { MSG msg; GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); @@ -8149,7 +8175,8 @@ DEFUN ("w32-registered-hot-keys", Fw32_registered_hot_keys, DEFUN ("w32-reconstruct-hot-key", Fw32_reconstruct_hot_key, Sw32_reconstruct_hot_key, 1, 1, 0, - doc: /* Convert hot-key ID to a lisp key combination. */) + doc: /* Convert hot-key ID to a lisp key combination. +usage: (w32-reconstruct-hot-key ID) */) (hotkeyid) Lisp_Object hotkeyid; { @@ -8202,8 +8229,13 @@ is set to off if the low bit of NEW-STATE is zero, otherwise on. */) if (!dwWindowsThreadId) return make_number (w32_console_toggle_lock_key (vk_code, new_state)); +#ifdef USE_LISP_UNION_TYPE + if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, + (WPARAM) vk_code, (LPARAM) new_state.i)) +#else if (PostThreadMessage (dwWindowsThreadId, WM_EMACS_TOGGLE_LOCK_KEY, (WPARAM) vk_code, (LPARAM) new_state)) +#endif { MSG msg; GetMessage (&msg, NULL, WM_EMACS_DONE, WM_EMACS_DONE); @@ -8383,7 +8415,7 @@ DEFUN ("default-printer-name", Fdefault_printer_name, Sdefault_printer_name, Initialization ***********************************************************************/ -/* Keep this list in the same order as frame_parms in frame.c. +/* Keep this list in the same order as frame_parms in frame.c. Use 0 for unsupported frame parameters. */ frame_parm_handler w32_frame_parm_handlers[] = @@ -8468,7 +8500,7 @@ syms_of_w32fns () w32_grabbed_keys = Qnil; DEFVAR_LISP ("w32-color-map", &Vw32_color_map, - doc: /* An array of color name mappings for windows. */); + doc: /* An array of color name mappings for Windows. */); Vw32_color_map = Qnil; DEFVAR_LISP ("w32-pass-alt-to-system", &Vw32_pass_alt_to_system, @@ -8482,9 +8514,9 @@ open the System menu. When nil, Emacs silently swallows alt key events. */); When nil, Emacs will translate the alt key to the Alt modifier, and not Meta. */); Vw32_alt_is_meta = Qt; - DEFVAR_INT ("w32-quit-key", &Vw32_quit_key, - doc: /* If non-zero, the virtual key code for an alternative quit key. */); - XSETINT (Vw32_quit_key, 0); + DEFVAR_INT ("w32-quit-key", &w32_quit_key, + doc: /* If non-zero, the virtual key code for an alternative quit key. */); + w32_quit_key = 0; DEFVAR_LISP ("w32-pass-lwindow-to-system", &Vw32_pass_lwindow_to_system, @@ -8498,9 +8530,9 @@ When non-nil, the Start menu is opened by tapping the key. */); When non-nil, the Start menu is opened by tapping the key. */); Vw32_pass_rwindow_to_system = Qt; - DEFVAR_INT ("w32-phantom-key-code", + DEFVAR_LISP ("w32-phantom-key-code", &Vw32_phantom_key_code, - doc: /* Virtual key code used to generate \"phantom\" key presses. + doc: /* Virtual key code used to generate \"phantom\" key presses. Value is a number between 0 and 255. Phantom key presses are generated in order to stop the system from @@ -8508,7 +8540,7 @@ acting on \"Windows\" key events when `w32-pass-lwindow-to-system' or `w32-pass-rwindow-to-system' is nil. */); /* Although 255 is technically not a valid key code, it works and means that this hack won't interfere with any real key code. */ - Vw32_phantom_key_code = 255; + XSETINT (Vw32_phantom_key_code, 255); DEFVAR_LISP ("w32-enable-num-lock", &Vw32_enable_num_lock, @@ -8563,21 +8595,21 @@ Any other value will cause the key to be ignored. */); Vw32_enable_palette = Qt; DEFVAR_INT ("w32-mouse-button-tolerance", - &Vw32_mouse_button_tolerance, + &w32_mouse_button_tolerance, doc: /* Analogue of double click interval for faking middle mouse events. The value is the minimum time in milliseconds that must elapse between left/right button down events before they are considered distinct events. If both mouse buttons are depressed within this interval, a middle mouse button down event is generated instead. */); - XSETINT (Vw32_mouse_button_tolerance, GetDoubleClickTime () / 2); + w32_mouse_button_tolerance = GetDoubleClickTime () / 2; DEFVAR_INT ("w32-mouse-move-interval", - &Vw32_mouse_move_interval, + &w32_mouse_move_interval, doc: /* Minimum interval between mouse move events. The value is the minimum time in milliseconds that must elapse between successive mouse move (or scroll bar drag) events before they are reported as lisp events. */); - XSETINT (Vw32_mouse_move_interval, 0); + w32_mouse_move_interval = 0; DEFVAR_BOOL ("w32-pass-extra-mouse-buttons-to-system", &w32_pass_extra_mouse_buttons_to_system, @@ -8857,6 +8889,11 @@ void globals_of_w32fns () /* ditto for GetClipboardSequenceNumber. */ clipboard_sequence_fn = (ClipboardSequence_Proc) GetProcAddress (user32_lib, "GetClipboardSequenceNumber"); + + DEFVAR_INT ("w32-ansi-code-page", + &w32_ansi_code_page, + doc: /* The ANSI code page used by the system. */); + w32_ansi_code_page = GetACP (); } #undef abort diff --git a/src/w32heap.c b/src/w32heap.c index b40db430ea9..d947842474f 100644 --- a/src/w32heap.c +++ b/src/w32heap.c @@ -245,6 +245,7 @@ init_heap () exit (1); } +#if defined (NO_UNION_TYPE) && !defined (USE_LSB_TAG) /* Ensure that the addresses don't use the upper tag bits since the Lisp type goes there. */ if (((unsigned long) data_region_base & ~VALMASK) != 0) @@ -252,7 +253,7 @@ init_heap () printf ("Error: The heap was allocated in upper memory.\n"); exit (1); } - +#endif data_region_end = data_region_base; real_data_region_end = data_region_end; } diff --git a/src/w32inevt.c b/src/w32inevt.c index 168a0fb87b3..8dd4f406881 100644 --- a/src/w32inevt.c +++ b/src/w32inevt.c @@ -464,12 +464,12 @@ key_event (KEY_EVENT_RECORD *event, struct input_event *emacs_ev, int *isdead) } if (event->uChar.AsciiChar == 0) return 0; - XSETINT (emacs_ev->code, event->uChar.AsciiChar); + emacs_ev->code = event->uChar.AsciiChar; } else { emacs_ev->kind = NON_ASCII_KEYSTROKE_EVENT; - XSETINT (emacs_ev->code, event->wVirtualKeyCode); + emacs_ev->code = event->wVirtualKeyCode; } XSETFRAME (emacs_ev->frame_or_window, get_frame ()); @@ -524,8 +524,8 @@ w32_console_mouse_position (FRAME_PTR *f, *part = 0; SELECTED_FRAME ()->mouse_moved = 0; - *x = movement_pos.X; - *y = movement_pos.Y; + XSETINT(*x, movement_pos.X); + XSETINT(*y, movement_pos.Y); *time = movement_time; UNBLOCK_INPUT; @@ -593,9 +593,9 @@ do_mouse_event (MOUSE_EVENT_RECORD *event, if (but_change & mask) { if (i < NUM_TRANSLATED_MOUSE_BUTTONS) - XSETINT (emacs_ev->code, emacs_button_translation[i]); + emacs_ev->code = emacs_button_translation[i]; else - XSETINT (emacs_ev->code, i); + emacs_ev->code = i; break; } diff --git a/src/w32menu.c b/src/w32menu.c index 5f8f8a4e5e0..cc0932d7bf5 100644 --- a/src/w32menu.c +++ b/src/w32menu.c @@ -2225,9 +2225,12 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item) /* Set help string for menu item. Leave it as a Lisp_Object until it is ready to be displayed, since GC can happen while menus are active. */ - if (wv->help) - info.dwItemData = (DWORD) wv->help; - + if (!NILP (wv->help)) +#ifdef USE_LISP_UNION_TYPE + info.dwItemData = (DWORD) (wv->help).i; +#else + info.dwItemData = (DWORD) (wv->help); +#endif if (wv->button_type == BUTTON_TYPE_RADIO) { /* CheckMenuRadioItem allows us to differentiate TOGGLE and @@ -2307,7 +2310,12 @@ w32_menu_display_help (HWND owner, HMENU menu, UINT item, UINT flags) info.fMask = MIIM_DATA; get_menu_item_info (menu, item, FALSE, &info); +#ifdef USE_LISP_UNION_TYPE + help = info.dwItemData ? (Lisp_Object) ((EMACS_INT) info.dwItemData) + : Qnil; +#else help = info.dwItemData ? (Lisp_Object) info.dwItemData : Qnil; +#endif } /* Store the help echo in the keyboard buffer as the X toolkit diff --git a/src/w32proc.c b/src/w32proc.c index edd286e50d0..8452337f7e2 100644 --- a/src/w32proc.c +++ b/src/w32proc.c @@ -1,5 +1,5 @@ /* Process support for GNU Emacs on the Microsoft W32 API. - Copyright (C) 1992, 1995, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1992, 95, 99, 2000, 01, 04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -82,7 +82,7 @@ Lisp_Object Vw32_start_process_inherit_error_mode; avoids the inefficiency of frequently reading small amounts of data. This is primarily necessary for handling DOS processes on Windows 95, but is useful for W32 processes on both Windows 95 and NT as well. */ -Lisp_Object Vw32_pipe_read_delay; +int w32_pipe_read_delay; /* Control conversion of upper case file names to lower case. nil means no, t means yes. */ @@ -367,7 +367,7 @@ create_child (char *exe, char *cmdline, char *env, int is_gui_app, cp->pid = -cp->pid; /* pid must fit in a Lisp_Int */ - cp->pid = (cp->pid & VALMASK); + cp->pid = cp->pid & INTMASK; *pPid = cp->pid; @@ -2202,7 +2202,7 @@ When non-nil, they inherit their error mode setting from Emacs, which stops them blocking when trying to access unmounted drives etc. */); Vw32_start_process_inherit_error_mode = Qt; - DEFVAR_INT ("w32-pipe-read-delay", &Vw32_pipe_read_delay, + DEFVAR_INT ("w32-pipe-read-delay", &w32_pipe_read_delay, doc: /* Forced delay before reading subprocess output. This is done to improve the buffering of subprocess output, by avoiding the inefficiency of frequently reading small amounts of data. @@ -2211,7 +2211,7 @@ If positive, the value is the number of milliseconds to sleep before reading the subprocess output. If negative, the magnitude is the number of time slices to wait (effectively boosting the priority of the child process temporarily). A value of zero disables waiting entirely. */); - Vw32_pipe_read_delay = 50; + w32_pipe_read_delay = 50; DEFVAR_LISP ("w32-downcase-file-names", &Vw32_downcase_file_names, doc: /* Non-nil means convert all-upper case file names to lower case. diff --git a/src/w32select.c b/src/w32select.c index 21f828d1f0c..cc0ca64fab8 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -249,11 +249,18 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext); + CloseClipboard (); + + /* Common sense says to read the sequence number inside the + OpenClipboard/ CloseClipboard block to avoid race conditions + where another app puts something on the clipboard straight after + us. But experience suggests that the sequence number from the + SetClipboardData is not allocated until we close the clipboard! + Since clipboard operations are normally user-driven, the race + condition is probably not going to really happen. */ if (clipboard_sequence_fn) last_clipboard_sequence_number = clipboard_sequence_fn (); - CloseClipboard (); - if (ok) goto done; error: diff --git a/src/w32term.c b/src/w32term.c index a9afc99b959..95ccafe415b 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -204,7 +204,7 @@ int last_scroll_bar_drag_pos; static RECT last_mouse_glyph; static Lisp_Object last_mouse_press_frame; -Lisp_Object Vw32_num_mouse_buttons; +int w32_num_mouse_buttons; Lisp_Object Vw32_swap_mouse_buttons; @@ -1371,7 +1371,8 @@ static void w32_draw_image_foreground_1 P_ ((struct glyph_string *, HBITMAP)); static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, int, int, int)); static void w32_draw_relief_rect P_ ((struct frame *, int, int, int, int, - int, int, int, int, RECT *)); + int, int, int, int, int, int, + RECT *)); static void w32_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, int, int, int, RECT *)); @@ -1952,9 +1953,10 @@ x_setup_relief_colors (s) static void w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, - raised_p, left_p, right_p, clip_rect) + raised_p, top_p, bot_p, left_p, right_p, clip_rect) struct frame *f; - int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; + int left_x, top_y, right_x, bottom_y, width; + int top_p, bot_p, left_p, right_p, raised_p; RECT *clip_rect; { int i; @@ -1969,10 +1971,11 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, w32_set_clip_rectangle (hdc, clip_rect); /* Top. */ - for (i = 0; i < width; ++i) - w32_fill_area (f, hdc, gc.foreground, - left_x + i * left_p, top_y + i, - right_x - left_x - i * (left_p + right_p ) + 1, 1); + if (top_p) + for (i = 0; i < width; ++i) + w32_fill_area (f, hdc, gc.foreground, + left_x + i * left_p, top_y + i, + right_x - left_x - i * (left_p + right_p ) + 1, 1); /* Left. */ if (left_p) @@ -1987,10 +1990,11 @@ w32_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, gc.foreground = f->output_data.w32->white_relief.gc->foreground; /* Bottom. */ - for (i = 0; i < width; ++i) - w32_fill_area (f, hdc, gc.foreground, - left_x + i * left_p, bottom_y - i, - right_x - left_x - i * (left_p + right_p) + 1, 1); + if (bot_p) + for (i = 0; i < width; ++i) + w32_fill_area (f, hdc, gc.foreground, + left_x + i * left_p, bottom_y - i, + right_x - left_x - i * (left_p + right_p) + 1, 1); /* Right. */ if (right_p) @@ -2100,7 +2104,7 @@ x_draw_glyph_string_box (s) { x_setup_relief_colors (s); w32_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, - width, raised_p, left_p, right_p, &clip_rect); + width, raised_p, 1, 1, left_p, right_p, &clip_rect); } } @@ -2111,21 +2115,22 @@ static void x_draw_image_foreground (s) struct glyph_string *s; { - int x; - int y = s->ybase - image_ascent (s->img, s->face); + int x = s->x; + int y = s->ybase - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = s->x + abs (s->face->box_line_width); - else - x = s->x; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; SaveDC (s->hdc); @@ -2147,12 +2152,12 @@ x_draw_image_foreground (s) SetTextColor (s->hdc, RGB (255, 255, 255)); SetBkColor (s->hdc, RGB (0, 0, 0)); - BitBlt (s->hdc, x, y, s->img->width, s->img->height, - compat_hdc, 0, 0, SRCINVERT); - BitBlt (s->hdc, x, y, s->img->width, s->img->height, - mask_dc, 0, 0, SRCAND); - BitBlt (s->hdc, x, y, s->img->width, s->img->height, - compat_hdc, 0, 0, SRCINVERT); + BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, + compat_hdc, s->slice.x, s->slice.y, SRCINVERT); + BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, + mask_dc, s->slice.x, s->slice.y, SRCAND); + BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, + compat_hdc, s->slice.x, s->slice.y, SRCINVERT); SelectObject (mask_dc, mask_orig_obj); DeleteDC (mask_dc); @@ -2162,8 +2167,8 @@ x_draw_image_foreground (s) SetTextColor (s->hdc, s->gc->foreground); SetBkColor (s->hdc, s->gc->background); - BitBlt (s->hdc, x, y, s->img->width, s->img->height, - compat_hdc, 0, 0, SRCCOPY); + BitBlt (s->hdc, x, y, s->slice.width, s->slice.height, + compat_hdc, s->slice.x, s->slice.y, SRCCOPY); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will @@ -2176,7 +2181,8 @@ x_draw_image_foreground (s) int r = s->img->relief; if (r < 0) r = -r; w32_draw_rectangle (s->hdc, s->gc, x - r, y - r , - s->img->width + r*2 - 1, s->img->height + r*2 - 1); + s->slice.width + r*2 - 1, + s->slice.height + r*2 - 1); } } @@ -2187,8 +2193,8 @@ x_draw_image_foreground (s) DeleteDC (compat_hdc); } else - w32_draw_rectangle (s->hdc, s->gc, x, y, s->img->width -1, - s->img->height - 1); + w32_draw_rectangle (s->hdc, s->gc, x, y, + s->slice.width - 1, s->slice.height - 1); RestoreDC (s->hdc ,-1); } @@ -2203,21 +2209,22 @@ x_draw_image_relief (s) { int x0, y0, x1, y1, thick, raised_p; RECT r; - int x; - int y = s->ybase - image_ascent (s->img, s->face); + int x = s->x; + int y = s->ybase - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = s->x + abs (s->face->box_line_width); - else - x = s->x; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->hl == DRAW_IMAGE_SUNKEN || s->hl == DRAW_IMAGE_RAISED) @@ -2233,12 +2240,17 @@ x_draw_image_relief (s) x0 = x - thick; y0 = y - thick; - x1 = x + s->img->width + thick - 1; - y1 = y + s->img->height + thick - 1; + x1 = x + s->slice.width + thick - 1; + y1 = y + s->slice.height + thick - 1; x_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); - w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); + w32_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, + s->slice.y == 0, + s->slice.y + s->slice.height == s->img->height, + s->slice.x == 0, + s->slice.x + s->slice.width == s->img->width, + &r); } @@ -2251,21 +2263,22 @@ w32_draw_image_foreground_1 (s, pixmap) { HDC hdc = CreateCompatibleDC (s->hdc); HGDIOBJ orig_hdc_obj = SelectObject (hdc, pixmap); - int x; - int y = s->ybase - s->y - image_ascent (s->img, s->face); + int x = 0; + int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = abs (s->face->box_line_width); - else - x = 0; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->img->pixmap) { @@ -2281,12 +2294,12 @@ w32_draw_image_foreground_1 (s, pixmap) SetTextColor (hdc, RGB (0, 0, 0)); SetBkColor (hdc, RGB (255, 255, 255)); - BitBlt (hdc, x, y, s->img->width, s->img->height, - compat_hdc, 0, 0, SRCINVERT); - BitBlt (hdc, x, y, s->img->width, s->img->height, - mask_dc, 0, 0, SRCAND); - BitBlt (hdc, x, y, s->img->width, s->img->height, - compat_hdc, 0, 0, SRCINVERT); + BitBlt (hdc, x, y, s->slice.width, s->slice.height, + compat_hdc, s->slice.x, s->slice.y, SRCINVERT); + BitBlt (hdc, x, y, s->slice.width, s->slice.height, + mask_dc, s->slice.x, s->slice.y, SRCAND); + BitBlt (hdc, x, y, s->slice.width, s->slice.height, + compat_hdc, s->slice.x, s->slice.y, SRCINVERT); SelectObject (mask_dc, mask_orig_obj); DeleteDC (mask_dc); @@ -2296,8 +2309,8 @@ w32_draw_image_foreground_1 (s, pixmap) SetTextColor (hdc, s->gc->foreground); SetBkColor (hdc, s->gc->background); - BitBlt (hdc, x, y, s->img->width, s->img->height, - compat_hdc, 0, 0, SRCCOPY); + BitBlt (hdc, x, y, s->slice.width, s->slice.height, + compat_hdc, s->slice.x, s->slice.y, SRCCOPY); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will @@ -2309,8 +2322,9 @@ w32_draw_image_foreground_1 (s, pixmap) { int r = s->img->relief; if (r < 0) r = -r; - w32_draw_rectangle (hdc, s->gc, x - r, y - r , - s->img->width + r*2 - 1, s->img->height + r*2 - 1); + w32_draw_rectangle (hdc, s->gc, x - r, y - r, + s->slice.width + r*2 - 1, + s->slice.height + r*2 - 1); } } @@ -2320,8 +2334,8 @@ w32_draw_image_foreground_1 (s, pixmap) DeleteDC (compat_hdc); } else - w32_draw_rectangle (hdc, s->gc, x, y, s->img->width - 1, - s->img->height - 1); + w32_draw_rectangle (hdc, s->gc, x, y, + s->slice.width - 1, s->slice.height - 1); SelectObject (hdc, orig_hdc_obj); DeleteDC (hdc); @@ -2380,19 +2394,22 @@ x_draw_image_glyph_string (s) taller than image or if image has a clip mask to reduce flickering. */ s->stippled_p = s->face->stipple != 0; - if (height > s->img->height + if (height > s->slice.height || s->img->hmargin || s->img->vmargin || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) { - if (box_line_hwidth && s->first_glyph->left_box_line_p) - x = s->x + box_line_hwidth; - else - x = s->x; + x = s->x; + if (s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += box_line_hwidth; + + y = s->y; + if (s->slice.y == 0) + y += box_line_vwidth; - y = s->y + box_line_vwidth; #if 0 /* TODO: figure out if we need to do this on Windows. */ if (s->img->mask) { @@ -4311,8 +4328,7 @@ w32_read_socket (sd, expected, hold_quit) /* So people can tell when we have read the available input. */ input_signal_count++; - /* TODO: tool-bars, ghostscript integration, mouse - cursors. */ + /* TODO: ghostscript integration. */ while (get_next_msg (&msg, FALSE)) { struct input_event inev; @@ -4495,10 +4511,16 @@ w32_read_socket (sd, expected, hold_quit) /* If the contents of the global variable help_echo_string has changed, generate a HELP_EVENT. */ +#if 0 /* The below is an invalid comparison when USE_LISP_UNION_TYPE. + But it was originally changed to this to fix a bug, so I have + not removed it completely in case the bug is still there. */ if (help_echo_string != previous_help_echo_string || (!NILP (help_echo_string) && !STRINGP (help_echo_string) && f->mouse_moved)) +#else /* This is what xterm.c does. */ + if (!NILP (help_echo_string) + || !NILP (previous_help_echo_string)) do_help = 1; - +#endif break; case WM_LBUTTONDOWN: @@ -4919,7 +4941,7 @@ w32_read_socket (sd, expected, hold_quit) if (do_help > 0) { - if (help_echo_string == Qnil) + if (NILP (help_echo_string)) { help_echo_object = help_echo_window = Qnil; help_echo_pos = -1; @@ -5068,28 +5090,38 @@ x_draw_hollow_cursor (w, row) struct frame *f = XFRAME (WINDOW_FRAME (w)); HDC hdc; RECT rect; - int wd; + int wd, h; struct glyph *cursor_glyph; HBRUSH hb = CreateSolidBrush (f->output_data.w32->cursor_pixel); + /* Get the glyph the cursor is on. If we can't tell because + the current matrix is invalid or such, give up. */ + cursor_glyph = get_phys_cursor_glyph (w); + if (cursor_glyph == NULL) + return; + /* Compute frame-relative coordinates from window-relative coordinates. */ rect.left = WINDOW_TEXT_TO_FRAME_PIXEL_X (w, w->phys_cursor.x); rect.top = (WINDOW_TO_FRAME_PIXEL_Y (w, w->phys_cursor.y) + row->ascent - w->phys_cursor_ascent); - rect.bottom = rect.top + row->height; - /* Get the glyph the cursor is on. If we can't tell because - the current matrix is invalid or such, give up. */ - cursor_glyph = get_phys_cursor_glyph (w); - if (cursor_glyph == NULL) - return; + /* Compute the proper height and ascent of the rectangle, based + on the actual glyph. Using the full height of the row looks + bad when there are tall images on that row. */ + h = max (min (FRAME_LINE_HEIGHT (f), row->height), + cursor_glyph->ascent + cursor_glyph->descent); + if (h < row->height) + rect.top += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; + h--; + + rect.bottom = rect.top + h; /* Compute the width of the rectangle to draw. If on a stretch glyph, and `x-stretch-block-cursor' is nil, don't draw a rectangle as wide as the glyph, but use a canonical character width instead. */ - wd = cursor_glyph->pixel_width; + wd = cursor_glyph->pixel_width; /* TODO: Why off by one compared with X? */ if (cursor_glyph->type == STRETCH_GLYPH && !x_stretch_cursor_p) wd = min (FRAME_COLUMN_WIDTH (f), wd); @@ -6604,9 +6636,9 @@ syms_of_w32term () Qvendor_specific_keysyms = intern ("vendor-specific-keysyms"); DEFVAR_INT ("w32-num-mouse-buttons", - &Vw32_num_mouse_buttons, + &w32_num_mouse_buttons, doc: /* Number of physical mouse buttons. */); - Vw32_num_mouse_buttons = Qnil; + w32_num_mouse_buttons = 2; DEFVAR_LISP ("w32-swap-mouse-buttons", &Vw32_swap_mouse_buttons, diff --git a/src/w32term.h b/src/w32term.h index cf6956c1efa..524b1097c42 100644 --- a/src/w32term.h +++ b/src/w32term.h @@ -252,6 +252,10 @@ extern int unibyte_display_via_language_environment; struct w32_display_info *x_display_info_for_name (); +Lisp_Object display_x_get_resource P_ ((struct w32_display_info *, + Lisp_Object, Lisp_Object, + Lisp_Object, Lisp_Object)); + extern struct w32_display_info *w32_term_init (); extern Lisp_Object w32_list_fonts P_ ((struct frame *, Lisp_Object, int, int)); @@ -721,9 +725,10 @@ struct face; XGCValues *XCreateGC (void *, Window, unsigned long, XGCValues *); struct frame * check_x_frame (Lisp_Object); +Lisp_Object vga_stdcolor_name (int); + EXFUN (Fx_display_color_p, 1); EXFUN (Fx_display_grayscale_p, 1); -int image_ascent P_ ((struct image *, struct face *)); #define FONT_TYPE_FOR_UNIBYTE(font, ch) \ ((font)->bdf ? BDF_1D_FONT : ANSI_FONT) diff --git a/src/window.c b/src/window.c index 47bbf0806ee..d3203c99e90 100644 --- a/src/window.c +++ b/src/window.c @@ -1,6 +1,6 @@ /* Window creation, deletion and examination for GNU Emacs. Does not include redisplay. - Copyright (C) 1985,86,87,93,94,95,96,97,1998,2000, 2001, 2002, 2003 + Copyright (C) 1985,86,87, 1993,94,95,96,97,98, 2000,01,02,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -322,7 +322,11 @@ DEFUN ("pos-visible-in-window-p", Fpos_visible_in_window_p, Return nil if that position is scrolled vertically out of view. If a character is only partially visible, nil is returned, unless the optional argument PARTIALLY is non-nil. -POS defaults to point in WINDOW; WINDOW defaults to the selected window. */) +POS defaults to point in WINDOW; WINDOW defaults to the selected window. + +If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil, +return value is a list (X Y PARTIAL) where X and Y are the pixel relative +coordinate */) (pos, window, partially) Lisp_Object pos, window, partially; { @@ -330,8 +334,9 @@ POS defaults to point in WINDOW; WINDOW defaults to the selected window. */) register int posint; register struct buffer *buf; struct text_pos top; - Lisp_Object in_window; - int fully_p; + Lisp_Object in_window = Qnil; + int fully_p = 1; + int x, y; w = decode_window (window); buf = XBUFFER (w->buffer); @@ -347,38 +352,20 @@ POS defaults to point in WINDOW; WINDOW defaults to the selected window. */) else posint = XMARKER (w->pointm)->charpos; - /* If position is above window start, it's not visible. */ - if (posint < CHARPOS (top)) - in_window = Qnil; - else if (XFASTINT (w->last_modified) >= BUF_MODIFF (buf) - && XFASTINT (w->last_overlay_modified) >= BUF_OVERLAY_MODIFF (buf) - && posint < BUF_Z (buf) - XFASTINT (w->window_end_pos)) - { - /* If frame is up-to-date, and POSINT is < window end pos, use - that info. This doesn't work for POSINT == end pos, because - the window end pos is actually the position _after_ the last - char in the window. */ - if (NILP (partially)) - { - pos_visible_p (w, posint, &fully_p, NILP (partially)); - in_window = fully_p ? Qt : Qnil; - } - else - in_window = Qt; - } - else if (posint > BUF_ZV (buf)) - in_window = Qnil; - else if (CHARPOS (top) < BUF_BEGV (buf) || CHARPOS (top) > BUF_ZV (buf)) - /* If window start is out of range, do something reasonable. */ - in_window = Qnil; - else - { - if (pos_visible_p (w, posint, &fully_p, NILP (partially))) - in_window = !NILP (partially) || fully_p ? Qt : Qnil; - else - in_window = Qnil; - } - + /* If position is above window start or outside buffer boundaries, + or if window start is out of range, position is not visible. */ + if (posint >= CHARPOS (top) + && posint <= BUF_ZV (buf) + && CHARPOS (top) >= BUF_BEGV (buf) + && CHARPOS (top) <= BUF_ZV (buf) + && pos_visible_p (w, posint, &fully_p, &x, &y, NILP (partially)) + && (!NILP (partially) || fully_p)) + in_window = Qt; + + if (!NILP (in_window) && !NILP (partially)) + in_window = Fcons (make_number (x), + Fcons (make_number (y), + Fcons (fully_p ? Qt : Qnil, Qnil))); return in_window; } @@ -3036,7 +3023,7 @@ set_window_buffer (window, buffer, run_hooks_p, keep_margins_p) DEFUN ("set-window-buffer", Fset_window_buffer, Sset_window_buffer, 2, 3, 0, doc: /* Make WINDOW display BUFFER as its contents. BUFFER can be a buffer or buffer name. -Optional third arg KEEP_MARGINS non-nil means that WINDOW's current +Optional third arg KEEP-MARGINS non-nil means that WINDOW's current display margins, fringe widths, and scroll bar settings are maintained; the default is to reset these from BUFFER's local settings or the frame defaults. */) @@ -3075,8 +3062,8 @@ defaults. */) DEFUN ("select-window", Fselect_window, Sselect_window, 1, 2, 0, doc: /* Select WINDOW. Most editing will apply to WINDOW's buffer. -If WINDOW is not already selected, also make WINDOW's buffer current. -Also make WINDOW the frame's selected window. +If WINDOW is not already selected, make WINDOW's buffer current +and make WINDOW the frame's selected window. Optional second arg NORECORD non-nil means do not put this buffer at the front of the list of recently selected ones. @@ -3283,6 +3270,10 @@ If FRAME is nil, search only the selected frame unless `pop-up-frames' or `display-buffer-reuse-frames' is non-nil, which means search visible and iconified frames. +If a full-width window on a splittable frame is available to display +the buffer, it may be split, subject to the value of the variable +`split-height-threshold'. + If `even-window-heights' is non-nil, window heights will be evened out if displaying the buffer causes two vertically adjacent windows to be displayed. */) @@ -3460,7 +3451,7 @@ DEFUN ("force-window-update", Fforce_window_update, Sforce_window_update, 0, 1, 0, doc: /* Force redisplay of all windows. If optional arg OBJECT is a window, force redisplay of that window only. -If OBJECT is a buffer or buffer name, force redisplay of all windows +If OBJECT is a buffer or buffer name, force redisplay of all windows displaying that buffer. */) (object) Lisp_Object object; @@ -3482,7 +3473,7 @@ displaying that buffer. */) ++update_mode_lines; return Qt; } - + if (STRINGP (object)) object = Fget_buffer (object); if (BUFFERP (object) && !NILP (XBUFFER (object)->name)) @@ -3547,7 +3538,7 @@ temp_output_buffer_show (buf) Lisp_Object prev_window, prev_buffer; prev_window = selected_window; XSETBUFFER (prev_buffer, old); - + /* Select the window that was chosen, for running the hook. Note: Both Fselect_window and select_window_norecord may set-buffer to the buffer displayed in the window, @@ -3598,7 +3589,8 @@ DEFUN ("split-window", Fsplit_window, Ssplit_window, 0, 3, "", WINDOW defaults to selected one and SIZE to half its size. If optional third arg HORFLAG is non-nil, split side by side and put SIZE columns in the first of the pair. In that case, -SIZE includes that window's scroll bar, or the divider column to its right. */) +SIZE includes that window's scroll bar, or the divider column to its right. +Returns the newly-created window. */) (window, size, horflag) Lisp_Object window, size, horflag; { @@ -6067,7 +6059,7 @@ If TYPE is t, use the frame's scroll-bar type. */) vertical_type = Qnil; if (!(EQ (vertical_type, Qnil) - || EQ (vertical_type, Qleft) + || EQ (vertical_type, Qleft) || EQ (vertical_type, Qright) || EQ (vertical_type, Qt))) error ("Invalid type of vertical scroll bar"); @@ -6116,12 +6108,13 @@ value. */) Smooth scrolling ***********************************************************************/ -DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 1, 0, +DEFUN ("window-vscroll", Fwindow_vscroll, Swindow_vscroll, 0, 2, 0, doc: /* Return the amount by which WINDOW is scrolled vertically. Use the selected window if WINDOW is nil or omitted. -Value is a multiple of the canonical character height of WINDOW. */) - (window) - Lisp_Object window; +Normally, value is a multiple of the canonical character height of WINDOW; +optional second arg PIXELS_P means value is measured in pixels. */) + (window, pixels_p) + Lisp_Object window, pixels_p; { Lisp_Object result; struct frame *f; @@ -6135,7 +6128,9 @@ Value is a multiple of the canonical character height of WINDOW. */) f = XFRAME (w->frame); if (FRAME_WINDOW_P (f)) - result = FRAME_CANON_Y_FROM_PIXEL_Y (f, -w->vscroll); + result = (NILP (pixels_p) + ? FRAME_CANON_Y_FROM_PIXEL_Y (f, -w->vscroll) + : make_number (-w->vscroll)); else result = make_number (0); return result; @@ -6143,12 +6138,13 @@ Value is a multiple of the canonical character height of WINDOW. */) DEFUN ("set-window-vscroll", Fset_window_vscroll, Sset_window_vscroll, - 2, 2, 0, + 2, 3, 0, doc: /* Set amount by which WINDOW should be scrolled vertically to VSCROLL. -WINDOW nil means use the selected window. VSCROLL is a non-negative -multiple of the canonical character height of WINDOW. */) - (window, vscroll) - Lisp_Object window, vscroll; +WINDOW nil means use the selected window. Normally, VSCROLL is a +non-negative multiple of the canonical character height of WINDOW; +optional third arg PIXELS_P non-nil means that VSCROLL is in pixels. */) + (window, vscroll, pixels_p) + Lisp_Object window, vscroll, pixels_p; { struct window *w; struct frame *f; @@ -6166,7 +6162,9 @@ multiple of the canonical character height of WINDOW. */) { int old_dy = w->vscroll; - w->vscroll = - FRAME_LINE_HEIGHT (f) * XFLOATINT (vscroll); + w->vscroll = - (NILP (pixels_p) + ? FRAME_LINE_HEIGHT (f) * XFLOATINT (vscroll) + : XFLOATINT (vscroll)); w->vscroll = min (w->vscroll, 0); /* Adjust glyph matrix of the frame if the virtual display @@ -6178,7 +6176,7 @@ multiple of the canonical character height of WINDOW. */) XBUFFER (w->buffer)->prevent_redisplay_optimizations_p = 1; } - return Fwindow_vscroll (window); + return Fwindow_vscroll (window, pixels_p); } @@ -6506,9 +6504,10 @@ using `special-display-function'. See also `special-display-regexps'. An element of the list can be a list instead of just a string. There are two ways to use a list as an element: (BUFFER FRAME-PARAMETERS...) (BUFFER FUNCTION OTHER-ARGS...) -In the first case, FRAME-PARAMETERS are used to create the frame. -In the latter case, FUNCTION is called with BUFFER as the first argument, -followed by OTHER-ARGS--it can display BUFFER in any way it likes. +In the first case, the FRAME-PARAMETERS are pairs of the form +\(PARAMETER . VALUE); these parameter values are used to create the frame. +In the second case, FUNCTION is called with BUFFER as the first argument, +followed by the OTHER-ARGS--it can display BUFFER in any way it likes. All this is done by the function found in `special-display-function'. If the specified frame parameters include (same-buffer . t), the @@ -6531,9 +6530,10 @@ using `special-display-function'. An element of the list can be a list instead of just a string. There are two ways to use a list as an element: (REGEXP FRAME-PARAMETERS...) (REGEXP FUNCTION OTHER-ARGS...) -In the first case, FRAME-PARAMETERS are used to create the frame. -In the latter case, FUNCTION is called with the buffer as first argument, -followed by OTHER-ARGS--it can display the buffer in any way it likes. +In the first case, the FRAME-PARAMETERS are pairs of the form +\(PARAMETER . VALUE); these parameter values are used to create the frame. +In the second case, FUNCTION is called with BUFFER as the first argument, +followed by the OTHER-ARGS--it can display the buffer in any way it likes. All this is done by the function found in `special-display-function'. If the specified frame parameters include (same-buffer . t), the @@ -6599,7 +6599,7 @@ See also `same-window-buffer-names'. */); next_screen_context_lines = 2; DEFVAR_INT ("split-height-threshold", &split_height_threshold, - doc: /* *display-buffer would prefer to split the largest window if this large. + doc: /* *A window must be at least this tall to be eligible for splitting by `display-buffer'. If there is only one window, it is split regardless of this value. */); split_height_threshold = 500; diff --git a/src/window.h b/src/window.h index c665e9921c6..1e53ae659cb 100644 --- a/src/window.h +++ b/src/window.h @@ -1,5 +1,5 @@ /* Window definitions for GNU Emacs. - Copyright (C) 1985, 1986, 1993, 1995, 1997, 1998, 1999, 2000, 2001, 2003 + Copyright (C) 1985,86,93,95,97,98,99, 2000,01,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -320,7 +320,7 @@ struct window | | +--------------------------- LEFT_MARGIN_COLS | +------------------------------- LEFT_FRINGE_WIDTH +---------------------------------- LEFT_SCROLL_BAR_COLS - + */ @@ -767,8 +767,8 @@ EXFUN (Fdisplay_buffer, 3); EXFUN (Fset_window_buffer, 3); EXFUN (Fset_window_hscroll, 2); EXFUN (Fwindow_hscroll, 1); -EXFUN (Fset_window_vscroll, 2); -EXFUN (Fwindow_vscroll, 1); +EXFUN (Fset_window_vscroll, 3); +EXFUN (Fwindow_vscroll, 2); EXFUN (Fset_window_margins, 3); EXFUN (Fwindow_live_p, 1); EXFUN (Fset_window_point, 2); diff --git a/src/xdisp.c b/src/xdisp.c index 13fdd0d8c72..41e00893c30 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -199,8 +199,6 @@ Boston, MA 02111-1307, USA. */ #endif #ifdef MAC_OS #include "macterm.h" - -Cursor No_Cursor; #endif #ifndef FRAME_X_OUTPUT @@ -302,8 +300,10 @@ extern Lisp_Object Qface, Qinvisible, Qwidth; Lisp_Object Vdisplay_pixels_per_inch; Lisp_Object Qspace, QCalign_to, QCrelative_width, QCrelative_height; Lisp_Object Qleft_margin, Qright_margin, Qspace_width, Qraise; +Lisp_Object Qslice; Lisp_Object Qcenter; Lisp_Object Qmargin, Qpointer; +Lisp_Object Qline_height, Qtotal; extern Lisp_Object Qheight; extern Lisp_Object QCwidth, QCheight, QCascent; extern Lisp_Object Qscroll_bar; @@ -671,10 +671,6 @@ EMACS_INT hscroll_margin; /* How much to scroll horizontally when point is inside the above margin. */ Lisp_Object Vhscroll_step; -/* A list of symbols, one for each supported image type. */ - -Lisp_Object Vimage_types; - /* The variable `resize-mini-windows'. If nil, don't resize mini-windows. If t, always resize them to fit the text they display. If `grow-only', let mini-windows grow only until they @@ -800,6 +796,9 @@ int help_echo_pos; Lisp_Object previous_help_echo_string; +/* Null glyph slice */ + +static struct glyph_slice null_glyph_slice = { 0, 0, 0, 0 }; /* Function prototypes. */ @@ -852,7 +851,7 @@ static void insert_left_trunc_glyphs P_ ((struct it *)); static struct glyph_row *get_overlay_arrow_glyph_row P_ ((struct window *, Lisp_Object)); static void extend_face_to_end_of_line P_ ((struct it *)); -static int append_space P_ ((struct it *, int)); +static int append_space_for_newline P_ ((struct it *, int)); static int make_cursor_line_fully_visible P_ ((struct window *, int)); static int try_scrolling P_ ((Lisp_Object, int, EMACS_INT, EMACS_INT, int, int)); static int try_cursor_movement P_ ((Lisp_Object, struct text_pos, int *)); @@ -1238,9 +1237,9 @@ line_bottom_y (it) and header-lines heights. */ int -pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) +pos_visible_p (w, charpos, fully, x, y, exact_mode_line_heights_p) struct window *w; - int charpos, *fully, exact_mode_line_heights_p; + int charpos, *fully, *x, *y, exact_mode_line_heights_p; { struct it it; struct text_pos top; @@ -1288,14 +1287,27 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) visible_p = 1; *fully = bottom_y <= it.last_visible_y; } + if (visible_p && x) + { + *x = it.current_x; + *y = max (top_y + it.max_ascent - it.ascent, window_top_y); + } } else if (it.current_y + it.max_ascent + it.max_descent > it.last_visible_y) { + struct it it2; + + it2 = it; move_it_by_lines (&it, 1, 0); if (charpos < IT_CHARPOS (it)) { visible_p = 1; - *fully = 0; + if (x) + { + move_it_to (&it2, charpos, -1, -1, -1, MOVE_TO_POS); + *x = it2.current_x; + *y = it2.current_y + it2.max_ascent - it2.ascent; + } } } @@ -1303,6 +1315,7 @@ pos_visible_p (w, charpos, fully, exact_mode_line_heights_p) set_buffer_internal_1 (old_buffer); current_header_line_height = current_mode_line_height = -1; + return visible_p; } @@ -2057,6 +2070,9 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) { if (NATNUMP (current_buffer->extra_line_spacing)) it->extra_line_spacing = XFASTINT (current_buffer->extra_line_spacing); + else if (FLOATP (current_buffer->extra_line_spacing)) + it->extra_line_spacing = (XFLOAT_DATA (current_buffer->extra_line_spacing) + * FRAME_LINE_HEIGHT (it->f)); else if (it->f->extra_line_spacing > 0) it->extra_line_spacing = it->f->extra_line_spacing; } @@ -2070,9 +2086,11 @@ init_iterator (it, w, charpos, bytepos, row, base_face_id) if (FRAME_FACE_CACHE (it->f)->used == 0) recompute_basic_faces (it->f); - /* Current value of the `space-width', and 'height' properties. */ + /* Current value of the `slice', `space-width', and 'height' properties. */ + it->slice.x = it->slice.y = it->slice.width = it->slice.height = Qnil; it->space_width = Qnil; it->font_height = Qnil; + it->override_ascent = -1; /* Are control characters displayed as `^C'? */ it->ctl_arrow_p = !NILP (current_buffer->ctl_arrow); @@ -2713,19 +2731,10 @@ next_overlay_change (pos) int noverlays; int endpos; Lisp_Object *overlays; - int len; int i; /* Get all overlays at the given position. */ - len = 10; - overlays = (Lisp_Object *) alloca (len * sizeof *overlays); - noverlays = overlays_at (pos, 0, &overlays, &len, &endpos, NULL, 1); - if (noverlays > len) - { - len = noverlays; - overlays = (Lisp_Object *) alloca (len * sizeof *overlays); - noverlays = overlays_at (pos, 0, &overlays, &len, &endpos, NULL, 1); - } + GET_OVERLAYS_AT (pos, overlays, noverlays, &endpos, 1); /* If any of these overlays ends before endpos, use its ending point instead. */ @@ -3278,8 +3287,9 @@ handle_display_prop (it) } /* Reset those iterator values set from display property values. */ - it->font_height = Qnil; + it->slice.x = it->slice.y = it->slice.width = it->slice.height = Qnil; it->space_width = Qnil; + it->font_height = Qnil; it->voffset = 0; /* We don't support recursive `display' properties, i.e. string @@ -3298,6 +3308,7 @@ handle_display_prop (it) && !EQ (XCAR (prop), Qimage) && !EQ (XCAR (prop), Qspace) && !EQ (XCAR (prop), Qwhen) + && !EQ (XCAR (prop), Qslice) && !EQ (XCAR (prop), Qspace_width) && !EQ (XCAR (prop), Qheight) && !EQ (XCAR (prop), Qraise) @@ -3494,6 +3505,30 @@ handle_single_display_prop (it, prop, object, position, it->space_width = value; } else if (CONSP (prop) + && EQ (XCAR (prop), Qslice)) + { + /* `(slice X Y WIDTH HEIGHT)'. */ + Lisp_Object tem; + + if (FRAME_TERMCAP_P (it->f) || FRAME_MSDOS_P (it->f)) + return 0; + + if (tem = XCDR (prop), CONSP (tem)) + { + it->slice.x = XCAR (tem); + if (tem = XCDR (tem), CONSP (tem)) + { + it->slice.y = XCAR (tem); + if (tem = XCDR (tem), CONSP (tem)) + { + it->slice.width = XCAR (tem); + if (tem = XCDR (tem), CONSP (tem)) + it->slice.height = XCAR (tem); + } + } + } + } + else if (CONSP (prop) && EQ (XCAR (prop), Qraise) && CONSP (XCDR (prop))) { @@ -4427,6 +4462,7 @@ push_it (it) p->string_nchars = it->string_nchars; p->area = it->area; p->multibyte_p = it->multibyte_p; + p->slice = it->slice; p->space_width = it->space_width; p->font_height = it->font_height; p->voffset = it->voffset; @@ -4459,6 +4495,7 @@ pop_it (it) it->string_nchars = p->string_nchars; it->area = p->area; it->multibyte_p = p->multibyte_p; + it->slice = p->slice; it->space_width = p->space_width; it->font_height = p->font_height; it->voffset = p->voffset; @@ -4616,6 +4653,14 @@ back_to_previous_visible_line_start (it) visible_p = 0; } + if (visible_p) + { + struct it it2 = *it; + + if (handle_display_prop (&it2) == HANDLED_RETURN) + visible_p = 0; + } + /* Back one more newline if the current one is invisible. */ if (!visible_p) back_to_previous_line_start (it); @@ -9539,7 +9584,7 @@ update_overlay_arrows (up_to_date) if (!SYMBOLP (var)) continue; - if (up_to_date) + if (up_to_date > 0) { Lisp_Object val = find_symbol_value (var); Fput (var, Qlast_arrow_position, @@ -10862,15 +10907,14 @@ make_cursor_line_fully_visible (w, force_p) if (!MATRIX_ROW_PARTIALLY_VISIBLE_P (row)) return 1; - if (force_p) - return 0; - /* If the row the cursor is in is taller than the window's height, it's not clear what to do, so do nothing. */ window_height = window_box_height (w); if (row->height >= window_height) - return 1; - + { + if (!force_p || w->vscroll) + return 1; + } return 0; #if 0 @@ -10979,6 +11023,12 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, else this_scroll_margin = 0; + /* Force scroll_conservatively to have a reasonable value so it doesn't + cause an overflow while computing how much to scroll. */ + if (scroll_conservatively) + scroll_conservatively = min (scroll_conservatively, + MOST_POSITIVE_FIXNUM / FRAME_LINE_HEIGHT (f)); + /* Compute how much we should try to scroll maximally to bring point into view. */ if (scroll_step || scroll_conservatively || temp_scroll_step) @@ -11054,7 +11104,12 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, aggressive = current_buffer->scroll_up_aggressively; height = WINDOW_BOX_TEXT_HEIGHT (w); if (NUMBERP (aggressive)) - amount_to_scroll = XFLOATINT (aggressive) * height; + { + double float_amount = XFLOATINT (aggressive) * height; + amount_to_scroll = float_amount; + if (amount_to_scroll == 0 && float_amount > 0) + amount_to_scroll = 1; + } } if (amount_to_scroll <= 0) @@ -11112,7 +11167,12 @@ try_scrolling (window, just_this_one_p, scroll_conservatively, aggressive = current_buffer->scroll_down_aggressively; height = WINDOW_BOX_TEXT_HEIGHT (w); if (NUMBERP (aggressive)) - amount_to_scroll = XFLOATINT (aggressive) * height; + { + double float_amount = XFLOATINT (aggressive) * height; + amount_to_scroll = float_amount; + if (amount_to_scroll == 0 && float_amount > 0) + amount_to_scroll = 1; + } } if (amount_to_scroll <= 0) @@ -11307,7 +11367,7 @@ try_cursor_movement (window, startp, scroll_step) && (FRAME_WINDOW_P (f) || !overlay_arrow_in_current_buffer_p ())) { - int this_scroll_margin; + int this_scroll_margin, top_scroll_margin; struct glyph_row *row = NULL; #if GLYPH_DEBUG @@ -11320,6 +11380,10 @@ try_cursor_movement (window, startp, scroll_step) this_scroll_margin = min (this_scroll_margin, WINDOW_TOTAL_LINES (w) / 4); this_scroll_margin *= FRAME_LINE_HEIGHT (f); + top_scroll_margin = this_scroll_margin; + if (WINDOW_WANTS_HEADER_LINE_P (w)) + top_scroll_margin += CURRENT_HEADER_LINE_HEIGHT (w); + /* Start with the row the cursor was displayed during the last not paused redisplay. Give up if that row is not valid. */ if (w->last_cursor.vpos < 0 @@ -11380,7 +11444,7 @@ try_cursor_movement (window, startp, scroll_step) && (MATRIX_ROW_START_CHARPOS (row) > PT || (MATRIX_ROW_START_CHARPOS (row) == PT && MATRIX_ROW_STARTS_IN_MIDDLE_OF_CHAR_P (row))) - && (row->y > this_scroll_margin + && (row->y > top_scroll_margin || CHARPOS (startp) == BEGV)) { xassert (row->enabled_p); @@ -11408,7 +11472,7 @@ try_cursor_movement (window, startp, scroll_step) ++row; /* If within the scroll margin, scroll. */ - if (row->y < this_scroll_margin + if (row->y < top_scroll_margin && CHARPOS (startp) != BEGV) scroll_p = 1; } @@ -12578,9 +12642,8 @@ try_window_reusing_current_matrix (w) position. */ if (pt_row) { - w->cursor.vpos -= MATRIX_ROW_VPOS (first_reusable_row, - w->current_matrix); - w->cursor.y -= first_reusable_row->y; + w->cursor.vpos -= nrows_scrolled; + w->cursor.y -= first_reusable_row->y - start_row->y; } /* Scroll the display. */ @@ -12625,6 +12688,29 @@ try_window_reusing_current_matrix (w) for (row -= nrows_scrolled; row < bottom_row; ++row) row->enabled_p = 0; + /* Point may have moved to a different line, so we cannot assume that + the previous cursor position is valid; locate the correct row. */ + if (pt_row) + { + for (row = MATRIX_ROW (w->current_matrix, w->cursor.vpos); + row < bottom_row && PT >= MATRIX_ROW_END_CHARPOS (row); + row++) + { + w->cursor.vpos++; + w->cursor.y = row->y; + } + if (row < bottom_row) + { + struct glyph *glyph = row->glyphs[TEXT_AREA] + w->cursor.hpos; + while (glyph->charpos < PT) + { + w->cursor.hpos++; + w->cursor.x += glyph->pixel_width; + glyph++; + } + } + } + /* Adjust window end. A null value of last_text_row means that the window end is in reused rows which in turn means that only its vpos can have changed. */ @@ -13408,9 +13494,9 @@ try_window_id (w) if ((w->cursor.y < this_scroll_margin && CHARPOS (start) > BEGV) - /* Don't take scroll margin into account at the bottom because - old redisplay didn't do it either. */ - || w->cursor.y + cursor_height > it.last_visible_y) + /* Old redisplay didn't take scroll margin into account at the bottom, + but then global-hl-line-mode doesn't scroll. KFS 2004-06-14 */ + || w->cursor.y + cursor_height + this_scroll_margin > it.last_visible_y) { w->cursor.vpos = -1; clear_glyph_matrix (w->desired_matrix); @@ -14196,8 +14282,7 @@ compute_line_metrics (it) /* Append one space to the glyph row of iterator IT if doing a - window-based redisplay. DEFAULT_FACE_P non-zero means let the - space have the default face, otherwise let it have the same face as + window-based redisplay. The space has the same face as IT->face_id. Value is non-zero if a space was added. This function is called to make sure that there is always one glyph @@ -14209,7 +14294,7 @@ compute_line_metrics (it) end of the line if the row ends in italic text. */ static int -append_space (it, default_face_p) +append_space_for_newline (it, default_face_p) struct it *it; int default_face_p; { @@ -14223,7 +14308,7 @@ append_space (it, default_face_p) /* Save some values that must not be changed. Must save IT->c and IT->len because otherwise ITERATOR_AT_END_P wouldn't work anymore after - append_space has been called. */ + append_space_for_newline has been called. */ enum display_element_type saved_what = it->what; int saved_c = it->c, saved_len = it->len; int saved_x = it->current_x; @@ -14250,6 +14335,8 @@ append_space (it, default_face_p) PRODUCE_GLYPHS (it); + it->override_ascent = -1; + it->constrain_row_ascent_descent_p = 0; it->current_x = saved_x; it->object = saved_object; it->position = saved_pos; @@ -14531,7 +14618,7 @@ display_line (it) row->exact_window_width_line_p = 1; else #endif /* HAVE_WINDOW_SYSTEM */ - if ((append_space (it, 1) && row->used[TEXT_AREA] == 1) + if ((append_space_for_newline (it, 1) && row->used[TEXT_AREA] == 1) || row->used[TEXT_AREA] == 0) { row->glyphs[TEXT_AREA]->charpos = -1; @@ -14773,7 +14860,7 @@ display_line (it) /* Add a space at the end of the line that is used to display the cursor there. */ if (!IT_OVERFLOW_NEWLINE_INTO_FRINGE (it)) - append_space (it, 0); + append_space_for_newline (it, 0); #endif /* HAVE_WINDOW_SYSTEM */ /* Extend the face to the end of the line. */ @@ -17400,6 +17487,7 @@ fill_image_glyph_string (s) xassert (s->first_glyph->type == IMAGE_GLYPH); s->img = IMAGE_FROM_ID (s->f, s->first_glyph->u.img_id); xassert (s->img); + s->slice = s->first_glyph->slice; s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; s->width = s->first_glyph->pixel_width; @@ -18146,6 +18234,7 @@ append_glyph (it) glyph->glyph_not_available_p = it->glyph_not_available_p; glyph->face_id = it->face_id; glyph->u.ch = it->char_to_display; + glyph->slice = null_glyph_slice; glyph->font_type = FONT_TYPE_UNKNOWN; ++it->glyph_row->used[area]; } @@ -18182,6 +18271,7 @@ append_composite_glyph (it) glyph->glyph_not_available_p = 0; glyph->face_id = it->face_id; glyph->u.cmp_id = it->cmp_id; + glyph->slice = null_glyph_slice; glyph->font_type = FONT_TYPE_UNKNOWN; ++it->glyph_row->used[area]; } @@ -18200,7 +18290,7 @@ take_vertical_position_into_account (it) if (it->voffset < 0) /* Increase the ascent so that we can display the text higher in the line. */ - it->ascent += abs (it->voffset); + it->ascent -= it->voffset; else /* Increase the descent so that we can display the text lower in the line. */ @@ -18220,6 +18310,7 @@ produce_image_glyph (it) struct image *img; struct face *face; int face_ascent, glyph_ascent; + struct glyph_slice slice; xassert (it->what == IT_IMAGE); @@ -18243,19 +18334,68 @@ produce_image_glyph (it) /* Make sure X resources of the image is loaded. */ prepare_image_for_display (it->f, img); - it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face); - it->descent = it->phys_descent = img->height + 2 * img->vmargin - it->ascent; - it->pixel_width = img->width + 2 * img->hmargin; + slice.x = slice.y = 0; + slice.width = img->width; + slice.height = img->height; + + if (INTEGERP (it->slice.x)) + slice.x = XINT (it->slice.x); + else if (FLOATP (it->slice.x)) + slice.x = XFLOAT_DATA (it->slice.x) * img->width; + + if (INTEGERP (it->slice.y)) + slice.y = XINT (it->slice.y); + else if (FLOATP (it->slice.y)) + slice.y = XFLOAT_DATA (it->slice.y) * img->height; + + if (INTEGERP (it->slice.width)) + slice.width = XINT (it->slice.width); + else if (FLOATP (it->slice.width)) + slice.width = XFLOAT_DATA (it->slice.width) * img->width; + + if (INTEGERP (it->slice.height)) + slice.height = XINT (it->slice.height); + else if (FLOATP (it->slice.height)) + slice.height = XFLOAT_DATA (it->slice.height) * img->height; + + if (slice.x >= img->width) + slice.x = img->width; + if (slice.y >= img->height) + slice.y = img->height; + if (slice.x + slice.width >= img->width) + slice.width = img->width - slice.x; + if (slice.y + slice.height > img->height) + slice.height = img->height - slice.y; + + if (slice.width == 0 || slice.height == 0) + return; + + it->ascent = it->phys_ascent = glyph_ascent = image_ascent (img, face, &slice); + + it->descent = slice.height - glyph_ascent; + if (slice.y == 0) + it->descent += img->vmargin; + if (slice.y + slice.height == img->height) + it->descent += img->vmargin; + it->phys_descent = it->descent; + + it->pixel_width = slice.width; + if (slice.x == 0) + it->pixel_width += img->hmargin; + if (slice.x + slice.width == img->width) + it->pixel_width += img->hmargin; /* It's quite possible for images to have an ascent greater than their height, so don't get confused in that case. */ if (it->descent < 0) it->descent = 0; +#if 0 /* this breaks image tiling */ /* If this glyph is alone on the last line, adjust it.ascent to minimum row ascent. */ face_ascent = face->font ? FONT_BASE (face->font) : FRAME_BASELINE_OFFSET (it->f); if (face_ascent > it->ascent) it->ascent = it->phys_ascent = face_ascent; +#endif it->nglyphs = 1; @@ -18263,13 +18403,15 @@ produce_image_glyph (it) { if (face->box_line_width > 0) { - it->ascent += face->box_line_width; - it->descent += face->box_line_width; + if (slice.y == 0) + it->ascent += face->box_line_width; + if (slice.y + slice.height == img->height) + it->descent += face->box_line_width; } - if (it->start_of_box_run_p) + if (it->start_of_box_run_p && slice.x == 0) it->pixel_width += abs (face->box_line_width); - if (it->end_of_box_run_p) + if (it->end_of_box_run_p && slice.x + slice.width == img->width) it->pixel_width += abs (face->box_line_width); } @@ -18298,6 +18440,7 @@ produce_image_glyph (it) glyph->glyph_not_available_p = 0; glyph->face_id = it->face_id; glyph->u.img_id = img->id; + glyph->slice = slice; glyph->font_type = FONT_TYPE_UNKNOWN; ++it->glyph_row->used[area]; } @@ -18340,6 +18483,7 @@ append_stretch_glyph (it, object, width, height, ascent) glyph->face_id = it->face_id; glyph->u.stretch.ascent = ascent; glyph->u.stretch.height = height; + glyph->slice = null_glyph_slice; glyph->font_type = FONT_TYPE_UNKNOWN; ++it->glyph_row->used[area]; } @@ -18505,6 +18649,107 @@ produce_stretch_glyph (it) take_vertical_position_into_account (it); } +/* Calculate line-height and line-spacing properties. + An integer value specifies explicit pixel value. + A float value specifies relative value to current face height. + A cons (float . face-name) specifies relative value to + height of specified face font. + + Returns height in pixels, or nil. */ + +static Lisp_Object +calc_line_height_property (it, prop, font, boff, total) + struct it *it; + Lisp_Object prop; + XFontStruct *font; + int boff, *total; +{ + Lisp_Object position, val; + Lisp_Object face_name = Qnil; + int ascent, descent, height, override; + + if (STRINGP (it->object)) + position = make_number (IT_STRING_CHARPOS (*it)); + else + position = make_number (IT_CHARPOS (*it)); + + val = Fget_char_property (position, prop, it->object); + + if (NILP (val)) + return val; + + if (total && CONSP (val) && EQ (XCAR (val), Qtotal)) + { + *total = 1; + val = XCDR (val); + } + + if (INTEGERP (val)) + return val; + + if (CONSP (val)) + { + face_name = XCDR (val); + val = XCAR (val); + } + else if (SYMBOLP (val)) + { + face_name = val; + val = Qnil; + } + + override = EQ (prop, Qline_height); + + if (NILP (face_name)) + { + font = FRAME_FONT (it->f); + boff = FRAME_BASELINE_OFFSET (it->f); + } + else if (EQ (face_name, Qt)) + { + override = 0; + } + else + { + int face_id; + struct face *face; + struct font_info *font_info; + + face_id = lookup_named_face (it->f, face_name); + if (face_id < 0) + return make_number (-1); + + face = FACE_FROM_ID (it->f, face_id); + font = face->font; + if (font == NULL) + return make_number (-1); + + font_info = FONT_INFO_FROM_ID (it->f, face->font_info_id); + boff = font_info->baseline_offset; + if (font_info->vertical_centering) + boff = VCENTER_BASELINE_OFFSET (font, it->f) - boff; + } + + ascent = FONT_BASE (font) + boff; + descent = FONT_DESCENT (font) - boff; + + if (override) + { + it->override_ascent = ascent; + it->override_descent = descent; + it->override_boff = boff; + } + + height = ascent + descent; + if (FLOATP (val)) + height = (int)(XFLOAT_DATA (val) * height); + else if (INTEGERP (val)) + height *= XINT (val); + + return make_number (height); +} + + /* RIF: Produce glyphs/get display metrics for the display element IT is loaded with. See the description of struct display_iterator in @@ -18514,6 +18759,8 @@ void x_produce_glyphs (it) struct it *it; { + int extra_line_spacing = it->extra_line_spacing; + it->glyph_not_available_p = 0; if (it->what == IT_CHARACTER) @@ -18585,8 +18832,18 @@ x_produce_glyphs (it) pcm = rif->per_char_metric (font, &char2b, FONT_TYPE_FOR_UNIBYTE (font, it->char_to_display)); - it->ascent = FONT_BASE (font) + boff; - it->descent = FONT_DESCENT (font) - boff; + + if (it->override_ascent >= 0) + { + it->ascent = it->override_ascent; + it->descent = it->override_descent; + boff = it->override_boff; + } + else + { + it->ascent = FONT_BASE (font) + boff; + it->descent = FONT_DESCENT (font) - boff; + } if (pcm) { @@ -18597,11 +18854,28 @@ x_produce_glyphs (it) else { it->glyph_not_available_p = 1; - it->phys_ascent = FONT_BASE (font) + boff; - it->phys_descent = FONT_DESCENT (font) - boff; + it->phys_ascent = it->ascent; + it->phys_descent = it->descent; it->pixel_width = FONT_WIDTH (font); } + if (it->constrain_row_ascent_descent_p) + { + if (it->descent > it->max_descent) + { + it->ascent += it->descent - it->max_descent; + it->descent = it->max_descent; + } + if (it->ascent > it->max_ascent) + { + it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent); + it->ascent = it->max_ascent; + } + it->phys_ascent = min (it->phys_ascent, it->ascent); + it->phys_descent = min (it->phys_descent, it->descent); + extra_line_spacing = 0; + } + /* If this is a space inside a region of text with `space-width' property, change its width. */ stretched_p = it->char_to_display == ' ' && !NILP (it->space_width); @@ -18634,6 +18908,14 @@ x_produce_glyphs (it) if (face->overline_p) it->ascent += 2; + if (it->constrain_row_ascent_descent_p) + { + if (it->ascent > it->max_ascent) + it->ascent = it->max_ascent; + if (it->descent > it->max_descent) + it->descent = it->max_descent; + } + take_vertical_position_into_account (it); /* If we have to actually produce glyphs, do it. */ @@ -18660,17 +18942,73 @@ x_produce_glyphs (it) } else if (it->char_to_display == '\n') { - /* A newline has no width but we need the height of the line. */ + /* A newline has no width but we need the height of the line. + But if previous part of the line set a height, don't + increase that height */ + + Lisp_Object height; + + it->override_ascent = -1; it->pixel_width = 0; it->nglyphs = 0; - it->ascent = it->phys_ascent = FONT_BASE (font) + boff; - it->descent = it->phys_descent = FONT_DESCENT (font) - boff; - if (face->box != FACE_NO_BOX - && face->box_line_width > 0) + height = calc_line_height_property(it, Qline_height, font, boff, 0); + + if (it->override_ascent >= 0) { - it->ascent += face->box_line_width; - it->descent += face->box_line_width; + it->ascent = it->override_ascent; + it->descent = it->override_descent; + boff = it->override_boff; + } + else + { + it->ascent = FONT_BASE (font) + boff; + it->descent = FONT_DESCENT (font) - boff; + } + + if (EQ (height, make_number(0))) + { + if (it->descent > it->max_descent) + { + it->ascent += it->descent - it->max_descent; + it->descent = it->max_descent; + } + if (it->ascent > it->max_ascent) + { + it->descent = min (it->max_descent, it->descent + it->ascent - it->max_ascent); + it->ascent = it->max_ascent; + } + it->phys_ascent = min (it->phys_ascent, it->ascent); + it->phys_descent = min (it->phys_descent, it->descent); + it->constrain_row_ascent_descent_p = 1; + extra_line_spacing = 0; + } + else + { + Lisp_Object spacing; + int total = 0; + + it->phys_ascent = it->ascent; + it->phys_descent = it->descent; + + if ((it->max_ascent > 0 || it->max_descent > 0) + && face->box != FACE_NO_BOX + && face->box_line_width > 0) + { + it->ascent += face->box_line_width; + it->descent += face->box_line_width; + } + if (!NILP (height) + && XINT (height) > it->ascent + it->descent) + it->ascent = XINT (height) - it->descent; + + spacing = calc_line_height_property(it, Qline_spacing, font, boff, &total); + if (INTEGERP (spacing)) + { + extra_line_spacing = XINT (spacing); + if (total) + extra_line_spacing -= (it->phys_ascent + it->phys_descent); + } } } else if (it->char_to_display == '\t') @@ -19093,7 +19431,8 @@ x_produce_glyphs (it) if (it->area == TEXT_AREA) it->current_x += it->pixel_width; - it->descent += it->extra_line_spacing; + if (extra_line_spacing > 0) + it->descent += extra_line_spacing; it->max_ascent = max (it->max_ascent, it->ascent); it->max_descent = max (it->max_descent, it->descent); @@ -20390,8 +20729,8 @@ on_hot_spot_p (hot_spot, x, y) return inside; } } - else - return 0; + /* If we don't understand the format, pretend we're not in the hot-spot. */ + return 0; } Lisp_Object @@ -20426,7 +20765,6 @@ Returns the alist element for the first matching AREA in MAP. */) Lisp_Object map; Lisp_Object x, y; { - int ix, iy; if (NILP (map)) return Qnil; @@ -20466,11 +20804,7 @@ define_frame_cursor1 (f, cursor, pointer) cursor = FRAME_X_OUTPUT (f)->nontext_cursor; } -#ifndef HAVE_CARBON if (cursor != No_Cursor) -#else - if (bcmp (&cursor, &No_Cursor, sizeof (Cursor))) -#endif rif->define_frame_cursor (f, cursor); } @@ -20492,7 +20826,7 @@ note_mode_line_or_margin_highlight (w, x, y, area) Lisp_Object pointer = Qnil; int charpos, dx, dy, width, height; Lisp_Object string, object = Qnil; - Lisp_Object pos, help, image; + Lisp_Object pos, help; if (area == ON_MODE_LINE || area == ON_HEADER_LINE) string = mode_line_string (w, area, &x, &y, &charpos, @@ -20671,7 +21005,7 @@ note_mouse_highlight (f, x, y) Lisp_Object object; Lisp_Object mouse_face = Qnil, overlay = Qnil, position; Lisp_Object *overlay_vec = NULL; - int len, noverlays; + int noverlays; struct buffer *obuf; int obegv, ozv, same_region; @@ -20687,7 +21021,9 @@ note_mouse_highlight (f, x, y) Lisp_Object image_map, hotspot; if ((image_map = Fplist_get (XCDR (img->spec), QCmap), !NILP (image_map)) - && (hotspot = find_hot_spot (image_map, dx, dy), + && (hotspot = find_hot_spot (image_map, + glyph->slice.x + dx, + glyph->slice.y + dy), CONSP (hotspot)) && (hotspot = XCDR (hotspot), CONSP (hotspot))) { @@ -20756,19 +21092,8 @@ note_mouse_highlight (f, x, y) if (BUFFERP (object)) { - /* Put all the overlays we want in a vector in overlay_vec. - Store the length in len. If there are more than 10, make - enough space for all, and try again. */ - len = 10; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL, 0); - if (noverlays > len) - { - len = noverlays; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (pos, 0, &overlay_vec, &len, NULL, NULL,0); - } - + /* Put all the overlays we want in a vector in overlay_vec. */ + GET_OVERLAYS_AT (pos, overlay_vec, noverlays, NULL, 0); /* Sort overlays into increasing priority order. */ noverlays = sort_overlays (overlay_vec, noverlays, w); } @@ -21724,6 +22049,8 @@ syms_of_xdisp () staticpro (&Qspace_width); Qraise = intern ("raise"); staticpro (&Qraise); + Qslice = intern ("slice"); + staticpro (&Qslice); Qspace = intern ("space"); staticpro (&Qspace); Qmargin = intern ("margin"); @@ -21736,6 +22063,10 @@ syms_of_xdisp () staticpro (&Qright_margin); Qcenter = intern ("center"); staticpro (&Qcenter); + Qline_height = intern ("line-height"); + staticpro (&Qline_height); + Qtotal = intern ("total"); + staticpro (&Qtotal); QCalign_to = intern (":align-to"); staticpro (&QCalign_to); QCrelative_width = intern (":relative-width"); @@ -22096,11 +22427,6 @@ Note that the lower bound for automatic hscrolling specified by `scroll-left' and `scroll-right' overrides this variable's effect. */); Vhscroll_step = make_number (0); - DEFVAR_LISP ("image-types", &Vimage_types, - doc: /* List of supported image types. -Each element of the list is a symbol for a supported image type. */); - Vimage_types = Qnil; - DEFVAR_BOOL ("message-truncate-lines", &message_truncate_lines, doc: /* If non-nil, messages are truncated instead of resizing the echo area. Bind this around calls to `message' to let it take effect. */); diff --git a/src/xfaces.c b/src/xfaces.c index f44b216877f..d2da290ed56 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -464,6 +464,7 @@ int menu_face_changed_default; struct font_name; struct table_entry; +struct named_merge_point; static void map_tty_color P_ ((struct frame *, struct face *, enum lface_attribute_index, int *)); @@ -519,11 +520,10 @@ static int face_numeric_weight P_ ((Lisp_Object)); static int face_numeric_slant P_ ((Lisp_Object)); static int face_numeric_swidth P_ ((Lisp_Object)); static int face_fontset P_ ((Lisp_Object *)); -static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*, Lisp_Object)); -static void merge_face_inheritance P_ ((struct frame *f, Lisp_Object, - Lisp_Object *, Lisp_Object)); -static void merge_face_vector_with_property P_ ((struct frame *, Lisp_Object *, - Lisp_Object)); +static void merge_face_vectors P_ ((struct frame *, Lisp_Object *, Lisp_Object*, + struct named_merge_point *)); +static int merge_face_ref P_ ((struct frame *, Lisp_Object, Lisp_Object *, + int, struct named_merge_point *)); static int set_lface_from_font_name P_ ((struct frame *, Lisp_Object, Lisp_Object, int, int)); static Lisp_Object lface_from_face_name P_ ((struct frame *, Lisp_Object, int)); @@ -3214,6 +3214,49 @@ check_lface (lface) #endif /* GLYPH_DEBUG == 0 */ + +/* Face-merge cycle checking. */ + +/* A `named merge point' is simply a point during face-merging where we + look up a face by name. We keep a stack of which named lookups we're + currently processing so that we can easily detect cycles, using a + linked- list of struct named_merge_point structures, typically + allocated on the stack frame of the named lookup functions which are + active (so no consing is required). */ +struct named_merge_point +{ + Lisp_Object face_name; + struct named_merge_point *prev; +}; + + +/* If a face merging cycle is detected for FACE_NAME, return 0, + otherwise add NEW_NAMED_MERGE_POINT, which is initialized using + FACE_NAME, as the head of the linked list pointed to by + NAMED_MERGE_POINTS, and return 1. */ + +static INLINE int +push_named_merge_point (struct named_merge_point *new_named_merge_point, + Lisp_Object face_name, + struct named_merge_point **named_merge_points) +{ + struct named_merge_point *prev; + + for (prev = *named_merge_points; prev; prev = prev->prev) + if (EQ (face_name, prev->face_name)) + return 0; + + new_named_merge_point->face_name = face_name; + new_named_merge_point->prev = *named_merge_points; + + *named_merge_points = new_named_merge_point; + + return 1; +} + + + + /* Resolve face name FACE_NAME. If FACE_NAME is a string, intern it to make it a symvol. If FACE_NAME is an alias for another face, return that face's name. */ @@ -3480,6 +3523,8 @@ merge_face_heights (from, to, invalid, gcpro) else if (FLOATP (to)) /* relative X relative => relative */ result = make_float (XFLOAT_DATA (from) * XFLOAT_DATA (to)); + else if (UNSPECIFIEDP (to)) + result = from; } else if (FUNCTIONP (from)) /* FROM is a function, which use to adjust TO. */ @@ -3511,14 +3556,15 @@ merge_face_heights (from, to, invalid, gcpro) completely specified and contain only absolute attributes. Every specified attribute of FROM overrides the corresponding attribute of TO; relative attributes in FROM are merged with the absolute value in - TO and replace it. CYCLE_CHECK is used internally to detect loops in - face inheritance; it should be Qnil when called from other places. */ + TO and replace it. NAMED_MERGE_POINTS is used internally to detect + loops in face inheritance; it should be 0 when called from other + places. */ static INLINE void -merge_face_vectors (f, from, to, cycle_check) +merge_face_vectors (f, from, to, named_merge_points) struct frame *f; Lisp_Object *from, *to; - Lisp_Object cycle_check; + struct named_merge_point *named_merge_points; { int i; @@ -3529,7 +3575,7 @@ merge_face_vectors (f, from, to, cycle_check) other code uses `unspecified' as a generic value for face attributes. */ if (!UNSPECIFIEDP (from[LFACE_INHERIT_INDEX]) && !NILP (from[LFACE_INHERIT_INDEX])) - merge_face_inheritance (f, from[LFACE_INHERIT_INDEX], to, cycle_check); + merge_face_ref (f, from[LFACE_INHERIT_INDEX], to, 0, named_merge_points); /* If TO specifies a :font attribute, and FROM specifies some font-related attribute, we need to clear TO's :font attribute @@ -3548,7 +3594,8 @@ merge_face_vectors (f, from, to, cycle_check) if (!UNSPECIFIEDP (from[i])) { if (i == LFACE_HEIGHT_INDEX && !INTEGERP (from[i])) - to[i] = merge_face_heights (from[i], to[i], to[i], cycle_check); + to[i] = merge_face_heights (from[i], to[i], to[i], + named_merge_points); else to[i] = from[i]; } @@ -3558,87 +3605,45 @@ merge_face_vectors (f, from, to, cycle_check) to[LFACE_INHERIT_INDEX] = Qnil; } +/* Merge the named face FACE_NAME on frame F, into the vector of face + attributes TO. NAMED_MERGE_POINTS is used to detect loops in face + inheritance. Returns true if FACE_NAME is a valid face name and + merging succeeded. */ -/* Checks the `cycle check' variable CHECK to see if it indicates that - EL is part of a cycle; CHECK must be either Qnil or a value returned - by an earlier use of CYCLE_CHECK. SUSPICIOUS is the number of - elements after which a cycle might be suspected; after that many - elements, this macro begins consing in order to keep more precise - track of elements. - - Returns nil if a cycle was detected, otherwise a new value for CHECK - that includes EL. - - CHECK is evaluated multiple times, EL and SUSPICIOUS 0 or 1 times, so - the caller should make sure that's ok. */ - -#define CYCLE_CHECK(check, el, suspicious) \ - (NILP (check) \ - ? make_number (0) \ - : (INTEGERP (check) \ - ? (XFASTINT (check) < (suspicious) \ - ? make_number (XFASTINT (check) + 1) \ - : Fcons (el, Qnil)) \ - : (!NILP (Fmemq ((el), (check))) \ - ? Qnil \ - : Fcons ((el), (check))))) - - -/* Merge face attributes from the face on frame F whose name is - INHERITS, into the vector of face attributes TO; INHERITS may also be - a list of face names, in which case they are applied in order. - CYCLE_CHECK is used to detect loops in face inheritance. - Returns true if any of the inherited attributes are `font-related'. */ - -static void -merge_face_inheritance (f, inherit, to, cycle_check) +static int +merge_named_face (f, face_name, to, named_merge_points) struct frame *f; - Lisp_Object inherit; + Lisp_Object face_name; Lisp_Object *to; - Lisp_Object cycle_check; + struct named_merge_point *named_merge_points; { - if (SYMBOLP (inherit) && !EQ (inherit, Qunspecified)) - /* Inherit from the named face INHERIT. */ - { - Lisp_Object lface; - - /* Make sure we're not in an inheritance loop. */ - cycle_check = CYCLE_CHECK (cycle_check, inherit, 15); - if (NILP (cycle_check)) - /* Cycle detected, ignore any further inheritance. */ - return; + struct named_merge_point named_merge_point; - lface = lface_from_face_name (f, inherit, 0); - if (!NILP (lface)) - merge_face_vectors (f, XVECTOR (lface)->contents, to, cycle_check); - } - else if (CONSP (inherit)) - /* Handle a list of inherited faces by calling ourselves recursively - on each element. Note that we only do so for symbol elements, so - it's not possible to infinitely recurse. */ + if (push_named_merge_point (&named_merge_point, + face_name, &named_merge_points)) { - while (CONSP (inherit)) - { - if (SYMBOLP (XCAR (inherit))) - merge_face_inheritance (f, XCAR (inherit), to, cycle_check); + Lisp_Object from[LFACE_VECTOR_SIZE]; + int ok = get_lface_attributes (f, face_name, from, 0); - /* Check for a circular inheritance list. */ - cycle_check = CYCLE_CHECK (cycle_check, inherit, 15); - if (NILP (cycle_check)) - /* Cycle detected. */ - break; + if (ok) + merge_face_vectors (f, from, to, named_merge_points); - inherit = XCDR (inherit); - } + return ok; } + else + return 0; } -/* Given a Lisp face attribute vector TO and a Lisp object PROP that - is a face property, determine the resulting face attributes on - frame F, and store them in TO. PROP may be a single face - specification or a list of such specifications. Each face - specification can be +/* Merge face attributes from the lisp `face reference' FACE_REF on + frame F into the face attribute vector TO. If ERR_MSGS is non-zero, + problems with FACE_REF cause an error message to be shown. Return + non-zero if no errors occurred (regardless of the value of ERR_MSGS). + NAMED_MERGE_POINTS is used to detect loops in face inheritance or + list structure; it may be 0 for most callers. + + FACE_REF may be a single face specification or a list of such + specifications. Each face specification can be: 1. A symbol or string naming a Lisp face. @@ -3653,22 +3658,26 @@ merge_face_inheritance (f, inherit, to, cycle_check) Face specifications earlier in lists take precedence over later specifications. */ -static void -merge_face_vector_with_property (f, to, prop) +static int +merge_face_ref (f, face_ref, to, err_msgs, named_merge_points) struct frame *f; + Lisp_Object face_ref; Lisp_Object *to; - Lisp_Object prop; + int err_msgs; + struct named_merge_point *named_merge_points; { - if (CONSP (prop)) + int ok = 1; /* Succeed without an error? */ + + if (CONSP (face_ref)) { - Lisp_Object first = XCAR (prop); + Lisp_Object first = XCAR (face_ref); if (EQ (first, Qforeground_color) || EQ (first, Qbackground_color)) { /* One of (FOREGROUND-COLOR . COLOR) or (BACKGROUND-COLOR . COLOR). COLOR must be a string. */ - Lisp_Object color_name = XCDR (prop); + Lisp_Object color_name = XCDR (face_ref); Lisp_Object color = first; if (STRINGP (color_name)) @@ -3679,23 +3688,28 @@ merge_face_vector_with_property (f, to, prop) to[LFACE_BACKGROUND_INDEX] = color_name; } else - add_to_log ("Invalid face color", color_name, Qnil); + { + if (err_msgs) + add_to_log ("Invalid face color", color_name, Qnil); + ok = 0; + } } else if (SYMBOLP (first) && *SDATA (SYMBOL_NAME (first)) == ':') { /* Assume this is the property list form. */ - while (CONSP (prop) && CONSP (XCDR (prop))) + while (CONSP (face_ref) && CONSP (XCDR (face_ref))) { - Lisp_Object keyword = XCAR (prop); - Lisp_Object value = XCAR (XCDR (prop)); + Lisp_Object keyword = XCAR (face_ref); + Lisp_Object value = XCAR (XCDR (face_ref)); + int err = 0; if (EQ (keyword, QCfamily)) { if (STRINGP (value)) to[LFACE_FAMILY_INDEX] = value; else - add_to_log ("Invalid face font family", value, Qnil); + err = 1; } else if (EQ (keyword, QCheight)) { @@ -3703,10 +3717,10 @@ merge_face_vector_with_property (f, to, prop) merge_face_heights (value, to[LFACE_HEIGHT_INDEX], Qnil, Qnil); - if (NILP (new_height)) - add_to_log ("Invalid face font height", value, Qnil); - else + if (! NILP (new_height)) to[LFACE_HEIGHT_INDEX] = new_height; + else + err = 1; } else if (EQ (keyword, QCweight)) { @@ -3714,7 +3728,7 @@ merge_face_vector_with_property (f, to, prop) && face_numeric_weight (value) >= 0) to[LFACE_WEIGHT_INDEX] = value; else - add_to_log ("Invalid face weight", value, Qnil); + err = 1; } else if (EQ (keyword, QCslant)) { @@ -3722,7 +3736,7 @@ merge_face_vector_with_property (f, to, prop) && face_numeric_slant (value) >= 0) to[LFACE_SLANT_INDEX] = value; else - add_to_log ("Invalid face slant", value, Qnil); + err = 1; } else if (EQ (keyword, QCunderline)) { @@ -3731,7 +3745,7 @@ merge_face_vector_with_property (f, to, prop) || STRINGP (value)) to[LFACE_UNDERLINE_INDEX] = value; else - add_to_log ("Invalid face underline", value, Qnil); + err = 1; } else if (EQ (keyword, QCoverline)) { @@ -3740,7 +3754,7 @@ merge_face_vector_with_property (f, to, prop) || STRINGP (value)) to[LFACE_OVERLINE_INDEX] = value; else - add_to_log ("Invalid face overline", value, Qnil); + err = 1; } else if (EQ (keyword, QCstrike_through)) { @@ -3749,7 +3763,7 @@ merge_face_vector_with_property (f, to, prop) || STRINGP (value)) to[LFACE_STRIKE_THROUGH_INDEX] = value; else - add_to_log ("Invalid face strike-through", value, Qnil); + err = 1; } else if (EQ (keyword, QCbox)) { @@ -3761,7 +3775,7 @@ merge_face_vector_with_property (f, to, prop) || NILP (value)) to[LFACE_BOX_INDEX] = value; else - add_to_log ("Invalid face box", value, Qnil); + err = 1; } else if (EQ (keyword, QCinverse_video) || EQ (keyword, QCreverse_video)) @@ -3769,21 +3783,21 @@ merge_face_vector_with_property (f, to, prop) if (EQ (value, Qt) || NILP (value)) to[LFACE_INVERSE_INDEX] = value; else - add_to_log ("Invalid face inverse-video", value, Qnil); + err = 1; } else if (EQ (keyword, QCforeground)) { if (STRINGP (value)) to[LFACE_FOREGROUND_INDEX] = value; else - add_to_log ("Invalid face foreground", value, Qnil); + err = 1; } else if (EQ (keyword, QCbackground)) { if (STRINGP (value)) to[LFACE_BACKGROUND_INDEX] = value; else - add_to_log ("Invalid face background", value, Qnil); + err = 1; } else if (EQ (keyword, QCstipple)) { @@ -3792,7 +3806,7 @@ merge_face_vector_with_property (f, to, prop) if (!NILP (pixmap_p)) to[LFACE_STIPPLE_INDEX] = value; else - add_to_log ("Invalid face stipple", value, Qnil); + err = 1; #endif } else if (EQ (keyword, QCwidth)) @@ -3801,52 +3815,51 @@ merge_face_vector_with_property (f, to, prop) && face_numeric_swidth (value) >= 0) to[LFACE_SWIDTH_INDEX] = value; else - add_to_log ("Invalid face width", value, Qnil); + err = 1; } else if (EQ (keyword, QCinherit)) { - if (SYMBOLP (value)) - to[LFACE_INHERIT_INDEX] = value; - else - { - Lisp_Object tail; - for (tail = value; CONSP (tail); tail = XCDR (tail)) - if (!SYMBOLP (XCAR (tail))) - break; - if (NILP (tail)) - to[LFACE_INHERIT_INDEX] = value; - else - add_to_log ("Invalid face inherit", value, Qnil); - } + /* This is not really very useful; it's just like a + normal face reference. */ + if (! merge_face_ref (f, value, to, + err_msgs, named_merge_points)) + err = 1; } else - add_to_log ("Invalid attribute %s in face property", - keyword, Qnil); + err = 1; - prop = XCDR (XCDR (prop)); + if (err) + { + add_to_log ("Invalid face attribute %S %S", keyword, value); + ok = 0; + } + + face_ref = XCDR (XCDR (face_ref)); } } else { - /* This is a list of face specs. Specifications at the - beginning of the list take precedence over later - specifications, so we have to merge starting with the - last specification. */ - Lisp_Object next = XCDR (prop); - if (!NILP (next)) - merge_face_vector_with_property (f, to, next); - merge_face_vector_with_property (f, to, first); + /* This is a list of face refs. Those at the beginning of the + list take precedence over what follows, so we have to merge + from the end backwards. */ + Lisp_Object next = XCDR (face_ref); + + if (! NILP (next)) + ok = merge_face_ref (f, next, to, err_msgs, named_merge_points); + + if (! merge_face_ref (f, first, to, err_msgs, named_merge_points)) + ok = 0; } } else { - /* PROP ought to be a face name. */ - Lisp_Object lface = lface_from_face_name (f, prop, 0); - if (NILP (lface)) - add_to_log ("Invalid face text property value: %s", prop, Qnil); - else - merge_face_vectors (f, XVECTOR (lface)->contents, to, Qnil); + /* FACE_REF ought to be a face name. */ + ok = merge_named_face (f, face_ref, to, named_merge_points); + if (!ok && err_msgs) + add_to_log ("Invalid face reference: %s", face_ref, Qnil); } + + return ok; } @@ -3962,12 +3975,13 @@ Otherwise check for the existence of a global face. */) DEFUN ("internal-copy-lisp-face", Finternal_copy_lisp_face, Sinternal_copy_lisp_face, 4, 4, 0, doc: /* Copy face FROM to TO. -If FRAME it t, copy the global face definition of FROM to the -global face definition of TO. Otherwise, copy the frame-local -definition of FROM on FRAME to the frame-local definition of TO -on NEW-FRAME, or FRAME if NEW-FRAME is nil. +If FRAME is t, copy the global face definition of FROM. +Otherwise, copy the frame-local definition of FROM on FRAME. +If NEW-FRAME is a frame, copy that data into the frame-local +definition of TO on NEW-FRAME. If NEW-FRAME is nil. +FRAME controls where the data is copied to. -Value is TO. */) +The value is TO. */) (from, to, frame, new_frame) Lisp_Object from, to, frame, new_frame; { @@ -3975,8 +3989,6 @@ Value is TO. */) CHECK_SYMBOL (from); CHECK_SYMBOL (to); - if (NILP (new_frame)) - new_frame = frame; if (EQ (frame, Qt)) { @@ -3988,6 +4000,8 @@ Value is TO. */) else { /* Copy frame-local definition of FROM. */ + if (NILP (new_frame)) + new_frame = frame; CHECK_LIVE_FRAME (frame); CHECK_LIVE_FRAME (new_frame); lface = lface_from_face_name (XFRAME (frame), from, 1); @@ -4797,8 +4811,8 @@ DEFUN ("internal-get-lisp-face-attribute", Finternal_get_lisp_face_attribute, doc: /* Return face attribute KEYWORD of face SYMBOL. If SYMBOL does not name a valid Lisp face or KEYWORD isn't a valid face attribute name, signal an error. -If the optional argument FRAME is given, report on face FACE in that -frame. If FRAME is t, report on the defaults for face FACE (for new +If the optional argument FRAME is given, report on face SYMBOL in that +frame. If FRAME is t, report on the defaults for face SYMBOL (for new frames). If FRAME is omitted or nil, use the selected frame. */) (symbol, keyword, frame) Lisp_Object symbol, keyword, frame; @@ -4995,49 +5009,52 @@ return the font name used for CHARACTER. */) } -/* Compare face vectors V1 and V2 for equality. Value is non-zero if +/* Compare face-attribute values v1 and v2 for equality. Value is non-zero if all attributes are `equal'. Tries to be fast because this function is called quite often. */ static INLINE int -lface_equal_p (v1, v2) - Lisp_Object *v1, *v2; +face_attr_equal_p (v1, v2) + Lisp_Object v1, v2; { - int i, equal_p = 1; + /* Type can differ, e.g. when one attribute is unspecified, i.e. nil, + and the other is specified. */ + if (XTYPE (v1) != XTYPE (v2)) + return 0; - for (i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i) - { - Lisp_Object a = v1[i]; - Lisp_Object b = v2[i]; + if (EQ (v1, v2)) + return 1; - /* Type can differ, e.g. when one attribute is unspecified, i.e. nil, - and the other is specified. */ - equal_p = XTYPE (a) == XTYPE (b); - if (!equal_p) - break; + switch (XTYPE (v1)) + { + case Lisp_String: + if (SBYTES (v1) != SBYTES (v2)) + return 0; - if (!EQ (a, b)) - { - switch (XTYPE (a)) - { - case Lisp_String: - equal_p = ((SBYTES (a) - == SBYTES (b)) - && bcmp (SDATA (a), SDATA (b), - SBYTES (a)) == 0); - break; + return bcmp (SDATA (v1), SDATA (v2), SBYTES (v1)) == 0; - case Lisp_Int: - case Lisp_Symbol: - equal_p = 0; - break; + case Lisp_Int: + case Lisp_Symbol: + return 0; - default: - equal_p = !NILP (Fequal (a, b)); - break; - } - } + default: + return !NILP (Fequal (v1, v2)); } +} + + +/* Compare face vectors V1 and V2 for equality. Value is non-zero if + all attributes are `equal'. Tries to be fast because this function + is called quite often. */ + +static INLINE int +lface_equal_p (v1, v2) + Lisp_Object *v1, *v2; +{ + int i, equal_p = 1; + + for (i = 1; i < LFACE_VECTOR_SIZE && equal_p; ++i) + equal_p = face_attr_equal_p (v1[i], v2[i]); return equal_p; } @@ -5333,192 +5350,6 @@ If FRAME is unspecified or nil, the current frame is used. */) /*********************************************************************** - Face capability testing for ttys - ***********************************************************************/ - - -/* If the distance (as returned by color_distance) between two colors is - less than this, then they are considered the same, for determining - whether a color is supported or not. The range of values is 0-65535. */ - -#define TTY_SAME_COLOR_THRESHOLD 10000 - - -DEFUN ("tty-supports-face-attributes-p", - Ftty_supports_face_attributes_p, Stty_supports_face_attributes_p, - 1, 2, 0, - doc: /* Return non-nil if all the face attributes in ATTRIBUTES are supported. -The optional argument FRAME is the frame on which to test; if it is nil -or unspecified, then the current frame is used. If FRAME is not a tty -frame, then nil is returned. - -The definition of `supported' is somewhat heuristic, but basically means -that a face containing all the attributes in ATTRIBUTES, when merged -with the default face for display, can be represented in a way that's - - \(1) different in appearance than the default face, and - \(2) `close in spirit' to what the attributes specify, if not exact. - -Point (2) implies that a `:weight black' attribute will be satisified -by any terminal that can display bold, and a `:foreground "yellow"' as -long as the terminal can display a yellowish color, but `:slant italic' -will _not_ be satisified by the tty display code's automatic -substitution of a `dim' face for italic. */) - (attributes, frame) - Lisp_Object attributes, frame; -{ - int weight, i; - struct frame *f; - Lisp_Object val, fg, bg; - XColor fg_tty_color, fg_std_color; - XColor bg_tty_color, bg_std_color; - Lisp_Object attrs[LFACE_VECTOR_SIZE]; - unsigned test_caps = 0; - - if (NILP (frame)) - frame = selected_frame; - CHECK_LIVE_FRAME (frame); - f = XFRAME (frame); - - for (i = 0; i < LFACE_VECTOR_SIZE; i++) - attrs[i] = Qunspecified; - merge_face_vector_with_property (f, attrs, attributes); - - /* This function only works on ttys. */ - if (!FRAME_TERMCAP_P (f) && !FRAME_MSDOS_P (f)) - return Qnil; - - /* First check some easy-to-check stuff; ttys support none of the - following attributes, so we can just return nil if any are requested. */ - - /* stipple */ - val = attrs[LFACE_STIPPLE_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - return Qnil; - - /* font height */ - val = attrs[LFACE_HEIGHT_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - return Qnil; - - /* font width */ - val = attrs[LFACE_SWIDTH_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val) - && face_numeric_swidth (val) != XLFD_SWIDTH_MEDIUM) - return Qnil; - - /* overline */ - val = attrs[LFACE_OVERLINE_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - return Qnil; - - /* strike-through */ - val = attrs[LFACE_STRIKE_THROUGH_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - return Qnil; - - /* boxes */ - val = attrs[LFACE_BOX_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - return Qnil; - - /* slant (italics/oblique); We consider any non-default value - unsupportable on ttys, even though the face code actually `fakes' - them using a dim attribute if possible. This is because the faked - result is too different from what the face specifies. */ - val = attrs[LFACE_SLANT_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val) - && face_numeric_slant (val) != XLFD_SLANT_ROMAN) - return Qnil; - - - /* Test for terminal `capabilities' (non-color character attributes). */ - - /* font weight (bold/dim) */ - weight = face_numeric_weight (attrs[LFACE_WEIGHT_INDEX]); - if (weight >= 0) - { - if (weight > XLFD_WEIGHT_MEDIUM) - test_caps = TTY_CAP_BOLD; - else if (weight < XLFD_WEIGHT_MEDIUM) - test_caps = TTY_CAP_DIM; - } - - /* underlining */ - val = attrs[LFACE_UNDERLINE_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - { - if (STRINGP (val)) - return Qnil; /* ttys don't support colored underlines */ - else - test_caps |= TTY_CAP_UNDERLINE; - } - - /* inverse video */ - val = attrs[LFACE_INVERSE_INDEX]; - if (!UNSPECIFIEDP (val) && !NILP (val)) - test_caps |= TTY_CAP_INVERSE; - - - /* Color testing. */ - - /* Default the color indices in FG_TTY_COLOR and BG_TTY_COLOR, since - we use them when calling `tty_capable_p' below, even if the face - specifies no colors. */ - fg_tty_color.pixel = FACE_TTY_DEFAULT_FG_COLOR; - bg_tty_color.pixel = FACE_TTY_DEFAULT_BG_COLOR; - - /* Check if foreground color is close enough. */ - fg = attrs[LFACE_FOREGROUND_INDEX]; - if (STRINGP (fg)) - { - if (! tty_lookup_color (f, fg, &fg_tty_color, &fg_std_color)) - return Qnil; - else if (color_distance (&fg_tty_color, &fg_std_color) - > TTY_SAME_COLOR_THRESHOLD) - return Qnil; - } - - /* Check if background color is close enough. */ - bg = attrs[LFACE_BACKGROUND_INDEX]; - if (STRINGP (bg)) - { - if (! tty_lookup_color (f, bg, &bg_tty_color, &bg_std_color)) - return Qnil; - else if (color_distance (&bg_tty_color, &bg_std_color) - > TTY_SAME_COLOR_THRESHOLD) - return Qnil; - } - - /* If both foreground and background are requested, see if the - distance between them is OK. We just check to see if the distance - between the tty's foreground and background is close enough to the - distance between the standard foreground and background. */ - if (STRINGP (fg) && STRINGP (bg)) - { - int delta_delta - = (color_distance (&fg_std_color, &bg_std_color) - - color_distance (&fg_tty_color, &bg_tty_color)); - if (delta_delta > TTY_SAME_COLOR_THRESHOLD - || delta_delta < -TTY_SAME_COLOR_THRESHOLD) - return Qnil; - } - - - /* See if the capabilities we selected above are supported, with the - given colors. */ - if (test_caps != 0 && - ! tty_capable_p (f, test_caps, fg_tty_color.pixel, bg_tty_color.pixel)) - return Qnil; - - - /* Hmmm, everything checks out, this terminal must support this face. */ - return Qt; -} - - - -/*********************************************************************** Face Cache ***********************************************************************/ @@ -5570,8 +5401,8 @@ clear_face_gcs (c) } -/* Free all realized faces in face cache C, including basic faces. C - may be null. If faces are freed, make sure the frame's current +/* Free all realized faces in face cache C, including basic faces. + C may be null. If faces are freed, make sure the frame's current matrix is marked invalid, so that a display caused by an expose event doesn't try to use faces we destroyed. */ @@ -5911,7 +5742,8 @@ lookup_named_face (f, symbol) get_lface_attributes (f, symbol, symbol_attrs, 1); bcopy (default_face->lface, attrs, sizeof attrs); - merge_face_vectors (f, symbol_attrs, attrs, Qnil); + merge_face_vectors (f, symbol_attrs, attrs, 0); + return lookup_face (f, attrs); } @@ -6049,7 +5881,7 @@ lookup_derived_face (f, symbol, face_id) get_lface_attributes (f, symbol, symbol_attrs, 1); bcopy (default_face->lface, attrs, sizeof attrs); - merge_face_vectors (f, symbol_attrs, attrs, Qnil); + merge_face_vectors (f, symbol_attrs, attrs, 0); return lookup_face (f, attrs); } @@ -6062,15 +5894,367 @@ DEFUN ("face-attributes-as-vector", Fface_attributes_as_vector, Lisp_Object lface; lface = Fmake_vector (make_number (LFACE_VECTOR_SIZE), Qunspecified); - merge_face_vector_with_property (XFRAME (selected_frame), - XVECTOR (lface)->contents, - plist); + merge_face_ref (XFRAME (selected_frame), plist, XVECTOR (lface)->contents, + 1, 0); return lface; } /*********************************************************************** + Face capability testing + ***********************************************************************/ + + +/* If the distance (as returned by color_distance) between two colors is + less than this, then they are considered the same, for determining + whether a color is supported or not. The range of values is 0-65535. */ + +#define TTY_SAME_COLOR_THRESHOLD 10000 + +#ifdef HAVE_WINDOW_SYSTEM + +/* Return non-zero if all the face attributes in ATTRS are supported + on the window-system frame F. + + The definition of `supported' is somewhat heuristic, but basically means + that a face containing all the attributes in ATTRS, when merged with the + default face for display, can be represented in a way that's + + \(1) different in appearance than the default face, and + \(2) `close in spirit' to what the attributes specify, if not exact. */ + +static int +x_supports_face_attributes_p (f, attrs, def_face) + struct frame *f; + Lisp_Object *attrs; + struct face *def_face; +{ + Lisp_Object *def_attrs = def_face->lface; + + /* Check that other specified attributes are different that the default + face. */ + if ((!UNSPECIFIEDP (attrs[LFACE_UNDERLINE_INDEX]) + && face_attr_equal_p (attrs[LFACE_UNDERLINE_INDEX], + def_attrs[LFACE_UNDERLINE_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_INVERSE_INDEX]) + && face_attr_equal_p (attrs[LFACE_INVERSE_INDEX], + def_attrs[LFACE_INVERSE_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_FOREGROUND_INDEX]) + && face_attr_equal_p (attrs[LFACE_FOREGROUND_INDEX], + def_attrs[LFACE_FOREGROUND_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_BACKGROUND_INDEX]) + && face_attr_equal_p (attrs[LFACE_BACKGROUND_INDEX], + def_attrs[LFACE_BACKGROUND_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX]) + && face_attr_equal_p (attrs[LFACE_STIPPLE_INDEX], + def_attrs[LFACE_STIPPLE_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) + && face_attr_equal_p (attrs[LFACE_OVERLINE_INDEX], + def_attrs[LFACE_OVERLINE_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) + && face_attr_equal_p (attrs[LFACE_STRIKE_THROUGH_INDEX], + def_attrs[LFACE_STRIKE_THROUGH_INDEX])) + || (!UNSPECIFIEDP (attrs[LFACE_BOX_INDEX]) + && face_attr_equal_p (attrs[LFACE_BOX_INDEX], + def_attrs[LFACE_BOX_INDEX]))) + return 0; + + /* Check font-related attributes, as those are the most commonly + "unsupported" on a window-system (because of missing fonts). */ + if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_WEIGHT_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_AVGWIDTH_INDEX])) + { + int face_id; + struct face *face; + Lisp_Object merged_attrs[LFACE_VECTOR_SIZE]; + + bcopy (def_attrs, merged_attrs, sizeof merged_attrs); + + merge_face_vectors (f, attrs, merged_attrs, 0); + + face_id = lookup_face (f, merged_attrs); + face = FACE_FROM_ID (f, face_id); + + if (! face) + signal_error ("cannot make face", 0); + + /* If the font is the same, then not supported. */ + if (face->font == def_face->font) + return 0; + } + + /* Everything checks out, this face is supported. */ + return 1; +} + +#endif /* HAVE_WINDOW_SYSTEM */ + +/* Return non-zero if all the face attributes in ATTRS are supported + on the tty frame F. + + The definition of `supported' is somewhat heuristic, but basically means + that a face containing all the attributes in ATTRS, when merged + with the default face for display, can be represented in a way that's + + \(1) different in appearance than the default face, and + \(2) `close in spirit' to what the attributes specify, if not exact. + + Point (2) implies that a `:weight black' attribute will be satisfied + by any terminal that can display bold, and a `:foreground "yellow"' as + long as the terminal can display a yellowish color, but `:slant italic' + will _not_ be satisfied by the tty display code's automatic + substitution of a `dim' face for italic. */ + +static int +tty_supports_face_attributes_p (f, attrs, def_face) + struct frame *f; + Lisp_Object *attrs; + struct face *def_face; +{ + int weight, i; + Lisp_Object val, fg, bg; + XColor fg_tty_color, fg_std_color; + XColor bg_tty_color, bg_std_color; + unsigned test_caps = 0; + Lisp_Object *def_attrs = def_face->lface; + + + /* First check some easy-to-check stuff; ttys support none of the + following attributes, so we can just return false if any are requested + (even if `nominal' values are specified, we should still return false, + as that will be the same value that the default face uses). We + consider :slant unsupportable on ttys, even though the face code + actually `fakes' them using a dim attribute if possible. This is + because the faked result is too different from what the face + specifies. */ + if (!UNSPECIFIEDP (attrs[LFACE_FAMILY_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_STIPPLE_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_HEIGHT_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_SWIDTH_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_OVERLINE_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_STRIKE_THROUGH_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_BOX_INDEX]) + || !UNSPECIFIEDP (attrs[LFACE_SLANT_INDEX])) + return 0; + + + /* Test for terminal `capabilities' (non-color character attributes). */ + + /* font weight (bold/dim) */ + weight = face_numeric_weight (attrs[LFACE_WEIGHT_INDEX]); + if (weight >= 0) + { + int def_weight = face_numeric_weight (def_attrs[LFACE_WEIGHT_INDEX]); + + if (weight > XLFD_WEIGHT_MEDIUM) + { + if (def_weight > XLFD_WEIGHT_MEDIUM) + return 0; /* same as default */ + test_caps = TTY_CAP_BOLD; + } + else if (weight < XLFD_WEIGHT_MEDIUM) + { + if (def_weight < XLFD_WEIGHT_MEDIUM) + return 0; /* same as default */ + test_caps = TTY_CAP_DIM; + } + else if (def_weight == XLFD_WEIGHT_MEDIUM) + return 0; /* same as default */ + } + + /* underlining */ + val = attrs[LFACE_UNDERLINE_INDEX]; + if (!UNSPECIFIEDP (val)) + { + if (STRINGP (val)) + return 0; /* ttys can't use colored underlines */ + else if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + return 0; /* same as default */ + else + test_caps |= TTY_CAP_UNDERLINE; + } + + /* inverse video */ + val = attrs[LFACE_INVERSE_INDEX]; + if (!UNSPECIFIEDP (val)) + { + if (face_attr_equal_p (val, def_attrs[LFACE_UNDERLINE_INDEX])) + return 0; /* same as default */ + else + test_caps |= TTY_CAP_INVERSE; + } + + + /* Color testing. */ + + /* Default the color indices in FG_TTY_COLOR and BG_TTY_COLOR, since + we use them when calling `tty_capable_p' below, even if the face + specifies no colors. */ + fg_tty_color.pixel = FACE_TTY_DEFAULT_FG_COLOR; + bg_tty_color.pixel = FACE_TTY_DEFAULT_BG_COLOR; + + /* Check if foreground color is close enough. */ + fg = attrs[LFACE_FOREGROUND_INDEX]; + if (STRINGP (fg)) + { + Lisp_Object def_fg = def_attrs[LFACE_FOREGROUND_INDEX]; + + if (face_attr_equal_p (fg, def_fg)) + return 0; /* same as default */ + else if (! tty_lookup_color (f, fg, &fg_tty_color, &fg_std_color)) + return 0; /* not a valid color */ + else if (color_distance (&fg_tty_color, &fg_std_color) + > TTY_SAME_COLOR_THRESHOLD) + return 0; /* displayed color is too different */ + else + /* Make sure the color is really different than the default. */ + { + XColor def_fg_color; + if (tty_lookup_color (f, def_fg, &def_fg_color, 0) + && (color_distance (&fg_tty_color, &def_fg_color) + <= TTY_SAME_COLOR_THRESHOLD)) + return 0; + } + } + + /* Check if background color is close enough. */ + bg = attrs[LFACE_BACKGROUND_INDEX]; + if (STRINGP (bg)) + { + Lisp_Object def_bg = def_attrs[LFACE_FOREGROUND_INDEX]; + + if (face_attr_equal_p (bg, def_bg)) + return 0; /* same as default */ + else if (! tty_lookup_color (f, bg, &bg_tty_color, &bg_std_color)) + return 0; /* not a valid color */ + else if (color_distance (&bg_tty_color, &bg_std_color) + > TTY_SAME_COLOR_THRESHOLD) + return 0; /* displayed color is too different */ + else + /* Make sure the color is really different than the default. */ + { + XColor def_bg_color; + if (tty_lookup_color (f, def_bg, &def_bg_color, 0) + && (color_distance (&bg_tty_color, &def_bg_color) + <= TTY_SAME_COLOR_THRESHOLD)) + return 0; + } + } + + /* If both foreground and background are requested, see if the + distance between them is OK. We just check to see if the distance + between the tty's foreground and background is close enough to the + distance between the standard foreground and background. */ + if (STRINGP (fg) && STRINGP (bg)) + { + int delta_delta + = (color_distance (&fg_std_color, &bg_std_color) + - color_distance (&fg_tty_color, &bg_tty_color)); + if (delta_delta > TTY_SAME_COLOR_THRESHOLD + || delta_delta < -TTY_SAME_COLOR_THRESHOLD) + return 0; + } + + + /* See if the capabilities we selected above are supported, with the + given colors. */ + if (test_caps != 0 && + ! tty_capable_p (f, test_caps, fg_tty_color.pixel, bg_tty_color.pixel)) + return 0; + + + /* Hmmm, everything checks out, this terminal must support this face. */ + return 1; +} + + +DEFUN ("display-supports-face-attributes-p", + Fdisplay_supports_face_attributes_p, Sdisplay_supports_face_attributes_p, + 1, 2, 0, + doc: /* Return non-nil if all the face attributes in ATTRIBUTES are supported. +The optional argument DISPLAY can be a display name, a frame, or +nil (meaning the selected frame's display) + +The definition of `supported' is somewhat heuristic, but basically means +that a face containing all the attributes in ATTRIBUTES, when merged +with the default face for display, can be represented in a way that's + + \(1) different in appearance than the default face, and + \(2) `close in spirit' to what the attributes specify, if not exact. + +Point (2) implies that a `:weight black' attribute will be satisfied by +any display that can display bold, and a `:foreground \"yellow\"' as long +as it can display a yellowish color, but `:slant italic' will _not_ be +satisfied by the tty display code's automatic substitution of a `dim' +face for italic. */) + (attributes, display) + Lisp_Object attributes, display; +{ + int supports, i; + Lisp_Object frame; + struct frame *f; + struct face *def_face; + Lisp_Object attrs[LFACE_VECTOR_SIZE]; + + if (noninteractive || !initialized) + /* We may not be able to access low-level face information in batch + mode, or before being dumped, and this function is not going to + be very useful in those cases anyway, so just give up. */ + return Qnil; + + if (NILP (display)) + frame = selected_frame; + else if (FRAMEP (display)) + frame = display; + else + { + /* Find any frame on DISPLAY. */ + Lisp_Object fl_tail; + + frame = Qnil; + for (fl_tail = Vframe_list; CONSP (fl_tail); fl_tail = XCDR (fl_tail)) + { + frame = XCAR (fl_tail); + if (!NILP (Fequal (Fcdr (Fassq (Qdisplay, + XFRAME (frame)->param_alist)), + display))) + break; + } + } + + CHECK_LIVE_FRAME (frame); + f = XFRAME (frame); + + for (i = 0; i < LFACE_VECTOR_SIZE; i++) + attrs[i] = Qunspecified; + merge_face_ref (f, attributes, attrs, 1, 0); + + def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); + if (def_face == NULL) + { + if (! realize_basic_faces (f)) + signal_error ("Cannot realize default face", 0); + def_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); + } + + /* Dispatch to the appropriate handler. */ + if (FRAME_TERMCAP_P (f) || FRAME_MSDOS_P (f)) + supports = tty_supports_face_attributes_p (f, attrs, def_face); +#ifdef HAVE_WINDOW_SYSTEM + else + supports = x_supports_face_attributes_p (f, attrs, def_face); +#endif + + return supports ? Qt : Qnil; +} + + +/*********************************************************************** Font selection ***********************************************************************/ @@ -6968,7 +7152,7 @@ realize_named_face (f, symbol, id) /* Merge SYMBOL's face with the default face. */ get_lface_attributes (f, symbol, symbol_attrs, 1); - merge_face_vectors (f, symbol_attrs, attrs, Qnil); + merge_face_vectors (f, symbol_attrs, attrs, 0); /* Realize the face. */ new_face = realize_face (c, attrs, id); @@ -7441,15 +7625,10 @@ compute_char_face (f, ch, prop) else { Lisp_Object attrs[LFACE_VECTOR_SIZE]; - struct face *face = FACE_FROM_ID (f, DEFAULT_FACE_ID); - bcopy (face->lface, attrs, sizeof attrs); - merge_face_vector_with_property (f, attrs, prop); + struct face *default_face = FACE_FROM_ID (f, DEFAULT_FACE_ID); + bcopy (default_face->lface, attrs, sizeof attrs); + merge_face_ref (f, prop, attrs, 1, 0); face_id = lookup_face (f, attrs); - if (! ASCII_CHAR_P (ch)) - { - face = FACE_FROM_ID (f, face_id); - face_id = FACE_FOR_CHAR (f, face, ch, -1, Qnil); - } } return face_id; @@ -7513,24 +7692,8 @@ face_at_buffer_position (w, pos, region_beg, region_end, /* Look at properties from overlays. */ { int next_overlay; - int len; - - /* First try with room for 40 overlays. */ - len = 40; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (pos, 0, &overlay_vec, &len, - &next_overlay, NULL, 0); - - /* If there are more than 40, make enough space for all, and try - again. */ - if (noverlays > len) - { - len = noverlays; - overlay_vec = (Lisp_Object *) alloca (len * sizeof (Lisp_Object)); - noverlays = overlays_at (pos, 0, &overlay_vec, &len, - &next_overlay, NULL, 0); - } + GET_OVERLAYS_AT (pos, overlay_vec, noverlays, &next_overlay, 0); if (next_overlay < endpos) endpos = next_overlay; } @@ -7550,7 +7713,7 @@ face_at_buffer_position (w, pos, region_beg, region_end, /* Merge in attributes specified via text properties. */ if (!NILP (prop)) - merge_face_vector_with_property (f, attrs, prop); + merge_face_ref (f, prop, attrs, 1, 0); /* Now merge the overlay data. */ noverlays = sort_overlays (overlay_vec, noverlays, w); @@ -7561,7 +7724,7 @@ face_at_buffer_position (w, pos, region_beg, region_end, prop = Foverlay_get (overlay_vec[i], propname); if (!NILP (prop)) - merge_face_vector_with_property (f, attrs, prop); + merge_face_ref (f, prop, attrs, 1, 0); oend = OVERLAY_END (overlay_vec[i]); oendpos = OVERLAY_POSITION (oend); @@ -7572,8 +7735,7 @@ face_at_buffer_position (w, pos, region_beg, region_end, /* If in the region, merge in the region face. */ if (pos >= region_beg && pos < region_end) { - Lisp_Object region_face = lface_from_face_name (f, Qregion, 0); - merge_face_vectors (f, XVECTOR (region_face)->contents, attrs, Qnil); + merge_named_face (f, Qregion, attrs, 0); if (region_end < endpos) endpos = region_end; @@ -7669,16 +7831,13 @@ face_at_string_position (w, string, pos, bufpos, region_beg, /* Merge in attributes specified via text properties. */ if (!NILP (prop)) - merge_face_vector_with_property (f, attrs, prop); + merge_face_ref (f, prop, attrs, 1, 0); /* If in the region, merge in the region face. */ if (bufpos && bufpos >= region_beg && bufpos < region_end) - { - Lisp_Object region_face = lface_from_face_name (f, Qregion, 0); - merge_face_vectors (f, XVECTOR (region_face)->contents, attrs, Qnil); - } + merge_named_face (f, Qregion, attrs, 0); /* Look up a realized face with the given face attributes, or realize a new one for ASCII characters. */ @@ -7946,7 +8105,7 @@ syms_of_xfaces () defsubr (&Sinternal_merge_in_global_face); defsubr (&Sface_font); defsubr (&Sframe_face_alist); - defsubr (&Stty_supports_face_attributes_p); + defsubr (&Sdisplay_supports_face_attributes_p); defsubr (&Scolor_distance); defsubr (&Sinternal_set_font_selection_order); defsubr (&Sinternal_set_alternative_font_family_alist); diff --git a/src/xfns.c b/src/xfns.c index 12df902ae49..cdbce00fe4c 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4425,6 +4425,8 @@ x_create_tip_frame (dpyinfo, parms, text) old_buffer = current_buffer; set_buffer_internal_1 (XBUFFER (buffer)); current_buffer->truncate_lines = Qnil; + specbind (Qinhibit_read_only, Qt); + specbind (Qinhibit_modification_hooks, Qt); Ferase_buffer (); Finsert (1, &text); set_buffer_internal_1 (old_buffer); @@ -5477,6 +5479,11 @@ Chinese, Japanese, and Korean. */); #endif /* USE_X_TOOLKIT */ #ifdef USE_GTK + /* Provide x-toolkit also for GTK. Internally GTK does not use Xt so it + is not an X toolkit in that sense (USE_X_TOOLKIT is not defined). + But for a user it is a toolkit for X, and indeed, configure + accepts --with-x-toolkit=gtk. */ + Fprovide (intern ("x-toolkit"), Qnil); Fprovide (intern ("gtk"), Qnil); DEFVAR_LISP ("gtk-version-string", &Vgtk_version_string, diff --git a/src/xselect.c b/src/xselect.c index b4d61f7c9a9..7be238651a0 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -1,5 +1,5 @@ /* X Selection processing for Emacs. - Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003 + Copyright (C) 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2004 Free Software Foundation. This file is part of GNU Emacs. @@ -2576,7 +2576,7 @@ are ignored. */) if (event.xclient.format != 8 && event.xclient.format != 16 && event.xclient.format != 32) error ("FORMAT must be one of 8, 16 or 32"); - + if (FRAMEP (dest) || NILP (dest)) { struct frame *fdest = check_x_frame (dest); diff --git a/src/xsmfns.c b/src/xsmfns.c index e486e5c6e32..9a6a7ccefb8 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -1,6 +1,6 @@ /* Session management module for systems which understand the X Session management protocol. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. diff --git a/src/xterm.c b/src/xterm.c index ae4d4063be9..3e606e2560a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1,5 +1,5 @@ /* X Communication module for terminals which understand the X protocol. - Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000, 01, 02, 2003 + Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999, 2000,01,02,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -983,7 +983,8 @@ static void x_draw_image_foreground_1 P_ ((struct glyph_string *, Pixmap)); static void x_clear_glyph_string_rect P_ ((struct glyph_string *, int, int, int, int)); static void x_draw_relief_rect P_ ((struct frame *, int, int, int, int, - int, int, int, int, XRectangle *)); + int, int, int, int, int, int, + XRectangle *)); static void x_draw_box_rect P_ ((struct glyph_string *, int, int, int, int, int, int, int, XRectangle *)); @@ -2025,9 +2026,10 @@ x_setup_relief_colors (s) static void x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, - raised_p, left_p, right_p, clip_rect) + raised_p, top_p, bot_p, left_p, right_p, clip_rect) struct frame *f; - int left_x, top_y, right_x, bottom_y, width, left_p, right_p, raised_p; + int left_x, top_y, right_x, bottom_y, width; + int top_p, bot_p, left_p, right_p, raised_p; XRectangle *clip_rect; { Display *dpy = FRAME_X_DISPLAY (f); @@ -2042,10 +2044,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); /* Top. */ - for (i = 0; i < width; ++i) - XDrawLine (dpy, window, gc, - left_x + i * left_p, top_y + i, - right_x + 1 - i * right_p, top_y + i); + if (top_p) + for (i = 0; i < width; ++i) + XDrawLine (dpy, window, gc, + left_x + i * left_p, top_y + i, + right_x + 1 - i * right_p, top_y + i); /* Left. */ if (left_p) @@ -2061,10 +2064,11 @@ x_draw_relief_rect (f, left_x, top_y, right_x, bottom_y, width, XSetClipRectangles (dpy, gc, 0, 0, clip_rect, 1, Unsorted); /* Bottom. */ - for (i = 0; i < width; ++i) - XDrawLine (dpy, window, gc, - left_x + i * left_p, bottom_y - i, - right_x + 1 - i * right_p, bottom_y - i); + if (bot_p) + for (i = 0; i < width; ++i) + XDrawLine (dpy, window, gc, + left_x + i * left_p, bottom_y - i, + right_x + 1 - i * right_p, bottom_y - i); /* Right. */ if (right_p) @@ -2172,7 +2176,7 @@ x_draw_glyph_string_box (s) { x_setup_relief_colors (s); x_draw_relief_rect (s->f, left_x, top_y, right_x, bottom_y, - width, raised_p, left_p, right_p, &clip_rect); + width, raised_p, 1, 1, left_p, right_p, &clip_rect); } } @@ -2183,21 +2187,22 @@ static void x_draw_image_foreground (s) struct glyph_string *s; { - int x; - int y = s->ybase - image_ascent (s->img, s->face); + int x = s->x; + int y = s->ybase - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = s->x + abs (s->face->box_line_width); - else - x = s->x; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->img->pixmap) { @@ -2222,11 +2227,12 @@ x_draw_image_foreground (s) get_glyph_string_clip_rect (s, &clip_rect); image_rect.x = x; image_rect.y = y; - image_rect.width = s->img->width; - image_rect.height = s->img->height; + image_rect.width = s->slice.width; + image_rect.height = s->slice.height; if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) XCopyArea (s->display, s->img->pixmap, s->window, s->gc, - r.x - x, r.y - y, r.width, r.height, r.x, r.y); + s->slice.x + r.x - x, s->slice.y + r.y - y, + r.width, r.height, r.x, r.y); } else { @@ -2235,11 +2241,12 @@ x_draw_image_foreground (s) get_glyph_string_clip_rect (s, &clip_rect); image_rect.x = x; image_rect.y = y; - image_rect.width = s->img->width; - image_rect.height = s->img->height; + image_rect.width = s->slice.width; + image_rect.height = s->slice.height; if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) XCopyArea (s->display, s->img->pixmap, s->window, s->gc, - r.x - x, r.y - y, r.width, r.height, r.x, r.y); + s->slice.x + r.x - x, s->slice.y + r.y - y, + r.width, r.height, r.x, r.y); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will @@ -2251,15 +2258,17 @@ x_draw_image_foreground (s) { int r = s->img->relief; if (r < 0) r = -r; - XDrawRectangle (s->display, s->window, s->gc, x - r, y - r, - s->img->width + r*2 - 1, s->img->height + r*2 - 1); + XDrawRectangle (s->display, s->window, s->gc, + x - r, y - r, + s->slice.width + r*2 - 1, + s->slice.height + r*2 - 1); } } } else /* Draw a rectangle if image could not be loaded. */ XDrawRectangle (s->display, s->window, s->gc, x, y, - s->img->width - 1, s->img->height - 1); + s->slice.width - 1, s->slice.height - 1); } @@ -2271,21 +2280,22 @@ x_draw_image_relief (s) { int x0, y0, x1, y1, thick, raised_p; XRectangle r; - int x; - int y = s->ybase - image_ascent (s->img, s->face); + int x = s->x; + int y = s->ybase - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = s->x + abs (s->face->box_line_width); - else - x = s->x; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->hl == DRAW_IMAGE_SUNKEN || s->hl == DRAW_IMAGE_RAISED) @@ -2301,12 +2311,17 @@ x_draw_image_relief (s) x0 = x - thick; y0 = y - thick; - x1 = x + s->img->width + thick - 1; - y1 = y + s->img->height + thick - 1; + x1 = x + s->slice.width + thick - 1; + y1 = y + s->slice.height + thick - 1; x_setup_relief_colors (s); get_glyph_string_clip_rect (s, &r); - x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, 1, 1, &r); + x_draw_relief_rect (s->f, x0, y0, x1, y1, thick, raised_p, + s->slice.y == 0, + s->slice.y + s->slice.height == s->img->height, + s->slice.x == 0, + s->slice.x + s->slice.width == s->img->width, + &r); } @@ -2317,21 +2332,22 @@ x_draw_image_foreground_1 (s, pixmap) struct glyph_string *s; Pixmap pixmap; { - int x; - int y = s->ybase - s->y - image_ascent (s->img, s->face); + int x = 0; + int y = s->ybase - s->y - image_ascent (s->img, s->face, &s->slice); /* If first glyph of S has a left box line, start drawing it to the right of that line. */ if (s->face->box != FACE_NO_BOX - && s->first_glyph->left_box_line_p) - x = abs (s->face->box_line_width); - else - x = 0; + && s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += abs (s->face->box_line_width); /* If there is a margin around the image, adjust x- and y-position by that margin. */ - x += s->img->hmargin; - y += s->img->vmargin; + if (s->slice.x == 0) + x += s->img->hmargin; + if (s->slice.y == 0) + y += s->img->vmargin; if (s->img->pixmap) { @@ -2347,19 +2363,21 @@ x_draw_image_foreground_1 (s, pixmap) XGCValues xgcv; xgcv.clip_mask = s->img->mask; - xgcv.clip_x_origin = x; - xgcv.clip_y_origin = y; + xgcv.clip_x_origin = x - s->slice.x; + xgcv.clip_y_origin = y - s->slice.y; xgcv.function = GXcopy; XChangeGC (s->display, s->gc, mask, &xgcv); XCopyArea (s->display, s->img->pixmap, pixmap, s->gc, - 0, 0, s->img->width, s->img->height, x, y); + s->slice.x, s->slice.y, + s->slice.width, s->slice.height, x, y); XSetClipMask (s->display, s->gc, None); } else { XCopyArea (s->display, s->img->pixmap, pixmap, s->gc, - 0, 0, s->img->width, s->img->height, x, y); + s->slice.x, s->slice.y, + s->slice.width, s->slice.height, x, y); /* When the image has a mask, we can expect that at least part of a mouse highlight or a block cursor will @@ -2372,14 +2390,15 @@ x_draw_image_foreground_1 (s, pixmap) int r = s->img->relief; if (r < 0) r = -r; XDrawRectangle (s->display, s->window, s->gc, x - r, y - r, - s->img->width + r*2 - 1, s->img->height + r*2 - 1); + s->slice.width + r*2 - 1, + s->slice.height + r*2 - 1); } } } else /* Draw a rectangle if image could not be loaded. */ XDrawRectangle (s->display, pixmap, s->gc, x, y, - s->img->width - 1, s->img->height - 1); + s->slice.width - 1, s->slice.height - 1); } @@ -2421,33 +2440,28 @@ static void x_draw_image_glyph_string (s) struct glyph_string *s; { - int x, y; int box_line_hwidth = abs (s->face->box_line_width); int box_line_vwidth = max (s->face->box_line_width, 0); int height; Pixmap pixmap = None; - height = s->height - 2 * box_line_vwidth; - + height = s->height; + if (s->slice.y == 0) + height -= box_line_vwidth; + if (s->slice.y + s->slice.height >= s->img->height) + height -= box_line_vwidth; /* Fill background with face under the image. Do it only if row is taller than image or if image has a clip mask to reduce flickering. */ s->stippled_p = s->face->stipple != 0; - if (height > s->img->height + if (height > s->slice.height || s->img->hmargin || s->img->vmargin || s->img->mask || s->img->pixmap == 0 || s->width != s->background_width) { - if (box_line_hwidth && s->first_glyph->left_box_line_p) - x = s->x + box_line_hwidth; - else - x = s->x; - - y = s->y + box_line_vwidth; - if (s->img->mask) { /* Create a pixmap as large as the glyph string. Fill it @@ -2486,7 +2500,19 @@ x_draw_image_glyph_string (s) } } else - x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); + { + int x = s->x; + int y = s->y; + + if (s->first_glyph->left_box_line_p + && s->slice.x == 0) + x += box_line_hwidth; + + if (s->slice.y == 0) + y += box_line_vwidth; + + x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); + } s->background_filled_p = 1; } @@ -7239,7 +7265,8 @@ x_draw_hollow_cursor (w, row) /* Compute the proper height and ascent of the rectangle, based on the actual glyph. Using the full height of the row looks bad when there are tall images on that row. */ - h = max (FRAME_LINE_HEIGHT (f), cursor_glyph->ascent + cursor_glyph->descent); + h = max (min (FRAME_LINE_HEIGHT (f), row->height), + cursor_glyph->ascent + cursor_glyph->descent); if (h < row->height) y += row->ascent /* - w->phys_cursor_ascent */ + cursor_glyph->descent - h; h--; diff --git a/src/xterm.h b/src/xterm.h index fe0449a3bc5..d87135e8bf6 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1,5 +1,5 @@ /* Definitions and headers for communication with X protocol. - Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2001 + Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000,01,02,03,04 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -167,7 +167,7 @@ struct x_display_info /* The colormap being used. */ Colormap cmap; - /* Number of panes on this screen. */ + /* Number of planes on this screen. */ int n_planes; /* Dimensions of this screen. */ @@ -941,7 +941,6 @@ Lisp_Object display_x_get_resource P_ ((struct x_display_info *, struct frame *check_x_frame P_ ((Lisp_Object)); EXFUN (Fx_display_color_p, 1); EXFUN (Fx_display_grayscale_p, 1); -int image_ascent P_ ((struct image *, struct face *)); extern void x_free_gcs P_ ((struct frame *)); /* From xrdb.c. */ |