summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2012-10-22 16:53:10 (GMT)
committer Jaromil <jaromil@dyne.org>2012-10-22 16:53:10 (GMT)
commitfe4429197132fa318da0a0800d5194227831a0c0 (patch)
tree01e2d0f44dd20b54f08b5669bee91800fc261cbe
parent95d753fba0c47dafd73fab6e278a48cc9c0ab1ed (diff)
usability updates for osx and new modes: nxhtml for php, css etc, lua and freemind export, also updated org-mode to latest version
-rw-r--r--elisp/autoload.el13
-rw-r--r--elisp/autorg.el133
-rw-r--r--elisp/freemind.el1007
-rw-r--r--elisp/lua-mode.el1665
-rw-r--r--elisp/nxhtml/alts/find-recursive-orig.el137
-rw-r--r--elisp/nxhtml/alts/javascript-mozlab.el712
-rw-r--r--elisp/nxhtml/alts/smarty-mode-vdebout.el2715
-rw-r--r--elisp/nxhtml/autostart.el194
-rw-r--r--elisp/nxhtml/autostart22.el71
-rw-r--r--elisp/nxhtml/emacs22.cmd1
-rw-r--r--elisp/nxhtml/etc/img/pause/pause.jpgbin0 -> 25849 bytes
-rw-r--r--elisp/nxhtml/etc/img/pause/pause2.jpgbin0 -> 26756 bytes
-rw-r--r--elisp/nxhtml/etc/schema/genshi-old.rnc27
-rw-r--r--elisp/nxhtml/etc/schema/genshi-schemas.xml3
-rw-r--r--elisp/nxhtml/etc/schema/genshi.rnc84
-rw-r--r--elisp/nxhtml/etc/schema/mjt.rnc74
-rw-r--r--elisp/nxhtml/etc/schema/nxml-erb.patch37
-rw-r--r--elisp/nxhtml/etc/schema/old-genshi.rnc31
-rw-r--r--elisp/nxhtml/etc/schema/old-qtmstr-xhtml.rnc61
-rw-r--r--elisp/nxhtml/etc/schema/old-xinclude.rnc11
-rw-r--r--elisp/nxhtml/etc/schema/qtmstr-xhtml-old.rnc58
-rw-r--r--elisp/nxhtml/etc/schema/qtmstr-xhtml.rnc66
-rw-r--r--elisp/nxhtml/etc/schema/schema-path-patch.el95
-rw-r--r--elisp/nxhtml/etc/schema/xinclude.rnc35
-rw-r--r--elisp/nxhtml/etc/templates/rollover-2v.css25
-rw-r--r--elisp/nxhtml/etc/viper-tut/0intro59
-rw-r--r--elisp/nxhtml/etc/viper-tut/1basics187
-rw-r--r--elisp/nxhtml/etc/viper-tut/2moving269
-rw-r--r--elisp/nxhtml/etc/viper-tut/3cutpaste318
-rw-r--r--elisp/nxhtml/etc/viper-tut/4inserting180
-rw-r--r--elisp/nxhtml/etc/viper-tut/5tricks229
-rw-r--r--elisp/nxhtml/etc/viper-tut/README49
-rw-r--r--elisp/nxhtml/etc/viper-tut/outline131
-rw-r--r--elisp/nxhtml/nxhtml-base.el150
-rw-r--r--elisp/nxhtml/nxhtml-loaddefs.el4490
-rw-r--r--elisp/nxhtml/nxhtml-web-vcs.el689
-rw-r--r--elisp/nxhtml/nxhtml/ChangeLog17
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/Las_Medulas.jpgbin0 -> 40927 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/Toco_toucan.jpgbin0 -> 17430 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/bacchante2.jpgbin0 -> 67205 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/butterflies.jpgbin0 -> 14954 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/butterflies.pngbin0 -> 65893 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/butterflies.xcfbin0 -> 87456 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/continue-play.jpgbin0 -> 44390 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/divine2.jpgbin0 -> 69985 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/edit-part.pngbin0 -> 23263 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/editing-web-files.pngbin0 -> 7237 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/editing-web-files.xcfbin0 -> 15415 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/emacs-style-completion.pngbin0 -> 23199 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/emacsP.pngbin0 -> 1882 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/emacsP16.pngbin0 -> 694 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/embedded-css.pngbin0 -> 14019 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/embedded-xhtml.pngbin0 -> 17326 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/foldit-closed.pngbin0 -> 7894 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/foldit-temp-opened.pngbin0 -> 17590 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/fun-brain-2.pngbin0 -> 40042 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/getitbuttons-1.pngbin0 -> 1931 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/getitbuttons-1.xcfbin0 -> 5446 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/getitbuttons-2.pngbin0 -> 1276 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/getitbuttons.pngbin0 -> 1324 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/getitbuttons.xcfbin0 -> 5988 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/giraffe.jpgbin0 -> 20966 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/healthy_feet2.jpgbin0 -> 24042 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/itsalltext-pref.pngbin0 -> 14720 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/links-appmenu.pngbin0 -> 7124 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/nxml-where.pngbin0 -> 17217 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/php-in-nxhtml-2.pngbin0 -> 23203 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/php-in-nxhtml.pngbin0 -> 22179 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/php-in-php.pngbin0 -> 21113 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/php-in-xhtml.pngbin0 -> 21510 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/popup-compl.pngbin0 -> 8709 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/raindrops2.jpgbin0 -> 36480 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/region-selected-after.pngbin0 -> 3122 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/region-selected-completion.pngbin0 -> 27193 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/region-selected.pngbin0 -> 3662 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/rembrandt-self-portrait.jpgbin0 -> 52583 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/style-in-nxhtml.pngbin0 -> 19275 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/use-nXhtml-trans.pngbin0 -> 1485 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/use-nXhtml-trans2.pngbin0 -> 1520 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/use-nXhtml.pngbin0 -> 1347 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/use-nXhtml.xcfbin0 -> 3484 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/validation-error.pngbin0 -> 2293 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/volga.jpgbin0 -> 34027 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/img/xml-validation-header.pngbin0 -> 23172 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/carrow1.gifbin0 -> 243 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/carrow2.gifbin0 -> 241 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/fleche1.gifbin0 -> 1035 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/fleche1.pngbin0 -> 2626 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/fleche2.gifbin0 -> 974 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/fleche2.pngbin0 -> 2889 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/loading-bar-black.gifbin0 -> 10814 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/open.gifbin0 -> 489 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/img/open.pngbin0 -> 1258 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/jd.gallery.css238
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/css/layout.css91
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/scripts/jd.gallery.js449
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/scripts/mootools.js2
-rw-r--r--elisp/nxhtml/nxhtml/doc/js/smoothgallery/scripts/mootools.uncompressed.js4078
-rw-r--r--elisp/nxhtml/nxhtml/doc/nxhtml.css171
-rw-r--r--elisp/nxhtml/nxhtml/doc/wd/grapes/grapes.css107
-rw-r--r--elisp/nxhtml/nxhtml/doc/wd/grapes/images/bkgrnd.gifbin0 -> 974 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/wd/grapes/images/grapes.jpgbin0 -> 24419 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/wd/grapes/images/quote.gifbin0 -> 643 bytes
-rw-r--r--elisp/nxhtml/nxhtml/doc/wd/grapes/nxhtml-grapes.css252
-rw-r--r--elisp/nxhtml/nxhtml/html-chklnk.el168
-rw-r--r--elisp/nxhtml/nxhtml/html-chklnk/PerlLib/HTML/LinkWalker.pm774
-rw-r--r--elisp/nxhtml/nxhtml/html-chklnk/PerlLib/HTML/ParserTagEnd.pm448
-rw-r--r--elisp/nxhtml/nxhtml/html-chklnk/PerlLib/PathSubs.pm207
-rw-r--r--elisp/nxhtml/nxhtml/html-chklnk/link_checker.pl328
-rw-r--r--elisp/nxhtml/nxhtml/html-imenu.el101
-rw-r--r--elisp/nxhtml/nxhtml/html-move.el251
-rw-r--r--elisp/nxhtml/nxhtml/html-pagetoc.el336
-rw-r--r--elisp/nxhtml/nxhtml/html-quote.el71
-rw-r--r--elisp/nxhtml/nxhtml/html-site.el801
-rw-r--r--elisp/nxhtml/nxhtml/html-toc.el363
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/html-toc-template.css141
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/html-toc.css84
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/html-toc.js361
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/blank12.gifbin0 -> 825 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/down.gifbin0 -> 853 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/freeCont.gifbin0 -> 913 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/gnu-m-x-160.pngbin0 -> 1957 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/gnu-m-x-160.xcfbin0 -> 22466 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/hideCont.gifbin0 -> 917 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/nailCont.gifbin0 -> 917 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/nosearch.gifbin0 -> 1100 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/right.gifbin0 -> 857 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/search.gifbin0 -> 1118 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-toc/html-toc/img/showCont.gifbin0 -> 909 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-upl.el329
-rw-r--r--elisp/nxhtml/nxhtml/html-upl/COPYING340
-rw-r--r--elisp/nxhtml/nxhtml/html-upl/Changes115
-rw-r--r--elisp/nxhtml/nxhtml/html-upl/README111
-rw-r--r--elisp/nxhtml/nxhtml/html-upl/TODO2
-rw-r--r--elisp/nxhtml/nxhtml/html-upl/ftpsync.pl700
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc.el200
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/PerlLib/PathSubs.pm207
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/PerlLib/html_tags.pm127
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/html-wtoc-template.css141
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/html-wtoc.css84
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/html-wtoc.js361
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/html-wtoc.pl1395
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/blank12.gifbin0 -> 825 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/down.gifbin0 -> 853 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/freeCont.gifbin0 -> 913 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.pngbin0 -> 1957 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/gnu-m-x-160.xcfbin0 -> 22466 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/hideCont.gifbin0 -> 917 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/nailCont.gifbin0 -> 917 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/nosearch.gifbin0 -> 1100 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.gifbin0 -> 3202 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/CompFaceLogoTemp4.pngbin0 -> 6710 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/blue_left_top.pngbin0 -> 381 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/close-cross.gifbin0 -> 866 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue.pngbin0 -> 3763 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/lbiinfo_and_blue1.pngbin0 -> 4012 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1.gifbin0 -> 3732 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/lbinfo_col1_30.gifbin0 -> 1299 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/other/up.gifbin0 -> 851 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/right.gifbin0 -> 857 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/search.gifbin0 -> 1118 bytes
-rw-r--r--elisp/nxhtml/nxhtml/html-wtoc/img/showCont.gifbin0 -> 909 bytes
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml-autoload.el147
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml-bug.el332
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml-menu.el1658
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml-mode.el2796
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml-mumamo.el365
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml-strval.el210
-rw-r--r--elisp/nxhtml/nxhtml/nxhtml.el339
-rw-r--r--elisp/nxhtml/nxhtml/nxhtmljs.el240
-rw-r--r--elisp/nxhtml/nxhtml/nxml-where.el734
-rw-r--r--elisp/nxhtml/nxhtml/outline-magic.el588
-rw-r--r--elisp/nxhtml/nxhtml/rngalt.el828
-rw-r--r--elisp/nxhtml/nxhtml/tidy-xhtml.el2921
-rw-r--r--elisp/nxhtml/nxhtml/wtest.el56
-rw-r--r--elisp/nxhtml/nxhtml/xhtml-help.el373
-rw-r--r--elisp/nxhtml/nxhtmlmaint.el439
-rw-r--r--elisp/nxhtml/related/csharp-mode.el1977
-rw-r--r--elisp/nxhtml/related/django.el203
-rw-r--r--elisp/nxhtml/related/env.js695
-rw-r--r--elisp/nxhtml/related/flymake-css.el161
-rw-r--r--elisp/nxhtml/related/flymake-helpers.el78
-rw-r--r--elisp/nxhtml/related/flymake-java-1.el109
-rw-r--r--elisp/nxhtml/related/flymake-js.el234
-rw-r--r--elisp/nxhtml/related/flymakemsg.el144
-rw-r--r--elisp/nxhtml/related/flymu.el157
-rw-r--r--elisp/nxhtml/related/iss-mode.el205
-rw-r--r--elisp/nxhtml/related/iss-mumamo.el70
-rw-r--r--elisp/nxhtml/related/js_temp.js4
-rw-r--r--elisp/nxhtml/related/jslint.js523
-rw-r--r--elisp/nxhtml/related/moz.el289
-rw-r--r--elisp/nxhtml/related/mozadd.el369
-rw-r--r--elisp/nxhtml/related/php-imenu.el174
-rw-r--r--elisp/nxhtml/related/php-mode.el1231
-rw-r--r--elisp/nxhtml/related/rhino.js14
-rw-r--r--elisp/nxhtml/related/smarty-mode.el2753
-rw-r--r--elisp/nxhtml/related/tt-mode.el124
-rw-r--r--elisp/nxhtml/related/visual-basic-mode.el1263
-rw-r--r--elisp/nxhtml/related/wikipedia-mode.el2296
-rw-r--r--elisp/nxhtml/tests/angus77-setup-jde.el90
-rw-r--r--elisp/nxhtml/tests/emacstest-suites.el102
-rw-r--r--elisp/nxhtml/tests/ert.el2418
-rw-r--r--elisp/nxhtml/tests/ert2.el268
-rw-r--r--elisp/nxhtml/tests/hfy-test.el102
-rw-r--r--elisp/nxhtml/tests/in/400415-index.phtml43
-rw-r--r--elisp/nxhtml/tests/in/asp.asp40
-rw-r--r--elisp/nxhtml/tests/in/bastien-test.mm38
-rw-r--r--elisp/nxhtml/tests/in/blorgit.rb313
-rw-r--r--elisp/nxhtml/tests/in/bug-1908494.php6
-rw-r--r--elisp/nxhtml/tests/in/bug-2010-02-17-delgado.mm10
-rw-r--r--elisp/nxhtml/tests/in/bug-2010-02-17-delgado.org3
-rw-r--r--elisp/nxhtml/tests/in/bug-290364.php66
-rw-r--r--elisp/nxhtml/tests/in/bug-311641.php7
-rw-r--r--elisp/nxhtml/tests/in/bug-381191-dh-test.el23
-rw-r--r--elisp/nxhtml/tests/in/bug-381191-dh-test.php6
-rw-r--r--elisp/nxhtml/tests/in/bug-johan-2010-02-12.rhtml22
-rw-r--r--elisp/nxhtml/tests/in/bug-johan-2010-02-16.html.haml34
-rw-r--r--elisp/nxhtml/tests/in/bug-johan-2010-02-17-2.erb14
-rw-r--r--elisp/nxhtml/tests/in/bug-johan-2010-02-17.erb4
-rw-r--r--elisp/nxhtml/tests/in/bug261792.ghtml7
-rw-r--r--elisp/nxhtml/tests/in/bug271497.el14
-rw-r--r--elisp/nxhtml/tests/in/bug272871.php7
-rw-r--r--elisp/nxhtml/tests/in/bug354363-index.php38
-rw-r--r--elisp/nxhtml/tests/in/bug354363-test.php3
-rw-r--r--elisp/nxhtml/tests/in/bug370417.php10
-rw-r--r--elisp/nxhtml/tests/in/bug381979-2.php6
-rw-r--r--elisp/nxhtml/tests/in/bug381979-svnlib.inc744
-rw-r--r--elisp/nxhtml/tests/in/bug388729-nxhtml_test.php2
-rw-r--r--elisp/nxhtml/tests/in/bug393137-new.html.erb18
-rw-r--r--elisp/nxhtml/tests/in/bug400415-foo.php9
-rw-r--r--elisp/nxhtml/tests/in/bug400415-foo2.php9
-rw-r--r--elisp/nxhtml/tests/in/bug416505-Body.mxml85
-rw-r--r--elisp/nxhtml/tests/in/bug416505-nxhtml.el45
-rw-r--r--elisp/nxhtml/tests/in/bug452676.php12
-rw-r--r--elisp/nxhtml/tests/in/bug463136.php5
-rw-r--r--elisp/nxhtml/tests/in/bug492366-test.php21
-rw-r--r--elisp/nxhtml/tests/in/bug495770-heredoc_demo.pl95
-rw-r--r--elisp/nxhtml/tests/in/bug505554-sample.html.erb11
-rw-r--r--elisp/nxhtml/tests/in/bug509586.ghtml16
-rw-r--r--elisp/nxhtml/tests/in/bug523065.jsp9
-rw-r--r--elisp/nxhtml/tests/in/bug523065.php6
-rw-r--r--elisp/nxhtml/tests/in/bug529133-statemachine.py1491
-rw-r--r--elisp/nxhtml/tests/in/bug531328.rhtml1
-rw-r--r--elisp/nxhtml/tests/in/bug532500.rhtml7
-rw-r--r--elisp/nxhtml/tests/in/bug532759.djhtml17
-rw-r--r--elisp/nxhtml/tests/in/bug552789-loremipsum.php10
-rw-r--r--elisp/nxhtml/tests/in/bug552789.php20
-rw-r--r--elisp/nxhtml/tests/in/bug556832-error-test.py23
-rw-r--r--elisp/nxhtml/tests/in/bug557700-2.erb5
-rw-r--r--elisp/nxhtml/tests/in/bug557700-3.erb3
-rw-r--r--elisp/nxhtml/tests/in/bug557700-4.erb11
-rw-r--r--elisp/nxhtml/tests/in/bug557700-5.erb4
-rw-r--r--elisp/nxhtml/tests/in/bug557700-6.erb11
-rw-r--r--elisp/nxhtml/tests/in/bug557700.erb3
-rw-r--r--elisp/nxhtml/tests/in/bug559772-TextHelper.php205
-rw-r--r--elisp/nxhtml/tests/in/bug565595.mako12
-rw-r--r--elisp/nxhtml/tests/in/bug568178.pl4
-rw-r--r--elisp/nxhtml/tests/in/ch-2008-07-25-test.html.erb37
-rw-r--r--elisp/nxhtml/tests/in/chunks-in-chunks1.php19
-rw-r--r--elisp/nxhtml/tests/in/cr-lf.el2
-rw-r--r--elisp/nxhtml/tests/in/cvd-080805-ac.php21
-rw-r--r--elisp/nxhtml/tests/in/cvd-080805-cc.php18
-rw-r--r--elisp/nxhtml/tests/in/drechsler-080517-simple.xml3
-rw-r--r--elisp/nxhtml/tests/in/el-070424-duh.xml6
-rw-r--r--elisp/nxhtml/tests/in/el-070602-index.php54
-rw-r--r--elisp/nxhtml/tests/in/el-070604.php11
-rw-r--r--elisp/nxhtml/tests/in/el-070722-comment-error.php6
-rw-r--r--elisp/nxhtml/tests/in/el-070722-index-2.el7
-rw-r--r--elisp/nxhtml/tests/in/el-070722-index-2.php48
-rw-r--r--elisp/nxhtml/tests/in/el-070722-index-noheader.php48
-rw-r--r--elisp/nxhtml/tests/in/el-070722-index.php55
-rw-r--r--elisp/nxhtml/tests/in/emacswiki-080119.php15
-rw-r--r--elisp/nxhtml/tests/in/emacswiki-erb-bug.el36
-rw-r--r--elisp/nxhtml/tests/in/eval-in-html.elbin0 -> 22420 bytes
-rw-r--r--elisp/nxhtml/tests/in/fontif-err.php339
-rw-r--r--elisp/nxhtml/tests/in/genshi-HelloWorldPage.ghtml10
-rw-r--r--elisp/nxhtml/tests/in/genshi.ghtml23
-rw-r--r--elisp/nxhtml/tests/in/goesele-091110-testnote-orig.mm16
-rw-r--r--elisp/nxhtml/tests/in/goesele-091110-testnote-temp.mm16
-rw-r--r--elisp/nxhtml/tests/in/goesele-091110-testnote.mm16
-rw-r--r--elisp/nxhtml/tests/in/goesele-091110-testnote.mm.org5
-rw-r--r--elisp/nxhtml/tests/in/goesele-091110-testnote.mm.org.mm16
-rw-r--r--elisp/nxhtml/tests/in/haml1.haml132
-rw-r--r--elisp/nxhtml/tests/in/heredoc.php61
-rw-r--r--elisp/nxhtml/tests/in/heredoc.pl11
-rw-r--r--elisp/nxhtml/tests/in/heredoc.py11
-rw-r--r--elisp/nxhtml/tests/in/heredoc.rb8
-rw-r--r--elisp/nxhtml/tests/in/hg-2008-03-22-ajax.xhtml38
-rw-r--r--elisp/nxhtml/tests/in/hq-070510-test.php12
-rw-r--r--elisp/nxhtml/tests/in/hq-070524-bug.php10
-rw-r--r--elisp/nxhtml/tests/in/hq-071006-index.php38
-rw-r--r--elisp/nxhtml/tests/in/ind-0-error.php28
-rw-r--r--elisp/nxhtml/tests/in/java.java13
-rw-r--r--elisp/nxhtml/tests/in/jcl-080802-index.html.erb16
-rw-r--r--elisp/nxhtml/tests/in/jcl-080802-messages_controller.rb57
-rw-r--r--elisp/nxhtml/tests/in/josh-091115-cancer_summary.xsl490
-rw-r--r--elisp/nxhtml/tests/in/jump-parse.rhtml9
-rw-r--r--elisp/nxhtml/tests/in/kp-080604.php4
-rw-r--r--elisp/nxhtml/tests/in/kubica-080516-freezing.css36
-rw-r--r--elisp/nxhtml/tests/in/kwalo-080930.php23
-rw-r--r--elisp/nxhtml/tests/in/latex-clojre-mumamo-test.lclj17
-rw-r--r--elisp/nxhtml/tests/in/markdown.markdown16
-rw-r--r--elisp/nxhtml/tests/in/mason.mason46
-rw-r--r--elisp/nxhtml/tests/in/mumamo-and-org.org20
-rw-r--r--elisp/nxhtml/tests/in/mumamo-and-org.org.mm45
-rw-r--r--elisp/nxhtml/tests/in/no-php-end-2.php18
-rw-r--r--elisp/nxhtml/tests/in/no-php-end-3.php18
-rw-r--r--elisp/nxhtml/tests/in/no-php-end-4.php18
-rw-r--r--elisp/nxhtml/tests/in/no-php-end.php4
-rw-r--r--elisp/nxhtml/tests/in/noweb1.now38
-rw-r--r--elisp/nxhtml/tests/in/nutshell.mako27
-rw-r--r--elisp/nxhtml/tests/in/nxml-indent.el1
-rw-r--r--elisp/nxhtml/tests/in/only-php.php10
-rw-r--r--elisp/nxhtml/tests/in/pavel-071116.djhtml31
-rw-r--r--elisp/nxhtml/tests/in/php-parseable.php11
-rw-r--r--elisp/nxhtml/tests/in/rgr-030809-indexbody.php57
-rw-r--r--elisp/nxhtml/tests/in/rgr-080307.php2
-rw-r--r--elisp/nxhtml/tests/in/rgr-080308-header-2.php56
-rw-r--r--elisp/nxhtml/tests/in/rgr-080308-header.php56
-rw-r--r--elisp/nxhtml/tests/in/rgr-080308-indexbody.php57
-rw-r--r--elisp/nxhtml/tests/in/rr-090524-header.php76
-rw-r--r--elisp/nxhtml/tests/in/rr-090923-header.php101
-rw-r--r--elisp/nxhtml/tests/in/rr-address-090304.php4
-rw-r--r--elisp/nxhtml/tests/in/rr-address-nxhtml.errbin0 -> 6647 bytes
-rw-r--r--elisp/nxhtml/tests/in/rr-min8.php6
-rw-r--r--elisp/nxhtml/tests/in/ryan-091104-literal.tpl148
-rw-r--r--elisp/nxhtml/tests/in/ryan-091111-wrong-side.tpl18
-rw-r--r--elisp/nxhtml/tests/in/schemas.xml3
-rw-r--r--elisp/nxhtml/tests/in/sd-080803-test.php14
-rw-r--r--elisp/nxhtml/tests/in/senny-091118.htm247
-rw-r--r--elisp/nxhtml/tests/in/sheit-2007-12-26.php9
-rw-r--r--elisp/nxhtml/tests/in/short-tags.php3
-rw-r--r--elisp/nxhtml/tests/in/ssjs.ssjs9
-rw-r--r--elisp/nxhtml/tests/in/string-bug.php1
-rw-r--r--elisp/nxhtml/tests/in/svg.svg1
-rw-r--r--elisp/nxhtml/tests/in/temp2.php48
-rw-r--r--elisp/nxhtml/tests/in/test-only-nxml.my-xhtml38
-rw-r--r--elisp/nxhtml/tests/in/test.tt11
-rw-r--r--elisp/nxhtml/tests/in/tut1.jsp5
-rw-r--r--elisp/nxhtml/tests/in/utf8-problem.el7
-rw-r--r--elisp/nxhtml/tests/in/wiki-080606-indent.php18
-rw-r--r--elisp/nxhtml/tests/in/wiki-080708-ind-problem.rhtml5
-rw-r--r--elisp/nxhtml/tests/in/wiki-2008-01-30.rhtml1
-rw-r--r--elisp/nxhtml/tests/in/wiki-comments.php20
-rw-r--r--elisp/nxhtml/tests/in/xml-as-string.php54
-rw-r--r--elisp/nxhtml/tests/in/ygne-2008-02-07-hotproperty.html.php1967
-rw-r--r--elisp/nxhtml/tests/in/zn-090529-doxysample.php37
-rw-r--r--elisp/nxhtml/tests/inemacs/bug1013.el35
-rw-r--r--elisp/nxhtml/tests/mumamo-test.el299
-rw-r--r--elisp/nxhtml/tests/nxhtmltest-Q.el114
-rw-r--r--elisp/nxhtml/tests/nxhtmltest-helpers.el156
-rw-r--r--elisp/nxhtml/tests/nxhtmltest-suites.el632
-rw-r--r--elisp/nxhtml/util/anchored-transpose.el305
-rw-r--r--elisp/nxhtml/util/appmenu-fold.el79
-rw-r--r--elisp/nxhtml/util/appmenu.el523
-rw-r--r--elisp/nxhtml/util/as-external.el310
-rw-r--r--elisp/nxhtml/util/buffer-bg.el89
-rw-r--r--elisp/nxhtml/util/chartg.el844
-rw-r--r--elisp/nxhtml/util/css-color.el983
-rw-r--r--elisp/nxhtml/util/css-palette.el471
-rw-r--r--elisp/nxhtml/util/css-simple-completion.el238
-rw-r--r--elisp/nxhtml/util/cus-new-user.el803
-rw-r--r--elisp/nxhtml/util/custsets.el83
-rw-r--r--elisp/nxhtml/util/ecb-batch-compile.el65
-rw-r--r--elisp/nxhtml/util/ediff-url.el188
-rw-r--r--elisp/nxhtml/util/ffip.el304
-rw-r--r--elisp/nxhtml/util/fold-dwim.el466
-rw-r--r--elisp/nxhtml/util/foldit.el357
-rw-r--r--elisp/nxhtml/util/fupd.el127
-rw-r--r--elisp/nxhtml/util/gimpedit.el172
-rw-r--r--elisp/nxhtml/util/gpl.el213
-rw-r--r--elisp/nxhtml/util/hfyview.el651
-rw-r--r--elisp/nxhtml/util/hl-needed.el402
-rw-r--r--elisp/nxhtml/util/html-write.el455
-rw-r--r--elisp/nxhtml/util/idn.el151
-rw-r--r--elisp/nxhtml/util/inlimg.el429
-rw-r--r--elisp/nxhtml/util/key-cat.el329
-rw-r--r--elisp/nxhtml/util/majmodpri.el448
-rw-r--r--elisp/nxhtml/util/markchars.el151
-rw-r--r--elisp/nxhtml/util/mlinks.el1367
-rw-r--r--elisp/nxhtml/util/mumamo-aspnet.el227
-rw-r--r--elisp/nxhtml/util/mumamo-fun.el3333
-rw-r--r--elisp/nxhtml/util/mumamo-regions.el311
-rw-r--r--elisp/nxhtml/util/mumamo-trace.el6
-rw-r--r--elisp/nxhtml/util/mumamo.el9100
-rw-r--r--elisp/nxhtml/util/n-back.el1296
-rw-r--r--elisp/nxhtml/util/new-key-seq-widget.el312
-rw-r--r--elisp/nxhtml/util/nxml-mode-os-additions.el99
-rw-r--r--elisp/nxhtml/util/ocr-user.el86
-rw-r--r--elisp/nxhtml/util/org-panel.el745
-rw-r--r--elisp/nxhtml/util/ourcomments-util.el2427
-rw-r--r--elisp/nxhtml/util/ourcomments-widgets.el141
-rw-r--r--elisp/nxhtml/util/pause.el794
-rw-r--r--elisp/nxhtml/util/pointback.el93
-rw-r--r--elisp/nxhtml/util/popcmp.el472
-rw-r--r--elisp/nxhtml/util/rebind.el240
-rw-r--r--elisp/nxhtml/util/rnc-mode.el265
-rw-r--r--elisp/nxhtml/util/rxi.el148
-rw-r--r--elisp/nxhtml/util/search-form.el473
-rw-r--r--elisp/nxhtml/util/sex-mode.el463
-rw-r--r--elisp/nxhtml/util/sml-modeline.el192
-rw-r--r--elisp/nxhtml/util/tabkey2.el1701
-rw-r--r--elisp/nxhtml/util/tyda.el94
-rw-r--r--elisp/nxhtml/util/udev-ecb.el229
-rw-r--r--elisp/nxhtml/util/udev-rinari.el204
-rw-r--r--elisp/nxhtml/util/udev.el456
-rw-r--r--elisp/nxhtml/util/useful-commands.el63
-rw-r--r--elisp/nxhtml/util/viper-tut.el1009
-rw-r--r--elisp/nxhtml/util/vline.el350
-rw-r--r--elisp/nxhtml/util/whelp.el988
-rw-r--r--elisp/nxhtml/util/winsav.el1585
-rw-r--r--elisp/nxhtml/util/winsize.el1173
-rw-r--r--elisp/nxhtml/util/wrap-to-fill.el364
-rw-r--r--elisp/nxhtml/util/zencoding-mode.el801
-rw-r--r--elisp/nxhtml/web-autoload.el262
-rw-r--r--elisp/nxhtml/web-vcs.el2069
-rw-r--r--elisp/osx.el53
-rwxr-xr-xmac/AutOrg.command3
-rw-r--r--mac/AutOrg.icnsbin0 -> 156849 bytes
-rw-r--r--mac/Info.plist4
420 files changed, 109716 insertions, 41 deletions
diff --git a/elisp/autoload.el b/elisp/autoload.el
index 71c4833..52a519f 100644
--- a/elisp/autoload.el
+++ b/elisp/autoload.el
@@ -3,6 +3,9 @@
(provide 'autoload)
+;; local emacs extensions
+(add-to-list 'load-path "~/.emacs.d")
+
;; word count
(autoload 'word-count-mode "word-count"
"Minor mode to count words." t nil)
@@ -57,10 +60,13 @@
;;; Encryption
-(require 'pgg)
-(require 'org-crypt)
-(org-crypt-use-before-save-magic)
+; (require 'pgg)
+; (require 'org-crypt)
+; (org-crypt-use-before-save-magic)
+
+;;; NXHTML
+(require 'nxhtml-autostart)
;;; DOT mode
(defun load-graphviz () (interactive)
@@ -133,5 +139,4 @@
;; folding minor mode
(require 'folding)
-
;;;; EOF
diff --git a/elisp/autorg.el b/elisp/autorg.el
index 85149ad..e876d28 100644
--- a/elisp/autorg.el
+++ b/elisp/autorg.el
@@ -4,9 +4,56 @@
(provide 'autorg)
-;; local emacs extensions
-(add-to-list 'load-path "~/.emacs.d")
-
+; remember extension
+(require 'remember)
+
+; load org-mode first
+(add-to-list 'load-path (concat AutOrgRes "/org-mode/lisp"))
+(add-to-list 'load-path (concat AutOrgRes "/org-mode/contrib/lisp"))
+'(org-modules (quote (org-bbdb org-bibtex org-gnus org-info
+org-jsinfo org-irc org-w3m org-mouse org-eval org-eval-light
+org-exp-bibtex org-man org-mtags org-panel org-R
+org-special-blocks org-exp-blocks org-mobile org-odt org2blog
+org-crypt org-remember org-agenda)))
+(require 'org)
+(org-remember-insinuate)
+
+;; export options
+'(org-export-html-inline-images t)
+'(org-export-html-use-infojs t)
+'(org-export-html-with-timestamp t)
+'(org-export-html-validation-link
+ "<p class=\"xhtml-validation\"><a href=\"http://validator.w3.org/check?uri=referer\">Validate XHTML 1.0</a></p>")
+
+;; extra export formats
+(require 'org-export-generic)
+'(org-export-blocks (quote ((comment org-export-blocks-format-comment t)
+ (ditaa org-export-blocks-format-ditaa t)
+ (dot org-export-blocks-format-dot t)
+ (r org-export-blocks-format-R nil)
+ (R org-export-blocks-format-R nil))))
+
+;; org protocol helps setting communications outside of Emacs
+(require 'org-protocol)
+
+;; freemind export
+(require 'freemind)
+
+; Encryption
+(require 'pgg)
+(require 'org-crypt)
+(org-crypt-use-before-save-magic)
+
+; enables semantic mode for completion
+(semantic-mode t)
+
+; load HTML, PHP and related variou syntax support
+(load (concat AutOrgRes "/nxhtml/autostart.el"))
+
+; LUA mode
+(autoload 'lua-mode "lua-mode" "Lua editing mode." t)
+(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
+(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
;; deactivate all menubar scrollbar toolbar
; (tool-bar-mode)
@@ -20,29 +67,16 @@
(fset 'yes-or-no-p 'y-or-n-p)
(setq inhibit-startup-message t)
+
; stop leaving backup~ turds scattered everywhere
(setq make-backup-files nil)
; save on exit
(defadvice save-buffers-kill-emacs (around no-y-or-n activate)
(flet ((yes-or-no-p (&rest args) t)
- (y-or-n-p (&rest args) t))
+ (y-or-n-p (&rest args) t))
ad-do-it))
-; load color-themes extension
-(require 'color-theme)
-(color-theme-initialize)
-(color-theme-gray30)
-; (color-theme-matrix)
-; (color-theme-blippblopp)
-; (color-theme-dark-laptop)
-
-; transparency (thanks dreamer!)
-(set-frame-parameter (selected-frame) 'alpha '(90 50))
-(add-to-list 'default-frame-alist '(alpha 90 50))
-
-; start listening to commandline invokations
-(server-start)
; ===========================
;; setup our keyboard mappings
@@ -67,16 +101,20 @@
(global-set-key [(meta O) ?H] 'beginning-of-line)
(global-set-key [home] 'beginning-of-line)
(global-set-key [(meta O) ?F] 'end-of-line)
-(global-set-key [end] 'end-of-line)
+(global-set-key [end] 'end-of-line)
(setq next-line-add-newlines nil)
; C-c c to either comment out a region or uncomment it depending on context.
(global-set-key (kbd "C-c c") 'comment-dwim)
; Shift-arrows a la windows...
+
+
+
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
+
'(browse-url-firefox-program "open")
'(column-number-mode t)
'(keyboard-coding-system (quote mule-utf-8))
@@ -84,16 +122,17 @@
'(nil nil t)
; '(get-frame-for-buffer-default-instance-limit nil)
- '(pc-select-meta-moves-sexps t)
- '(pc-select-selection-keys-only t)
- '(pc-selection-mode t nil (pc-select))
+; '(pc-select-meta-moves-sexps t)
+; '(pc-select-selection-keys-only t)
+; '(pc-selection-mode t nil (pc-select))
'(word-count-non-character-regexp "[
]")
- '(x-select-enable-clipboard t))
-;; X selection manipulation
-(define-key global-map [(delete)] "\C-d")
+ '(x-select-enable-clipboard t)
+)
+;; X selection manipulation
+(define-key global-map [(delete)] "\C-d")
(defun x-own-selection (s) (x-set-selection `PRIMARY s))
(global-set-key [(shift insert)]
'(lambda () (interactive)
@@ -111,13 +150,15 @@
(global-set-key "\C-c\C-m" 'execute-extended-command)
(global-set-key "\C-xm" 'execute-extended-command)
(global-set-key "\C-cm" 'execute-extended-command)
+; enables deleting an highlighted block
+(delete-selection-mode)
;; By default we starting in text mode.
(setq initial-major-mode
(lambda ()
- (text-mode)
- (turn-on-auto-fill)
+ (text-mode)
+ (turn-on-auto-fill)
(setq transient-mark-mode t)
(global-font-lock-mode t)
(setq font-lock-mode-maximum-decoration t)
@@ -125,6 +166,18 @@
(setq revert-without-query (cons "TAGS" revert-without-query))
+; grep directories
+(defun grep-on-the-fly ()
+ "grep the whole directory for something defaults to term at cursor position"
+ (interactive)
+ (setq default (thing-at-point 'symbol))
+ (setq needle (or (read-string (concat "grep for <" default "> ")) default))
+ (setq needle (if (equal needle "") default needle))
+ (grep (concat "egrep -s -i -n " needle " * /dev/null")))
+(global-set-key "\C-x." 'grep-on-the-fly)
+(global-set-key [f8] 'next-error)
+
+
; internationalisation support
(require 'mule)
(prefer-coding-system 'mule-utf-8)
@@ -146,7 +199,11 @@
(require 'mwheel)
; Make the mouse jump away when you type over it.
(mouse-avoidance-mode 'cat-and-mouse)
-
+;; scroll one line at a time (less "jumpy" than defaults)
+ (setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ;; one line at a time
+; (setq mouse-wheel-progressive-speed nil) ;; don't accelerate scrolling
+ (setq mouse-wheel-follow-mouse 't) ;; scroll window under mouse
+ (setq scroll-step 1) ;; keyboard scroll one line at a time
; IDO lets you open files and switch buffers with fuzzy matching,
; really nice when you have lots of things open.
@@ -155,10 +212,26 @@
(ido-mode t)
(setq ido-enable-flex-matching t)
+; appearance
+
+; load color-themes extension
+(require 'color-theme)
+(color-theme-initialize)
+(color-theme-emacs-nw)
+; (color-theme-gray30)
+; (color-theme-matrix)
+; (color-theme-blippblopp)
+; (color-theme-dark-laptop)
+
;; set our favourite: Anonymous!
(set-face-font
'default "-*-Inconsolata-normal-normal-normal-*-16-*-*-*-*-*-*")
-; folding mode
-(require 'folding)
+; transparency (thanks dreamer!)
+(set-frame-parameter (selected-frame) 'alpha '(95 50))
+(add-to-list 'default-frame-alist '(alpha 95 50))
+
+
+; start listening to commandline invokations
+(server-start)
diff --git a/elisp/freemind.el b/elisp/freemind.el
new file mode 100644
index 0000000..f3bb521
--- /dev/null
+++ b/elisp/freemind.el
@@ -0,0 +1,1007 @@
+;;; freemind.el --- Export to FreeMind
+;;
+;; Author: Lennart Borgman (lennart O borgman A gmail O com)
+;; Created: 2008-02-19 Tue
+(defconst freemind:version "0.60") ;; Version:
+;; Last-Updated: 2009-08-04 Tue
+;; URL:
+;; Keywords:
+;; Compatibility:
+;;
+;; Features that might be required by this library:
+;;
+ ;; `easymenu', `font-lock', `noutline', `org', `org-compat',
+ ;; `org-faces', `org-footnote', `org-list', `org-macs',
+ ;; `org-panel', `outline', `syntax', `time-date', `xml'.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; This file tries to implement some functions useful for
+;; transformation between org-mode and FreeMind files.
+;;
+;; To use this library you can add to your .emacs
+;;
+;; (require 'freemind)
+;;
+;; Here are the commands you can use:
+;;
+;; M-x `freemind-from-org-mode'
+;; M-x `freemind-from-org-mode-node'
+;; M-x `freemind-from-org-sparse-tree'
+;;
+;; M-x `freemind-to-org-mode'
+;;
+;; M-x `freemind-show'
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Change log:
+;;
+;; 2009-02-15: Added check for next level=current+1
+;; 2009-02-21: Fixed bug in `freemind-to-org-mode'.
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; 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., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+(require 'xml)
+(require 'org)
+(eval-when-compile (require 'cl))
+
+;; Fix-me: I am not sure these are useful:
+;;
+;; (defcustom freemind-main-fgcolor "black"
+;; "Color of main node's text."
+;; :type 'color
+;; :group 'freemind)
+
+;; (defcustom freemind-main-color "black"
+;; "Background color of main node."
+;; :type 'color
+;; :group 'freemind)
+
+;; (defcustom freemind-child-fgcolor "black"
+;; "Color of child nodes' text."
+;; :type 'color
+;; :group 'freemind)
+
+;; (defcustom freemind-child-color "black"
+;; "Background color of child nodes."
+;; :type 'color
+;; :group 'freemind)
+
+(defvar freemind-node-style nil "Internal use.")
+
+(defcustom freemind-node-styles nil
+ "Styles to apply to node.
+NOT READY YET."
+ :type '(repeat
+ (list :tag "Node styles for file"
+ (regexp :tag "File name")
+ (repeat
+ (list :tag "Node"
+ (regexp :tag "Node name regexp")
+ (set :tag "Node properties"
+ (list :format "%v" (const :format "" node-style)
+ (choice :tag "Style"
+ :value bubble
+ (const bubble)
+ (const fork)))
+ (list :format "%v" (const :format "" color)
+ (color :tag "Color" :value "red"))
+ (list :format "%v" (const :format "" background-color)
+ (color :tag "Background color" :value "yellow"))
+ (list :format "%v" (const :format "" edge-color)
+ (color :tag "Edge color" :value "green"))
+ (list :format "%v" (const :format "" edge-style)
+ (choice :tag "Edge style" :value bezier
+ (const :tag "Linear" linear)
+ (const :tag "Bezier" bezier)
+ (const :tag "Sharp Linear" sharp-linear)
+ (const :tag "Sharp Bezier" sharp-bezier)))
+ (list :format "%v" (const :format "" edge-width)
+ (choice :tag "Edge width" :value thin
+ (const :tag "Parent" parent)
+ (const :tag "Thin" thin)
+ (const 1)
+ (const 2)
+ (const 4)
+ (const 8)))
+ (list :format "%v" (const :format "" italic)
+ (const :tag "Italic font" t))
+ (list :format "%v" (const :format "" bold)
+ (const :tag "Bold font" t))
+ (list :format "%v" (const :format "" font-name)
+ (string :tag "Font name" :value "SansSerif"))
+ (list :format "%v" (const :format "" font-size)
+ (integer :tag "Font size" :value 12)))))))
+ :group 'freemind)
+
+
+;;;###autoload
+(defun freemind-show (mm-file)
+ "Show file MM-FILE in Freemind."
+ (interactive
+ (list
+ (save-match-data
+ (let ((name (read-file-name "FreeMind file: "
+ nil nil nil
+ (if (buffer-file-name)
+ (file-name-nondirectory (buffer-file-name))
+ "")
+ ;; Fix-me: Is this an Emacs bug?
+ ;; This predicate function is never
+ ;; called.
+ (lambda (fn)
+ (string-match "^mm$" (file-name-extension fn))))))
+ (setq name (expand-file-name name))
+ name))))
+ (cond
+ ((fboundp 'w32-shell-execute) (w32-shell-execute "open" mm-file))
+ (t (message "Don't know how to show %s" mm-file))))
+
+(defconst freemind-org-nfix "--org-mode: ")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Format converters
+
+(defun freemind-escape-str-from-org (org-str)
+ (let ((chars (append org-str nil))
+ (fm-str ""))
+ (dolist (cc chars)
+ (setq fm-str
+ (concat fm-str
+ (if (< cc 256)
+ (cond
+ ((= cc ?\") "&quot;")
+ ((= cc ?\&) "&amp;")
+ ((= cc ?\<) "&lt;")
+ ((= cc ?\>) "&gt;")
+ (t (char-to-string cc)))
+ ;; Formatting as &#number; is maybe needed
+ ;; according to a bug report from kazuo
+ ;; fujimoto, but I have now instead added a xml
+ ;; processing instruction saying that the mm
+ ;; file is utf-8:
+ ;;
+ ;; (format "&#x%x;" (- cc ;; ?\x800))
+ (char-to-string cc)
+ ))))
+ fm-str))
+
+(defun freemind-unescape-str-to-org (fm-str)
+ (let ((org-str fm-str))
+ (setq org-str (replace-regexp-in-string "&quot;" "\"" org-str))
+ (setq org-str (replace-regexp-in-string "&amp;" "&" org-str))
+ (setq org-str (replace-regexp-in-string "&lt;" "<" org-str))
+ (setq org-str (replace-regexp-in-string "&gt;" ">" org-str))
+ (setq org-str (replace-regexp-in-string
+ "&#x\\([a-f0-9]\\{2\\}\\);"
+ (lambda (m)
+ (char-to-string (+ (string-to-number (match-string 1 str) 16)
+ ?\x800)))
+ org-str))))
+
+;; (freemind-test-escape)
+;; (defun freemind-test-escape ()
+;; (let* ((str1 "a quote: \", an amp: &, lt: <; over 256: ŲŚš÷Ňń")
+;; (str2 (freemind-escape-str-from-org str1))
+;; (str3 (freemind-unescape-str-to-org str2))
+;; )
+;; (unless (string= str1 str3)
+;; (error "str3=%s" str3))
+;; ))
+
+(defun freemind-convert-links-from-org (org-str)
+ (let ((fm-str (replace-regexp-in-string
+ (rx (not (any "[\""))
+ (submatch
+ "http"
+ (opt ?\s)
+ "://"
+ (1+
+ (any "-%.?@a-zA-Z0-9()_/:~=&#"))))
+ "[[\\1][\\1]]"
+ org-str)))
+ (replace-regexp-in-string (rx "[["
+ (submatch (*? nonl))
+ "]["
+ (submatch (*? nonl))
+ "]]")
+ "<a href=\"\\1\">\\2</a>"
+ fm-str)))
+
+;;(freemind-convert-links-to-org "<a href=\"http://www.somewhere/\">link-text</a>")
+(defun freemind-convert-links-to-org (fm-str)
+ (let ((org-str (replace-regexp-in-string
+ (rx "<a"
+ space
+ (0+
+ (0+ (not (any ">")))
+ space)
+ "href=\""
+ (submatch (0+ (not (any "\""))))
+ "\""
+ (0+ (not (any ">")))
+ ">"
+ (submatch (0+ (not (any "<"))))
+ "</a>")
+ "[[\\1][\\2]]"
+ fm-str)))
+ org-str))
+
+(defun freemind-convert-drawers-from-org (text)
+ )
+
+;; (freemind-test-links)
+;; (defun freemind-test-links ()
+;; (let* ((str1 "[[http://www.somewhere/][link-text]")
+;; (str2 (freemind-convert-links-from-org str1))
+;; (str3 (freemind-convert-links-to-org str2))
+;; )
+;; (unless (string= str1 str3)
+;; (error "str3=%s" str3))
+;; ))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Org => FreeMind
+
+(defun freemind-org-text-to-freemind-subnode/note (node-name start end)
+ ;; fix-me: doc
+ (let ((text (buffer-substring-no-properties start end))
+ (node-res "")
+ (note-res ""))
+ (save-match-data
+ (setq text (freemind-escape-str-from-org text))
+ ;; First see if there is something that should be moved to the
+ ;; note part:
+ (let (drawers)
+ (while (string-match drawers-regexp text)
+ (setq drawers (cons (match-string 0 text) drawers))
+ (setq text
+ (concat (substring text 0 (match-beginning 0))
+ (substring text (match-end 0))))
+ )
+ (when drawers
+ (dolist (drawer drawers)
+ (let ((lines (split-string drawer "\n")))
+ (dolist (line lines)
+ (setq note-res (concat
+ note-res
+ freemind-org-nfix line "<br />\n")))
+ ))))
+
+ (when (> (length note-res) 0)
+ (setq note-res (concat
+ "<richcontent TYPE=\"NOTE\"><html>\n"
+ "<head>\n"
+ "</head>\n"
+ "<body>\n"
+ note-res
+ "</body>\n"
+ "</html>\n"
+ "</richcontent>\n"))
+ )
+
+ ;; There is always an LF char:
+ (when (> (length text) 1)
+ (setq node-res (concat
+ "<node style=\"bubble\" background_color=\"#eeee00\">\n"
+ "<richcontent TYPE=\"NODE\"><html>\n"
+ "<head>\n"
+ "<style type=\"text/css\">\n"
+ "<!--\n"
+ "p { margin-top: 0 }\n"
+ "-->\n"
+ "</style>\n"
+ "</head>\n"
+ "<body>\n"))
+ (setq node-res (concat node-res "<p>"))
+ (setq text (replace-regexp-in-string (rx "\n" (0+ blank) "\n") "</p><p>\n" text))
+ ;;(setq text (replace-regexp-in-string (rx bol (1+ blank) eol) "" text))
+ ;;(setq text (replace-regexp-in-string (rx bol (1+ blank)) "<br />" text))
+ (setq text (replace-regexp-in-string "\n" "<br />" text))
+ (freemind-convert-links-from-org text)
+ (setq node-res (concat node-res text))
+ (setq node-res (concat node-res "</p>\n"))
+ (setq node-res (concat
+ node-res
+ "</body>\n"
+ "</html>\n"
+ "</richcontent>\n"
+ ;; Put a note that this is for the parent node
+ "<richcontent TYPE=\"NOTE\"><html>"
+ "<head>"
+ "</head>"
+ "<body>"
+ "<p>"
+ "-- This is more about \"" node-name "\" --"
+ "</p>"
+ "</body>"
+ "</html>"
+ "</richcontent>\n"
+ "</node>\n" ;; ok
+ )))
+ (list node-res note-res))))
+
+(defun freemind-write-node (this-m2 this-node-end)
+ (let* (this-icons
+ this-bg-color
+ this-m2-escaped
+ this-rich-node
+ this-rich-note
+ )
+ (when (string-match "TODO" this-m2)
+ (setq this-m2 (replace-match "" nil nil this-m2))
+ (add-to-list 'this-icons "button_cancel")
+ (setq this-bg-color "#ffff88")
+ (when (string-match "\\[#\\(.\\)\\]" this-m2)
+ (let ((prior (string-to-char (match-string 1 this-m2))))
+ (setq this-m2 (replace-match "" nil nil this-m2))
+ (cond
+ ((= prior ?A)
+ (add-to-list 'this-icons "full-1")
+ (setq this-bg-color "#ff0000"))
+ ((= prior ?B)
+ (add-to-list 'this-icons "full-2")
+ (setq this-bg-color "#ffaa00"))
+ ((= prior ?C)
+ (add-to-list 'this-icons "full-3")
+ (setq this-bg-color "#ffdd00"))
+ ((= prior ?D)
+ (add-to-list 'this-icons "full-4")
+ (setq this-bg-color "#ffff00"))
+ ((= prior ?E)
+ (add-to-list 'this-icons "full-5"))
+ ((= prior ?F)
+ (add-to-list 'this-icons "full-6"))
+ ((= prior ?G)
+ (add-to-list 'this-icons "full-7"))
+ ))))
+ (setq this-m2 (org-trim this-m2))
+ (setq this-m2-escaped (freemind-escape-str-from-org this-m2))
+ (let ((node-notes (freemind-org-text-to-freemind-subnode/note
+ this-m2-escaped
+ this-node-end (1- next-node-start))))
+ (setq this-rich-node (nth 0 node-notes))
+ (setq this-rich-note (nth 1 node-notes)))
+ (with-current-buffer mm-buffer
+ (insert "<node text=\"" this-m2-escaped "\"")
+ (freemind-get-node-style this-m2)
+ ;;(when (and (> current-level base-level) (> next-level current-level))
+ (when (> next-level current-level)
+ (unless (or this-children-visible
+ next-has-some-visible-child)
+ (insert " folded=\"true\"")))
+ (when (and (= current-level (1+ base-level))
+ (> num-left-nodes 0))
+ (setq num-left-nodes (1- num-left-nodes))
+ (insert " position=\"left\""))
+ (when this-bg-color
+ (insert " background_color=\"" this-bg-color "\""))
+ (insert ">\n")
+ (when this-icons
+ (dolist (icon this-icons)
+ (insert "<icon builtin=\"" icon "\"/>\n")))
+ )
+ (with-current-buffer mm-buffer
+ (when this-rich-note (insert this-rich-note))
+ (when this-rich-node (insert this-rich-node))
+ )
+ ))
+
+(defun freemind-check-overwrite (file interactively)
+ (if (file-exists-p file)
+ (if interactively
+ (y-or-n-p (format "File %s exists, replace it? " file))
+ (error "File %s already exists" file))
+ t))
+
+(defvar freemind-node-pattern (rx bol
+ (submatch (1+ "*"))
+ (1+ space)
+ (submatch (*? nonl))
+ eol))
+
+(defun freemind-look-for-visible-child (node-level)
+ (save-excursion
+ (save-match-data
+ (let ((found-visible-child nil))
+ (while (and (not found-visible-child)
+ (re-search-forward freemind-node-pattern nil t))
+ (let* ((m1 (match-string-no-properties 1))
+ (level (length m1)))
+ (if (>= node-level level)
+ (setq found-visible-child 'none)
+ (unless (get-char-property (line-beginning-position) 'invisible)
+ (setq found-visible-child 'found)))))
+ (eq found-visible-child 'found)
+ ))))
+
+(defun freemind-goto-line (line)
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (forward-line (1- line))))
+
+(defun freemind-write-mm-buffer (org-buffer mm-buffer node-at-line)
+ (with-current-buffer org-buffer
+ (dolist (node-style freemind-node-styles)
+ (when (string-match-p (car node-style) buffer-file-name)
+ (setq freemind-node-style (cadr node-style))))
+ ;;(message "freemind-node-style =%s" freemind-node-style)
+ (save-match-data
+ (let* ((drawers (copy-sequence org-drawers))
+ drawers-regexp
+ (num-top1-nodes 0)
+ (num-top2-nodes 0)
+ num-left-nodes
+ (unclosed-nodes 0)
+ (first-time t)
+ (current-level 1)
+ base-level
+ prev-node-end
+ rich-text
+ unfinished-tag
+ node-at-line-level
+ node-at-line-last)
+ (with-current-buffer mm-buffer
+ (erase-buffer)
+ (insert "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
+ (insert "<map version=\"0.9.0\">\n")
+ (insert "<!-- To view this file, download free mind mapping software FreeMind from http://freemind.sourceforge.net -->\n"))
+ (save-excursion
+ ;; Get special buffer vars:
+ (goto-char (point-min))
+ (while (re-search-forward (rx bol "#+DRAWERS:") nil t)
+ (let ((dr-txt (buffer-substring-no-properties (match-end 0) (line-end-position))))
+ (setq drawers (append drawers (split-string dr-txt) nil))))
+ (setq drawers-regexp
+ (concat (rx bol (0+ blank) ":")
+ (regexp-opt drawers)
+ (rx ":" (0+ blank)
+ "\n"
+ (*? anything)
+ "\n"
+ (0+ blank)
+ ":END:"
+ (0+ blank)
+ eol)
+ ))
+
+ (if node-at-line
+ ;; Get number of top nodes and last line for this node
+ (progn
+ (freemind-goto-line node-at-line)
+ (unless (looking-at freemind-node-pattern)
+ (error "No node at line %s" node-at-line))
+ (setq node-at-line-level (length (match-string-no-properties 1)))
+ (forward-line)
+ (setq node-at-line-last
+ (catch 'last-line
+ (while (re-search-forward freemind-node-pattern nil t)
+ (let* ((m1 (match-string-no-properties 1))
+ (level (length m1)))
+ (if (<= level node-at-line-level)
+ (progn
+ (beginning-of-line)
+ (throw 'last-line (1- (point))))
+ (if (= level (1+ node-at-line-level))
+ (setq num-top2-nodes (1+ num-top2-nodes))))))))
+ (setq current-level node-at-line-level)
+ (setq num-top1-nodes 1)
+ (freemind-goto-line node-at-line))
+
+ ;; First get number of top nodes
+ (goto-char (point-min))
+ (while (re-search-forward freemind-node-pattern nil t)
+ (let* ((m1 (match-string-no-properties 1))
+ (level (length m1)))
+ (if (= level 1)
+ (setq num-top1-nodes (1+ num-top1-nodes))
+ (if (= level 2)
+ (setq num-top2-nodes (1+ num-top2-nodes))))))
+ ;; If there is more than one top node we need to insert a node
+ ;; to keep them together.
+ (goto-char (point-min))
+ (when (> num-top1-nodes 1)
+ (setq num-top2-nodes num-top1-nodes)
+ (setq current-level 0)
+ (let ((orig-name (if buffer-file-name
+ (file-name-nondirectory (buffer-file-name))
+ (buffer-name))))
+ (with-current-buffer mm-buffer
+ (insert "<node text=\"" orig-name "\" background_color=\"#00bfff\">\n"
+ ;; Put a note that this is for the parent node
+ "<richcontent TYPE=\"NOTE\"><html>"
+ "<head>"
+ "</head>"
+ "<body>"
+ "<p>"
+ freemind-org-nfix "WHOLE FILE"
+ "</p>"
+ "</body>"
+ "</html>"
+ "</richcontent>\n")))))
+
+ (setq num-left-nodes (floor num-top2-nodes 2))
+ (setq base-level current-level)
+ (let (this-m2
+ this-node-end
+ this-children-visible
+ next-m2
+ next-level
+ next-has-some-visible-child
+ next-children-visible)
+ (while (and
+ (re-search-forward freemind-node-pattern nil t)
+ (if node-at-line-last (<= (point) node-at-line-last) t)
+ )
+ (let* ((next-m1 (match-string-no-properties 1))
+ (next-node-start (match-beginning 0))
+ (next-node-end (match-end 0))
+ )
+ (setq next-m2 (match-string-no-properties 2))
+ (setq next-level (length next-m1))
+ (when (> next-level current-level)
+ (unless (= next-level (1+ current-level))
+ (error "Next level step > +1 for node ending at line %s" (line-number-at-pos))
+ ))
+ (setq next-children-visible
+ (not (eq 'outline
+ (get-char-property (line-end-position) 'invisible))))
+ (setq next-has-some-visible-child
+ (if next-children-visible t
+ (freemind-look-for-visible-child next-level)))
+ (when this-m2
+ (freemind-write-node this-m2 this-node-end))
+ (when (if (= num-top1-nodes 1) (> current-level base-level) t)
+ (while (>= current-level next-level)
+ (with-current-buffer mm-buffer
+ (insert "</node>\n")
+ ;;(insert (format "</node>\ncurrent-level=%s, next-level%s\n" current-level next-level))
+ (setq current-level (1- current-level)))))
+ (setq this-node-end (1+ next-node-end))
+ (setq this-m2 next-m2)
+ (setq current-level next-level)
+ (setq this-children-visible next-children-visible)
+ (forward-char)
+ ))
+;;; (unless (if node-at-line-last
+;;; (>= (point) node-at-line-last)
+;;; nil)
+ ;; Write last node:
+ (setq this-m2 next-m2)
+ (setq current-level next-level)
+ (setq next-node-start (if node-at-line-last
+ (1+ node-at-line-last)
+ (point-max)))
+ (freemind-write-node this-m2 this-node-end)
+ (with-current-buffer mm-buffer (insert "</node>\n"))
+ ;)
+ )
+ (with-current-buffer mm-buffer
+ (while (> current-level base-level)
+ (insert "</node>\n")
+ (setq current-level (1- current-level))))
+ (with-current-buffer mm-buffer
+ (insert "</map>")
+ (delete-trailing-whitespace)
+ (goto-char (point-min))
+ ))))))
+
+(defun freemind-get-node-style (node-name)
+ "NOT READY YET."
+ ;;<node BACKGROUND_COLOR="#eeee00" CREATED="1234668815593" MODIFIED="1234668815593" STYLE="bubble">
+ ;;<font BOLD="true" NAME="SansSerif" SIZE="12"/>
+ (let (node-styles
+ node-style)
+ (dolist (style-list freemind-node-style)
+ (let ((node-regexp (car style-list)))
+ (message "node-regexp=%s node-name=%s" node-regexp node-name)
+ (when (string-match-p node-regexp node-name)
+ ;;(setq node-style (freemind-do-apply-node-style style-list))
+ (setq node-style (cadr style-list))
+ (when node-style
+ (message "node-style=%s" node-style)
+ (setq node-styles (append node-styles node-style)))
+ )))))
+
+(defun freemind-do-apply-node-style (style-list)
+ (message "style-list=%S" style-list)
+ (let ((node-style 'fork)
+ (color "red")
+ (background-color "yellow")
+ (edge-color "green")
+ (edge-style 'bezier)
+ (edge-width 'thin)
+ (italic t)
+ (bold t)
+ (font-name "SansSerif")
+ (font-size 12))
+ (dolist (style (cadr style-list))
+ (message " style=%s" style)
+ (let ((what (car style)))
+ (cond
+ ((eq what 'node-style)
+ (setq node-style (cadr style)))
+ ((eq what 'color)
+ (setq color (cadr style)))
+ ((eq what 'background-color)
+ (setq background-color (cadr style)))
+
+ ((eq what 'edge-color)
+ (setq edge-color (cadr style)))
+
+ ((eq what 'edge-style)
+ (setq edge-style (cadr style)))
+
+ ((eq what 'edge-width)
+ (setq edge-width (cadr style)))
+
+ ((eq what 'italic)
+ (setq italic (cadr style)))
+
+ ((eq what 'bold)
+ (setq bold (cadr style)))
+
+ ((eq what 'font-name)
+ (setq font-name (cadr style)))
+
+ ((eq what 'font-size)
+ (setq font-size (cadr style)))
+ )
+ (insert (format " style=\"%s\"" node-style))
+ (insert (format " color=\"%s\"" color))
+ (insert (format " background_color=\"%s\"" background-color))
+ (insert ">\n")
+ (insert "<edge")
+ (insert (format " color=\"%s\"" edge-color))
+ (insert (format " style=\"%s\"" edge-style))
+ (insert (format " width=\"%s\"" edge-width))
+ (insert "/>\n")
+ (insert "<font")
+ (insert (format " italic=\"%s\"" italic))
+ (insert (format " bold=\"%s\"" bold))
+ (insert (format " name=\"%s\"" font-name))
+ (insert (format " size=\"%s\"" font-size))
+ ))))
+
+;;;###autoload
+(defun freemind-from-org-mode-node (node-line mm-file)
+ "Convert node at line NODE-LINE to the FreeMind file MM-FILE."
+ (interactive
+ (progn
+ (unless (org-back-to-heading nil)
+ (error "Can't find org-mode node start"))
+ (let* ((line (line-number-at-pos))
+ (default-mm-file (concat (if buffer-file-name
+ (file-name-nondirectory buffer-file-name)
+ "nofile")
+ "-line-" (number-to-string line)
+ ".mm"))
+ (mm-file (read-file-name "Output FreeMind file: " nil nil nil default-mm-file)))
+ (list line mm-file))))
+ (when (freemind-check-overwrite mm-file (called-interactively-p))
+ (let ((org-buffer (current-buffer))
+ (mm-buffer (find-file-noselect mm-file)))
+ (freemind-write-mm-buffer org-buffer mm-buffer node-line)
+ (with-current-buffer mm-buffer
+ (basic-save-buffer)
+ (when (called-interactively-p)
+ (switch-to-buffer-other-window mm-buffer)
+ (freemind-show buffer-file-name))))))
+
+;;;###autoload
+(defun freemind-from-org-mode (org-file mm-file)
+ "Convert the `org-mode' file ORG-FILE to the FreeMind file MM-FILE."
+ ;; Fix-me: better doc, include recommendations etc.
+ (interactive
+ (let* ((org-file buffer-file-name)
+ (default-mm-file (concat
+ (if org-file
+ (file-name-nondirectory org-file)
+ "nofile")
+ ".mm"))
+ (mm-file (read-file-name "Output FreeMind file: " nil nil nil default-mm-file)))
+ (list org-file mm-file)))
+ (when (freemind-check-overwrite mm-file (called-interactively-p))
+ (let ((org-buffer (if org-file (find-file-noselect org-file) (current-buffer)))
+ (mm-buffer (find-file-noselect mm-file)))
+ (freemind-write-mm-buffer org-buffer mm-buffer nil)
+ (with-current-buffer mm-buffer
+ (basic-save-buffer)
+ (when (called-interactively-p)
+ (switch-to-buffer-other-window mm-buffer)
+ (freemind-show buffer-file-name))))))
+
+;;;###autoload
+(defun freemind-from-org-sparse-tree (org-buffer mm-file)
+ "Convert visible part of buffer ORG-BUFFER to FreeMind file MM-FILE."
+ (interactive
+ (let* ((org-file buffer-file-name)
+ (default-mm-file (concat
+ (if org-file
+ (file-name-nondirectory org-file)
+ "nofile")
+ "-sparse.mm"))
+ (mm-file (read-file-name "Output FreeMind file: " nil nil nil default-mm-file)))
+ (list (current-buffer) mm-file)))
+ (when (freemind-check-overwrite mm-file (called-interactively-p))
+ (let (org-buffer
+ (mm-buffer (find-file-noselect mm-file)))
+ (save-window-excursion
+ (org-export-visible ?\ nil)
+ (setq org-buffer (current-buffer)))
+ (freemind-write-mm-buffer org-buffer mm-buffer nil)
+ (with-current-buffer mm-buffer
+ (basic-save-buffer)
+ (when (called-interactively-p)
+ (switch-to-buffer-other-window mm-buffer)
+ (freemind-show buffer-file-name))))))
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; FreeMind => Org
+
+;; (sort '(b a c) 'freemind-lt-symbols)
+(defun freemind-lt-symbols (sym-a sym-b)
+ (string< (symbol-name sym-a) (symbol-name sym-b)))
+;; (sort '((b . 1) (a . 2) (c . 3)) 'freemind-lt-xml-attrs)
+(defun freemind-lt-xml-attrs (attr-a attr-b)
+ (string< (symbol-name (car attr-a)) (symbol-name (car attr-b))))
+
+;; xml-parse-region gives things like
+;; ((p nil "\n"
+;; (a
+;; ((href . "link"))
+;; "text")
+;; "\n"
+;; (b nil "hej")
+;; "\n"))
+
+;; '(a . nil)
+
+;; (freemind-symbols= 'a (car '(A B)))
+(defsubst freemind-symbols= (sym-a sym-b)
+ (or (eq sym-a sym-b)
+ (string= (downcase (symbol-name sym-a))
+ (downcase (symbol-name sym-b)))))
+
+(defun freemind-get-children (parent path)
+ "Find children node to PARENT from PATH.
+PATH should be a list of steps, where each step has the form
+
+ '(NODE-NAME (ATTR-NAME . ATTR-VALUE))
+"
+ ;; Fix-me: maybe implement op? step: Name, number, attr, attr op val
+ ;; Fix-me: case insensitive version for children?
+ (let* ((children (if (not (listp (car parent)))
+ (cddr parent)
+ (let (cs)
+ (dolist (p parent)
+ (dolist (c (cddr p))
+ (add-to-list 'cs c)))
+ cs)
+ ))
+ (step (car path))
+ (step-node (if (listp step) (car step) step))
+ (step-attr-list (when (listp step) (sort (cdr step) 'freemind-lt-xml-attrs)))
+ (path-tail (cdr path))
+ path-children)
+ (dolist (child children)
+ ;; skip xml.el formatting nodes
+ (unless (stringp child)
+ ;; compare node name
+ (when (if (not step-node)
+ t ;; any node name
+ (freemind-symbols= step-node (car child)))
+ (if (not step-attr-list)
+ ;;(throw 'path-child child) ;; no attr to care about
+ (add-to-list 'path-children child)
+ (let* ((child-attr-list (cadr child))
+ (step-attr-copy (copy-sequence step-attr-list)))
+ (dolist (child-attr child-attr-list)
+ ;; Compare attr names:
+ (when (freemind-symbols= (caar step-attr-copy) (car child-attr))
+ ;; Compare values:
+ (let ((step-val (cdar step-attr-copy))
+ (child-val (cdr child-attr)))
+ (when (if (not step-val)
+ t ;; any value
+ (string= step-val child-val))
+ (setq step-attr-copy (cdr step-attr-copy))))))
+ ;; Did we find all?
+ (unless step-attr-copy
+ ;;(throw 'path-child child)
+ (add-to-list 'path-children child)
+ ))))))
+ (if path-tail
+ (freemind-get-children path-children path-tail)
+ path-children)))
+
+(defun freemind-get-richcontent-node (node)
+ (let ((rc-nodes
+ (freemind-get-children node '((richcontent (type . "NODE")) html body))))
+ (when (> (length rc-nodes) 1)
+ (lwarn t :warning "Unexpected structure: several <richcontent type=\"NODE\" ...>"))
+ (car rc-nodes)))
+
+(defun freemind-get-richcontent-note (node)
+ (let ((rc-notes
+ (freemind-get-children node '((richcontent (type . "NOTE")) html body))))
+ (when (> (length rc-notes) 1)
+ (lwarn t :warning "Unexpected structure: several <richcontent type=\"NOTE\" ...>"))
+ (car rc-notes)))
+
+(defun freemind-test-get-tree-text ()
+ (let ((node '(p nil "\n"
+ (a
+ ((href . "link"))
+ "text")
+ "\n"
+ (b nil "hej")
+ "\n")))
+ (freemind-get-tree-text node)))
+;; (freemind-test-get-tree-text)
+
+(defun freemind-get-tree-text (node)
+ (when node
+ (let ((ntxt "")
+ (link nil)
+ (lf-after nil))
+ (dolist (n node)
+ (case n
+ ;;(a (setq is-link t) )
+ ((h1 h2 h3 h4 h5 h6 p)
+ ;;(setq ntxt (concat "\n" ntxt))
+ (setq lf-after 2)
+ )
+ (br
+ (setq lf-after 1)
+ )
+ (t
+ (cond
+ ((stringp n)
+ (when (string= n "\n") (setq n ""))
+ (if link
+ (setq ntxt (concat ntxt
+ "[[" link "][" n "]]"))
+ (setq ntxt (concat ntxt n))))
+ ((and n (listp n))
+ (if (symbolp (car n))
+ (setq ntxt (concat ntxt (freemind-get-tree-text n)))
+ ;; This should be the attributes:
+ (dolist (att-val n)
+ (let ((att (car att-val))
+ (val (cdr att-val)))
+ (when (eq att 'href)
+ (setq link val)))))
+ )))))
+ (if lf-after
+ (setq ntxt (concat ntxt (make-string lf-after ?\n)))
+ (setq ntxt (concat ntxt " ")))
+ ;;(setq ntxt (concat ntxt (format "{%s}" n)))
+ ntxt)))
+
+(defun freemind-get-richcontent-node-text (node)
+ "Get the node text as from the richcontent node."
+ (save-match-data
+ (let* ((rc (freemind-get-richcontent-node node))
+ (txt (freemind-get-tree-text rc)))
+ ;;(when txt (setq txt (replace-regexp-in-string (rx (1+ whitespace)) " " txt)))
+ txt
+ )))
+
+(defun freemind-get-richcontent-note-text (node)
+ "Get the node text as from the richcontent node."
+ (save-match-data
+ (let* ((rc (freemind-get-richcontent-note node))
+ (txt (when rc (freemind-get-tree-text rc))))
+ ;;(when txt (setq txt (replace-regexp-in-string (rx (1+ whitespace)) " " txt)))
+ txt
+ )))
+
+(defun freemind-get-icon-names (node)
+ (let* ((icon-nodes (freemind-get-children node '((icon ))))
+ names)
+ (dolist (icn icon-nodes)
+ (setq names (cons (cdr (assq 'builtin (cadr icn))) names)))
+ ;; (icon (builtin . "full-1"))
+ names))
+
+(defun freemind-node-to-org (node level skip-levels)
+ (let ((qname (car node))
+ (attributes (cadr node))
+ text
+ (note (freemind-get-richcontent-note-text node))
+ (mark "-- This is more about ")
+ (icons (freemind-get-icon-names node))
+ (children (cddr node)))
+ (when (< 0 (- level skip-levels))
+ (dolist (attrib attributes)
+ (case (car attrib)
+ ('TEXT (setq text (cdr attrib)))
+ ('text (setq text (cdr attrib)))))
+ (unless text
+ ;; There should be a richcontent node holding the text:
+ (setq text (freemind-get-richcontent-node-text node)))
+ (when icons
+ (when (member "full-1" icons) (setq text (concat "[#A] " text)))
+ (when (member "full-2" icons) (setq text (concat "[#B] " text)))
+ (when (member "full-3" icons) (setq text (concat "[#C] " text)))
+ (when (member "full-4" icons) (setq text (concat "[#D] " text)))
+ (when (member "full-5" icons) (setq text (concat "[#E] " text)))
+ (when (member "full-6" icons) (setq text (concat "[#F] " text)))
+ (when (member "full-7" icons) (setq text (concat "[#G] " text)))
+ (when (member "button_cancel" icons) (setq text (concat "TODO " text)))
+ )
+ (if (and note
+ (string= mark (substring note 0 (length mark))))
+ (progn
+ (setq text (replace-regexp-in-string "\n $" "" text))
+ (insert text))
+ (case qname
+ ('node
+ (insert (make-string (- level skip-levels) ?*) " " text "\n")
+ ))))
+ (dolist (child children)
+ (unless (or (null child)
+ (stringp child))
+ (freemind-node-to-org child (1+ level) skip-levels)))))
+
+;; Fix-me: put back special things, like drawers that are stored in
+;; the notes. Should maybe all notes contents be put in drawers?
+;;;###autoload
+(defun freemind-to-org-mode (mm-file org-file)
+ "Convert FreeMind file MM-FILE to `org-mode' file ORG-FILE."
+ (interactive
+ (save-match-data
+ (let* ((mm-file (buffer-file-name))
+ (default-org-file (concat (file-name-nondirectory mm-file) ".org"))
+ (org-file (read-file-name "Output org-mode file: " nil nil nil default-org-file)))
+ (list mm-file org-file))))
+ (when (freemind-check-overwrite org-file (called-interactively-p))
+ (let ((mm-buffer (find-file-noselect mm-file))
+ (org-buffer (find-file-noselect org-file)))
+ (with-current-buffer mm-buffer
+ (let* ((xml-list (xml-parse-file mm-file))
+ (top-node (cadr (cddar xml-list)))
+ (note (freemind-get-richcontent-note-text top-node))
+ (skip-levels
+ (if (and note
+ (string-match (rx bol "--org-mode: WHOLE FILE" eol) note))
+ 1
+ 0)))
+ (with-current-buffer org-buffer
+ (erase-buffer)
+ (freemind-node-to-org top-node 1 skip-levels)
+ (goto-char (point-min))
+ (org-set-tags t t) ;; Align all tags
+ )
+ (switch-to-buffer-other-window org-buffer)
+ )))))
+
+(provide 'freemind)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; freemind.el ends here
diff --git a/elisp/lua-mode.el b/elisp/lua-mode.el
new file mode 100644
index 0000000..b1e5e7d
--- /dev/null
+++ b/elisp/lua-mode.el
@@ -0,0 +1,1665 @@
+;;; lua-mode.el --- a major-mode for editing Lua scripts
+
+;; Copyright (C) 1997, 2001, 2004, 2006, 2007, 2010, 2011 Free Software Foundation, Inc.
+
+;; Author: 2011 immerrr <immerrr+lua@gmail.com>
+;; 2010-2011 Reuben Thomas <rrt@sc3d.org>
+;; 2006 Juergen Hoetzel <juergen@hoetzel.info>
+;; 2004 various (support for Lua 5 and byte compilation)
+;; 2001 Christian Vogler <cvogler@gradient.cis.upenn.edu>
+;; 1997 Bret Mogilefsky <mogul-lua@gelatinous.com> starting from
+;; tcl-mode by Gregor Schmid <schmid@fb3-s7.math.tu-berlin.de>
+;; with tons of assistance from
+;; Paul Du Bois <pld-lua@gelatinous.com> and
+;; Aaron Smith <aaron-lua@gelatinous.com>.
+;;
+;; URL: http://immerrr.github.com/lua-mode
+;; Version: 20111107
+;;
+;; This file is NOT part of 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
+;; of the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+;; MA 02110-1301, USA.
+
+;; Keywords: languages, processes, tools
+
+
+;;; Commentary:
+
+;; Thanks to d87 <github.com/d87> for an idea of highlighting lua
+;; builtins/numbers
+
+;; Thanks to Vedat Hallac <github.com/vhallac> for sharing some of
+;; his fixes and updates to core indentation logics
+
+;; Thanks to Rafael Sanchez <rafael@cornerdimension.com> for patch
+;; adding lua-mode to interpreter-mode-alist
+
+;; Thanks to Leonardo Etcheverry <leo@kalio.net> for enabling
+;; narrow-to-defun functionality
+
+;; Thanks to Tobias Polzin <polzin@gmx.de> for function indenting
+;; patch: Indent "(" like "{"
+
+;; Thanks to Fabien <fleutot@gmail.com> for imenu patches.
+
+;; Thanks to Simon Marshall <simonm@mail.esrin.esa.it> and Olivier
+;; Andrieu <oandrieu@gmail.com> for font-lock patches.
+
+;; Additional font-lock highlighting and indentation tweaks by
+;; Adam D. Moss <adam@gimp.org>.
+
+;; INSTALLATION:
+
+;; To install, just copy this file into a directory on your load-path
+;; (and byte-compile it). To set up Emacs to automatically edit files
+;; ending in ".lua" or with a lua hash-bang line using lua-mode add
+;; the following to your init file:
+;;
+;; (autoload 'lua-mode "lua-mode" "Lua editing mode." t)
+;; (add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
+;; (add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
+
+;; Usage
+
+;; Lua-mode supports c-mode style formatting and sending of
+;; lines/regions/files to a Lua interpreter. An interpreter (see
+;; variable `lua-default-application') will be started if you try to
+;; send some code and none is running. You can use the process-buffer
+;; (named after the application you chose) as if it were an
+;; interactive shell. See the documentation for `comint.el' for
+;; details.
+
+;; Lua-mode works with Hide Show minor mode (see ``hs-minor-mode``).
+
+;; Key-bindings
+
+;; To see all the keybindings for Lua mode, look at `lua-setup-keymap'
+;; or start `lua-mode' and type `\C-h m'.
+;; The keybindings may seem strange, since I prefer to use them with
+;; lua-prefix-key set to nil, but since those keybindings are already used
+;; the default for `lua-prefix-key' is `\C-c', which is the conventional
+;; prefix for major-mode commands.
+
+;; You can customise the keybindings either by setting `lua-prefix-key'
+;; or by putting the following in your .emacs
+;; (define-key lua-mode-map <your-key> <function>)
+;; for all the functions you need.
+
+
+;;; Code:
+(eval-when-compile
+ (require 'cl))
+
+(require 'comint)
+
+(eval-and-compile
+ ;; Backward compatibility for Emacsen < 24.1
+ (defalias 'lua--prog-mode
+ (if (fboundp 'prog-mode) 'prog-mode 'fundamental-mode))
+
+ (defalias 'lua--cl-assert
+ (if (fboundp 'cl-assert) 'cl-assert 'assert))
+
+ (defalias 'lua--cl-labels
+ (if (fboundp 'cl-labels) 'cl-labels 'flet))
+
+ ;; for Emacsen < 22.1
+ (defalias 'lua--with-no-warnings
+ (if (fboundp 'with-no-warnings) 'with-no-warnings 'progn))
+
+ ;; provide backward compatibility for Emacs < 23.2
+ ;; called-interactively-p receives an argument starting from Emacs 23.2
+ ;; In Emacs 22 & Emacs 23.1 it didn't expect an argument
+ ;; In Emacs 21 it was called interactively-p
+ (condition-case nil
+ (progn (called-interactively-p nil)
+ ;; if first call succeeds, make lua-called-interactively-p an alias
+ (defalias 'lua--called-interactively-p 'called-interactively-p))
+
+ (wrong-number-of-arguments
+ ;; wrong number of arguments means it's 22.1 <= Emacs < 23.2
+ ;;
+ ;; Newer and smarter Emacsen will warn about obsolete functions
+ ;; and/or wrong number of arguments. Turning these warnings off,
+ ;; since it's backward-compatibility-oriented code anyway.
+ (lua--with-no-warnings
+ (defun lua--called-interactively-p (kind)
+ "Return t if containing function was called interactively.
+
+This function provides lua-mode backward compatibility for
+pre-23.2 Emacsen."
+ (if (eq kind 'interactive)
+ (interactive-p)
+ (called-interactively-p)))))
+
+ ;; if not, it's probably < 22.1, provide partial compatibility
+ ;;
+ ;; Once again, turning obsolete-function warnings off (see above).
+ (error
+ (lua--with-no-warnings
+ (defun lua--called-interactively-p (&rest opts)
+ "Return t if containing function was called interactively.
+
+This function provides lua-mode backward compatibility for pre-22
+Emacsen."
+ (interactive-p)))))
+
+ ;; backward compatibility for Emacsen < 23.3
+ ;; Emacs 23.3 introduced with-silent-modifications macro
+ (if (fboundp 'with-silent-modifications)
+ (defalias 'lua--with-silent-modifications 'with-silent-modifications)
+
+ (defmacro lua--with-silent-modifications (&rest body)
+ "Execute BODY, pretending it does not modifies the buffer.
+
+This is a reimplementation of macro `with-silent-modifications'
+for Emacsen that doesn't contain one (pre-23.3)."
+ `(let ((old-modified-p (buffer-modified-p))
+ (inhibit-modification-hooks t)
+ (buffer-undo-list t))
+
+ (unwind-protect
+ ,@body
+ (set-buffer-modified-p old-modified-p))))))
+
+;; Local variables
+(defgroup lua nil
+ "Major mode for editing lua code."
+ :prefix "lua-"
+ :group 'languages)
+
+(defcustom lua-indent-level 3
+ "Amount by which Lua subexpressions are indented."
+ :type 'integer
+ :group 'lua)
+
+(defcustom lua-comment-start "-- "
+ "Default value of `comment-start'."
+ :type 'string
+ :group 'lua)
+
+(defcustom lua-comment-start-skip "-- "
+ "Default value of `comment-start-skip'."
+ :type 'string
+ :group 'lua)
+
+(defcustom lua-default-application "lua"
+ "Default application to run in lua subprocess."
+ :type 'string
+ :group 'lua)
+
+(defcustom lua-default-command-switches (list "-i")
+ "Command switches for `lua-default-application'.
+Should be a list of strings."
+ :type '(repeat string)
+ :group 'lua)
+
+(defcustom lua-always-show t
+ "*Non-nil means display lua-process-buffer after sending a command."
+ :type 'boolean
+ :group 'lua)
+
+(defcustom lua-search-url-prefix "http://www.lua.org/manual/5.1/manual.html#pdf-"
+ "*URL at which to search for documentation on a word"
+ :type 'string
+ :group 'lua)
+
+(defvar lua-process nil
+ "The active Lua subprocess")
+
+(defvar lua-process-buffer nil
+ "Buffer used for communication with Lua subprocess")
+
+(defun lua--customize-set-prefix-key (prefix-key-sym prefix-key-val)
+ (lua--cl-assert (eq prefix-key-sym 'lua-prefix-key))
+ (set prefix-key-sym (if (and prefix-key-val (> (length prefix-key-val) 0))
+ ;; read-kbd-macro returns a string or a vector
+ ;; in both cases (elt x 0) is ok
+ (elt (read-kbd-macro prefix-key-val) 0)))
+ (if (fboundp 'lua-prefix-key-update-bindings)
+ (lua-prefix-key-update-bindings))
+ (message "prefix key set to %S" (single-key-description (eval prefix-key-sym))))
+
+(defcustom lua-prefix-key "\C-c"
+ "Prefix for all lua-mode commands."
+ :type 'string
+ :group 'lua
+ :set 'lua--customize-set-prefix-key
+ :get '(lambda (sym)
+ (let ((val (eval sym))) (if val (single-key-description (eval sym)) ""))))
+
+(defvar lua-mode-menu (make-sparse-keymap "Lua")
+ "Keymap for lua-mode's menu.")
+
+(defvar lua-prefix-mode-map
+ (eval-when-compile
+ (let ((result-map (make-sparse-keymap)))
+ (mapc (lambda (key_defn)
+ (define-key result-map (read-kbd-macro (car key_defn)) (cdr key_defn)))
+ '(("C-l" . lua-send-buffer)
+ ("C-f" . lua-search-documentation)
+ ("C-;" . lua-mark-all-multiline-literals)))
+ result-map))
+ "Keymap that is used to define keys accessible by `lua-prefix-key'.
+
+If the latter is nil, the keymap translates into `lua-mode-map' verbatim.")
+
+(defvar lua-mode-map
+ (let ((result-map (make-sparse-keymap))
+ prefix-key)
+ (mapc (lambda (key_defn)
+ (define-key result-map (read-kbd-macro (car key_defn)) (cdr key_defn)))
+ ;; here go all the default bindings
+ ;; backquote enables evaluating certain symbols by comma
+ `(("}" . lua-electric-match)
+ ("]" . lua-electric-match)
+ (")" . lua-electric-match)))
+ (define-key result-map [menu-bar lua-mode] (cons "Lua" lua-mode-menu))
+
+ ;; FIXME: see if the declared logic actually works
+ ;; handle prefix-keyed bindings:
+ ;; * if no prefix, set prefix-map as parent, i.e.
+ ;; if key is not defined look it up in prefix-map
+ ;; * if prefix is set, bind the prefix-map to that key
+ (if (boundp 'lua-prefix-key)
+ (define-key result-map (vector lua-prefix-key) lua-prefix-mode-map)
+ (set-keymap-parent result-map lua-prefix-mode-map))
+ result-map)
+ "Keymap used in lua-mode buffers.")
+
+(defvar lua-electric-flag t
+ "If t, electric actions (like automatic reindentation) will happen when an electric
+ key like `{' is pressed")
+(make-variable-buffer-local 'lua-electric-flag)
+
+(defcustom lua-prompt-regexp "[^\n]*\\(>[\t ]+\\)+$"
+ "Regexp which matches the Lua program's prompt."
+ :type 'regexp
+ :group 'lua)
+
+(defcustom lua-traceback-line-re
+ "^\\(?:[\t ]*\\|.*>[\t ]+\\)\\([^\n\t ]+\\):\\([0-9]+\\):"
+ "Regular expression that describes tracebacks and errors."
+ :type 'regexp
+ :group 'lua)
+
+(defcustom lua-indent-string-contents nil
+ "If non-nil, contents of multiline string will be indented.
+Otherwise leading amount of whitespace on each line is preserved."
+ :group 'lua
+ :type 'boolean)
+
+(defcustom lua-jump-on-traceback t
+ "*Jump to innermost traceback location in *lua* buffer. When this
+variable is non-nil and a traceback occurs when running Lua code in a
+subprocess, jump immediately to the source code of the innermost
+traceback location."
+ :type 'boolean
+ :group 'lua)
+
+(defcustom lua-mode-hook nil
+ "Hooks called when Lua mode fires up."
+ :type 'hook
+ :group 'lua)
+
+(defvar lua-region-start (make-marker)
+ "Start of special region for Lua communication.")
+
+(defvar lua-region-end (make-marker)
+ "End of special region for Lua communication.")
+
+(defvar lua-emacs-menu
+ '(["Restart With Whole File" lua-restart-with-whole-file t]
+ ["Kill Process" lua-kill-process t]
+ ["Hide Process Buffer" lua-hide-process-buffer t]
+ ["Show Process Buffer" lua-show-process-buffer t]
+ ["Beginning Of Proc" lua-beginning-of-proc t]
+ ["End Of Proc" lua-end-of-proc t]
+ ["Set Lua-Region Start" lua-set-lua-region-start t]
+ ["Set Lua-Region End" lua-set-lua-region-end t]
+ ["Send Lua-Region" lua-send-lua-region t]
+ ["Send Current Line" lua-send-current-line t]
+ ["Send Region" lua-send-region t]
+ ["Send Proc" lua-send-proc t]
+ ["Send Buffer" lua-send-buffer t]
+ ["Search Documentation" lua-search-documentation t])
+ "Emacs menu for Lua mode.")
+
+;; the whole defconst is inside eval-when-compile, because it's later referenced
+;; inside another eval-and-compile block
+(eval-and-compile
+ (defconst
+ lua--builtins
+ (let*
+ ((modules
+ '("_G" "_VERSION" "assert" "collectgarbage" "dofile" "error" "getfenv" "getmetatable"
+ "ipairs" "load" "loadfile" "loadstring" "module" "next" "pairs" "pcall" "print"
+ "rawequal" "rawget" "rawlen" "rawset" "require" "select" "setfenv" "setmetatable"
+ "tonumber" "tostring" "type" "unpack" "xpcall"
+ ("bit32" . ("arshift" "band" "bnot" "bor" "btest" "bxor" "extract" "lrotate" "lshift"
+ "replace" "rrotate" "rshift"))
+ ("coroutine" . ("create" "resume" "running" "status" "wrap" "yield"))
+ ("debug" . ("debug" "getfenv" "gethook" "getinfo" "getlocal" "getmetatable"
+ "getregistry" "getupvalue" "getuservalue" "setfenv" "sethook" "setlocal"
+ "setmetatable" "setupvalue" "setuservalue" "traceback" "upvalueid"
+ "upvaluejoin"))
+ ("io" . ("close" "flush" "input" "lines" "open" "output" "popen" "read" "stderr"
+ "stdin" "stdout" "tmpfile" "type" "write"))
+ ("math" . ("abs" "acos" "asin" "atan" "atan2" "ceil" "cos" "cosh" "deg" "exp" "floor"
+ "fmod" "frexp" "huge" "ldexp" "log" "log10" "max" "min" "modf" "pi" "pow"
+ "rad" "random" "randomseed" "sin" "sinh" "sqrt" "tan" "tanh"))
+ ("os" . ("clock" "date" "difftime" "execute" "exit" "getenv" "remove" "rename"
+ "setlocale" "time" "tmpname"))
+ ("package" . ("config" "cpath" "loaded" "loaders" "loadlib" "path" "preload"
+ "searchers" "searchpath" "seeall"))
+ ("string" . ("byte" "char" "dump" "find" "format" "gmatch" "gsub" "len" "lower"
+ "match" "rep" "reverse" "sub" "upper"))
+ ("table" . ("concat" "insert" "maxn" "pack" "remove" "sort" "unpack")))))
+
+ ;; This code uses \\< and \\> to delimit builtin symbols instead of
+ ;; \\_< and \\_>, because -- a necessity -- '.' syntax class is hacked
+ ;; to 'symbol' and \\_> won't detect a symbol boundary in 'foo.bar' and
+ ;; -- sufficiency -- conveniently, underscore '_' is hacked to count as
+ ;; word constituent, but only for font-locking. Neither of these hacks
+ ;; makes sense to me, I'm going to wipe them out as soon as I'm sure
+ ;; that indentation won't get hurt. --immerrr
+ ;;
+ (lua--cl-labels
+ ((module-name-re (x)
+ (concat "\\(?1:\\<"
+ (if (listp x) (car x) x)
+ "\\>\\)"))
+ (module-members-re (x) (if (listp x)
+ (concat "\\(?:[ \t]*\\.[ \t]*"
+ "\\<\\(?2:"
+ (regexp-opt (cdr x))
+ "\\)\\>\\)?")
+ "")))
+
+ (concat
+ ;; common prefix - beginning-of-line or neither of [ '.', ':' ] to
+ ;; exclude "foo.string.rep"
+ "\\(?:\\`\\|[^:. \n\t]\\)"
+ ;; optional whitespace
+ "[ \n\t]*"
+ "\\(?:"
+ ;; any of modules/functions
+ (mapconcat (lambda (x) (concat (module-name-re x)
+ (module-members-re x)))
+ modules
+ "\\|")
+ "\\)"))))
+
+ "A regexp that matches lua builtin functions & variables.
+
+This is a compilation of 5.1 and 5.2 builtins taken from the
+index of respective Lua reference manuals.")
+
+(defvar lua-font-lock-keywords
+ (eval-when-compile
+ (list
+ ;; highlight the hash-bang line "#!/foo/bar/lua" as comment
+ '("^#!.*$" . font-lock-comment-face)
+ ;; Handle variable names
+ ;; local blalba =
+ ;; ^^^^^^
+ '("\\(local[ \t]+\\(\\sw+\\)[ \t]*=\\)"
+ (2 font-lock-variable-name-face))
+
+ ;; Function name declarations.
+ '("^[ \t]*\\_<\\(\\(local[ \t]+\\)?function\\)\\_>[ \t]+\\(\\(\\sw:\\|\\sw\\.\\|\\sw_\\|\\sw\\)+\\)"
+ (1 font-lock-keyword-face) (3 font-lock-function-name-face nil t))
+
+ ;; Highlight lua builtin functions and variables
+ `(,lua--builtins
+ (1 font-lock-builtin-face) (2 font-lock-builtin-face nil noerror))
+
+ ;; Handle function names in assignments
+ '("\\(\\(\\sw:\\|\\sw\\.\\|\\sw_\\|\\sw\\)+\\)[ \t]*=[ \t]*\\(function\\)\\_>"
+ (1 font-lock-function-name-face nil t) (3 font-lock-keyword-face))
+
+ ;; octal numbers
+ '("\\_<0x[[:xdigit:]]+\\_>" . font-lock-constant-face)
+
+ ;; regular numbers
+ ;;
+ ;; This regexp relies on '.' being symbol constituent. Whenever this
+ ;; changes, the regexp needs revisiting --immerrr
+ `(,(concat "\\_<\\(?1:"
+ ;; make a digit on either side of dot mandatory
+ "\\(?:[0-9]+\\.?[0-9]*\\|[0-9]*\\.?[0-9]+\\)"
+ "\\(?:[eE][+-]?[0-9]+\\)?"
+ "\\)\\_>")
+ . font-lock-constant-face)
+
+ ;; Keywords.
+ (concat "\\_<"
+ (regexp-opt '("and" "break" "do" "else" "elseif" "end" "false"
+ "for" "function" "if" "in" "local" "nil" "not"
+ "or" "repeat" "return" "then" "true" "until"
+ "while") t)
+ "\\_>")
+
+ "Default expressions to highlight in Lua mode.")))
+
+(defvar lua-imenu-generic-expression
+ '((nil "^[ \t]*\\(?:local[ \t]+\\)?function[ \t]+\\(\\(\\sw:\\|\\sw_\\|\\sw\\.\\|\\sw\\)+\\)" 1))
+ "Imenu generic expression for lua-mode. See `imenu-generic-expression'.")
+
+(defvar lua-sexp-alist '(("then" . "end")
+ ("function" . "end")
+ ("do" . "end")))
+
+(defvar lua-mode-abbrev-table nil
+ "Abbreviation table used in lua-mode buffers.")
+
+(define-abbrev-table 'lua-mode-abbrev-table
+ ;; Emacs 23 introduced :system property that prevents abbrev
+ ;; entries from being written to file specified by abbrev-file-name
+ ;;
+ ;; Emacs 22 and earlier had this functionality implemented
+ ;; by simple nil/non-nil flag as positional parameter
+ (if (>= emacs-major-version 23)
+ '(("end" "end" lua-indent-line :system t)
+ ("else" "else" lua-indent-line :system t)
+ ("elseif" "elseif" lua-indent-line :system t))
+ '(("end" "end" lua-indent-line nil 'system)
+ ("else" "else" lua-indent-line nil 'system)
+ ("elseif" "elseif" lua-indent-line nil 'system))))
+
+(eval-and-compile
+ (defalias 'lua-make-temp-file
+ (if (fboundp 'make-temp-file)
+ 'make-temp-file
+ (lambda (prefix &optional dir-flag) ;; Simple implementation
+ (expand-file-name
+ (make-temp-name prefix)
+ (if (fboundp 'temp-directory)
+ (temp-directory)
+ temporary-file-directory))))))
+
+(defvar lua-mode-syntax-table
+ (with-syntax-table (copy-syntax-table)
+ (modify-syntax-entry ?+ ".")
+ (modify-syntax-entry ?- ". 12")
+ (modify-syntax-entry ?* ".")
+ (modify-syntax-entry ?/ ".")
+ (modify-syntax-entry ?^ ".")
+ ;; This might be better as punctuation, as for C, but this way you
+ ;; can treat table index as symbol.
+ (modify-syntax-entry ?. "_") ; e.g. `io.string'
+ (modify-syntax-entry ?> ".")
+ (modify-syntax-entry ?< ".")
+ (modify-syntax-entry ?= ".")
+ (modify-syntax-entry ?~ ".")
+ (modify-syntax-entry ?\n ">")
+ (modify-syntax-entry ?\' "\"")
+ (modify-syntax-entry ?\" "\"")
+ (syntax-table))
+ "Syntax table used while in `lua-mode'.")
+
+;;;###autoload
+(define-derived-mode lua-mode lua--prog-mode "Lua"
+ "Major mode for editing Lua code."
+ :abbrev-table lua-mode-abbrev-table
+ :syntax-table lua-mode-syntax-table
+ :group 'lua
+ (let ((switches nil)
+ s)
+ (setq comint-prompt-regexp lua-prompt-regexp)
+ (make-local-variable 'lua-default-command-switches)
+ (set (make-local-variable 'beginning-of-defun-function)
+ 'lua-beginning-of-proc)
+ (set (make-local-variable 'end-of-defun-function) 'lua-end-of-proc)
+ (set (make-local-variable 'indent-line-function) 'lua-indent-line)
+ (set (make-local-variable 'comment-start) lua-comment-start)
+ (set (make-local-variable 'comment-start-skip) lua-comment-start-skip)
+ (set (make-local-variable 'font-lock-defaults)
+ '(lua-font-lock-keywords
+ nil nil ((?_ . "w"))))
+ (set (make-local-variable 'imenu-generic-expression)
+ lua-imenu-generic-expression)
+ (make-local-variable 'lua-default-eval)
+ ;; setup menu bar entry (XEmacs style)
+ (if (and (featurep 'menubar)
+ (boundp 'current-menubar)
+ (fboundp 'set-buffer-menubar)
+ (fboundp 'add-menu)
+ (not (assoc "Lua" current-menubar)))
+ (progn
+ (set-buffer-menubar (copy-sequence current-menubar))
+ (add-menu nil "Lua" lua-emacs-menu)))
+ ;; Append Lua menu to popup menu for Emacs.
+ (if (boundp 'mode-popup-menu)
+ (setq mode-popup-menu
+ (cons (concat mode-name " Mode Commands") lua-emacs-menu)))
+
+ ;; hideshow setup
+ (unless (assq 'lua-mode hs-special-modes-alist)
+ (add-to-list 'hs-special-modes-alist
+ `(lua-mode
+ ,(regexp-opt (mapcar 'car lua-sexp-alist) 'words) ;start
+ ,(regexp-opt (mapcar 'cdr lua-sexp-alist) 'words) ;end
+ nil lua-forward-sexp)))
+
+ (set (make-local-variable 'parse-sexp-lookup-properties) t)
+ (lua-mark-all-multiline-literals)
+ (lua--automark-multiline-update-timer)))
+
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.lua$" . lua-mode))
+
+;;;###autoload
+(add-to-list 'interpreter-mode-alist '("lua" . lua-mode))
+
+(defun lua-electric-match (arg)
+ "Insert character and adjust indentation."
+ (interactive "P")
+ (insert-char last-command-event (prefix-numeric-value arg))
+ (if lua-electric-flag
+ (lua-indent-line))
+ (blink-matching-open))
+
+;; private functions
+
+(defun lua-prefix-key-update-bindings ()
+ (let (old-cons)
+ (if (eq lua-prefix-mode-map (keymap-parent lua-mode-map))
+ ;; if prefix-map is a parent, delete the parent
+ (set-keymap-parent lua-mode-map nil)
+ ;; otherwise, look for it among children
+ (if (setq old-cons (rassoc lua-prefix-mode-map lua-mode-map))
+ (delq old-cons lua-mode-map)))
+
+ (if (null lua-prefix-key)
+ (set-keymap-parent lua-mode-map lua-prefix-mode-map)
+ (define-key lua-mode-map (vector lua-prefix-key) lua-prefix-mode-map))))
+
+(defun lua-set-prefix-key (new-key-str)
+ "Changes `lua-prefix-key' properly and updates keymaps
+
+This function replaces previous prefix-key binding with a new one."
+ (interactive "sNew prefix key (empty string means no key): ")
+ (lua--customize-set-prefix-key 'lua-prefix-key new-key-str)
+ (lua-prefix-key-update-bindings))
+
+(defun lua-string-p (&optional pos)
+ "Returns true if the point is in a string."
+ (save-excursion (elt (syntax-ppss pos) 3)))
+
+(defun lua-comment-p (&optional pos)
+ "Returns true if the point is in a comment."
+ (save-excursion (elt (syntax-ppss pos) 4)))
+
+(defun lua-comment-or-string-p (&optional pos)
+ "Returns true if the point is in a comment or string."
+ (save-excursion (let ((parse-result (syntax-ppss pos)))
+ (or (elt parse-result 3) (elt parse-result 4)))))
+
+(defun lua-comment-or-string-start (&optional pos)
+ "Returns start position of string or comment which contains point.
+
+If point is not inside string or comment, return nil."
+ (save-excursion (elt (syntax-ppss pos) 8)))
+
+(defun lua-indent-line ()
+ "Indent current line for Lua mode.
+Return the amount the indentation changed by."
+ (let (indent
+ (case-fold-search nil)
+ ;; save point as a distance to eob - it's invariant w.r.t indentation
+ (pos (- (point-max) (point))))
+ (back-to-indentation)
+ (if (lua-comment-or-string-p)
+ (setq indent (lua-calculate-string-or-comment-indentation)) ;; just restore point position
+ (setq indent (max 0 (lua-calculate-indentation nil))))
+
+ (when (not (equal indent (current-column)))
+ (delete-region (line-beginning-position) (point))
+ (indent-to indent))
+
+ ;; If initial point was within line's indentation,
+ ;; position after the indentation. Else stay at same point in text.
+ (if (> (- (point-max) pos) (point))
+ (goto-char (- (point-max) pos)))
+
+ indent))
+
+(defun lua-calculate-string-or-comment-indentation ()
+ "This function should be run when point at (current-indentation) is inside string"
+ (if (and (lua-string-p) (not lua-indent-string-contents))
+ ;; if inside string and strings aren't to be indented, return current indentation
+ (current-indentation)
+ ;; Otherwise, indent as a comment
+ (save-excursion
+ (cond
+ ;; If it is the end of a multi-line comment, simply mirror the opening
+ ;; line's indent.
+ ((looking-at "\\s *\\(?:--\\)?\\]\\(?1:=*\\)\\]")
+ (re-search-backward (format "\\[%s\\["
+ (or (match-string-no-properties 1) ""))
+ (lua-get-multiline-start)
+ 'noerror)
+ (current-indentation))
+ ;; otherwise indent by lua-indent-level relative to the line where literal starts
+ (t
+ (goto-char (lua-get-multiline-start))
+ (+ (current-indentation) lua-indent-level))))))
+
+(defun lua-find-regexp (direction regexp &optional limit ignore-p)
+ "Searches for a regular expression in the direction specified.
+Direction is one of 'forward and 'backward.
+By default, matches in comments and strings are ignored, but what to ignore is
+configurable by specifying ignore-p. If the regexp is found, returns point
+position, nil otherwise.
+ignore-p returns true if the match at the current point position should be
+ignored, nil otherwise."
+ (let ((ignore-func (or ignore-p 'lua-comment-or-string-p))
+ (search-func (if (eq direction 'forward)
+ 're-search-forward 're-search-backward))
+ (case-fold-search nil))
+ (catch 'found
+ (while (funcall search-func regexp limit t)
+ (if (and (not (funcall ignore-func (match-beginning 0)))
+ (not (funcall ignore-func (match-end 0))))
+ (throw 'found (point)))))))
+
+(defconst lua-block-regexp
+ (eval-when-compile
+ (concat
+ "\\(\\_<"
+ (regexp-opt '("do" "function" "repeat" "then"
+ "else" "elseif" "end" "until") t)
+ "\\_>\\)\\|"
+ (regexp-opt '("{" "(" "[" "]" ")" "}") t))))
+
+(defconst lua-block-token-alist
+ '(("do" "\\<end\\>" "\\<for\\|while\\>" middle-or-open)
+ ("function" "\\<end\\>" nil open)
+ ("repeat" "\\<until\\>" nil open)
+ ("then" "\\<\\(e\\(lse\\(if\\)?\\|nd\\)\\)\\>" "\\<\\(else\\)?if\\>" middle)
+ ("{" "}" nil open)
+ ("[" "]" nil open)
+ ("(" ")" nil open)
+ ("if" "\\<then\\>" nil open)
+ ("for" "\\<do\\>" nil open)
+ ("while" "\\<do\\>" nil open)
+ ("else" "\\<end\\>" "\\<then\\>" middle)
+ ("elseif" "\\<then\\>" "\\<then\\>" middle)
+ ("end" nil "\\<\\(do\\|function\\|then\\|else\\)\\>" close)
+ ("until" nil "\\<repeat\\>" close)
+ ("}" nil "{" close)
+ ("]" nil "\\[" close)
+ (")" nil "(" close))
+ "This is a list of block token information blocks.
+Each token information entry is of the form:
+ KEYWORD FORWARD-MATCH-REGEXP BACKWARDS-MATCH-REGEXP TOKEN-TYPE
+KEYWORD is the token.
+FORWARD-MATCH-REGEXP is a regexp that matches all possble tokens when going forward.
+BACKWARDS-MATCH-REGEXP is a regexp that matches all possble tokens when going backwards.
+TOKEN-TYPE determines where the token occurs on a statement. open indicates that the token appears at start, close indicates that it appears at end, middle indicates that it is a middle type token, and middle-or-open indicates that it can appear both as a middle or an open type.")
+
+(defconst lua-indentation-modifier-regexp
+ ;; The absence of else is deliberate, since it does not modify the
+ ;; indentation level per se. It only may cause the line, in which the
+ ;; else is, to be shifted to the left.
+ (concat
+ "\\(\\_<"
+ (regexp-opt '("do" "function" "repeat" "then" "if" "else" "elseif" "for" "while") t)
+ "\\_>\\|"
+ (regexp-opt '("{" "(" "["))
+ "\\)\\|\\(\\_<"
+ (regexp-opt '("end" "until") t)
+ "\\_>\\|"
+ (regexp-opt '("]" ")" "}"))
+ "\\)")
+ )
+
+(defun lua-get-block-token-info (token)
+ "Returns the block token info entry for TOKEN from lua-block-token-alist"
+ (assoc token lua-block-token-alist))
+
+(defun lua-get-token-match-re (token-info direction)
+ "Returns the relevant match regexp from token info"
+ (cond
+ ((eq direction 'forward) (cadr token-info))
+ ((eq direction 'backward) (caddr token-info))
+ (t nil)))
+
+(defun lua-get-token-type (token-info)
+ "Returns the relevant match regexp from token info"
+ (cadddr token-info))
+
+(defun lua-backwards-to-block-begin-or-end ()
+ "Move backwards to nearest block begin or end. Returns nil if not successful."
+ (interactive)
+ (lua-find-regexp 'backward lua-block-regexp))
+
+(defun lua-find-matching-token-word (token search-start &optional direction)
+ (let* ((token-info (lua-get-block-token-info token))
+ (match-type (lua-get-token-type token-info))
+ ;; If we are on a middle token, go backwards. If it is a middle or open,
+ ;; go forwards
+ (search-direction (or direction
+ (if (or (eq match-type 'open)
+ (eq match-type 'middle-or-open))
+ 'forward
+ 'backward)
+ 'backward))
+ (match (lua-get-token-match-re token-info search-direction))
+ maybe-found-pos)
+ ;; if we are searching forward from the token at the current point
+ ;; (i.e. for a closing token), need to step one character forward
+ ;; first, or the regexp will match the opening token.
+ (if (eq search-direction 'forward) (forward-char 1))
+ (if search-start (goto-char search-start))
+ (catch 'found
+ ;; If we are attempting to find a matching token for a terminating token
+ ;; (i.e. a token that starts a statement when searching back, or a token
+ ;; that ends a statement when searching forward), then we don't need to look
+ ;; any further.
+ (if (or (and (eq search-direction 'forward)
+ (eq match-type 'close))
+ (and (eq search-direction 'backward)
+ (eq match-type 'open)))
+ (throw 'found nil))
+ (while (lua-find-regexp search-direction lua-indentation-modifier-regexp)
+ ;; have we found a valid matching token?
+ (let ((found-token (match-string 0))
+ (found-pos (match-beginning 0)))
+ (let ((found-type (lua-get-token-type
+ (lua-get-block-token-info found-token))))
+ (if (not (and match (string-match match found-token)))
+ ;; no - then there is a nested block. If we were looking for
+ ;; a block begin token, found-token must be a block end
+ ;; token; likewise, if we were looking for a block end token,
+ ;; found-token must be a block begin token, otherwise there
+ ;; is a grammatical error in the code.
+ (if (not (and
+ (or (eq match-type 'middle)
+ (eq found-type 'middle)
+ (eq match-type 'middle-or-open)
+ (eq found-type 'middle-or-open)
+ (eq match-type found-type))
+ (lua-find-matching-token-word found-token nil
+ search-direction)))
+ (when maybe-found-pos
+ (goto-char maybe-found-pos)
+ (throw 'found maybe-found-pos)))
+ ;; yes.
+ ;; if it is a not a middle kind, report the location
+ (when (not (or (eq found-type 'middle)
+ (eq found-type 'middle-or-open)))
+ (throw 'found found-pos))
+ ;; if it is a middle-or-open type, record location, but keep searching.
+ ;; If we fail to complete the search, we'll report the location
+ (when (eq found-type 'middle-or-open)
+ (setq maybe-found-pos found-pos))
+ ;; Cannot use tail recursion. too much nesting on long chains of
+ ;; if/elseif. Will reset variables instead.
+ (setq token found-token)
+ (setq token-info (lua-get-block-token-info token))
+ (setq match (lua-get-token-match-re token-info search-direction))
+ (setq match-type (lua-get-token-type token-info))))))
+ maybe-found-pos)))
+
+(defun lua-goto-matching-block-token (&optional search-start parse-start direction)
+ "Find block begion/end token matching the one at the point.
+This function moves the point to the token that matches the one
+at the current point. Returns the point position of the first character of
+the matching token if successful, nil otherwise."
+ (if parse-start (goto-char parse-start))
+ (let ((case-fold-search nil))
+ (if (looking-at lua-indentation-modifier-regexp)
+ (let ((position (lua-find-matching-token-word (match-string 0)
+ search-start direction)))
+ (and position
+ (goto-char position))))))
+
+(defun lua-goto-matching-block (&optional noreport)
+ "Go to the keyword balancing the one under the point.
+If the point is on a keyword/brace that starts a block, go to the
+matching keyword that ends the block, and vice versa."
+ (interactive)
+ ;; search backward to the beginning of the keyword if necessary
+ (if (eq (char-syntax (following-char)) ?w)
+ (re-search-backward "\\_<" nil t))
+ (let ((position (lua-goto-matching-block-token)))
+ (if (and (not position)
+ (not noreport))
+ (error "Not on a block control keyword or brace")
+ position)))
+
+(defun lua-forward-line-skip-blanks (&optional back)
+ "Move 1 line forward (back if BACK is non-nil) skipping blank lines.
+
+Moves point 1 line forward (or backward) skipping lines that contain
+no Lua code besides comments. The point is put to the beginning of
+the line.
+
+Returns final value of point as integer or nil if operation failed."
+ (catch 'found
+ (while t
+ (unless (eql (forward-line (if back -1 1)) 0) ;; 0 means success
+ (throw 'found nil))
+ (unless (or (looking-at "\\s *\\(--.*\\)?$")
+ (lua-comment-or-string-p))
+ (throw 'found (point))))))
+
+(eval-when-compile
+ (defconst lua-operator-class
+ "-+*/^.=<>~"))
+
+(defconst lua-cont-eol-regexp
+ (eval-when-compile
+ (concat
+ "\\(\\_<"
+ (regexp-opt '("and" "or" "not" "in" "for" "while"
+ "local" "function" "if" "until" "elseif" "return") t)
+ "\\_>\\|"
+ "\\(^\\|[^" lua-operator-class "]\\)"
+ (regexp-opt '("+" "-" "*" "/" "^" ".." "==" "=" "<" ">" "<=" ">=" "~=") t)
+ "\\)"
+ "\\s *\\=")
+ )
+ "Regexp that matches the ending of a line that needs continuation
+
+This regexp starts from eol and looks for a binary operator or an unclosed
+block intro (i.e. 'for' without 'do' or 'if' without 'then') followed by
+an optional whitespace till the end of the line.")
+
+(defconst lua-cont-bol-regexp
+ (eval-when-compile
+ (concat
+ "\\=\\s *"
+ "\\(\\_<"
+ (regexp-opt '("and" "or" "not") t)
+ "\\_>\\|"
+ (regexp-opt '("+" "-" "*" "/" "^" ".." "==" "=" "<" ">" "<=" ">=" "~=") t)
+ "\\($\\|[^" lua-operator-class "]\\)"
+ "\\)")
+
+ )
+ "Regexp that matches a line that continues previous one
+
+This regexp means, starting from point there is an optional whitespace followed
+by Lua binary operator. Lua is very liberal when it comes to continuation line,
+so we're safe to assume that every line that starts with a binop continues
+previous one even though it looked like an end-of-statement.")
+
+(defun lua-last-token-continues-p ()
+ "Returns true if the last token on this line is a continuation token."
+ (let ((line-begin (line-beginning-position))
+ (line-end (line-end-position)))
+ (save-excursion
+ (end-of-line)
+ ;; we need to check whether the line ends in a comment and
+ ;; skip that one.
+ (while (lua-find-regexp 'backward "-" line-begin 'lua-string-p)
+ (if (looking-at "--")
+ (setq line-end (point))))
+ (goto-char line-end)
+ (re-search-backward lua-cont-eol-regexp line-begin t))))
+
+(defun lua-first-token-continues-p ()
+ "Returns true if the first token on this line is a continuation token."
+ (let ((line-end (line-end-position)))
+ (save-excursion
+ (beginning-of-line)
+ ;; if first character of the line is inside string, it's a continuation
+ ;; if strings aren't supposed to be indented, `lua-calculate-indentation' won't even let
+ ;; the control inside this function
+ (re-search-forward lua-cont-bol-regexp line-end t))))
+
+(defun lua-is-continuing-statement-p (&optional parse-start)
+ "Return non-nil if the line continues a statement.
+More specifically, return the point in the line that is continued.
+The criteria for a continuing statement are:
+
+* the last token of the previous line is a continuing op,
+ OR the first token of the current line is a continuing op
+
+"
+ (let ((prev-line nil))
+ (save-excursion
+ (if parse-start (goto-char parse-start))
+ (save-excursion (setq prev-line (lua-forward-line-skip-blanks 'back)))
+ (and prev-line
+ (or (lua-first-token-continues-p)
+ (and (goto-char prev-line)
+ ;; check last token of previous nonblank line
+ (lua-last-token-continues-p)))))))
+
+(defun lua-make-indentation-info-pair (found-token found-pos)
+ "This is a helper function to lua-calculate-indentation-info. Don't
+use standalone."
+ (cond
+ ;; function is a bit tricky to indent right. They can appear in a lot ot
+ ;; different contexts. Until I find a shortcut, I'll leave it with a simple
+ ;; relative indentation.
+ ;; The special cases are for indenting according to the location of the
+ ;; function. i.e.:
+ ;; (cons 'absolute (+ (current-column) lua-indent-level))
+ ;; TODO: Fix this. It causes really ugly indentations for in-line functions.
+ ((string-equal found-token "function")
+ (cons 'relative lua-indent-level))
+
+ ;; block openers
+ ((member found-token (list "{" "(" "["))
+ (save-excursion
+ ;; expression follows -> indent at start of next expression
+ ;; Last token on the line -> simple relative indent
+ (if (and (not (search-forward-regexp "[[:space:]]--" (line-end-position) t))
+ (search-forward-regexp "[^[:space:]]" (line-end-position) t))
+ (cons 'absolute (1- (current-column)))
+ (cons 'relative lua-indent-level))))
+
+ ;; These are not really block starters. They should not add to indentation.
+ ;; The corresponding "then" and "do" handle the indentation.
+ ((member found-token (list "if" "for" "while"))
+ (cons 'relative 0))
+ ;; closing tokens follow: These are usually taken care of by
+ ;; lua-calculate-indentation-override.
+ ;; elseif is a bit of a hack. It is not handled separately, but it needs to
+ ;; nullify a previous then if on the same line.
+ ((member found-token (list "until" "elseif"))
+ (save-excursion
+ (let ((line (line-number-at-pos)))
+ (if (and (lua-goto-matching-block-token nil found-pos 'backward)
+ (= line (line-number-at-pos)))
+ (cons 'remove-matching 0)
+ (cons 'relative 0)))))
+
+ ;; else is a special case; if its matching block token is on the same line,
+ ;; instead of removing the matching token, it has to replace it, so that
+ ;; either the next line will be indented correctly, or the end on the same
+ ;; line will remove the effect of the else.
+ ((string-equal found-token "else")
+ (save-excursion
+ (let ((line (line-number-at-pos)))
+ (if (and (lua-goto-matching-block-token nil found-pos 'backward)
+ (= line (line-number-at-pos)))
+ (cons 'replace-matching (cons 'relative lua-indent-level))
+ (cons 'relative lua-indent-level)))))
+
+ ;; Block closers. If they are on the same line as their openers, they simply
+ ;; eat up the matching indentation modifier. Otherwise, they pull
+ ;; indentation back to the matching block opener.
+ ((member found-token (list ")" "}" "]" "end"))
+ (save-excursion
+ (let ((line (line-number-at-pos)))
+ (lua-goto-matching-block-token nil found-pos 'backward)
+ (if (/= line (line-number-at-pos))
+ (cons 'absolute
+ (+ (current-indentation)
+ (lua-calculate-indentation-block-modifier
+ nil (point))))
+ (cons 'remove-matching 0)))))
+
+ ;; Everything else. This is from the original code: If opening a block
+ ;; (match-data 1 exists), then push indentation one level up, if it is
+ ;; closing a block, pull it one level down.
+ ('other-indentation-modifier
+ (cons 'relative (if (nth 2 (match-data))
+ ;; beginning of a block matched
+ lua-indent-level
+ ;; end of a block matched
+ (- lua-indent-level))))))
+
+(defun lua-add-indentation-info-pair (pair info)
+ "Add the given indentation info pair to the list of indentation information.
+This function has special case handling for two tokens: remove-matching,
+and replace-matching. These two tokens are cleanup tokens that remove or
+alter the effect of a previously recorded indentation info.
+
+When a remove-matching token is encountered, the last recorded info, i.e.
+the car of the list is removed. This is used to roll-back an indentation of a
+block opening statement when it is closed.
+
+When a replace-matching token is seen, the last recorded info is removed,
+and the cdr of the replace-matching info is added in its place. This is used
+when a middle-of the block (the only case is 'else') is seen on the same line
+the block is opened."
+ (cond
+ ( (eq 'remove-matching (car pair))
+ ; Remove head of list
+ (cdr info))
+ ( (eq 'replace-matching (car pair))
+ ; remove head of list, and add the cdr of pair instead
+ (cons (cdr pair) (cdr info)))
+ ( t
+ ; Just add the pair
+ (cons pair info))))
+
+(defun lua-calculate-indentation-info (&optional parse-start parse-end)
+ "For each block token on the line, computes how it affects the indentation.
+The effect of each token can be either a shift relative to the current
+indentation level, or indentation to some absolute column. This information
+is collected in a list of indentation info pairs, which denote absolute
+and relative each, and the shift/column to indent to."
+ (let ((combined-line-end (line-end-position))
+ (start-indentation (current-indentation)))
+ (save-excursion
+ (while (lua-last-token-continues-p)
+ (lua-forward-line-skip-blanks)
+ (setq combined-line-end (line-end-position))))
+ (let ((search-stop (if parse-end
+ (min parse-end combined-line-end)
+ combined-line-end))
+ (indentation-info nil))
+ (if parse-start (goto-char parse-start))
+ (save-excursion
+ (beginning-of-line)
+ (while (lua-find-regexp 'forward lua-indentation-modifier-regexp
+ search-stop)
+ (let ((found-token (match-string 0))
+ (found-pos (match-beginning 0))
+ (found-end (match-end 0))
+ (data (match-data)))
+ (setq indentation-info
+ (lua-add-indentation-info-pair
+ (lua-make-indentation-info-pair found-token found-pos)
+ indentation-info))))
+ (or indentation-info
+ (list (cons 'absolute start-indentation)))))))
+
+(defun lua-accumulate-indentation-info (info)
+ "Accumulates the indentation information previously calculated by
+lua-calculate-indentation-info. Returns either the relative indentation
+shift, or the absolute column to indent to."
+ (let ((info-list (reverse info))
+ (type 'relative)
+ (accu 0))
+ (mapc (lambda (x)
+ (setq accu (if (eq 'absolute (car x))
+ (progn (setq type 'absolute)
+ (cdr x))
+ (+ accu (cdr x)))))
+ info-list)
+ (cons type accu)))
+
+(defun lua-calculate-indentation-block-modifier (&optional parse-start
+ parse-end)
+ "Return amount by which this line modifies the indentation.
+Beginnings of blocks add lua-indent-level once each, and endings
+of blocks subtract lua-indent-level once each. This function is used
+to determine how the indentation of the following line relates to this
+one."
+ (if parse-start (goto-char parse-start))
+ ;; First go back to the line that starts it all
+ ;; lua-calculate-indentation-info will scan through the whole thing
+ (while (lua-is-continuing-statement-p)
+ (lua-forward-line-skip-blanks 'back))
+ (let ((case-fold-search nil)
+ (indentation-info (lua-accumulate-indentation-info
+ (lua-calculate-indentation-info nil parse-end))))
+ (if (eq (car indentation-info) 'absolute)
+ (- (cdr indentation-info) (current-indentation))
+ (cdr indentation-info))))
+
+(defun lua-point-is-after-left-shifter-p ()
+ "Check if point is at a left-shifter.
+A left-shifter is a partial lua expression which should be ignored for line up purposes when closing a block. An example of this is:
+ local a = function()
+ ....
+ end
+ ^ ^
+ | +- not here
+ +- Close here"
+ (save-excursion
+ (let ((old-point (point)))
+ (back-to-indentation)
+ (and
+ (or (looking-at "local\\s +\\(?:\\(?:\\sw\\|\\s_\\)+\\s *\\(,\\s *\\(?:\\sw\\|\\s_\\)+\\s *\\)*=\\s *\\)?")
+ ;; This is too generic, and will screw up a lot of indentations. Will need
+ ;; a better regexp for assignments
+ (looking-at "[^=]*=\\s *"))
+ (= old-point (match-end 0))))))
+
+(defun lua-calculate-indentation-override (&optional parse-start)
+ "Return overriding indentation amount for special cases.
+Look for an uninterrupted sequence of block-closing tokens that starts
+at the beginning of the line. For each of these tokens, shift indentation
+to the left by the amount specified in lua-indent-level."
+ (let ((indentation-modifier 0)
+ (case-fold-search nil)
+ (block-token nil))
+ (save-excursion
+ (if parse-start (goto-char parse-start))
+ ;; Look for the last block closing token
+ (back-to-indentation)
+ (if (and (not (lua-comment-or-string-p))
+ (looking-at lua-indentation-modifier-regexp)
+ (let ((token-info (lua-get-block-token-info (match-string 0))))
+ (and token-info
+ (not (eq 'open (lua-get-token-type token-info))))))
+ (when (lua-goto-matching-block-token nil nil 'backward)
+ ;; Exception cases: when the start of the line is an assignment,
+ ;; go to the start of the assignment instead of the matching item
+ (let ((block-start-column (current-column))
+ (block-start-point (point)))
+ (if (lua-point-is-after-left-shifter-p)
+ (current-indentation)
+ block-start-column)))))))
+
+(defun lua-calculate-indentation (&optional parse-start)
+ "Return appropriate indentation for current line as Lua code."
+ (save-excursion
+ (let ((continuing-p (lua-is-continuing-statement-p)))
+ (or
+ ;; when calculating indentation, do the following:
+ ;; 1. check, if the line starts with indentation-modifier (open/close brace)
+ ;; and if it should be indented/unindented in special way
+ (lua-calculate-indentation-override)
+
+ ;; 2. otherwise, use indentation modifiers from previous line + it's own indentation
+ ;; 3. if previous line doesn't contain indentation modifiers, additionally check
+ ;; if current line is a continuation line and add lua-indent-level if it is
+ (when (lua-forward-line-skip-blanks 'back)
+ ;; the order of function calls here is important. block modifier
+ ;; call may change the point to another line
+ (let ((modifier
+ (lua-calculate-indentation-block-modifier nil (line-end-position))))
+ (+ (if (and continuing-p (= 0 modifier))
+ lua-indent-level
+ modifier)
+ (current-indentation))))
+
+ ;; 4. if there's no previous line, indentation is 0
+ 0))))
+
+(defun lua-beginning-of-proc (&optional arg)
+ "Move backward to the beginning of a lua proc (or similar).
+With argument, do it that many times. Negative arg -N
+means move forward to Nth following beginning of proc.
+Returns t unless search stops due to beginning or end of buffer."
+ (interactive "P")
+ (or arg
+ (setq arg 1))
+ (let ((found nil)
+ (ret t))
+ (while (< arg 0)
+ (if (re-search-forward "^function[ \t]" nil t)
+ (setq arg (1+ arg)
+ found t)
+ (setq ret nil
+ arg 0)))
+ (if found
+ (beginning-of-line))
+ (if (> arg 0)
+ (if (re-search-forward "^function[ \t]" nil t)
+ (setq arg (1+ arg))
+ (goto-char (point-max))))
+ (while (> arg 0)
+ (if (re-search-backward "^function[ \t]" nil t)
+ (setq arg (1- arg))
+ (setq ret nil
+ arg 0)))
+ ret))
+
+(defun lua-end-of-proc (&optional arg)
+ "Move forward to next end of lua proc (or similar).
+With argument, do it that many times. Negative argument -N means move
+back to Nth preceding end of proc.
+
+This function just searches for a `end' at the beginning of a line."
+ (interactive "P")
+ (or arg
+ (setq arg 1))
+ (let ((found nil)
+ (ret t))
+ (if (and (< arg 0)
+ (not (bolp))
+ (save-excursion
+ (beginning-of-line)
+ (eq (following-char) ?})))
+ (forward-char -1))
+ (while (> arg 0)
+ (if (re-search-forward "^end" nil t)
+ (setq arg (1- arg)
+ found t)
+ (setq ret nil
+ arg 0)))
+ (while (< arg 0)
+ (if (re-search-backward "^end" nil t)
+ (setq arg (1+ arg)
+ found t)
+ (setq ret nil
+ arg 0)))
+ (if found
+ (progn
+ (beginning-of-line)
+ (forward-line)))
+ ret))
+
+(defun lua-start-process (&optional name program startfile &rest switches)
+ "Start a lua process named NAME, running PROGRAM.
+PROGRAM defaults to NAME, which defaults to `lua-default-application'.
+When called interactively, switch to the process buffer."
+ (interactive)
+ (or switches
+ (setq switches lua-default-command-switches))
+ (setq name (or name lua-default-application))
+ (setq program (or program name))
+ (setq lua-process-buffer (apply 'make-comint name program startfile switches))
+ (setq lua-process (get-buffer-process lua-process-buffer))
+ ;; wait for prompt
+ (with-current-buffer lua-process-buffer
+ (while (not (lua-prompt-line))
+ (accept-process-output (get-buffer-process (current-buffer)))
+ (goto-char (point-max))))
+ ;; when called interactively, switch to process buffer
+ (if (lua--called-interactively-p 'any)
+ (switch-to-buffer lua-process-buffer)))
+
+(defun lua-kill-process ()
+ "Kill lua subprocess and its buffer."
+ (interactive)
+ (if lua-process-buffer
+ (kill-buffer lua-process-buffer)))
+
+(defun lua-set-lua-region-start (&optional arg)
+ "Set start of region for use with `lua-send-lua-region'."
+ (interactive)
+ (set-marker lua-region-start (or arg (point))))
+
+(defun lua-set-lua-region-end (&optional arg)
+ "Set end of region for use with `lua-send-lua-region'."
+ (interactive)
+ (set-marker lua-region-end (or arg (point))))
+
+(defun lua-send-current-line ()
+ "Send current line to lua subprocess, found in `lua-process'.
+If `lua-process' is nil or dead, start a new process first."
+ (interactive)
+ (lua-send-region (line-beginning-position) (line-end-position)))
+
+(defun lua-send-region (start end)
+ "Send region to lua subprocess."
+ (interactive "r")
+ ;; make temporary lua file
+ (let ((tempfile (lua-make-temp-file "lua-"))
+ (last-prompt nil)
+ (prompt-found nil)
+ (lua-stdin-line-offset (count-lines (point-min) start))
+ (lua-stdin-buffer (current-buffer))
+ current-prompt )
+ (write-region start end tempfile)
+ (or (and lua-process
+ (comint-check-proc lua-process-buffer))
+ (lua-start-process lua-default-application))
+ ;; kill lua process without query
+ (if (fboundp 'process-kill-without-query)
+ (process-kill-without-query lua-process))
+ ;; send dofile(tempfile)
+ (with-current-buffer lua-process-buffer
+ (goto-char (point-max))
+ (setq last-prompt (point-max))
+ (comint-simple-send (get-buffer-process (current-buffer))
+ (format "dofile(\"%s\")"
+ (replace-regexp-in-string "\\\\" "\\\\\\\\" tempfile)))
+ ;; wait for prompt
+ (while (not prompt-found)
+ (accept-process-output (get-buffer-process (current-buffer)))
+ (goto-char (point-max))
+ (setq prompt-found (and (lua-prompt-line) (< last-prompt (point-max)))))
+ ;; remove temp. lua file
+ (delete-file tempfile)
+ (lua-postprocess-output-buffer lua-process-buffer last-prompt lua-stdin-line-offset)
+ (if lua-always-show
+ (display-buffer lua-process-buffer)))))
+
+(defun lua-postprocess-output-buffer (buf start &optional lua-stdin-line-offset)
+ "Highlight tracebacks found in buf. If an traceback occurred return
+t, otherwise return nil. BUF must exist."
+ (let ((lua-stdin-line-offset (or lua-stdin-line-offset 0))
+ line file bol err-p)
+ (with-current-buffer buf
+ (goto-char start)
+ (beginning-of-line)
+ (if (re-search-forward lua-traceback-line-re nil t)
+ (setq file (match-string 1)
+ line (string-to-number (match-string 2)))))
+ (when (and lua-jump-on-traceback line)
+ (beep)
+ ;; FIXME: highlight
+ (lua-jump-to-traceback file line lua-stdin-line-offset)
+ (setq err-p t))
+ err-p))
+
+(defun lua-jump-to-traceback (file line lua-stdin-line-offset)
+ "Jump to the Lua code in FILE at LINE."
+ ;; sanity check: temporary-file-directory
+ (if (string= (substring file 0 3) "...")
+ (message "Lua traceback output truncated: customize 'temporary-file-directory' or increase 'LUA_IDSIZE' in 'luaconf.h'.")
+ (let ((buffer (cond ((or (string-equal file tempfile) (string-equal file "stdin"))
+ (setq line (+ line lua-stdin-line-offset))
+ lua-stdin-buffer)
+ (t (find-file-noselect file)))))
+ (pop-to-buffer buffer)
+ ;; Force Lua mode
+ (if (not (eq major-mode 'lua-mode))
+ (lua-mode))
+ ;; FIXME: fix offset when executing region
+ (goto-char (point-min)) (forward-line (1- line))
+ (message "Jumping to error in file %s on line %d" file line))))
+
+(defun lua-prompt-line ()
+ (save-excursion
+ (save-match-data
+ (forward-line 0)
+ (if (looking-at comint-prompt-regexp)
+ (match-end 0)))))
+
+(defun lua-send-lua-region ()
+ "Send preset lua region to lua subprocess."
+ (interactive)
+ (or (and lua-region-start lua-region-end)
+ (error "lua-region not set"))
+ (or (and lua-process
+ (comint-check-proc lua-process-buffer))
+ (lua-start-process lua-default-application))
+ (comint-simple-send lua-process
+ (buffer-substring lua-region-start lua-region-end)
+ )
+ (if lua-always-show
+ (display-buffer lua-process-buffer)))
+
+(defun lua-send-proc ()
+ "Send proc around point to lua subprocess."
+ (interactive)
+ (let (beg end)
+ (save-excursion
+ (lua-beginning-of-proc)
+ (setq beg (point))
+ (lua-end-of-proc)
+ (setq end (point)))
+ (or (and lua-process
+ (comint-check-proc lua-process-buffer))
+ (lua-start-process lua-default-application))
+ (comint-simple-send lua-process
+ (buffer-substring beg end))
+ (if lua-always-show
+ (display-buffer lua-process-buffer))))
+
+;; FIXME: This needs work... -Bret
+(defun lua-send-buffer ()
+ "Send whole buffer to lua subprocess."
+ (interactive)
+ (lua-send-region (point-min) (point-max)))
+
+(defun lua-restart-with-whole-file ()
+ "Restart lua subprocess and send whole file as input."
+ (interactive)
+ (lua-kill-process)
+ (lua-start-process lua-default-application)
+ (lua-send-buffer))
+
+(defun lua-show-process-buffer ()
+ "Make sure `lua-process-buffer' is being displayed."
+ (interactive)
+ (display-buffer lua-process-buffer))
+
+(defun lua-hide-process-buffer ()
+ "Delete all windows that display `lua-process-buffer'."
+ (interactive)
+ (delete-windows-on lua-process-buffer))
+
+(defun lua-search-documentation ()
+ "Search Lua documentation for the word at the point."
+ (interactive)
+ (browse-url (concat lua-search-url-prefix (current-word t))))
+
+(defun lua-toggle-electric-state (&optional arg)
+ "Toggle the electric indentation feature.
+Optional numeric ARG, if supplied, turns on electric indentation when
+positive, turns it off when negative, and just toggles it when zero or
+left out."
+ (interactive "P")
+ (let ((num_arg (prefix-numeric-value arg)))
+ (setq lua-electric-flag (cond ((or (null arg)
+ (zerop num_arg)) (not lua-electric-flag))
+ ((< num_arg 0) nil)
+ ((> num_arg 0) t))))
+ (message "%S" lua-electric-flag))
+
+(defun lua-forward-sexp (&optional count)
+ "Forward to block end"
+ (interactive "p")
+ (save-match-data
+ (let* ((count (or count 1))
+ (block-start (mapcar 'car lua-sexp-alist))
+ (block-end (mapcar 'cdr lua-sexp-alist))
+ (block-regex (regexp-opt (append block-start block-end) 'words))
+ current-exp
+ )
+ (while (> count 0)
+ ;; skip whitespace
+ (skip-chars-forward " \t\n")
+ (if (looking-at (regexp-opt block-start 'words))
+ (let ((keyword (match-string 1)))
+ (lua-find-matching-token-word keyword nil))
+ ;; If the current keyword is not a "begin" keyword, then just
+ ;; perform the normal forward-sexp.
+ (forward-sexp 1))
+ (setq count (1- count))))))
+
+
+;; menu bar
+
+(define-key lua-mode-menu [restart-with-whole-file]
+ '("Restart With Whole File" . lua-restart-with-whole-file))
+(define-key lua-mode-menu [kill-process]
+ '("Kill Process" . lua-kill-process))
+
+(define-key lua-mode-menu [hide-process-buffer]
+ '("Hide Process Buffer" . lua-hide-process-buffer))
+(define-key lua-mode-menu [show-process-buffer]
+ '("Show Process Buffer" . lua-show-process-buffer))
+
+(define-key lua-mode-menu [end-of-proc]
+ '("End Of Proc" . lua-end-of-proc))
+(define-key lua-mode-menu [beginning-of-proc]
+ '("Beginning Of Proc" . lua-beginning-of-proc))
+
+(define-key lua-mode-menu [send-lua-region]
+ '("Send Lua-Region" . lua-send-lua-region))
+(define-key lua-mode-menu [set-lua-region-end]
+ '("Set Lua-Region End" . lua-set-lua-region-end))
+(define-key lua-mode-menu [set-lua-region-start]
+ '("Set Lua-Region Start" . lua-set-lua-region-start))
+
+(define-key lua-mode-menu [send-current-line]
+ '("Send Current Line" . lua-send-current-line))
+(define-key lua-mode-menu [send-region]
+ '("Send Region" . lua-send-region))
+(define-key lua-mode-menu [send-proc]
+ '("Send Proc" . lua-send-proc))
+(define-key lua-mode-menu [send-buffer]
+ '("Send Buffer" . lua-send-buffer))
+(define-key lua-mode-menu [search-documentation]
+ '("Search Documentation" . lua-search-documentation))
+
+(defsubst lua-put-char-property (pos property value &optional object)
+ (lua--with-silent-modifications
+
+ (if value
+ (put-text-property pos (1+ pos) property value object)
+ (remove-text-properties pos (1+ pos) (list property nil))))
+
+ ;; `lua--with-silent-modifications' inhibits modification hooks, one of which
+ ;; is the hook that keeps `syntax-ppss' internal cache up-to-date. If this
+ ;; isn't done, the results of subsequent calls to `syntax-ppss' are
+ ;; invalid. To avoid such cache discrepancy, the hook must be run manually.
+ (syntax-ppss-flush-cache pos))
+
+(defsubst lua-put-char-syntax-table (pos value &optional object)
+ (lua-put-char-property pos 'syntax-table value object))
+
+(defsubst lua-get-multiline-delim-syntax (type)
+ (cond ((eq type 'string) '(15))
+ ((eq type 'comment) '(14))
+ (nil)))
+
+(defun lua-mark-char-multiline-delim (pos type)
+ "Mark character as a delimiter of Lua multiline construct
+
+If TYPE is string, mark char as string delimiter. If TYPE is comment,
+mark char as comment delimiter. Otherwise, remove the mark if any."
+ (lua-put-char-syntax-table pos (lua-get-multiline-delim-syntax type)))
+
+(defsubst lua-inside-multiline-p (&optional pos)
+ (let ((status (syntax-ppss pos)))
+ (or (eq (elt status 3) t) ;; inside generic string
+ (eq (elt status 7) 'syntax-table)))) ;; inside generic comment
+
+(defun lua-get-multiline-start (&optional pos)
+ (interactive)
+ (when (lua-inside-multiline-p pos) ;; return string/comment start
+ (elt (syntax-ppss pos) 8)))
+
+(defun lua-unmark-multiline-literals (&optional begin end)
+ "Clears all Lua multiline construct markers in region
+
+If BEGIN is nil, start from `beginning-of-buffer'.
+If END is nil, stop at `end-of-buffer'."
+ (interactive)
+
+ (setq begin (or begin (point-min))
+ end (or end (point-max)))
+
+ (lua--with-silent-modifications
+ (remove-text-properties begin end '(syntax-table ())))
+
+ ;; `lua--with-silent-modifications' inhibits modification hooks, one of which
+ ;; is the hook that keeps `syntax-ppss' internal cache up-to-date. If this
+ ;; isn't done, the results of subsequent calls to `syntax-ppss' are
+ ;; invalid. To avoid such cache discrepancy, the hook must be run manually.
+ (syntax-ppss-flush-cache begin)
+
+ (font-lock-fontify-buffer))
+
+(defun lua-mark-multiline-region (begin end)
+ (let ((type (if (eq ?- (char-after begin)) 'comment 'string)))
+ (lua-mark-char-multiline-delim begin type)
+ (when end
+ (lua-mark-char-multiline-delim (1- end) type))))
+
+(defun lua-mark-all-multiline-literals (&optional begin end)
+ "Marks all Lua multiline constructs in region
+
+If BEGIN is nil, start from `beginning-of-buffer'.
+If END is nil, stop at `end-of-buffer'."
+ (interactive)
+
+ (if (and (lua--called-interactively-p 'any) (use-region-p))
+ (setq begin (region-beginning)
+ end (region-end)))
+
+ (lua-unmark-multiline-literals begin end)
+ (save-excursion
+ (goto-char (or begin (point-min)))
+
+ (while (and
+ ;; must check for point range, because matching previous
+ ;; multiline end might move point beyond end and this
+ ;; drives `re-search-forward' crazy
+ (if end (< (point) end) t)
+ ;; look for
+ ;; 1. (optional) two or more dashes followed by
+ ;; 2. lua multiline delimiter [[
+ (re-search-forward "\\(?2:--\\)?\\[\\(?1:=*\\)\\[" end 'noerror))
+ ;; match-start + 1 is considered instead of match-start, because
+ ;; such approach handles '---[[' situation correctly: Emacs
+ ;; thinks 2nd dash (i.e. match-start) is not yet a comment, but
+ ;; the third one is, hence the +1. In all the other situations,
+ ;; '+1' is safe to use because it bears the same syntactic
+ ;; properties, i.e. if match-start is inside string-or-comment,
+ ;; then '+1' is too and vice versa.
+ ;;
+ ;; PS. ping me if you find a situation in which this is not true
+ (unless (lua-comment-or-string-p (1+ (match-beginning 0)))
+ (let (ml-begin ml-end)
+ (setq ml-begin (match-beginning 0))
+ (when (re-search-forward (format "\\]%s\\]" (or (match-string 1) "")) nil 'noerror)
+ ;; (message "found match %s" (match-string 0))
+ (setq ml-end (match-end 0)))
+ (lua-mark-multiline-region ml-begin ml-end))))))
+
+(defvar lua-automark-multiline-timer nil
+ "Contains idle-timer object used for automatical multiline literal markup which must be cleaned up on exit.")
+(make-variable-buffer-local 'lua-automark-multiline-timer)
+
+(defvar lua-automark-multiline-start-pos nil
+ "Contains position from which automark procedure should start.
+
+Automarking shall start at the point before which no modification has been
+made since last automark. Additionally, if such point is inside string or
+comment, rewind start position to its beginning.
+
+nil means automark is unnecessary because there were no updates.")
+(make-variable-buffer-local 'lua-automark-multiline-start-pos)
+
+(defun lua--automark-update-start-pos (change-begin change-end old-len)
+ "Updates `lua-automark-multiline-start-pos' upon buffer modification."
+ (save-excursion
+ (goto-char change-begin)
+ (beginning-of-line)
+ (setq lua-automark-multiline-start-pos
+ (or (lua-comment-or-string-start) (point)))))
+
+(defun lua--automark-multiline-update-timer ()
+ (lua--automark-multiline-cleanup) ;; reset previous timer if it existed
+ (when lua-automark-multiline-interval
+ (add-hook 'change-major-mode-hook 'lua--automark-multiline-cleanup nil 'local)
+ (add-hook 'after-change-functions 'lua--automark-update-start-pos nil 'local)
+ (setq lua-automark-multiline-timer
+ (run-with-idle-timer lua-automark-multiline-interval 'repeat
+ 'lua--automark-multiline-run))))
+
+(defun lua--automark-multiline-cleanup ()
+ "Disable automatical multiline construct marking"
+ (unless (null lua-automark-multiline-timer)
+ (cancel-timer lua-automark-multiline-timer)
+ (setq lua-automark-multiline-timer nil)))
+
+(defun lua--automark-multiline-run ()
+ (when (<= (buffer-size) lua-automark-multiline-maxsize)
+ (when lua-automark-multiline-start-pos
+ (lua-mark-all-multiline-literals lua-automark-multiline-start-pos)
+ (setq lua-automark-multiline-start-pos nil))))
+
+(defun lua--customize-set-automark-multiline-interval (symbol value)
+ (set symbol value)
+ (dolist (buf (buffer-list))
+ (with-current-buffer buf
+ (when (eq major-mode 'lua-mode)
+ (lua--automark-multiline-update-timer)))))
+
+(defcustom lua-automark-multiline-interval 1
+ "If not 0, specifies idle time in seconds after which lua-mode will mark multiline literals."
+ :group 'lua
+ :type 'integer
+ :set 'lua--customize-set-automark-multiline-interval)
+
+(defcustom lua-automark-multiline-maxsize 100000
+ "Maximum buffer size for which lua-mode will mark multiline literals automatically."
+ :group 'lua
+ :type 'integer)
+
+(provide 'lua-mode)
+
+;;; lua-mode.el ends here
diff --git a/elisp/nxhtml/alts/find-recursive-orig.el b/elisp/nxhtml/alts/find-recursive-orig.el
new file mode 100644
index 0000000..509a038
--- /dev/null
+++ b/elisp/nxhtml/alts/find-recursive-orig.el
@@ -0,0 +1,137 @@
+;; find-recursive.el -- Find files recursively into a directory
+;;
+;; Copyright (C) 2001 Ovidiu Predescu
+;;
+;; Author: Ovidiu Predescu <ovidiu@cup.hp.com>
+;; Date: March 26, 2001
+;;
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License
+;; as published by the Free Software Foundation; either version 2
+;; of the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;
+;; Setup: put this file in your Lisp path and add the following line in
+;; your .emacs:
+;;
+;; (require 'find-recursive)
+;;
+
+(require 'cl)
+
+(defcustom find-recursive-exclude-files '(".*.class$" ".*~$" ".*.elc$")
+ "List of regular expressions of files to be excluded when recursively searching for files."
+ :type '(repeat (string :tag "File regexp")))
+
+(defun find-file-recursively (file-regexp directory)
+ (interactive "sFile name to search for recursively: \nDIn directory: ")
+ (let ((directory (if (equal (substring directory -1) "/")
+ directory
+ (concat directory "/")))
+ (matches
+ (find-recursive-filter-out
+ find-recursive-exclude-files
+ (find-recursive-directory-relative-files directory "" file-regexp))))
+ (cond ((eq (length matches) 0) (message "No file(s) found!"))
+ ((eq (length matches) 1)
+ (find-file (concat directory (car matches))))
+ (t
+ (run-with-timer 0.001 nil
+ (lambda ()
+ (dispatch-event
+ (make-event 'key-press '(key tab)))))
+ (let ((file (completing-read "Choose file: "
+ (mapcar 'list matches)
+ nil t)))
+ (if (or (eq file nil) (equal file ""))
+ (message "No file selected.")
+ (find-file (concat directory file))))))))
+
+(defun find-recursive-directory-relative-files (directory
+ relative-directory
+ file-regexp)
+ (let* ((full-dir (concat directory "/" relative-directory))
+ (matches
+ (mapcar
+ (function (lambda (x)
+ (concat relative-directory x)))
+ (find-recursive-filter-out '(nil)
+ (directory-files full-dir nil
+ file-regexp nil t))))
+ (inner
+ (mapcar
+ (function
+ (lambda (dir)
+ (find-recursive-directory-relative-files directory
+ (concat relative-directory
+ dir "/")
+ file-regexp)))
+ (find-recursive-filter-out '(nil "\\." "\\.\\.")
+ (directory-files full-dir nil ".*"
+ nil 'directories)))))
+ (mapcar (function (lambda (dir) (setq matches (append matches dir))))
+ inner)
+ matches))
+
+(defun find-recursive-filter-out (remove-list list)
+ "Remove all the elements in *remove-list* from *list*"
+ (if (eq list nil)
+ nil
+ (let ((elem (car list))
+ (rest (cdr list)))
+ (if (some
+ (lambda (regexp)
+ (if (or (eq elem nil) (eq regexp nil))
+ nil
+ (not (eq (string-match regexp elem) nil))))
+ remove-list)
+ (find-recursive-filter-out remove-list rest)
+ (cons elem (find-recursive-filter-out remove-list rest))))))
+
+(defvar find-recursive-running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))
+
+(if find-recursive-running-xemacs
+ nil
+ (defadvice directory-files (after
+ directory-files-xemacs
+ (dirname &optional full match nosort files-only)
+ activate)
+ "Add an additional argument, FILES-ONLY to the list of arguments
+for GNU Emacs. If the symbol is t, then only the files in the
+directory will be returned. If FILES-ONLY is nil, then both files and
+directories are selected. If FILES-ONLY is not nil and not t, then
+only sundirectories are returned."
+ (setq ad-return-value
+ (cond ((null files-only) ad-return-value)
+ ((eq files-only t)
+ (find-recursive-remove-if (lambda (f)
+ (file-directory-p
+ (concat dirname "/" f)))
+ ad-return-value))
+ (t
+ (find-recursive-remove-if (lambda (f)
+ (not (file-directory-p
+ (concat dirname "/" f))))
+ ad-return-value)))))
+
+ (defun find-recursive-remove-if (func list)
+ "Removes all elements satisfying FUNC from LIST."
+ (let ((result nil))
+ (while list
+ (if (not (funcall func (car list)))
+ (setq result (cons (car list) result)))
+ (setq list (cdr list)))
+ (nreverse result))))
+
+(global-set-key [(control x) (meta f)] 'find-file-recursively)
+
+(provide 'find-recursive)
diff --git a/elisp/nxhtml/alts/javascript-mozlab.el b/elisp/nxhtml/alts/javascript-mozlab.el
new file mode 100644
index 0000000..bcec39b
--- /dev/null
+++ b/elisp/nxhtml/alts/javascript-mozlab.el
@@ -0,0 +1,712 @@
+;;; javascript.el --- Major mode for editing JavaScript source text
+
+;; Copyright (C) 2006 Karl Landström
+
+;; Author: Karl Landström <kland@comhem.se>
+;; Maintainer: Karl Landström <kland@comhem.se>
+;; Version: 2.0 Beta 8
+;; Date: 2006-12-26
+;; Keywords: languages, oop
+
+;; This file 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 file 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:
+;;
+;; The main features of this JavaScript mode are syntactic
+;; highlighting (enabled with `font-lock-mode' or
+;; `global-font-lock-mode'), automatic indentation and filling of
+;; comments.
+;;
+;; This package has (only) been tested with GNU Emacs 21.4 (the latest
+;; stable release).
+;;
+;; Installation:
+;;
+;; Put this file in a directory where Emacs can find it (`C-h v
+;; load-path' for more info). Then add the following lines to your
+;; Emacs initialization file:
+;;
+;; (add-to-list 'auto-mode-alist '("\\.js\\'" . javascript-mode))
+;; (autoload 'javascript-mode "javascript" nil t)
+;;
+;; General Remarks:
+;;
+;; This mode assumes that block comments are not nested inside block
+;; comments and that strings do not contain line breaks.
+;;
+;; Exported names start with "javascript-" whereas private names start
+;; with "js-".
+;;
+;; Changes:
+;;
+;; See javascript.el.changelog.
+
+;;; Code:
+
+(require 'cc-mode)
+(require 'font-lock)
+(require 'newcomment)
+
+(defgroup javascript nil
+ "Customization variables for `javascript-mode'."
+ :tag "JavaScript"
+ :group 'languages)
+
+(defcustom javascript-indent-level 4
+ "Number of spaces for each indentation step."
+ :type 'integer
+ :group 'javascript)
+
+(defcustom javascript-auto-indent-flag t
+ "Automatic indentation with punctuation characters. If non-nil, the
+current line is indented when certain punctuations are inserted."
+ :type 'boolean
+ :group 'javascript)
+
+
+;; --- Keymap ---
+
+(defvar javascript-mode-map nil
+ "Keymap used in JavaScript mode.")
+
+(unless javascript-mode-map
+ (setq javascript-mode-map (make-sparse-keymap)))
+
+(when javascript-auto-indent-flag
+ (mapc (lambda (key)
+ (define-key javascript-mode-map key 'javascript-insert-and-indent))
+ '("{" "}" "(" ")" ":" ";" ",")))
+
+(defun javascript-insert-and-indent (key)
+ "Run command bound to key and indent current line. Runs the command
+bound to KEY in the global keymap and indents the current line."
+ (interactive (list (this-command-keys)))
+ (call-interactively (lookup-key (current-global-map) key))
+ (indent-according-to-mode))
+
+
+;; --- Syntax Table And Parsing ---
+
+(defvar javascript-mode-syntax-table
+ (let ((table (make-syntax-table)))
+ (c-populate-syntax-table table)
+
+ ;; The syntax class of underscore should really be `symbol' ("_")
+ ;; but that makes matching of tokens much more complex as e.g.
+ ;; "\\<xyz\\>" matches part of e.g. "_xyz" and "xyz_abc". Defines
+ ;; it as word constituent for now.
+ (modify-syntax-entry ?_ "w" table)
+
+ table)
+ "Syntax table used in JavaScript mode.")
+
+
+(defun js-re-search-forward-inner (regexp &optional bound count)
+ "Auxiliary function for `js-re-search-forward'."
+ (let ((parse)
+ (saved-point (point-min)))
+ (while (> count 0)
+ (re-search-forward regexp bound)
+ (setq parse (parse-partial-sexp saved-point (point)))
+ (cond ((nth 3 parse)
+ (re-search-forward
+ (concat "\\([^\\]\\|^\\)" (string (nth 3 parse)))
+ (save-excursion (end-of-line) (point)) t))
+ ((nth 7 parse)
+ (forward-line))
+ ((or (nth 4 parse)
+ (and (eq (char-before) ?\/) (eq (char-after) ?\*)))
+ (re-search-forward "\\*/"))
+ (t
+ (setq count (1- count))))
+ (setq saved-point (point))))
+ (point))
+
+
+(defun js-re-search-forward (regexp &optional bound noerror count)
+ "Search forward but ignore strings and comments. Invokes
+`re-search-forward' but treats the buffer as if strings and
+comments have been removed."
+ (let ((saved-point (point))
+ (search-expr
+ (cond ((null count)
+ '(js-re-search-forward-inner regexp bound 1))
+ ((< count 0)
+ '(js-re-search-backward-inner regexp bound (- count)))
+ ((> count 0)
+ '(js-re-search-forward-inner regexp bound count)))))
+ (condition-case err
+ (eval search-expr)
+ (search-failed
+ (goto-char saved-point)
+ (unless noerror
+ (error (error-message-string err)))))))
+
+
+(defun js-re-search-backward-inner (regexp &optional bound count)
+ "Auxiliary function for `js-re-search-backward'."
+ (let ((parse)
+ (saved-point (point-min)))
+ (while (> count 0)
+ (re-search-backward regexp bound)
+ (when (and (> (point) (point-min))
+ (save-excursion (backward-char) (looking-at "/[/*]")))
+ (forward-char))
+ (setq parse (parse-partial-sexp saved-point (point)))
+ (cond ((nth 3 parse)
+ (re-search-backward
+ (concat "\\([^\\]\\|^\\)" (string (nth 3 parse)))
+ (save-excursion (beginning-of-line) (point)) t))
+ ((nth 7 parse)
+ (goto-char (nth 8 parse)))
+ ((or (nth 4 parse)
+ (and (eq (char-before) ?/) (eq (char-after) ?*)))
+ (re-search-backward "/\\*"))
+ (t
+ (setq count (1- count))))))
+ (point))
+
+
+(defun js-re-search-backward (regexp &optional bound noerror count)
+ "Search backward but ignore strings and comments. Invokes
+`re-search-backward' but treats the buffer as if strings and
+comments have been removed."
+ (let ((saved-point (point))
+ (search-expr
+ (cond ((null count)
+ '(js-re-search-backward-inner regexp bound 1))
+ ((< count 0)
+ '(js-re-search-forward-inner regexp bound (- count)))
+ ((> count 0)
+ '(js-re-search-backward-inner regexp bound count)))))
+ (condition-case err
+ (eval search-expr)
+ (search-failed
+ (goto-char saved-point)
+ (unless noerror
+ (error (error-message-string err)))))))
+
+
+(defun js-continued-var-decl-list-p ()
+ "Return non-nil if point is inside a continued variable declaration
+list."
+ (interactive)
+ (let ((start (save-excursion (js-re-search-backward "\\<var\\>" nil t))))
+ (and start
+ (save-excursion (re-search-backward "\n" start t))
+ (not (save-excursion
+ (js-re-search-backward
+ ";\\|[^, \t][ \t]*\\(/[/*]\\|$\\)" start t))))))
+
+
+;; --- Font Lock ---
+
+(defun js-inside-param-list-p ()
+ "Return non-nil if point is inside a function parameter list."
+ (condition-case err
+ (save-excursion
+ (up-list -1)
+ (and (looking-at "(")
+ (progn (backward-word 1)
+ (or (looking-at "function")
+ (progn (backward-word 1) (looking-at "function"))))))
+ (error nil)))
+
+
+(defconst js-function-heading-1-re
+ "^[ \t]*function[ \t]+\\(\\w+\\)"
+ "Regular expression matching the start of a function header.")
+
+(defconst js-function-heading-2-re
+ "^[ \t]*\\(\\w+\\)[ \t]*:[ \t]*function\\>"
+ "Regular expression matching the start of a function entry in
+ an associative array.")
+
+(defconst js-keyword-re
+ (regexp-opt '("abstract" "break" "case" "catch" "class" "const"
+ "continue" "debugger" "default" "delete" "do" "else"
+ "enum" "export" "extends" "final" "finally" "for"
+ "function" "goto" "if" "implements" "import" "in"
+ "instanceof" "interface" "native" "new" "package"
+ "private" "protected" "public" "return" "static"
+ "super" "switch" "synchronized" "this" "throw"
+ "throws" "transient" "try" "typeof" "var" "void"
+ "volatile" "while" "with"
+ "let") 'words)
+ "Regular expression matching any JavaScript keyword.")
+
+(defconst js-basic-type-re
+ (regexp-opt '("boolean" "byte" "char" "double" "float" "int" "long"
+ "short" "void") 'words)
+ "Regular expression matching any predefined type in JavaScript.")
+
+(defconst js-constant-re
+ (regexp-opt '("false" "null" "true") 'words)
+ "Regular expression matching any future reserved words in JavaScript.")
+
+
+(defconst js-font-lock-keywords-1
+ (list
+ "\\<import\\>"
+ (list js-function-heading-1-re 1 font-lock-function-name-face)
+ (list js-function-heading-2-re 1 font-lock-function-name-face)
+ (list "[=(][ \t]*\\(/.*?[^\\]/\\w*\\)" 1 font-lock-string-face))
+ "Level one font lock.")
+
+(defconst js-font-lock-keywords-2
+ (append js-font-lock-keywords-1
+ (list (list js-keyword-re 1 font-lock-keyword-face)
+ (cons js-basic-type-re font-lock-type-face)
+ (cons js-constant-re font-lock-constant-face)))
+ "Level two font lock.")
+
+
+;; Limitations with variable declarations: There seems to be no
+;; sensible way to highlight variables occuring after an initialized
+;; variable in a variable list. For instance, in
+;;
+;; var x, y = f(a, b), z
+;;
+;; z will not be highlighted.
+
+(defconst js-font-lock-keywords-3
+ (append
+ js-font-lock-keywords-2
+ (list
+
+ ;; variable declarations
+ (list
+ (concat "\\<\\(const\\|var\\)\\>\\|" js-basic-type-re)
+ (list "\\(\\w+\\)[ \t]*\\([=;].*\\|,\\|/[/*]\\|$\\)"
+ nil
+ nil
+ '(1 font-lock-variable-name-face)))
+
+ ;; continued variable declaration list
+ (list
+ (concat "^[ \t]*\\w+[ \t]*\\([,;=]\\|/[/*]\\|$\\)")
+ (list "\\(\\w+\\)[ \t]*\\([=;].*\\|,\\|/[/*]\\|$\\)"
+ '(if (save-excursion (backward-char) (js-continued-var-decl-list-p))
+ (backward-word 1)
+ (end-of-line))
+ '(end-of-line)
+ '(1 font-lock-variable-name-face)))
+
+ ;; formal parameters
+ (list
+ (concat "\\<function\\>\\([ \t]+\\w+\\)?[ \t]*([ \t]*\\w")
+ (list "\\(\\w+\\)\\([ \t]*).*\\)?"
+ '(backward-char)
+ '(end-of-line)
+ '(1 font-lock-variable-name-face)))
+
+ ;; continued formal parameter list
+ (list
+ (concat "^[ \t]*\\w+[ \t]*[,)]")
+ (list "\\w+"
+ '(if (save-excursion (backward-char) (js-inside-param-list-p))
+ (backward-word 1)
+ (end-of-line))
+ '(end-of-line)
+ '(0 font-lock-variable-name-face)))))
+ "Level three font lock.")
+
+(defconst js-font-lock-keywords
+ '(js-font-lock-keywords-3 js-font-lock-keywords-1 js-font-lock-keywords-2
+ js-font-lock-keywords-3)
+ "See `font-lock-keywords'.")
+
+
+;; --- Indentation ---
+
+(defconst js-possibly-braceless-keyword-re
+ (regexp-opt
+ '("catch" "do" "else" "finally" "for" "if" "try" "while" "with" "let")
+ 'words)
+ "Regular expression matching keywords that are optionally
+ followed by an opening brace.")
+
+(defconst js-indent-operator-re
+ (concat "[-+*/%<>=&^|?:.]\\([^-+*/]\\|$\\)\\|"
+ (regexp-opt '("in" "instanceof") 'words))
+ "Regular expression matching operators that affect indentation
+ of continued expressions.")
+
+
+(defun js-looking-at-operator-p ()
+ "Return non-nil if text after point is an operator (that is not
+a comma)."
+ (save-match-data
+ (and (looking-at js-indent-operator-re)
+ (or (not (looking-at ":"))
+ (save-excursion
+ (and (js-re-search-backward "[?:{]\\|\\<case\\>" nil t)
+ (looking-at "?")))))))
+
+
+(defun js-continued-expression-p ()
+ "Returns non-nil if the current line continues an expression."
+ (save-excursion
+ (back-to-indentation)
+ (or (js-looking-at-operator-p)
+ (and (js-re-search-backward "\n" nil t)
+ (progn
+ (skip-chars-backward " \t")
+ (backward-char)
+ (and (> (point) (point-min))
+ (save-excursion (backward-char) (not (looking-at "[/*]/")))
+ (js-looking-at-operator-p)
+ (and (progn (backward-char)
+ (not (looking-at "++\\|--\\|/[/*]"))))))))))
+
+
+(defun js-end-of-do-while-loop-p ()
+ "Returns non-nil if word after point is `while' of a do-while
+statement, else returns nil. A braceless do-while statement
+spanning several lines requires that the start of the loop is
+indented to the same column as the current line."
+ (interactive)
+ (save-excursion
+ (save-match-data
+ (when (looking-at "\\s-*\\<while\\>")
+ (if (save-excursion
+ (skip-chars-backward "[ \t\n]*}")
+ (looking-at "[ \t\n]*}"))
+ (save-excursion
+ (backward-list) (backward-word 1) (looking-at "\\<do\\>"))
+ (js-re-search-backward "\\<do\\>" (point-at-bol) t)
+ (or (looking-at "\\<do\\>")
+ (let ((saved-indent (current-indentation)))
+ (while (and (js-re-search-backward "^[ \t]*\\<" nil t)
+ (/= (current-indentation) saved-indent)))
+ (and (looking-at "[ \t]*\\<do\\>")
+ (not (js-re-search-forward
+ "\\<while\\>" (point-at-eol) t))
+ (= (current-indentation) saved-indent)))))))))
+
+
+(defun js-ctrl-statement-indentation ()
+ "Returns the proper indentation of the current line if it
+starts the body of a control statement without braces, else
+returns nil."
+ (save-excursion
+ (back-to-indentation)
+ (when (save-excursion
+ (and (not (looking-at "[{]"))
+ (progn
+ (js-re-search-backward "[[:graph:]]" nil t)
+ (forward-char)
+ (when (= (char-before) ?\)) (backward-list))
+ (skip-syntax-backward " ")
+ (skip-syntax-backward "w")
+ (looking-at js-possibly-braceless-keyword-re))
+ (not (js-end-of-do-while-loop-p))))
+ (save-excursion
+ (goto-char (match-beginning 0))
+ (+ (current-indentation) javascript-indent-level)))))
+
+
+(defun js-proper-indentation (parse-status)
+ "Return the proper indentation for the current line."
+ (save-excursion
+ (back-to-indentation)
+ (let ((ctrl-stmt-indent (js-ctrl-statement-indentation))
+ (same-indent-p (looking-at "[]})]\\|\\<case\\>\\|\\<default\\>"))
+ (continued-expr-p (js-continued-expression-p)))
+ (cond (ctrl-stmt-indent)
+ ((js-continued-var-decl-list-p)
+ (js-re-search-backward "\\<var\\>" nil t)
+ (+ (current-indentation) javascript-indent-level))
+ ((nth 1 parse-status)
+ (goto-char (nth 1 parse-status))
+ (if (looking-at "[({[][ \t]*\\(/[/*]\\|$\\)")
+ (progn
+ (skip-syntax-backward " ")
+ (when (= (char-before) ?\)) (backward-list))
+ (back-to-indentation)
+ (cond (same-indent-p
+ (current-column))
+ (continued-expr-p
+ (+ (current-column) (* 2 javascript-indent-level)))
+ (t
+ (+ (current-column) javascript-indent-level))))
+ (unless same-indent-p
+ (forward-char)
+ (skip-chars-forward " \t"))
+ (current-column)))
+ (continued-expr-p javascript-indent-level)
+ (t 0)))))
+
+
+(defun javascript-indent-line ()
+ "Indent the current line as JavaScript source text."
+ (interactive)
+ (let ((parse-status
+ (save-excursion (parse-partial-sexp (point-min) (point-at-bol))))
+ (offset (- (current-column) (current-indentation))))
+ (when (not (nth 8 parse-status))
+ (indent-line-to (js-proper-indentation parse-status))
+ (when (> offset 0) (forward-char offset)))))
+
+
+;; --- Filling ---
+
+;; FIXME: It should be possible to use the more sofisticated function
+;; `c-fill-paragraph' in `cc-cmds.el' instead. However, just setting
+;; `fill-paragraph-function' to `c-fill-paragraph' does not work;
+;; inside `c-fill-paragraph', `fill-paragraph-function' evaluates to
+;; nil!?
+
+(defun js-backward-paragraph ()
+ "Move backward to start of paragraph. Postcondition: Point is at
+beginning of buffer or the previous line contains only whitespace."
+ (forward-line -1)
+ (while (not (or (bobp) (looking-at "^[ \t]*$")))
+ (forward-line -1))
+ (when (not (bobp)) (forward-line 1)))
+
+
+(defun js-forward-paragraph ()
+ "Move forward to end of paragraph. Postcondition: Point is at
+end of buffer or the next line contains only whitespace."
+ (forward-line 1)
+ (while (not (or (eobp) (looking-at "^[ \t]*$")))
+ (forward-line 1))
+ (when (not (eobp)) (backward-char 1)))
+
+
+(defun js-fill-block-comment-paragraph (parse-status justify)
+ "Fill current paragraph as a block comment. PARSE-STATUS is the
+result of `parse-partial-regexp' from beginning of buffer to
+point. JUSTIFY has the same meaning as in `fill-paragraph'."
+ (let ((offset (save-excursion
+ (goto-char (nth 8 parse-status)) (current-indentation))))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region (save-excursion
+ (goto-char (nth 8 parse-status)) (point-at-bol))
+ (save-excursion
+ (goto-char (nth 8 parse-status))
+ (re-search-forward "*/")))
+ (narrow-to-region (save-excursion
+ (js-backward-paragraph)
+ (when (looking-at "^[ \t]*$") (forward-line 1))
+ (point))
+ (save-excursion
+ (js-forward-paragraph)
+ (when (looking-at "^[ \t]*$") (backward-char))
+ (point)))
+ (goto-char (point-min))
+ (while (not (eobp))
+ (delete-horizontal-space)
+ (forward-line 1))
+ (let ((fill-column (- fill-column offset))
+ (fill-paragraph-function nil))
+ (fill-paragraph justify))
+
+ ;; In Emacs 21.4 as opposed to CVS Emacs 22,
+ ;; `fill-paragraph' seems toadd a newline at the end of the
+ ;; paragraph. Remove it!
+ (goto-char (point-max))
+ (when (looking-at "^$") (backward-delete-char 1))
+
+ (goto-char (point-min))
+ (while (not (eobp))
+ (indent-to offset)
+ (forward-line 1))))))
+
+
+(defun js-sline-comment-par-start ()
+ "Return point at the beginning of the line where the current
+single-line comment paragraph starts."
+ (save-excursion
+ (beginning-of-line)
+ (while (and (not (bobp))
+ (looking-at "^[ \t]*//[ \t]*[[:graph:]]"))
+ (forward-line -1))
+ (unless (bobp) (forward-line 1))
+ (point)))
+
+
+(defun js-sline-comment-par-end ()
+ "Return point at end of current single-line comment paragraph."
+ (save-excursion
+ (beginning-of-line)
+ (while (and (not (eobp))
+ (looking-at "^[ \t]*//[ \t]*[[:graph:]]"))
+ (forward-line 1))
+ (unless (bobp) (backward-char))
+ (point)))
+
+
+(defun js-sline-comment-offset (line)
+ "Return the column at the start of the current single-line
+comment paragraph."
+ (save-excursion
+ (goto-line line)
+ (re-search-forward "//" (point-at-eol))
+ (goto-char (match-beginning 0))
+ (current-column)))
+
+
+(defun js-sline-comment-text-offset (line)
+ "Return the column at the start of the text of the current
+single-line comment paragraph."
+ (save-excursion
+ (goto-line line)
+ (re-search-forward "//[ \t]*" (point-at-eol))
+ (current-column)))
+
+
+(defun js-at-empty-sline-comment-p ()
+ "Return non-nil if inside an empty single-line comment."
+ (and (save-excursion
+ (beginning-of-line)
+ (not (looking-at "^.*//.*[[:graph:]]")))
+ (save-excursion
+ (re-search-backward "//" (point-at-bol) t))))
+
+
+(defun js-fill-sline-comments (parse-status justify)
+ "Fill current paragraph as a sequence of single-line comments.
+PARSE-STATUS is the result of `parse-partial-regexp' from
+beginning of buffer to point. JUSTIFY has the same meaning as in
+`fill-paragraph'."
+ (when (not (js-at-empty-sline-comment-p))
+ (let* ((start (js-sline-comment-par-start))
+ (start-line (1+ (count-lines (point-min) start)))
+ (end (js-sline-comment-par-end))
+ (offset (js-sline-comment-offset start-line))
+ (text-offset (js-sline-comment-text-offset start-line)))
+ (save-excursion
+ (save-restriction
+ (narrow-to-region start end)
+ (goto-char (point-min))
+ (while (re-search-forward "^[ \t]*//[ \t]*" nil t)
+ (replace-match "")
+ (forward-line 1))
+ (let ((fill-paragraph-function nil)
+ (fill-column (- fill-column text-offset)))
+ (fill-paragraph justify))
+
+ ;; In Emacs 21.4 as opposed to CVS Emacs 22,
+ ;; `fill-paragraph' seems toadd a newline at the end of the
+ ;; paragraph. Remove it!
+ (goto-char (point-max))
+ (when (looking-at "^$") (backward-delete-char 1))
+
+ (goto-char (point-min))
+ (while (not (eobp))
+ (indent-to offset)
+ (insert "//")
+ (indent-to text-offset)
+ (forward-line 1)))))))
+
+
+(defun js-trailing-comment-p (parse-status)
+ "Return non-nil if inside a trailing comment. PARSE-STATUS is
+the result of `parse-partial-regexp' from beginning of buffer to
+point."
+ (save-excursion
+ (when (nth 4 parse-status)
+ (goto-char (nth 8 parse-status))
+ (skip-chars-backward " \t")
+ (not (bolp)))))
+
+
+(defun js-block-comment-p (parse-status)
+ "Return non-nil if inside a block comment. PARSE-STATUS is the
+result of `parse-partial-regexp' from beginning of buffer to
+point."
+ (save-excursion
+ (save-match-data
+ (when (nth 4 parse-status)
+ (goto-char (nth 8 parse-status))
+ (looking-at "/\\*")))))
+
+
+(defun javascript-fill-paragraph (&optional justify)
+ "If inside a comment, fill the current comment paragraph.
+Trailing comments are ignored."
+ (interactive)
+ (let ((parse-status (parse-partial-sexp (point-min) (point))))
+ (when (and (nth 4 parse-status)
+ (not (js-trailing-comment-p parse-status)))
+ (if (js-block-comment-p parse-status)
+ (js-fill-block-comment-paragraph parse-status justify)
+ (js-fill-sline-comments parse-status justify))))
+ t)
+
+
+;; --- Imenu ---
+
+(defconst js-imenu-generic-expression
+ (list
+ (list
+ nil
+ "function\\s-+\\(\\w+\\)\\s-*("
+ 1))
+ "Regular expression matching top level procedures. Used by imenu.")
+
+
+;; --- Main Function ---
+
+;;;###autoload
+(defun javascript-mode ()
+ "Major mode for editing JavaScript source text.
+
+Key bindings:
+
+\\{javascript-mode-map}"
+ (interactive)
+ (kill-all-local-variables)
+
+ (use-local-map javascript-mode-map)
+ (set-syntax-table javascript-mode-syntax-table)
+ (set (make-local-variable 'indent-line-function) 'javascript-indent-line)
+ (set (make-local-variable 'font-lock-defaults) (list js-font-lock-keywords))
+
+ (set (make-local-variable 'parse-sexp-ignore-comments) t)
+
+ ;; Comments
+ (setq comment-start "// ")
+ (setq comment-end "")
+ (set (make-local-variable 'fill-paragraph-function)
+ 'javascript-fill-paragraph)
+
+ ;; Make c-mark-function work
+ (setq c-nonsymbol-token-regexp "!=\\|%=\\|&[&=]\\|\\*[/=]\\|\\+[+=]\\|-[=-]\\|/[*/=]\\|<\\(?:<=\\|[<=]\\)\\|==\\|>\\(?:>\\(?:>=\\|[=>]\\)\\|[=>]\\)\\|\\^=\\||[=|]\\|[]!%&(-,./:-?[{-~^-]"
+ c-stmt-delim-chars "^;{}?:"
+ c-syntactic-ws-end "[ \n
+ \f/]"
+ c-syntactic-eol "\\(\\s \\|/\\*\\([^*\n
+]\\|\\*[^/\n
+]\\)*\\*/\\)*\\(\\(/\\*\\([^*\n
+]\\|\\*[^/\n
+]\\)*\\|\\\\\\)?$\\|//\\)")
+
+ ;; Imenu
+ (setq imenu-case-fold-search nil)
+ (set (make-local-variable 'imenu-generic-expression)
+ js-imenu-generic-expression)
+
+ (setq major-mode 'javascript-mode)
+ (setq mode-name "JavaScript")
+ (run-hooks 'javascript-mode-hook))
+
+
+(provide 'javascript-mode)
+;;; javascript.el ends here
diff --git a/elisp/nxhtml/alts/smarty-mode-vdebout.el b/elisp/nxhtml/alts/smarty-mode-vdebout.el
new file mode 100644
index 0000000..94d7352
--- /dev/null
+++ b/elisp/nxhtml/alts/smarty-mode-vdebout.el
@@ -0,0 +1,2715 @@
+;;; smarty-mode.el --- major mode for editing Smarty templates
+
+;; Author: Vincent DEBOUT <deboutv@free.fr>
+;; Maintainer: Vincent DEBOUT <deboutv@free.fr>
+;; Keywords: languages smarty templates
+;; WWW: http://deboutv.free.fr/lisp/smarty/
+
+;;; License
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License
+;; as published by the Free Software Foundation; either version 2
+;; of the License, or (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;; GNU General Public License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, write to the Free Software
+;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+;;; History
+
+;; $Log: smarty-mode.el,v $
+;; Revision 1.6 2006/12/16 19:54:26 vincent
+;; Update release version
+;;
+;; Revision 1.5 2006/12/16 19:53:00 vincent
+;; Fix bug #15
+;;
+;; Revision 1.4 2006/12/16 14:59:46 vincent
+;; Fix bugs for release
+;;
+;; Revision 1.3 2006/11/19 12:29:53 vincent
+;; Fix highlight bug, add templates
+;;
+;; Revision 1.2 2006/11/12 11:44:18 vincent
+;; First release commit
+;;
+
+(defconst smarty-version "0.0.4"
+ "Smarty Mode version number.")
+
+(defconst smarty-time-stamp "2006-12-16"
+ "Smarty Mode time stamp for last update.")
+
+(require 'font-lock)
+(require 'cc-mode)
+(require 'custom)
+(require 'etags)
+(eval-when-compile
+(require 'regexp-opt))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Customization
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defgroup smarty nil
+ "Customizations for Smarty mode."
+ :prefix "smarty-"
+ :group 'languages)
+
+(defgroup smarty-mode nil
+ "Customizations for Smarty mode."
+ :group 'smarty)
+
+(defcustom smarty-electric-mode t
+ "*Non-nil enables electrification (automatic template generation).
+If nil, template generators can still be invoked through key bindings and
+menu. Is indicated in the modeline by \"/e\" after the mode name and can be
+toggled by `\\[smarty-electric-mode]'."
+ :type 'boolean
+ :group 'smarty-mode)
+
+(defcustom smarty-stutter-mode t
+ "*Non-nil enables stuttering.
+Is indicated in the modeline by \"/s\" after the mode name and can be toggled
+by `\\[smarty-stutter-mode]'."
+ :type 'boolean
+ :group 'smarty-mode)
+
+(defgroup smarty-menu nil
+ "Customizations for menues."
+ :group 'smarty)
+
+(defcustom smarty-source-file-menu t
+ "*Non-nil means add a menu of all source files in current directory."
+ :type 'boolean
+ :group 'smarty-menu)
+
+(defgroup smarty-highlight nil
+ "Customizations for highlight."
+ :group 'smarty)
+
+(defcustom smarty-highlight-plugin-functions t
+ "*Non-nil means highlight the plugin functions in the buffer."
+ :type 'boolean
+ :group 'smarty-highlight)
+
+(defgroup smarty-template nil
+ "Customizations for templates."
+ :group 'smarty)
+
+(defgroup smarty-header nil
+ "Customizations for header template."
+ :group 'smarty-template)
+
+(defcustom smarty-file-header ""
+ "*String or file to insert as file header.
+If the string specifies an existing file name, the contents of the file is
+inserted, otherwise the string itself is inserted as file header.
+Type `C-j' for newlines.
+If the header contains RCS keywords, they may be written as <RCS>Keyword<RCS>
+if the header needs to be version controlled.
+
+The following keywords for template generation are supported:
+ <filename> : replaced by the name of the buffer
+ <author> : replaced by the user name and email address
+ \(`user-full-name',`mail-host-address', `user-mail-address')
+ <login> : replaced by user login name (`user-login-name')
+ <company> : replaced by contents of option `smarty-company-name'
+ <date> : replaced by the current date
+ <year> : replaced by the current year
+ <copyright> : replaced by copyright string (`smarty-copyright-string')
+ <cursor> : final cursor position."
+ :type 'string
+ :group 'smarty-header)
+
+(defcustom smarty-file-footer ""
+ "*String or file to insert as file footer.
+If the string specifies an existing file name, the contents of the file is
+inserted, otherwise the string itself is inserted as file footer (i.e. at
+the end of the file).
+Type `C-j' for newlines.
+The same keywords as in option `smarty-file-header' can be used."
+ :type 'string
+ :group 'smarty-header)
+
+(defcustom smarty-company-name ""
+ "*Name of company to insert in file header.
+See option `smarty-file-header'."
+ :type 'string
+ :group 'smarty-header)
+
+(defcustom smarty-copyright-string ""
+ "*Copyright string to insert in file header.
+Can be multi-line string (type `C-j' for newline) and contain other file
+header keywords (see option `smarty-file-header')."
+ :type 'string
+ :group 'smarty-header)
+
+(defcustom smarty-date-format "%Y-%m-%d"
+ "*Specifies the date format to use in the header.
+This string is passed as argument to the command `format-time-string'.
+For more information on format strings, see the documentation for the
+`format-time-string' command (C-h f `format-time-string')."
+ :type 'string
+ :group 'smarty-header)
+
+(defcustom smarty-modify-date-prefix-string ""
+ "*Prefix string of modification date in Smarty file header.
+If actualization of the modification date is called (menu,
+`\\[smarty-template-modify]'), this string is searched and the rest
+of the line replaced by the current date."
+ :type 'string
+ :group 'smarty-header)
+
+(defcustom smarty-modify-date-on-saving nil
+ "*Non-nil means update the modification date when the buffer is saved.
+Calls function `\\[smarty-template-modify]').
+
+NOTE: Activate the new setting in a Smarty buffer by using the menu entry
+ \"Activate Options\"."
+ :type 'boolean
+ :group 'smarty-header)
+
+(defgroup smarty-misc nil
+ "Miscellaneous customizations."
+ :group 'smarty)
+
+(defcustom smarty-left-delimiter "{"
+ "Left escaping delimiter."
+ :type 'string
+ :group 'smarty-misc)
+
+(defcustom smarty-right-delimiter "}"
+ "Right escaping delimiter."
+ :type 'string
+ :group 'smarty-misc)
+
+(defcustom smarty-intelligent-tab t
+ "*Non-nil means `TAB' does indentation, word completion and tab insertion.
+That is, if preceding character is part of a word then complete word,
+else if not at beginning of line then insert tab,
+else if last command was a `TAB' or `RET' then dedent one step,
+else indent current line (i.e. `TAB' is bound to `smarty-electric-tab').
+If nil, TAB always indents current line (i.e. `TAB' is bound to
+`indent-according-to-mode').
+
+NOTE: Activate the new setting in a Smarty buffer by using the menu entry
+ \"Activate Options\"."
+ :type 'boolean
+ :group 'smarty-misc)
+
+(defcustom smarty-word-completion-in-minibuffer t
+ "*Non-nil enables word completion in minibuffer (for template prompts).
+
+NOTE: Activate the new setting by restarting Emacs."
+ :type 'boolean
+ :group 'smarty-misc)
+
+(defcustom smarty-word-completion-case-sensitive nil
+ "*Non-nil means word completion using `TAB' is case sensitive.
+That is, `TAB' completes words that start with the same letters and case.
+Otherwise, case is ignored."
+ :type 'boolean
+ :group 'smarty-misc)
+
+;; Functions
+
+(defun smarty-customize ()
+ "Call the customize function with `smarty' as argument."
+ (interactive)
+ (customize-browse 'smarty))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Variables
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-menu-max-size 20
+ "*Specifies the maximum size of a menu before splitting it into submenues.")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Menu tools functions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-menu-split (list title)
+ "Split menu LIST into several submenues, if number of
+elements > `smarty-menu-max-size'."
+ (if (> (length list) smarty-menu-max-size)
+ (let ((remain list)
+ (result '())
+ (sublist '())
+ (menuno 1)
+ (i 0))
+ (while remain
+ (setq sublist (cons (car remain) sublist))
+ (setq remain (cdr remain))
+ (setq i (+ i 1))
+ (if (= i smarty-menu-max-size)
+ (progn
+ (setq result (cons (cons (format "%s %s" title menuno)
+ (nreverse sublist)) result))
+ (setq i 0)
+ (setq menuno (+ menuno 1))
+ (setq sublist '()))))
+ (and sublist
+ (setq result (cons (cons (format "%s %s" title menuno)
+ (nreverse sublist)) result)))
+ (nreverse result))
+ list))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Source file menu
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-sources-menu nil)
+
+;; Create the source menu
+(defun smarty-add-source-files-menu ()
+ "Scan directory for all Smarty source files and generate menu.
+The directory of the current source file is scanned."
+ (interactive)
+ (message "Scanning directory for source files ...")
+ (let ((newmap (current-local-map))
+ (file-list (smarty-get-source-files))
+ menu-list found)
+ ;; Create list for menu
+ (setq found nil)
+ (while file-list
+ (setq found t)
+ (setq menu-list (cons (vector (car file-list)
+ (list 'find-file (car file-list)) t)
+ menu-list))
+ (setq file-list (cdr file-list)))
+ (setq menu-list (smarty-menu-split menu-list "Sources"))
+ (when found (setq menu-list (cons "--" menu-list)))
+ (setq menu-list (cons ["*Rescan*" smarty-add-source-files-menu t] menu-list))
+ (setq menu-list (cons "Sources" menu-list))
+ ;; Create menu
+ (easy-menu-add menu-list)
+ (easy-menu-define smarty-sources-menu newmap
+ "Smarty source files menu" menu-list))
+ (message ""))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Smarty menu
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-create-mode-menu ()
+ "Create Smarty Mode menu."
+ `("Smarty"
+ ("Templates"
+ ("Built-in Functions"
+ ["capture" smarty-template-capture t]
+ ["config_load" smarty-template-config-load t]
+ ["else" smarty-template-else t]
+ ["elseif" smarty-template-elseif t]
+ ["foreach" smarty-template-foreach t]
+ ["foreachelse" smarty-template-foreachelse t]
+ ["if" smarty-template-if t]
+ ["include" smarty-template-include t]
+ ["include_php" smarty-template-include-php t]
+ ["insert" smarty-template-insert t]
+ ["ldelim" smarty-template-ldelim t]
+ ["literal" smarty-template-literal t]
+ ["php" smarty-template-php t]
+ ["rdelim" smarty-template-rdelim t]
+ ["section" smarty-template-section t]
+ ["sectionelse" smarty-template-sectionelse t]
+ ["strip" smarty-template-strip t])
+ ("Custom Functions"
+ ["assign" smarty-template-assign t]
+ ["counter" smarty-template-counter t]
+ ["cycle" smarty-template-cycle t]
+ ["debug" smarty-template-debug t]
+ ["eval" smarty-template-eval t]
+ ["fetch" smarty-template-fetch t]
+ ["html_checkboxes" smarty-template-html-checkboxes t]
+ ["html_image" smarty-template-html-image t]
+ ["html_options" smarty-template-html-options t]
+ ["html_radios" smarty-template-html-radios t]
+ ["html_select_date" smarty-template-html-select-date t]
+ ["html_select_time" smarty-template-html-select-time t]
+ ["html_table" smarty-template-html-table t]
+ ["mailto" smarty-template-mailto t]
+ ["math" smarty-template-math t]
+ ["popup" smarty-template-popup t]
+ ["popup_init" smarty-template-popup-init t]
+ ["textformat" smarty-template-textformat t])
+ ("Variable Modifiers"
+ ["capitalize" smarty-template-capitalize t]
+ ["cat" smarty-template-cat t]
+ ["count_characters" smarty-template-count-characters t]
+ ["count_paragraphs" smarty-template-count-paragraphs t]
+ ["count_sentences" smarty-template-count-sentences t]
+ ["count_words" smarty-template-count-words t]
+ ["date_format" smarty-template-date-format t]
+ ["default" smarty-template-default t]
+ ["escape" smarty-template-escape t]
+ ["indent" smarty-template-indent t]
+ ["lower" smarty-template-lower t]
+ ["nl2br" smarty-template-nl2br t]
+ ["regex_replace" smarty-template-regex-replace t]
+ ["replace" smarty-template-replace t]
+ ["spacify" smarty-template-spacify t]
+ ["string_format" smarty-template-string-format t]
+ ["strip" smarty-template-vstrip t]
+ ["strip_tags" smarty-template-strip-tags t]
+ ["truncate" smarty-template-truncate t]
+ ["upper" smarty-template-upper t]
+ ["wordwrap" smarty-template-wordwrap t])
+ ("Plugins (Functions)"
+ ("SmartyFormtool"
+ ["formtool_checkall" smarty-template-formtool-checkall t]
+ ["formtool_copy" smarty-template-formtool-copy t]
+ ["formtool_count_chars" smarty-template-formtool-count-chars t]
+ ["formtool_init" smarty-template-formtool-init t]
+ ["formtool_move" smarty-template-formtool-move t]
+ ["formtool_moveall" smarty-template-formtool-moveall t]
+ ["formtool_movedown" smarty-template-formtool-movedown t]
+ ["formtool_moveup" smarty-template-formtool-moveup t]
+ ["formtool_remove" smarty-template-formtool-remove t]
+ ["formtool_rename" smarty-template-formtool-rename t]
+ ["formtool_save" smarty-template-formtool-save t]
+ ["formtool_selectall" smarty-template-formtool-selectall t])
+ ("SmartyPaginate"
+ ["paginate_first" smarty-template-paginate-first t]
+ ["paginate_last" smarty-template-paginate-last t]
+ ["paginate_middle" smarty-template-paginate-middle t]
+ ["paginate_next" smarty-template-paginate-next t]
+ ["paginate_prev" smarty-template-paginate-prev t])
+ ("SmartyValidate"
+ ["validate" smarty-template-validate t]))
+ ("Plugins (Variable Modifiers)"
+ ("AlternativeDateModifierPlugin"
+ ["date_format2" smarty-template-date-formatto t])
+ ("B2Smilies"
+ ["B2Smilies" smarty-template-btosmilies t])
+ ("BBCodePlugin"
+ ["bbcode2html" smarty-template-bbcodetohtml t])
+ )
+ "--"
+ ["Insert Header" smarty-template-header t]
+ ["Insert Footer" smarty-template-footer t]
+ ["Insert Date" smarty-template-insert-date t]
+ ["Modify Date" smarty-template-modify t])
+ "--"
+ ["Show Messages" smarty-show-messages :keys "C-c M-m"]
+ ["Smarty Mode Documentation" smarty-doc-mode :keys "C-c C-h"]
+ ["Version" smarty-version :keys "C-c C-v"]
+ "--"
+ ("Options"
+ ("Mode"
+ ["Electric Mode"
+ (progn (customize-set-variable 'smarty-electric-mode
+ (not smarty-electric-mode))
+ (smarty-mode-line-update))
+ :style toggle :selected smarty-electric-mode :keys "C-c C-m C-e"]
+ ["Stutter Mode"
+ (progn (customize-set-variable 'smarty-stutter-mode
+ (not smarty-stutter-mode))
+ (smarty-mode-line-update))
+ :style toggle :selected smarty-stutter-mode :keys "C-c C-m C-s"]
+ "--"
+ ["Customize Group..." (customize-group 'smarty-mode) t])
+ ("Menu"
+ ["Source Menu"
+ (customize-set-variable 'smarty-source-file-menu
+ (not smarty-source-file-menu))
+ :style toggle :selected smarty-source-file-menu]
+ "--"
+ ["Customize Group..." (customize-group 'smarty-menu) t])
+ ("Highlight"
+ ["Highlight plugin functions"
+ (progn (customize-set-variable 'smarty-highlight-plugin-functions
+ (not smarty-highlight-plugin-functions)))
+ :style toggle :selected smarty-highlight-plugin-functions]
+ "--"
+ ["Customize Group..." (customize-group 'smarty-highlight) t])
+ ("Template"
+ ("Header"
+ ["Header template..."
+ (customize-option 'smarty-file-header) t]
+ ["Footer template..."
+ (customize-option 'smarty-file-footer) t]
+ ["Company..."
+ (customize-option 'smarty-company-name) t]
+ ["Copyright..."
+ (customize-option 'smarty-copyright-string) t]
+ ["Date format..."
+ (customize-option 'smarty-date-format) t]
+ ["Modify date prefix..."
+ (customize-option 'smarty-modify-date-prefix-string) t]
+ ["Modify date on saving"
+ (customize-set-variable 'smarty-modify-date-on-saving
+ (not smarty-modify-date-on-saving))
+ :style toggle :selected smarty-modify-date-on-saving]
+ "--"
+ ["Customize Group..." (customize-group 'smarty-header) t])
+ "--"
+ ["Customize Group..." (customize-group 'smarty-template) t])
+ ("Miscellaneous"
+ ["Left delimiter..."
+ (customize-option 'smarty-left-delimiter) t]
+ ["Right delimiter..."
+ (customize-option 'smarty-right-delimiter) t]
+ ["Use Intelligent Tab"
+ (progn (customize-set-variable 'smarty-intelligent-tab
+ (not smarty-intelligent-tab))
+ (smarty-activate-customizations))
+ :style toggle :selected smarty-intelligent-tab]
+ ["Word Completion in Minibuffer"
+ (progn (customize-set-variable 'smarty-word-completion-in-minibuffer
+ (not smarty-word-completion-in-minibuffer))
+ (message "Activate new setting by saving options and restarting Emacs"))
+ :style toggle :selected smarty-word-completion-in-minibuffer]
+ ["Completion is case sensitive"
+ (customize-set-variable 'smarty-word-completion-case-sensitive
+ (not smarty-word-completion-case-sensitive))
+ :style toggle :selected smarty-word-completion-case-sensitive]
+ "--"
+ ["Customize Group..." (customize-group 'smarty-misc) t])
+ "--"
+ ["Save Options" customize-save-customized t]
+ ["Activate Options" smarty-activate-customizations t]
+ ["Browse Options..." smarty-customize t])))
+
+(defvar smarty-mode-menu-list (smarty-create-mode-menu)
+ "Smarty Mode menu.")
+
+(defvar smarty-mode-map nil
+ "Keymap for Smarty Mode.")
+
+(defun smarty-update-mode-menu ()
+ "Update Smarty Mode menu."
+ (interactive)
+ (easy-menu-remove smarty-mode-menu-list)
+ (setq smarty-mode-menu-list (smarty-create-mode-menu))
+ (easy-menu-add smarty-mode-menu-list)
+ (easy-menu-define smarty-mode-menu smarty-mode-map
+ "Menu keymap for Smarty Mode." smarty-mode-menu-list))
+
+
+
+
+(defvar smarty-mode-hook nil)
+
+(defvar smarty-functions nil
+ "List of Smarty functions.")
+
+(defvar smarty-functions-regexp nil
+ "Regexp for Smarty functions.")
+
+(defconst smarty-01-functions
+ '("capture" "config_load" "foreach" "foreachelse" "include"
+ "include_php" "insert" "if" "elseif" "else" "ldelim" "rdelim"
+ "literal" "php" "section" "sectionelse" "strip" "assign" "counter"
+ "cycle" "debug" "eval" "fetch" "html_checkboxes" "html_image"
+ "html_options" "html_radios" "html_select_date" "html_select_time"
+ "html_table" "math" "mailto" "popup_init" "popup" "textformat")
+ "Smarty built-in & custom functions.")
+
+(defvar smarty-modifiers nil
+ "List of Smarty variable modifiers.")
+
+(defvar smarty-modifiers-regexp nil
+ "Regexp for Smarty variable modifiers.")
+
+(defconst smarty-01-modifiers
+ '("capitalize" "cat" "count_characters" "count_paragraphs"
+ "count_sentences" "count_words" "date_format" "default"
+ "escape" "indent" "lower" "nl2br" "regex_replace" "replace"
+ "spacify" "string_format" "strip" "strip_tags" "truncate"
+ "upper" "wordwrap")
+ "Smarty variable modifiers.")
+
+(defvar smarty-plugins-functions nil
+ "List of Smarty functions.")
+
+(defvar smarty-plugins-functions-regexp nil
+ "Regexp for Smarty functions.")
+
+(defconst smarty-01-plugins-functions
+ '("validate" "formtool_checkall" "formtool_copy" "formtool_count_chars"
+ "formtool_init" "formtool_move" "formtool_moveall"
+ "formtool_movedown" "formtool_moveup" "formtool_remove"
+ "formtool_rename" "formtool_save" "formtool_selectall"
+ "paginate_first" "paginate_last" "paginate_middle"
+ "paginate_next" "paginate_prev")
+ "Smarty plugins functions.")
+
+(defvar smarty-plugins-modifiers nil
+ "List of Smarty variable modifiers.")
+
+(defvar smarty-plugins-modifiers-regexp nil
+ "Regexp for Smarty functions.")
+
+(defconst smarty-01-plugins-modifiers
+ '("B2Smilies" "bbcode2html" "date_format2")
+ "Smarty plugins modifiers.")
+
+(defconst smarty-constants
+ (eval-when-compile
+ (regexp-opt
+ '("TRUE" "FALSE" "NULL") t))
+ "Smarty constants.")
+
+
+;; Syntax table creation
+(defvar smarty-mode-syntax-table nil
+ "Syntax table for smarty-mode.")
+
+(defvar smarty-mode-ext-syntax-table nil
+ "Syntax table extended by `_' used in `smarty-mode' buffers.")
+
+(defun smarty-create-syntax-table ()
+ (if smarty-mode-syntax-table
+ ()
+ (setq smarty-mode-syntax-table (make-syntax-table))
+
+ ;; Make | a punctuation character
+ (modify-syntax-entry ?| "." smarty-mode-syntax-table)
+ ;; Make " a punctuation character so highlighing works withing html strings
+ (modify-syntax-entry ?\" "." smarty-mode-syntax-table)
+ ;; define parentheses to match
+ (modify-syntax-entry ?\( "()" smarty-mode-syntax-table)
+ (modify-syntax-entry ?\) ")(" smarty-mode-syntax-table)
+ (modify-syntax-entry ?\[ "(]" smarty-mode-syntax-table)
+ (modify-syntax-entry ?\] ")[" smarty-mode-syntax-table)
+ (modify-syntax-entry ?\{ "(}" smarty-mode-syntax-table)
+ (modify-syntax-entry ?\} "){" smarty-mode-syntax-table)
+ )
+ (set-syntax-table smarty-mode-syntax-table)
+ ;; extended syntax table including '_' (for simpler search regexps)
+ (setq smarty-mode-ext-syntax-table (copy-syntax-table smarty-mode-syntax-table))
+ (modify-syntax-entry ?_ "w" smarty-mode-ext-syntax-table))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; File/directory manipulation
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-directory-files (directory &optional full match)
+ "Call `directory-files' if DIRECTORY exists, otherwise generate error
+message."
+ (if (not (file-directory-p directory))
+ (smarty-warning-when-idle "No such directory: \"%s\"" directory)
+ (let ((dir (directory-files directory full match)))
+ (setq dir (delete "." dir))
+ (setq dir (delete ".." dir))
+ dir)))
+
+(defun smarty-get-source-files (&optional full directory)
+ "Get list of SMARTY source files in DIRECTORY or current directory."
+ (let ((mode-alist auto-mode-alist)
+ filename-regexp)
+ ;; create regular expressions for matching file names
+ (setq filename-regexp "\\`[^.].*\\(")
+ (while mode-alist
+ (when (eq (cdar mode-alist) 'smarty-mode)
+ (setq filename-regexp
+ (concat filename-regexp (caar mode-alist) "\\|")))
+ (setq mode-alist (cdr mode-alist)))
+ (setq filename-regexp
+ (concat (substring filename-regexp 0
+ (string-match "\\\\|$" filename-regexp)) "\\)"))
+ ;; find files
+ (smarty-directory-files
+ (or directory default-directory) full filename-regexp)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Messages reporting
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-warnings nil
+ "Warnings to tell the user during start up.")
+
+(defun smarty-run-when-idle (secs repeat function)
+ "Wait until idle, then run FUNCTION."
+ (if (fboundp 'start-itimer)
+ (start-itimer "smarty-mode" function secs repeat t)
+; (run-with-idle-timer secs repeat function)))
+ ;; explicitely activate timer (necessary when Emacs is already idle)
+ (aset (run-with-idle-timer secs repeat function) 0 nil)))
+
+(defun smarty-warning-when-idle (&rest args)
+ "Wait until idle, then print out warning STRING and beep."
+ (if noninteractive
+ (smarty-warning (apply 'format args) t)
+ (unless smarty-warnings
+ (smarty-run-when-idle .1 nil 'smarty-print-warnings))
+ (setq smarty-warnings (cons (apply 'format args) smarty-warnings))))
+
+(defun smarty-warning (string &optional nobeep)
+ "Print out warning STRING and beep."
+ (message (concat "WARNING: " string))
+ (unless (or nobeep noninteractive) (beep)))
+
+(defun smarty-print-warnings ()
+ "Print out messages in variable `smarty-warnings'."
+ (let ((no-warnings (length smarty-warnings)))
+ (setq smarty-warnings (nreverse smarty-warnings))
+ (while smarty-warnings
+ (message (concat "WARNING: " (car smarty-warnings)))
+ (setq smarty-warnings (cdr smarty-warnings)))
+ (beep)
+ (when (> no-warnings 1)
+ (message "WARNING: See warnings in message buffer (type `C-c M-m')."))))
+
+(defun smarty-show-messages ()
+ "Get *Messages* buffer to show recent messages."
+ (interactive)
+ (display-buffer " *Message-Log*"))
+
+(defun smarty-version ()
+ "Echo the current version of Smarty Mode in the minibuffer."
+ (interactive)
+ (message "Smarty Mode %s (%s)" smarty-version smarty-time-stamp)
+ (smarty-keep-region-active))
+
+;; active regions
+(defun smarty-keep-region-active ()
+ "Do whatever is necessary to keep the region active in XEmacs.
+Ignore byte-compiler warnings you might see."
+ (and (boundp 'zmacs-region-stays)
+ (setq zmacs-region-stays t)))
+
+(defmacro smarty-prepare-search-1 (&rest body)
+ "Enable case insensitive search and switch to syntax table that includes '_',
+then execute BODY, and finally restore the old environment. Used for
+consistent searching."
+ `(let ((case-fold-search t) ; case insensitive search
+ (current-syntax-table (syntax-table))
+ result
+ (restore-prog ; program to restore enviroment
+ '(progn
+ ;; restore syntax table
+ (set-syntax-table current-syntax-table))))
+ ;; use extended syntax table
+ (set-syntax-table smarty-mode-ext-syntax-table)
+ ;; execute BODY safely
+ (setq result
+ (condition-case info
+ (progn ,@body)
+ (error (eval restore-prog) ; restore environment on error
+ (error (cadr info))))) ; pass error up
+ ;; restore environment
+ (eval restore-prog)
+ result))
+
+(defmacro smarty-prepare-search-2 (&rest body)
+ "Enable case insensitive search, switch to syntax table that includes '_',
+and remove `intangible' overlays, then execute BODY, and finally restore the
+old environment. Used for consistent searching."
+ `(let ((case-fold-search t) ; case insensitive search
+ (current-syntax-table (syntax-table))
+ result overlay-all-list overlay-intangible-list overlay
+ (restore-prog ; program to restore enviroment
+ '(progn
+ ;; restore syntax table
+ (set-syntax-table current-syntax-table)
+ ;; restore `intangible' overlays
+ (when (fboundp 'overlay-lists)
+ (while overlay-intangible-list
+ (overlay-put (car overlay-intangible-list) 'intangible t)
+ (setq overlay-intangible-list
+ (cdr overlay-intangible-list)))))))
+ ;; use extended syntax table
+ (set-syntax-table smarty-mode-ext-syntax-table)
+ ;; remove `intangible' overlays
+ (when (fboundp 'overlay-lists)
+ (setq overlay-all-list (overlay-lists))
+ (setq overlay-all-list
+ (append (car overlay-all-list) (cdr overlay-all-list)))
+ (while overlay-all-list
+ (setq overlay (car overlay-all-list))
+ (when (memq 'intangible (overlay-properties overlay))
+ (setq overlay-intangible-list
+ (cons overlay overlay-intangible-list))
+ (overlay-put overlay 'intangible nil))
+ (setq overlay-all-list (cdr overlay-all-list))))
+ ;; execute BODY safely
+ (setq result
+ (condition-case info
+ (progn ,@body)
+ (error (eval restore-prog) ; restore environment on error
+ (error (cadr info))))) ; pass error up
+ ;; restore environment
+ (eval restore-prog)
+ result))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Enabling/disabling
+
+(defun smarty-mode-line-update ()
+ "Update the modeline string for Smarty major mode."
+ (setq mode-name (concat "Smarty"
+ (and (or smarty-electric-mode smarty-stutter-mode) "/")
+ (and smarty-electric-mode "e")
+ (and smarty-stutter-mode "s")))
+ (force-mode-line-update t))
+
+(defun smarty-electric-mode (arg)
+ "Toggle Smarty electric mode.
+Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil."
+ (interactive "P")
+ (setq smarty-electric-mode
+ (cond ((or (not arg) (zerop arg)) (not smarty-electric-mode))
+ ((> arg 0) t) (t nil)))
+ (smarty-mode-line-update))
+
+(defun smarty-stutter-mode (arg)
+ "Toggle Smarty stuttering mode.
+Turn on if ARG positive, turn off if ARG negative, toggle if ARG zero or nil."
+ (interactive "P")
+ (setq smarty-stutter-mode
+ (cond ((or (not arg) (zerop arg)) (not smarty-stutter-mode))
+ ((> arg 0) t) (t nil)))
+ (smarty-mode-line-update))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Smarty code delimitation
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-in-literal ()
+ "Determine if point is in a Smarty literal."
+ (save-excursion
+ (let ((here (point))
+ start state)
+ (beginning-of-line)
+ (setq start (point))
+ (goto-char here)
+ (setq state (parse-partial-sexp start (point)))
+ (cond
+ ((nth 3 state) 'string)
+ ((nth 4 state) 'comment)
+ (t nil)))))
+
+(defun smarty-in-comment-p ()
+ "Check if point is in a comment."
+ (let ((result nil) (here (point-marker)) found)
+ (save-excursion
+ (setq found (re-search-backward (regexp-quote (concat smarty-left-delimiter "*")) nil t))
+ (when found
+ (setq result (re-search-forward (regexp-quote (concat "*" smarty-right-delimiter)) here t))
+ (setq result (not result))))
+ result))
+
+(defun smarty-after-ldelim ()
+ "Check that the previous character is the left delimiter."
+ (let ((here (point-marker)) ldelim-found ldelim-point)
+ (save-excursion
+ (setq ldelim-found (re-search-backward (regexp-quote smarty-left-delimiter) nil t))
+ (re-search-forward (regexp-quote smarty-left-delimiter) here t)
+ (setq ldelim-point (point-marker))
+ (goto-char here)
+ (if (and (= here ldelim-point) ldelim-found)
+ t
+ nil))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Words to expand
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-words-init ()
+ "Initialize reserved words."
+ (setq smarty-functions smarty-01-functions)
+ (setq smarty-modifiers smarty-01-modifiers)
+ (setq smarty-plugins-functions smarty-01-plugins-functions)
+ (setq smarty-plugins-modifiers smarty-01-plugins-modifiers)
+ (setq smarty-functions-regexp (concat "\\<\\(" (regexp-opt smarty-functions) "\\)\\>"))
+ (setq smarty-modifiers-regexp (concat "\\<\\(" (regexp-opt smarty-modifiers) "\\)\\>"))
+ (setq smarty-plugins-functions-regexp (concat "\\<\\(" (regexp-opt smarty-plugins-functions) "\\)\\>"))
+ (setq smarty-plugins-modifiers-regexp (concat "\\<\\(" (regexp-opt smarty-plugins-modifiers) "\\)\\>"))
+ (smarty-abbrev-list-init))
+
+(defvar smarty-abbrev-list nil
+ "Predefined abbreviations for Smarty.")
+
+(defun smarty-abbrev-list-init ()
+ (setq smarty-abbrev-list
+ (append
+ (list nil) smarty-functions
+ (list nil) smarty-modifiers
+ (list nil) smarty-plugins-functions
+ (list nil) smarty-plugins-modifiers)))
+
+(defvar smarty-expand-upper-case nil)
+
+(defun smarty-try-expand-abbrev (old)
+ "Try expanding abbreviations from `smarty-abbrev-list'."
+ (unless old
+ (he-init-string (he-dabbrev-beg) (point))
+ (setq he-expand-list
+ (let ((abbrev-list smarty-abbrev-list)
+ (sel-abbrev-list '()))
+ (while abbrev-list
+ ; (if (stringp (car abbrev-list))
+ ; (insert (concat " " (car abbrev-list))))
+ (when (or (not (stringp (car abbrev-list)))
+ (string-match
+ (concat "^" he-search-string) (car abbrev-list)))
+ (setq sel-abbrev-list
+ (cons (car abbrev-list) sel-abbrev-list)))
+ (setq abbrev-list (cdr abbrev-list)))
+ (nreverse sel-abbrev-list))))
+ (while (and he-expand-list
+ (or (not (stringp (car he-expand-list)))
+ (he-string-member (car he-expand-list) he-tried-table t)))
+ (unless (stringp (car he-expand-list))
+ (setq smarty-expand-upper-case (car he-expand-list)))
+ (setq he-expand-list (cdr he-expand-list)))
+ (if (null he-expand-list)
+ (progn (when old (he-reset-string))
+ nil)
+ (he-substitute-string
+ (if smarty-expand-upper-case
+ (upcase (car he-expand-list))
+ (car he-expand-list))
+ t)
+ (setq he-expand-list (cdr he-expand-list))
+ t))
+
+;; initialize reserved words for Smarty Mode
+(smarty-words-init)
+
+;; function for expanding abbrevs and dabbrevs
+(defun smarty-expand-abbrev (arg))
+(fset 'smarty-expand-abbrev (make-hippie-expand-function
+ '(try-expand-dabbrev
+ try-expand-dabbrev-all-buffers
+ smarty-try-expand-abbrev)))
+
+;; function for expanding parenthesis
+(defun smarty-expand-paren (arg))
+(fset 'smarty-expand-paren (make-hippie-expand-function
+ '(try-expand-list
+ try-expand-list-all-buffers)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Stuttering
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-electric-tab (&optional prefix-arg)
+ "If preceding character is part of a word or a paren then hippie-expand,
+else if right of non whitespace on line then insert tab,
+else if last command was a tab or return then dedent one step or if a comment
+toggle between normal indent and inline comment indent,
+else indent `correctly'."
+ (interactive "*P")
+ (smarty-prepare-search-2
+ (cond
+ ;; expand word
+ ((= (char-syntax (preceding-char)) ?w)
+ (let ((case-fold-search (not smarty-word-completion-case-sensitive))
+ (case-replace nil)
+ (hippie-expand-only-buffers
+ (or (and (boundp 'hippie-expand-only-buffers)
+ hippie-expand-only-buffers)
+ '(smarty-mode))))
+ (smarty-expand-abbrev prefix-arg)))
+ ;; expand parenthesis
+ ((or (= (preceding-char) ?\() (= (preceding-char) ?\)))
+ (let ((case-fold-search (not smarty-word-completion-case-sensitive))
+ (case-replace nil))
+ (smarty-expand-paren prefix-arg))))
+ (setq this-command 'smarty-electric-tab)))
+
+(defun smarty-electric-space (count)
+ "Expand abbreviations and self-insert space(s)."
+ (interactive "p")
+ (let ((here (point-marker)) ldelim-found ldelim-point rdelim-found rdelim-point
+ delete-a)
+ (setq ldelim-found (re-search-backward (regexp-quote smarty-left-delimiter) nil t))
+ (re-search-forward (regexp-quote smarty-left-delimiter) here t)
+ (setq ldelim-point (point-marker))
+ (goto-char here)
+ (setq rdelim-found (re-search-backward (regexp-quote (concat " " smarty-right-delimiter)) nil t))
+ (re-search-forward (regexp-quote (concat " " smarty-right-delimiter)) here t)
+ (setq rdelim-point (point-marker))
+ (goto-char here)
+ (cond ((and (= here ldelim-point) ldelim-found) (insert (concat "ldelim" smarty-right-delimiter)))
+ ((and (= here rdelim-point) rdelim-found)
+ (re-search-backward (regexp-quote (concat " " smarty-right-delimiter)) nil t)
+ (delete-char 1)
+ (insert (concat " " smarty-left-delimiter "rdelim"))
+ (goto-char here))
+ ((smarty-in-comment-p)
+ (self-insert-command count)
+ (cond ((>= (current-column) (+ 2 end-comment-column))
+ (backward-char 1)
+ (skip-chars-backward "^ \t\n")
+ (indent-new-comment-line)
+ (skip-chars-forward "^ \t\n")
+ (forward-char 1))
+ ((>= (current-column) end-comment-column)
+ (indent-new-comment-line))
+ (t nil)))
+ ((or (and (>= (preceding-char) ?a) (<= (preceding-char) ?z))
+ (and (>= (preceding-char) ?A) (<= (preceding-char) ?Z))
+ (and (>= (preceding-char) ?0) (<= (preceding-char) ?9)))
+ (progn
+ (setq here (point-marker))
+ (insert " ")
+ (setq delete-a t)
+ (if (re-search-backward "|" nil t)
+ (progn
+ (setq found (re-search-forward (regexp-quote "B2Smilies") here t))
+ (if (and found (= here (point-marker)))
+ (replace-match "btosmilies")
+ (setq found (re-search-forward (regexp-quote "bbcode2html") here t))
+ (if (and found (= here (point-marker)))
+ (replace-match "bbcodetohtml")
+ (setq found (re-search-forward (regexp-quote "date_format2") here t))
+ (if (and found (= here (point-marker)))
+ (replace-match "date_formatto")
+ (goto-char here)
+ (setq delete-a nil)
+ (delete-char 1)))))
+ (goto-char here)
+ (setq delete-a nil)
+ (delete-char 1)))
+ (smarty-prepare-search-1 (expand-abbrev))
+ (self-insert-command count)
+ (if (and delete-a (looking-at " "))
+ (delete-char 1)))
+ (t (self-insert-command count)))))
+
+(defun smarty-electric-open-bracket (count)
+ "'(' --> '(', '((' --> '[', '[(' --> '{'"
+ (interactive "p")
+ (if (and smarty-stutter-mode (= count 1) (not (smarty-in-literal)))
+ (if (= (preceding-char) ?\()
+ (progn (delete-char -1) (insert-char ?\[ 1))
+ (if (= (preceding-char) ?\[)
+ (progn (delete-char -1) (insert-char ?\{ 1))
+ (insert-char ?\( 1)))
+ (self-insert-command count)))
+
+(defun smarty-electric-close-bracket (count)
+ "')' --> ')', '))' --> ']', '])' --> '}'"
+ (interactive "p")
+ (if (and smarty-stutter-mode (= count 1) (not (smarty-in-literal)))
+ (progn
+ (if (= (preceding-char) ?\))
+ (progn (delete-char -1) (insert-char ?\] 1))
+ (if (= (preceding-char) ?\])
+ (progn (delete-char -1) (insert-char ?} 1))
+ (insert-char ?\) 1)))
+ (blink-matching-open))
+ (self-insert-command count)))
+
+(defun smarty-electric-star (count)
+ "After a left delimiter add a right delemiter to close the comment"
+ (interactive "p")
+ (let ((here (point-marker)) found)
+ (if (and smarty-stutter-mode (= count 1) (not (smarty-in-literal)))
+ (progn
+ (setq found (re-search-backward (regexp-quote smarty-left-delimiter) nil t))
+ (re-search-forward (regexp-quote smarty-left-delimiter) here t)
+ (if (not (and (= here (point-marker)) found))
+ (progn (goto-char here)
+ (self-insert-command count))
+ (self-insert-command count)
+ (insert " ")
+ (setq here (point-marker))
+ (insert " *")
+ (insert smarty-right-delimiter)
+ (goto-char here)))
+ (self-insert-command count))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Electrification
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defconst smarty-template-prompt-syntax "[^ =<>][^<>@.\n]*[^ =<>]"
+ "Syntax of prompt inserted by template generators.")
+
+(defvar smarty-template-invoked-by-hook nil
+ "Indicates whether a template has been invoked by a hook or by key or menu.
+Used for undoing after template abortion.")
+
+(defun smarty-minibuffer-tab (&optional prefix-arg)
+ "If preceding character is part of a word or a paren then hippie-expand,
+else insert tab (used for word completion in Smarty minibuffer)."
+ (interactive "P")
+ (cond
+ ;; expand word
+ ((= (char-syntax (preceding-char)) ?w)
+ (let ((case-fold-search (not smarty-word-completion-case-sensitive))
+ (case-replace nil)
+ (hippie-expand-only-buffers
+ (or (and (boundp 'hippie-expand-only-buffers)
+ hippie-expand-only-buffers)
+ '(smarty-mode))))
+ (smarty-expand-abbrev prefix-arg)))
+ ;; expand parenthesis
+ ((or (= (preceding-char) ?\() (= (preceding-char) ?\)))
+ (let ((case-fold-search (not smarty-word-completion-case-sensitive))
+ (case-replace nil))
+ (smarty-expand-paren prefix-arg)))
+ ;; insert tab
+ (t (insert-tab))))
+
+;; correct different behavior of function `unread-command-events' in XEmacs
+(defun smarty-character-to-event (arg))
+(defalias 'smarty-character-to-event
+ (if (fboundp 'character-to-event) 'character-to-event 'identity))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Abbrev ook bindings
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-mode-abbrev-table nil
+ "Abbrev table to use in `smarty-mode' buffers.")
+
+(defun smarty-mode-abbrev-table-init ()
+ "Initialize `smarty-mode-abbrev-table'."
+ (when smarty-mode-abbrev-table (clear-abbrev-table smarty-mode-abbrev-table))
+ (define-abbrev-table 'smarty-mode-abbrev-table
+ (append
+ '(
+ ("capture" "" smarty-template-capture-hook 0)
+ ("config_load" "" smarty-template-config-load-hook 0)
+ ("else" "" smarty-template-else-hook 0)
+ ("elseif" "" smarty-template-elseif-hook 0)
+ ("foreach" "" smarty-template-foreach-hook 0)
+ ("foreachelse" "" smarty-template-foreachelse-hook 0)
+ ("if" "" smarty-template-if-hook 0)
+ ("include" "" smarty-template-include-hook 0)
+ ("include_php" "" smarty-template-include-php-hook 0)
+ ("insert" "" smarty-template-insert-hook 0)
+ ("ldelim" "" smarty-template-ldelim-hook 0)
+ ("literal" "" smarty-template-literal-hook 0)
+ ("php" "" smarty-template-php-hook 0)
+ ("rdelim" "" smarty-template-rdelim-hook 0)
+ ("section" "" smarty-template-section-hook 0)
+ ("sectionelse" "" smarty-template-sectionelse-hook 0)
+ ("strip" "" smarty-template-strip-hook 0)
+ ("assign" "" smarty-template-assign-hook 0)
+ ("counter" "" smarty-template-counter-hook 0)
+ ("cycle" "" smarty-template-cycle-hook 0)
+ ("debug" "" smarty-template-debug-hook 0)
+ ("eval" "" smarty-template-eval-hook 0)
+ ("fetch" "" smarty-template-fetch-hook 0)
+ ("html_checkboxes" "" smarty-template-html-checkboxes-hook 0)
+ ("html_image" "" smarty-template-html-image-hook 0)
+ ("html_options" "" smarty-template-html-options-hook 0)
+ ("html_radios" "" smarty-template-html-radios-hook 0)
+ ("html_select_date" "" smarty-template-html-select-date-hook 0)
+ ("html_select_time" "" smarty-template-html-select-time-hook 0)
+ ("html_table" "" smarty-template-html-table-hook 0)
+ ("mailto" "" smarty-template-mailto-hook 0)
+ ("math" "" smarty-template-math-hook 0)
+ ("popup" "" smarty-template-popup-hook 0)
+ ("popup_init" "" smarty-template-popup-init-hook 0)
+ ("textformat" "" smarty-template-textformat-hook 0)
+ ("capitalize" "" smarty-template-capitalize-hook 0)
+ ("cat" "" smarty-template-cat-hook 0)
+ ("count_characters" "" smarty-template-count-characters-hook 0)
+ ("count_paragraphs" "" smarty-template-count-paragraphs-hook 0)
+ ("count_sentences" "" smarty-template-count-sentences-hook 0)
+ ("count_words" "" smarty-template-count-words-hook 0)
+ ("date_format" "" smarty-template-date-format-hook 0)
+ ("default" "" smarty-template-default-hook 0)
+ ("escape" "" smarty-template-escape-hook 0)
+ ("indent" "" smarty-template-indent-hook 0)
+ ("lower" "" smarty-template-lower-hook 0)
+ ("nl2br" "" smarty-template-nl2br-hook 0)
+ ("regex_replace" "" smarty-template-regex-replace-hook 0)
+ ("replace" "" smarty-template-replace-hook 0)
+ ("spacify" "" smarty-template-spacify-hook 0)
+ ("string_format" "" smarty-template-string-format-hook 0)
+ ("strip" "" smarty-template-vstrip-hook 0)
+ ("strip_tags" "" smarty-template-strip-tags-hook 0)
+ ("truncate" "" smarty-template-truncate-hook 0)
+ ("upper" "" smarty-template-upper-hook 0)
+ ("wordwrap" "" smarty-template-wordwrap-hook 0)
+ ("validate" "" smarty-template-validate-hook 0)
+ ("formtool_checkall" "" smarty-template-formtool-checkall-hook 0)
+ ("formtool_copy" "" smarty-template-formtool-copy-hook 0)
+ ("formtool_count_chars" "" smarty-template-formtool-count-chars-hook 0)
+ ("formtool_init" "" smarty-template-formtool-init-hook 0)
+ ("formtool_move" "" smarty-template-formtool-move-hook 0)
+ ("formtool_moveall" "" smarty-template-formtool-moveall-hook 0)
+ ("formtool_movedown" "" smarty-template-formtool-movedown-hook 0)
+ ("formtool_moveup" "" smarty-template-formtool-moveup-hook 0)
+ ("formtool_remove" "" smarty-template-formtool-remove-hook 0)
+ ("formtool_rename" "" smarty-template-formtool-rename-hook 0)
+ ("formtool_save" "" smarty-template-formtool-save-hook 0)
+ ("formtool_selectall" "" smarty-template-formtool-selectall-hook 0)
+ ("paginate_first" "" smarty-template-paginate-first-hook 0)
+ ("paginate_last" "" smarty-template-paginate-last-hook 0)
+ ("paginate_middle" "" smarty-template-paginate-middle-hook 0)
+ ("paginate_next" "" smarty-template-paginate-next-hook 0)
+ ("paginate_prev" "" smarty-template-paginate-prev-hook 0)
+ ("btosmilies" "" smarty-template-btosmilies-hook 0)
+ ("bbcodetohtml" "" smarty-template-bbcodetohtml-hook 0)
+ ("date_formatto" "" smarty-template-date-formatto-hook 0)))))
+
+;; initialize abbrev table for Smarty Mode
+(smarty-mode-abbrev-table-init)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Abbrev hooks
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-hooked-abbrev (func)
+ "Do function, if syntax says abbrev is a keyword, invoked by hooked abbrev,
+but not if inside a comment or quote)."
+ (if (or (smarty-in-literal)
+ (smarty-in-comment-p))
+ (progn
+ (insert " ")
+ (unexpand-abbrev)
+ (delete-char -1))
+ (if (not smarty-electric-mode)
+ (progn
+ (insert " ")
+ (unexpand-abbrev)
+ (backward-word 1)
+ (delete-char 1))
+ (let ((invoke-char last-command-char)
+ (abbrev-mode -1)
+ (smarty-template-invoked-by-hook t))
+ (let ((caught (catch 'abort
+ (funcall func))))
+ (when (stringp caught) (message caught)))
+ (when (= invoke-char ?-) (setq abbrev-start-location (point)))
+ ;; delete CR which is still in event queue
+ (if (fboundp 'enqueue-eval-event)
+ (enqueue-eval-event 'delete-char -1)
+ (setq unread-command-events ; push back a delete char
+ (list (smarty-character-to-event ?\177))))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Fontification
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-font-lock-keywords-1
+ (list
+
+ ;; Fontify built-in functions
+ (cons
+ (concat (regexp-quote smarty-left-delimiter) "[/]*" smarty-functions-regexp)
+ '(1 font-lock-keyword-face))
+
+ (cons
+ (concat "\\<\\(" smarty-constants "\\)\\>")
+ 'font-lock-constant-face)
+
+ (cons (concat "\\(" (regexp-quote (concat smarty-left-delimiter "*")) "\\(\\s-\\|\\w\\|\\s.\\|\\s_\\|\\s(\\|\\s)\\|\\s\\\\)*" (regexp-quote (concat "*" smarty-right-delimiter)) "\\)")
+ 'font-lock-comment-face)
+
+ )
+ "Subdued level highlighting for Smarty mode.")
+
+(defconst smarty-font-lock-keywords-2
+ (append
+ smarty-font-lock-keywords-1
+ (list
+
+ ;; Fontify variable names (\\sw\\|\\s_\\) matches any word character +
+ ;; underscore
+ '("\\$\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face)) ; $variable
+ '("->\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face t t)) ; ->variable
+ '("\\.\\(\\(?:\\sw\\|\\s_\\)+\\)" (1 font-lock-variable-name-face t t)) ; .variable
+ '("->\\(\\(?:\\sw\\|\\s_\\)+\\)\\s-*(" (1 font-lock-function-name-face t t)) ; ->function_call
+ '("\\<\\(\\(?:\\sw\\|\\s_\\)+\\s-*\\)(" (1 font-lock-function-name-face)) ; word(
+ '("\\<\\(\\(?:\\sw\\|\\s_\\)+\\s-*\\)[[]" (1 font-lock-variable-name-face)) ; word[
+ '("\\<[0-9]+" . default) ; number (also matches word)
+
+ ;; Fontify strings
+ ;;'("\"\\([^\"]*\\)\"[^\"]+" (1 font-lock-string-face t t))
+ ))
+
+ "Medium level highlighting for Smarty mode.")
+
+(defconst smarty-font-lock-keywords-3
+ (append
+ smarty-font-lock-keywords-2
+ (list
+ ;; Fontify modifiers
+ (cons (concat "|\\(" smarty-modifiers-regexp "\\)[:|]+") '(1 font-lock-function-name-face))
+ (cons (concat "|\\(" smarty-modifiers-regexp "\\)" (regexp-quote smarty-right-delimiter)) '(1 font-lock-function-name-face))
+
+ ;; Fontify config vars
+ (cons (concat (regexp-quote smarty-left-delimiter) "\\(#\\(?:\\sw\\|\\s_\\)+#\\)") '(1 font-lock-constant-face))))
+ "Balls-out highlighting for Smarty mode.")
+
+(defconst smarty-font-lock-keywords-4
+ (append
+ smarty-font-lock-keywords-3
+ (list
+ ;; Fontify plugin functions
+ (cons
+ (concat (regexp-quote smarty-left-delimiter) "[/]*" smarty-plugins-functions-regexp)
+ '(1 font-lock-keyword-face))
+
+ (cons (concat "|\\(" smarty-plugins-modifiers-regexp "\\)[:|]+") '(1 font-lock-function-name-face))
+ (cons (concat "|\\(" smarty-plugins-modifiers-regexp "\\)" (regexp-quote smarty-right-delimiter)) '(1 font-lock-function-name-face)))))
+
+(defvar smarty-font-lock-keywords smarty-font-lock-keywords-3
+ "Default highlighting level for Smarty mode")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Mode map
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defvar smarty-template-map nil
+ "Keymap for Smarty templates.")
+
+(defun smarty-template-map-init ()
+ "Initialize `smarty-template-map'."
+ (setq smarty-template-map (make-sparse-keymap))
+ ;; key bindings for Smarty templates
+ (define-key smarty-template-map "\C-ba" 'smarty-template-capture)
+ (define-key smarty-template-map "\C-bc" 'smarty-template-config-load)
+ (define-key smarty-template-map "\C-b\M-e" 'smarty-template-else)
+ (define-key smarty-template-map "\C-b\C-e" 'smarty-template-elseif)
+ (define-key smarty-template-map "\C-b\C-f" 'smarty-template-foreach)
+ (define-key smarty-template-map "\C-b\M-f" 'smarty-template-foreachelse)
+ (define-key smarty-template-map "\C-bf" 'smarty-template-if)
+ (define-key smarty-template-map "\C-b\C-i" 'smarty-template-include)
+ (define-key smarty-template-map "\C-b\M-i" 'smarty-template-include-php)
+ (define-key smarty-template-map "\C-bi" 'smarty-template-insert)
+ (define-key smarty-template-map "\C-bl" 'smarty-template-ldelim)
+ (define-key smarty-template-map "\C-b\C-l" 'smarty-template-literal)
+ (define-key smarty-template-map "\C-bp" 'smarty-template-php)
+ (define-key smarty-template-map "\C-br" 'smarty-template-rdelim)
+ (define-key smarty-template-map "\C-b\C-s" 'smarty-template-section)
+ (define-key smarty-template-map "\C-b\M-s" 'smarty-template-sectionelse)
+ (define-key smarty-template-map "\C-bs" 'smarty-template-strip)
+ (define-key smarty-template-map "\C-ca" 'smarty-template-assign)
+ (define-key smarty-template-map "\C-co" 'smarty-template-counter)
+ (define-key smarty-template-map "\C-cc" 'smarty-template-cycle)
+ (define-key smarty-template-map "\C-cd" 'smarty-template-debug)
+ (define-key smarty-template-map "\C-ce" 'smarty-template-eval)
+ (define-key smarty-template-map "\C-cf" 'smarty-template-fetch)
+ (define-key smarty-template-map "\C-c\C-hc" 'smarty-template-html-checkboxes)
+ (define-key smarty-template-map "\C-c\C-hi" 'smarty-template-html-image)
+ (define-key smarty-template-map "\C-c\C-ho" 'smarty-template-html-options)
+ (define-key smarty-template-map "\C-c\C-hr" 'smarty-template-html-radios)
+ (define-key smarty-template-map "\C-c\C-hd" 'smarty-template-html-select-date)
+ (define-key smarty-template-map "\C-c\C-hm" 'smarty-template-html-select-time)
+ (define-key smarty-template-map "\C-c\C-ht" 'smarty-template-html-table)
+ (define-key smarty-template-map "\C-ci" 'smarty-template-mailto)
+ (define-key smarty-template-map "\C-ch" 'smarty-template-math)
+ (define-key smarty-template-map "\C-c\C-p" 'smarty-template-popup)
+ (define-key smarty-template-map "\C-c\M-p" 'smarty-template-popup-init)
+ (define-key smarty-template-map "\C-ct" 'smarty-template-textformat)
+ (define-key smarty-template-map "\C-vp" 'smarty-template-capitalize)
+ (define-key smarty-template-map "\C-vc" 'smarty-template-cat)
+ (define-key smarty-template-map "\C-v\C-cc" 'smarty-template-count-characters)
+ (define-key smarty-template-map "\C-v\C-cp" 'smarty-template-count-paragraphs)
+ (define-key smarty-template-map "\C-v\C-cs" 'smarty-template-count-sentences)
+ (define-key smarty-template-map "\C-v\C-cw" 'smarty-template-count-words)
+ (define-key smarty-template-map "\C-vf" 'smarty-template-date-format)
+ (define-key smarty-template-map "\C-vd" 'smarty-template-default)
+ (define-key smarty-template-map "\C-ve" 'smarty-template-escape)
+ (define-key smarty-template-map "\C-vi" 'smarty-template-indent)
+ (define-key smarty-template-map "\C-vl" 'smarty-template-lower)
+ (define-key smarty-template-map "\C-vn" 'smarty-template-nl2br)
+ (define-key smarty-template-map "\C-vx" 'smarty-template-regex-replace)
+ (define-key smarty-template-map "\C-v\C-p" 'smarty-template-replace)
+ (define-key smarty-template-map "\C-vy" 'smarty-template-spacify)
+ (define-key smarty-template-map "\C-vs" 'smarty-template-string-format)
+ (define-key smarty-template-map "\C-v\C-s" 'smarty-template-vstrip)
+ (define-key smarty-template-map "\C-v\M-s" 'smarty-template-strip-tags)
+ (define-key smarty-template-map "\C-vt" 'smarty-template-truncate)
+ (define-key smarty-template-map "\C-vu" 'smarty-template-upper)
+ (define-key smarty-template-map "\C-vw" 'smarty-template-wordwrap)
+ (define-key smarty-template-map "\C-h" 'smarty-template-header)
+ (define-key smarty-template-map "\C-f" 'smarty-template-footer)
+ (define-key smarty-template-map "\C-di" 'smarty-template-insert-date)
+ (define-key smarty-template-map "\C-dm" 'smarty-template-modify))
+
+;; initialize template map for Smarty Mode
+(smarty-template-map-init)
+
+(defun smarty-mode-map-init ()
+ "Initialize `smarty-mode-map'."
+ (setq smarty-mode-map (make-sparse-keymap))
+ ;; template key bindings
+ (define-key smarty-mode-map "\C-c\C-t" smarty-template-map)
+ ;; mode specific key bindings
+ (define-key smarty-mode-map "\C-c\C-m\C-e" 'smarty-electric-mode)
+ (define-key smarty-mode-map "\C-c\C-m\C-s" 'smarty-stutter-mode)
+ (define-key smarty-mode-map "\C-c\C-s\C-u" 'smarty-add-source-files-menu)
+ (define-key smarty-mode-map "\C-c\M-m" 'smarty-show-messages)
+ (define-key smarty-mode-map "\C-c\C-h" 'smarty-doc-mode)
+ (define-key smarty-mode-map "\C-c\C-v" 'smarty-version)
+ ;; electric key bindings
+ (when smarty-intelligent-tab
+ (define-key smarty-mode-map "\t" 'smarty-electric-tab))
+ (define-key smarty-mode-map " " 'smarty-electric-space)
+ (define-key smarty-mode-map "(" 'smarty-electric-open-bracket)
+ (define-key smarty-mode-map ")" 'smarty-electric-close-bracket)
+ (define-key smarty-mode-map "*" 'smarty-electric-star))
+
+;; initialize mode map for Smarty Mode
+(smarty-mode-map-init)
+
+(defvar smarty-minibuffer-local-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map minibuffer-local-map)
+ (when smarty-word-completion-in-minibuffer
+ (define-key map "\t" 'smarty-minibuffer-tab))
+ map)
+ "Keymap for minibuffer used in Smarty Mode.")
+
+(mapcar
+ (function
+ (lambda (sym)
+ (put sym 'delete-selection t) ; for `delete-selection-mode' (Emacs)
+ (put sym 'pending-delete t))) ; for `pending-delete-mode' (XEmacs)
+ '(smarty-electric-space
+ smarty-electric-tab
+ smarty-electric-open-bracket
+ smarty-electric-close-bracket
+ smarty-electric-star))
+
+;;;###autoload
+(defun smarty-mode ()
+ "Smarty Mode
+***********
+
+Smarty Mode is a GNU XEmacs major mode for editing Smarty templates.
+
+1 Introduction
+**************
+
+Smarty-Mode is a mode allowing easy edit of Smarty templates:
+highlight, templates, navigation into source files...
+
+
+
+Features (new features in bold) :
+
+ * Completion
+
+ * Customizable
+
+ * Highlight
+
+ * Menu
+
+ * Stuttering
+
+ * Templates
+ - Built-in Functions
+
+ - User Functions
+
+ - Variable Modifiers
+
+ - Plugin (Functions)
+ * Smarty Formtool
+
+ * Smarty Paginate
+
+ * Smarty Validate
+
+ - Plugin (Variable Modifiers)
+ * AlternativeDateModifierPlugin
+
+ * B2Smilies
+
+ * BBCodePlugin
+
+ - Fonctions Non-Smarty
+
+
+
+This manual describes Smarty Mode version 0.0.4.
+
+2 Installation
+**************
+
+2.1 Requirements
+================
+
+Smarty Mode is a XEmacs major mode that needs the following
+software/packages:
+
+ * XEmacs (http://www.xemacs.org/).
+
+ * `font-lock' mode generaly installed with XEmacs.
+
+ * `assoc' mode generaly installed with XEmacs.
+
+ * `easymenu' mode generaly installed with XEmacs.
+
+ * `hippie-exp' mode generaly installed with XEmacs.
+
+Before continuing, you must be sure to have all this packages
+installed.
+
+2.2 Download
+============
+
+Two internet address to download Smarty Mode :
+
+ * Principal: Smarty-Mode 0.0.4
+ (http://deboutv.free.fr/lisp/smarty/download/smarty-0.0.4.tar.gz)
+ (http://deboutv.free.fr/lisp/smarty/)
+
+ * Secondary: Smarty-Mode 0.0.4
+ (http://www.morinie.fr/lisp/smarty/download/smarty-0.0.4.tar.gz)
+ (http://www.morinie.fr/lisp/smarty/)
+
+ * Old releases: Smarty-Mode
+ (http://deboutv.free.fr/lisp/smarty/download.php)
+ (http://deboutv.free.fr/lisp/smarty/)
+
+2.3 Installation
+================
+
+2.3.1 Installation
+------------------
+
+To install Smarty Mode you need to choose an installation directory
+(for example `/usr/local/share/lisp' or `c:\lisp'). The administrator
+must have the write rights on this directory.
+
+With your favorite unzip software, unzip the archive in the
+installation directory.
+
+Example:
+ cd /usr/local/share/lisp
+ tar zxvf smarty-0.0.4.tar.gz
+Now you have a `smarty' directory in the installation directory. This
+directory contains 2 files `smarty-mode.el' and `smarty-mode.elc' and
+another directory `docs' containing the documentation.
+
+You need to configure XEmacs. open you initialization file `init.el'
+(open the file or start XEmacs then choose the Options menu and Edit
+Init File). Add the following lines (the installation directory in
+this example is `/usr/local/share/lisp') :
+
+ (setq load-path
+ (append (list \"/usr/local/share/lisp/\") load-path))
+ (autoload 'smarty-mode \"smarty-mode\" \"Smarty Mode\" t)
+
+2.3.2 Update
+------------
+
+The update is easy. You need to unzip the archive in the installation
+directory to remove the old release.
+
+Example:
+ cd /usr/local/share/lisp
+ rm -rf smarty
+ tar zxvf smarty-0.0.4.tar.gz
+
+2.4 Invoke Smarty-Mode
+======================
+
+You have two possibilities to invoke the Smarty Mode.
+
+ - Manually: At each file opening you need to launch Smarty Mode
+ with the following command:
+
+ `M-x smarty-mode'
+
+ - Automatically: Add the following linesin your initialization
+ file `init.el' :
+
+ (setq auto-mode-alist
+ (append
+ '((\"\\.tpl$\" . smarty-mode))
+ auto-mode-alist))
+
+
+3 Customization
+***************
+
+This chapter describes the differents parameters and functions that
+you can change to customize Smarty Mode. To do that, open a Smarty
+file, click on the Smarty menu and choose Options then Browse
+Options....
+
+3.1 Parameters
+==============
+
+3.1.1 Mode
+----------
+
+Smarty Mode has 2 modes allowing to simplify the writing of Smarty
+templates. You can enable/disable each mode individually.
+
+`smarty-electric-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable automatic generation of template.
+ If `nil'; template generators can still be invoked through key
+ bindings and menu. Is indicated in the modeline by \"/e\" after
+ the mode name and can be toggled by `smarty-electric-mode'.
+
+`smarty-stutter-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable the stuttering. Is indicated in the
+ modeline by \"/s\" after the mode name and can be toggled by
+ `smarty-stutter-mode'.
+
+3.1.2 Menu
+----------
+
+Smarty Mode has also 1 menu that you can enable/disable. The menu
+Sources is specific to each Smarty files opened.
+
+`smarty-source-file-menu'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; the Sources menu is enabled. This menu
+ contains the list of Smarty file located in the current
+ directory. The Sources menu scans the directory when a file is
+ opened.
+
+3.1.3 Menu
+----------
+
+`smarty-highlight-plugin-functions'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; the functions described in the smarty
+ plugins are highlighted.
+
+3.1.4 Templates
+---------------
+
+3.1.4.1 Header
+..............
+
+`smarty-file-header'
+ Type: string
+ Default value: `\"\"'
+ Description: String or file to insert as file header. If the
+ string specifies an existing file name the contents of the file
+ is inserted; otherwise the string itself is inserted as file
+ header.
+ Type `C-j' for newlines.
+ The follonwing keywords are supported:
+ <filename>: replaced by the file name.
+ <author>: replaced by the user name and email address.
+ <login>: replaced by `user-login-name'.
+ <company>: replaced by `smarty-company-name' content.
+ <date>: replaced by the current date.
+ <year>: replaced by the current year.
+ <copyright>: replaced by `smarty-copyright-string' content.
+ <cursor>: final cursor position.
+
+`smarty-file-footer'
+ Type: string
+ Default value: `\"\"'
+ Description: String or file to insert as file footer. See
+ `smarty-file-header'
+
+`smarty-company-name'
+ Type: string
+ Default value: `\"\"'
+ Description: Name of the company to insert in file header.
+
+`smarty-copyright-string'
+ Type: string
+ Default value: `\"\"'
+ Description: Coryright string to insert in file header.
+
+`smarty-date-format'
+ Type: string
+ Default value: `\"%Y-%m-%d\"'
+ Description: Date format.
+
+`smarty-modify-date-prefix-string'
+ Type: string
+ Default value: `\"\"'
+ Description: Prefix string of modification date in Smarty file
+ header.
+
+`smarty-modify-date-on-saving'
+ Type: bool
+ Default value: `nil'
+ Description: If `t'; update the modification date when the
+ buffer is saved.
+
+3.1.5 Miscellaneous
+-------------------
+
+`smarty-left-delimiter'
+ Type: string
+ Default value: `\"\"'
+ Description: Left escaping delimiter for Smarty templates.
+
+`smarty-right-delimiter'
+ Type: string
+ Default value: `\"\"'
+ Description: Right escaping delimiter for Smarty templates.
+
+`smarty-intelligent-tab'
+ Type: bool
+ Default value: `t'
+ Description: If `t'; TAB does indentation; completion and insert
+ tabulations. If `nil'; TAB does only indentation.
+
+`smarty-word-completion-in-minibuffer'
+ Type: bool
+ Default value: `t'
+ Description: If `t'; enable completion in the minibuffer.
+
+`smarty-word-completion-case-sensitive'
+ Type: bool
+ Default value: `nil'
+ Description: If `t'; completion is case sensitive.
+
+3.2 Functions
+=============
+
+3.2.1 Mode
+----------
+
+`smarty-electric-mode'
+ Menu: Smarty -> Options -> Mode -> Electric Mode
+ Keybinding: `C-c C-m C-e'
+ Description: This functions is used to enable/disable the
+ electric mode.
+
+`smarty-stutter-mode'
+ Menu: Smarty -> Options -> Mode -> Stutter Mode
+ Keybinding: `C-c C-m C-s'
+ Description: This function is used to enable/disable the stutter
+ mode.
+
+4 Menus
+*******
+
+There are 2 menus: Smarty and Sources. All theses menus can be
+accessed from the menubar or from the right click. This chapter
+describes each menus.
+
+4.1 Smarty
+==========
+
+This is the main menu of Smarty Mode. It allows an easy access to the
+main features of the Smarty Mode: Templates (see *Note Templates::)
+and Options (see *Note Customization::).
+
+This menu contains also 3 functions that are discussed in the next
+part.
+
+4.1.1 Functions
+---------------
+
+`smarty-show-messages'
+ Menu: Smarty -> Show Messages
+ Keybinding: `C-c M-m'
+ Description: This function opens the *Messages* buffer to
+ display previous error messages.
+
+`smarty-doc-mode'
+ Menu: Smarty -> Smarty Mode Documentation
+ Keybinding: `C-c C-h'
+ Description: This function opens the *Help* buffer and prints in
+ it the Smarty Mode documentation.
+
+`smarty-version'
+ Menu: Smarty -> Version
+ Keybinding: `C-c C-v'
+ Description: This function displays in the minibuffer the
+ current Smarty Mode version with the timestamp.
+
+4.2 Sources
+===========
+
+The Sources menu shows the Smarty files in the current directory. If
+you add or delete a file in the current directory, you need to
+refresh the menu.
+
+4.2.1 Customization
+-------------------
+
+`smarty-source-file-menu'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; the Sources menu is enabled. This menu
+ contains the list of Smarty file located in the current
+ directory. The Sources menu scans the directory when a file is
+ opened.
+
+4.2.2 Functions
+---------------
+
+`smarty-add-source-files-menu'
+ Menu: Sources -> *Rescan*
+ Keybinding: `C-c C-s C-u'
+ Description: This function is used to refresh the Sources menu.
+
+5 Stuttering
+************
+
+The stutter mode is a mode that affects a function to a key. For
+example, when you use the `ENTER' key, the associated function will
+create a new line and indent it.
+
+5.1 Customization
+=================
+
+`smarty-stutter-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable the stuttering. Is indicated in the
+ modeline by \"/s\" after the mode name and can be toggled by
+ `smarty-stutter-mode'.
+
+5.2 Functions
+=============
+
+`SPACE'
+ If in comment, indent the comment and add new line if necessary.
+ In other case, add a space.
+
+`('
+ If the previous character is a `(', the `((' will be replaced by
+ `['.
+ If the previous character is a `[', the `[(' will be replaced by
+ `{'.
+ In other case, insert a `('.
+
+`)'
+ If the previous character is a `)', the `))' will be replaced by
+ `]'.
+ If the previous character is a `]', the `])' will be replaced by
+ `}'.
+ In other case, insert a `)'.
+
+6 Templates
+***********
+
+In the Smarty Mode, the Smarty functions (like if, while, for, fopen,
+fclose) are predefined in functions called \"Templates\".
+
+Each template can be invoked by the function name or by using the
+<SPACE> key after the Smarty function name in the buffer (Note, using
+`M-<SPACE>' disable the template).
+
+A template can be aborted by using the `C-g' or by lefting empty the
+tempate prompt (in the minibuffer).
+
+6.1 Customization
+=================
+
+`smarty-electric-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable automatic generation of template.
+ If `nil'; template generators can still be invoked through key
+ bindings and menu. Is indicated in the modeline by \"/e\" after
+ the mode name and can be toggled by `smarty-electric-mode'.
+
+For a complete description of the template customizable variables,
+see *Note Cu01-Pa01-Template::
+
+6.2 Functions
+=============
+
+6.2.1 Smarty Functions
+----------------------
+
+For Smarty functions, see PDF or HTML documentation.
+
+6.2.2 Non-Smarty Functions
+--------------------------
+
+`smarty-template-header'
+ Menu: Smarty -> Templates -> Insert Header
+ Keybinding: `C-c C-t C-h'
+ Description: This function is used to insert a header in the
+ current buffer.
+
+`smarty-template-footer'
+ Menu: Smarty -> Templates -> Insert Footer
+ Keybinding: `C-c C-t C-f'
+ Description: This function is used to insert a footer in the
+ current buffer.
+
+`smarty-template-insert-date'
+ Menu: Smarty -> Templates -> Insert Date
+ Keybinding: `C-c C-t C-d i'
+ Description: This function is used to insert the date in the
+ current buffer.
+
+`smarty-template-modify'
+ Menu: Smarty -> Templates -> Modify Date
+ Keybinding: `C-c C-t C-d m'
+ Description: This function is used to modify the last
+ modification date in the current buffer.
+
+7 Bugs, Help
+************
+
+ * To report bugs: Bugtracker
+ (http://bugtracker.morinie.fr/lisp/set_project.php?project_id=2)
+
+ * To obtain help you can post on the dedicated forum: Forum
+ (http://forum.morinie.fr/lisp/)
+
+8 Key bindings
+**************
+
+\\{smarty-mode-map}"
+ (interactive)
+ (kill-all-local-variables)
+ (setq major-mode 'smarty-mode)
+ (setq mode-name "Smarty")
+
+ (smarty-create-syntax-table)
+
+ ;; set maps and tables
+ (use-local-map smarty-mode-map)
+ (set-syntax-table smarty-mode-syntax-table)
+ (setq local-abbrev-table smarty-mode-abbrev-table)
+
+ (set (make-local-variable 'comment-start) (concat smarty-left-delimiter "*"))
+ (set (make-local-variable 'comment-end) (concat "*" smarty-right-delimiter))
+ (set (make-local-variable 'comment-multi-line) t)
+ (set (make-local-variable 'end-comment-column) 80)
+
+ (make-local-variable 'font-lock-defaults)
+ (if smarty-highlight-plugin-functions
+ (setq smarty-font-lock-keywords smarty-font-lock-keywords-4)
+ (setq smarty-font-lock-keywords smarty-font-lock-keywords-3))
+ (setq font-lock-defaults
+ '((smarty-font-lock-keywords)
+ nil ; Keywords only (i.e. no comment or string highlighting
+ t ; case fold
+ nil ; syntax-alist
+ nil ; syntax-begin
+ ))
+
+ (setq font-lock-maximum-decoration t
+ case-fold-search t)
+
+ ;; add source file menu
+ (if smarty-source-file-menu (smarty-add-source-files-menu))
+ ;; add Smarty menu
+ (easy-menu-add smarty-mode-menu-list)
+ (easy-menu-define smarty-mode-menu smarty-mode-map
+ "Menu keymap for Smarty Mode." smarty-mode-menu-list)
+
+ (message "Smarty Mode %s.%s" smarty-version
+ (if noninteractive "" " See menu for documentation and release notes."))
+ (smarty-mode-line-update)
+ (run-hooks 'smarty-mode-hook))
+
+(defun smarty-doc-mode ()
+ "Display Smarty Mode documentation in *Help* buffer."
+ (interactive)
+ (with-output-to-temp-buffer
+ (if (fboundp 'help-buffer) (help-buffer) "*Help*")
+ (princ mode-name)
+ (princ " mode:\n")
+ (princ (documentation 'smarty-mode))
+ (with-current-buffer standard-output
+ (help-mode))
+ (print-help-return-message)))
+
+(defun smarty-activate-customizations ()
+ "Activate all customizations on local variables."
+ (interactive)
+ (smarty-mode-map-init)
+ (use-local-map smarty-mode-map)
+ (set-syntax-table smarty-mode-syntax-table)
+ (smarty-update-mode-menu)
+ (run-hooks 'menu-bar-update-hook)
+ (smarty-mode-line-update))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Templates
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(defun smarty-template-field (prompt &optional follow-string optional
+ begin end is-string string-char default)
+ "Prompt for string and insert it in buffer with optional FOLLOW-STRING.
+If OPTIONAL is nil, the prompt is left if an empty string is inserted. If
+an empty string is inserted, return nil and call `smarty-template-undo' for
+the region between BEGIN and END. IS-STRING indicates whether a string
+with double-quotes is to be inserted. DEFAULT specifies a default string."
+ (let ((position (point))
+ string)
+ (insert "<" prompt ">")
+ (if (not (> (length string-char) 0))
+ (setq string-char "\""))
+ (setq string
+ (condition-case ()
+ (read-from-minibuffer (concat prompt ": ")
+ (or (and is-string (cons (concat string-char string-char) 1)) default)
+ smarty-minibuffer-local-map)
+ (quit (if (and optional begin end)
+ (progn (beep) "")
+ (keyboard-quit)))))
+ (when (or (not (equal string "")) optional)
+ (delete-region position (point)))
+ (when (and (equal string "") optional begin end)
+ (smarty-template-undo begin end)
+ (message "Template aborted"))
+ (unless (equal string "")
+ (insert string))
+ (when (or (not (equal string "")) (not optional))
+ (insert (or follow-string "")))
+ (if (equal string "") nil string)))
+
+(defun smarty-template-undo (begin end)
+ "Undo aborted template by deleting region and unexpanding the keyword."
+ (cond (smarty-template-invoked-by-hook
+ (goto-char end)
+ (insert " ")
+ (delete-region begin end)
+ (unexpand-abbrev))
+ (t (delete-region begin end))))
+
+(defun smarty-template-generic-function (label close-label field mandatory-count &optional infinite special-field)
+ "Generic function template 'label field1= field2=..."
+ (interactive)
+ (let ((start (point)) found here result-value elt continue field-count stop prompt)
+ (if smarty-template-invoked-by-hook
+ (setq found (smarty-after-ldelim))
+ (insert smarty-left-delimiter)
+ (setq found t))
+ (insert label)
+ (setq here (point-marker))
+ (insert " ")
+ (when found
+ (setq elt field)
+ (setq continue t)
+ (setq field-count 0)
+ (setq stop nil)
+ (while (and elt continue)
+ (setq prompt (car elt))
+ (when (not special-field)
+ (insert prompt "="))
+ (setq result-value (smarty-template-field prompt nil t))
+ (if (and (not result-value)
+ (< field-count mandatory-count))
+ (progn (setq continue nil)
+ (delete-region start (point))
+ (insert (concat label " "))
+ (setq stop t))
+ (if (not result-value)
+ (setq continue nil)
+ (setq here (point-marker))
+ (insert " ")))
+ (setq field-count (+ 1 field-count))
+ (setq elt (cdr elt)))
+ (when (and infinite continue)
+ (while continue
+ (setq result-value (smarty-template-field "var_name" "=" t here))
+ (if (not result-value)
+ (setq continue nil)
+ (setq continue (smarty-template-field "var_value" nil t here))
+ (setq here (point-marker))
+ (insert " "))))
+ (when (not stop)
+ (delete-region here (point))
+ (if (> 0 mandatory-count)
+ (delete-char -1))
+ (if special-field
+ (delete-char -1))
+ (insert smarty-right-delimiter)
+ (setq here (point-marker))
+ (if close-label
+ (insert smarty-left-delimiter "/" label smarty-right-delimiter))
+ (goto-char here)))))
+
+(defun smarty-template-generic-modifier (label field mandatory-count)
+ "Generic modifier template '|label:field1:field2..."
+ (interactive)
+ (let ((start (point)) found here result-value elt continue field-count stop prompt)
+ (setq found (re-search-backward (concat (regexp-quote smarty-left-delimiter) "\\$\\(\\w+\\)" (regexp-quote "|")) nil t))
+ (if found
+ (progn
+ (setq found (re-search-forward (regexp-quote smarty-right-delimiter) start t))
+ (if (not found)
+ (progn
+ (goto-char start)
+ (insert label)
+ (setq here (point-marker))
+ (setq elt field)
+ (setq continue t)
+ (setq field-count 0)
+ (setq stop nil)
+ (while (and elt continue)
+ (setq prompt (car elt))
+ (insert ":")
+ (setq result-value (smarty-template-field prompt nil t))
+ (if (and (not result-value)
+ (< field-count mandatory-count))
+ (progn (setq continue nil)
+ (delete-region start (point))
+ (insert (concat label " "))
+ (setq stop t))
+ (if (not result-value)
+ (setq continue nil)
+ (setq here (point-marker))
+ (insert ":")))
+ (setq field-count (+ 1 field-count))
+ (setq elt (cdr elt)))
+ (when (not stop)
+ (delete-region here (point))
+ (if (not (or (looking-at smarty-right-delimiter)
+ (looking-at "|")))
+ (insert smarty-right-delimiter))))
+ (goto-char start)
+ (insert label " ")))
+ (goto-char start)
+ (insert label " "))))
+
+(defun smarty-template-capture-hook ()
+ (smarty-hooked-abbrev 'smarty-template-capture))
+(defun smarty-template-config-load-hook ()
+ (smarty-hooked-abbrev 'smarty-template-config-load))
+(defun smarty-template-else-hook ()
+ (smarty-hooked-abbrev 'smarty-template-else))
+(defun smarty-template-elseif-hook ()
+ (smarty-hooked-abbrev 'smarty-template-elseif))
+(defun smarty-template-foreach-hook ()
+ (smarty-hooked-abbrev 'smarty-template-foreach))
+(defun smarty-template-foreachelse-hook ()
+ (smarty-hooked-abbrev 'smarty-template-foreachelse))
+(defun smarty-template-if-hook ()
+ (smarty-hooked-abbrev 'smarty-template-if))
+(defun smarty-template-include-hook ()
+ (smarty-hooked-abbrev 'smarty-template-include))
+(defun smarty-template-include-php-hook ()
+ (smarty-hooked-abbrev 'smarty-template-include-php))
+(defun smarty-template-insert-hook ()
+ (smarty-hooked-abbrev 'smarty-template-insert))
+(defun smarty-template-ldelim-hook ()
+ (smarty-hooked-abbrev 'smarty-template-ldelim))
+(defun smarty-template-literal-hook ()
+ (smarty-hooked-abbrev 'smarty-template-literal))
+(defun smarty-template-php-hook ()
+ (smarty-hooked-abbrev 'smarty-template-php))
+(defun smarty-template-rdelim-hook ()
+ (smarty-hooked-abbrev 'smarty-template-rdelim))
+(defun smarty-template-section-hook ()
+ (smarty-hooked-abbrev 'smarty-template-section))
+(defun smarty-template-sectionelse-hook ()
+ (smarty-hooked-abbrev 'smarty-template-sectionelse))
+(defun smarty-template-strip-hook ()
+ (smarty-hooked-abbrev 'smarty-template-strip))
+
+(defun smarty-template-assign-hook ()
+ (smarty-hooked-abbrev 'smarty-template-assign))
+(defun smarty-template-counter-hook ()
+ (smarty-hooked-abbrev 'smarty-template-counter))
+(defun smarty-template-cycle-hook ()
+ (smarty-hooked-abbrev 'smarty-template-cycle))
+(defun smarty-template-debug-hook ()
+ (smarty-hooked-abbrev 'smarty-template-debug))
+(defun smarty-template-eval-hook ()
+ (smarty-hooked-abbrev 'smarty-template-eval))
+(defun smarty-template-fetch-hook ()
+ (smarty-hooked-abbrev 'smarty-template-fetch))
+(defun smarty-template-html-checkboxes-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-checkboxes))
+(defun smarty-template-html-image-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-image))
+(defun smarty-template-html-options-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-options))
+(defun smarty-template-html-radios-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-radios))
+(defun smarty-template-html-select-date-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-select-date))
+(defun smarty-template-html-select-time-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-select-time))
+(defun smarty-template-html-table-hook ()
+ (smarty-hooked-abbrev 'smarty-template-html-table))
+(defun smarty-template-mailto-hook ()
+ (smarty-hooked-abbrev 'smarty-template-mailto))
+(defun smarty-template-math-hook ()
+ (smarty-hooked-abbrev 'smarty-template-math))
+(defun smarty-template-popup-hook ()
+ (smarty-hooked-abbrev 'smarty-template-popup))
+(defun smarty-template-popup-init-hook ()
+ (smarty-hooked-abbrev 'smarty-template-popup-init))
+(defun smarty-template-textformat-hook ()
+ (smarty-hooked-abbrev 'smarty-template-textformat))
+
+(defun smarty-template-capitalize-hook ()
+ (smarty-hooked-abbrev 'smarty-template-capitalize))
+(defun smarty-template-cat-hook ()
+ (smarty-hooked-abbrev 'smarty-template-cat))
+(defun smarty-template-count-characters-hook ()
+ (smarty-hooked-abbrev 'smarty-template-count-characters))
+(defun smarty-template-count-paragraphs-hook ()
+ (smarty-hooked-abbrev 'smarty-template-count-paragraphs))
+(defun smarty-template-count-sentences-hook ()
+ (smarty-hooked-abbrev 'smarty-template-count-sentences))
+(defun smarty-template-count-words-hook ()
+ (smarty-hooked-abbrev 'smarty-template-count-words))
+(defun smarty-template-date-format-hook ()
+ (smarty-hooked-abbrev 'smarty-template-date-format))
+(defun smarty-template-default-hook ()
+ (smarty-hooked-abbrev 'smarty-template-default))
+(defun smarty-template-escape-hook ()
+ (smarty-hooked-abbrev 'smarty-template-escape))
+(defun smarty-template-indent-hook ()
+ (smarty-hooked-abbrev 'smarty-template-indent))
+(defun smarty-template-lower-hook ()
+ (smarty-hooked-abbrev 'smarty-template-lower))
+(defun smarty-template-nl2br-hook ()
+ (smarty-hooked-abbrev 'smarty-template-nl2br))
+(defun smarty-template-regex-replace-hook ()
+ (smarty-hooked-abbrev 'smarty-template-regex-replace))
+(defun smarty-template-replace-hook ()
+ (smarty-hooked-abbrev 'smarty-template-replace))
+(defun smarty-template-spacify-hook ()
+ (smarty-hooked-abbrev 'smarty-template-spacify))
+(defun smarty-template-string-format-hook ()
+ (smarty-hooked-abbrev 'smarty-template-string-format))
+(defun smarty-template-vstrip-hook ()
+ (smarty-hooked-abbrev 'smarty-template-vstrip))
+(defun smarty-template-strip-tags-hook ()
+ (smarty-hooked-abbrev 'smarty-template-strip-tags))
+(defun smarty-template-truncate-hook ()
+ (smarty-hooked-abbrev 'smarty-template-truncate))
+(defun smarty-template-upper-hook ()
+ (smarty-hooked-abbrev 'smarty-template-upper))
+(defun smarty-template-wordwrap-hook ()
+ (smarty-hooked-abbrev 'smarty-template-wordwrap))
+
+(defun smarty-template-validate-hook ()
+ (smarty-hooked-abbrev 'smarty-template-validate))
+(defun smarty-template-formtool-checkall-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-checkall))
+(defun smarty-template-formtool-copy-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-copy))
+(defun smarty-template-formtool-count-chars-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-count-chars))
+(defun smarty-template-formtool-init-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-init))
+(defun smarty-template-formtool-move-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-move))
+(defun smarty-template-formtool-moveall-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-moveall))
+(defun smarty-template-formtool-movedown-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-movedown))
+(defun smarty-template-formtool-moveup-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-moveup))
+(defun smarty-template-formtool-remove-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-remove))
+(defun smarty-template-formtool-rename-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-rename))
+(defun smarty-template-formtool-save-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-save))
+(defun smarty-template-formtool-selectall-hook ()
+ (smarty-hooked-abbrev 'smarty-template-formtool-selectall))
+(defun smarty-template-paginate-first-hook ()
+ (smarty-hooked-abbrev 'smarty-template-paginate-first))
+(defun smarty-template-paginate-last-hook ()
+ (smarty-hooked-abbrev 'smarty-template-paginate-last))
+(defun smarty-template-paginate-middle-hook ()
+ (smarty-hooked-abbrev 'smarty-template-paginate-middle))
+(defun smarty-template-paginate-next-hook ()
+ (smarty-hooked-abbrev 'smarty-template-paginate-next))
+(defun smarty-template-paginate-prev-hook ()
+ (smarty-hooked-abbrev 'smarty-template-paginate-prev))
+
+(defun smarty-template-btosmilies-hook ()
+ (smarty-hooked-abbrev 'smarty-template-btosmilies))
+(defun smarty-template-bbcodetohtml-hook ()
+ (smarty-hooked-abbrev 'smarty-template-bbcodetohtml))
+(defun smarty-template-date-formatto-hook ()
+ (smarty-hooked-abbrev 'smarty-template-date-formatto))
+
+(defun smarty-template-capture ()
+ "Insert a capture statement."
+ (interactive)
+ (smarty-template-generic-function "capture" t '("name" "assign") 0))
+
+(defun smarty-template-config-load ()
+ "Insert a config_load statement."
+ (interactive)
+ (smarty-template-generic-function "config_load" nil '("file" "section" "scope" "global") 1))
+
+(defun smarty-template-else ()
+ "Insert a else statement."
+ (interactive)
+ (smarty-template-generic-function "else" nil '() 0))
+
+(defun smarty-template-elseif ()
+ "Insert a elseif statement."
+ (interactive)
+ (smarty-template-generic-function "elseif" nil '("condition") 1 nil t))
+
+(defun smarty-template-foreach ()
+ "Insert a foreach statement."
+ (interactive)
+ (smarty-template-generic-function "foreach" t '("from" "item" "key" "name") 2))
+
+(defun smarty-template-foreachelse ()
+ "Insert a foreachelse statement."
+ (interactive)
+ (smarty-template-generic-function "foreachelse" nil '() 0))
+
+(defun smarty-template-if ()
+ "Insert a if statement."
+ (interactive)
+ (smarty-template-generic-function "if" t '("condition") 1 nil t))
+
+(defun smarty-template-include ()
+ "Insert a include statement."
+ (interactive)
+ (smarty-template-generic-function "include" nil '("file" "assign") 1 t))
+
+(defun smarty-template-include-php ()
+ "Insert a include_php statement."
+ (interactive)
+ (smarty-template-generic-function "include_php" nil '("file" "once" "assign") 1))
+
+(defun smarty-template-insert ()
+ "Insert a insert statement."
+ (interactive)
+ (smarty-template-generic-function "insert" nil '("name" "assign" "script") 1 t))
+
+(defun smarty-template-ldelim ()
+ "Insert a ldelim statement."
+ (interactive)
+ (smarty-template-generic-function "ldelim" nil '() 0))
+
+(defun smarty-template-literal ()
+ "Insert a literal statement."
+ (interactive)
+ (smarty-template-generic-function "literal" t '() 0))
+
+(defun smarty-template-php ()
+ "Insert a php statement."
+ (interactive)
+ (smarty-template-generic-function "php" t '() 0))
+
+(defun smarty-template-rdelim ()
+ "Insert a rdelim statement."
+ (interactive)
+ (smarty-template-generic-function "rdelim" nil '() 0))
+
+(defun smarty-template-section ()
+ "Insert a section statement."
+ (interactive)
+ (smarty-template-generic-function "section" t '("name" "loop" "start" "step" "max" "show") 2))
+
+(defun smarty-template-sectionelse ()
+ "Insert a sectionelse statement."
+ (interactive)
+ (smarty-template-generic-function "sectionelse" nil '() 0))
+
+(defun smarty-template-strip ()
+ "Insert a strip statement."
+ (interactive)
+ (smarty-template-generic-function "strip" t '() 0))
+
+
+(defun smarty-template-assign ()
+ "Insert a assign statement."
+ (interactive)
+ (smarty-template-generic-function "assign" nil '("var" "value") 2))
+
+(defun smarty-template-counter ()
+ "Insert a counter statement."
+ (interactive)
+ (smarty-template-generic-function "counter" nil '("name" "start" "skip" "direction" "print" "assign") 0))
+
+(defun smarty-template-cycle ()
+ "Insert a cycle statement."
+ (interactive)
+ (smarty-template-generic-function "cycle" nil '("values" "name" "print" "advance" "delimiter" "assign" "reset") 1))
+
+(defun smarty-template-debug ()
+ "Insert a debug statement."
+ (interactive)
+ (smarty-template-generic-function "debug" nil '("output") 0))
+
+(defun smarty-template-eval ()
+ "Insert a eval statement."
+ (interactive)
+ (smarty-template-generic-function "eval" nil '("var" "assign") 1))
+
+(defun smarty-template-fetch ()
+ "Insert a fetch statement."
+ (interactive)
+ (smarty-template-generic-function "fetch" nil '("file" "assign") 1))
+
+(defun smarty-template-html-checkboxes ()
+ "Insert a html_checkboxes statement."
+ (interactive)
+ (smarty-template-generic-function "html_checkboxes" nil '("name" "values" "output" "selected" "options" "separator" "assign" "labels") 0))
+
+(defun smarty-template-html-image ()
+ "Insert a html_image statement."
+ (interactive)
+ (smarty-template-generic-function "html_image" nil '("file" "height" "width" "basedir" "alt" "href" "path_prefix") 1))
+
+(defun smarty-template-html-options ()
+ "Insert a html_options statement."
+ (interactive)
+ (smarty-template-generic-function "html_options" nil '("name" "values" "output" "selected" "options") 0))
+
+(defun smarty-template-html-radios ()
+ "Insert a html_radios statement."
+ (interactive)
+ (smarty-template-generic-function "html_radios" nil '("name" "values" "output" "selected" "options" "separator" "assign") 0))
+
+(defun smarty-template-html-select-date ()
+ "Insert a html_select_date statement."
+ (interactive)
+ (smarty-template-generic-function "html_select_date" nil '("prefix" "time" "start_year" "end_year" "display_days" "display_months" "display_years" "month_format" "day_format" "day_value_format" "year_as_text" "reverse_years" "field_array" "day_size" "month_size" "year_size" "all_extra" "day_extra" "month_extra" "year_extra" "field_order" "field_separator" "month_value_format" "year_empty" "month_empty" "day_empty") 0))
+
+(defun smarty-template-html-select-time ()
+ "Insert a html_select_time statement."
+ (interactive)
+ (smarty-template-generic-function "html_select_time" nil '("prefix" "time" "display_hours" "display_minutes" "display_seconds" "display_meridian" "use_24_hours" "minute_interval" "second_interval" "field_array" "all_extra" "hour_extra" "minute_extra" "second_extra" "meridian_extra") 0))
+
+(defun smarty-template-html-table ()
+ "Insert a html_table statement."
+ (interactive)
+ (smarty-template-generic-function "html_table" nil '("loop" "cols" "rows" "inner" "caption" "table_attr" "th_attr" "tr_attr" "td_attr" "trailpad" "hdir" "vdir") 1))
+
+(defun smarty-template-mailto ()
+ "Insert a mailto statement."
+ (interactive)
+ (smarty-template-generic-function "mailto" nil '("address" "text" "encode" "cc" "bcc" "subject" "newsgroups" "followupto" "extra") 1))
+
+(defun smarty-template-math ()
+ "Insert a math statement."
+ (interactive)
+ (smarty-template-generic-function "math" nil '("equation" "var" "format" "assign") 2 t))
+
+(defun smarty-template-popup ()
+ "Insert a popup statement."
+ (interactive)
+ (smarty-template-generic-function "popup" nil '("text" "trigger" "sticky" "caption" "fgcolor" "bgcolor" "textcolor" "capcolor" "closecolor" "textfont" "captionfont" "closefont" "textsize" "captionsize" "closesize" "width" "height" "left" "right" "center" "above" "below" "border" "offsetx" "offsety" "fgbackground" "bgbackground" "closetext" "noclose" "status" "autostatus" "autostatuscap" "inarray" "caparray" "capicon" "snapx" "snapy" "fixx" "fixy" "background" "padx" "pady" "fullhtml" "frame" "function" "delay" "hauto" "vauto") 1))
+
+(defun smarty-template-popup-init ()
+ "Insert a popup_init statement."
+ (interactive)
+ (smarty-template-generic-function "popup_init" nil '("src") 1))
+
+(defun smarty-template-textformat ()
+ "Insert a textformat statement."
+ (interactive)
+ (smarty-template-generic-function "textformat" t '("style" "indent" "indent_first" "indent_char" "wrap" "wrap_char" "wrap_cut" "assign") 0))
+
+(defun smarty-template-capitalize ()
+ "Insert a capitalize statement."
+ (interactive)
+ (smarty-template-generic-modifier "capitalize" '("upcase_numeric") 0))
+
+(defun smarty-template-cat ()
+ "Insert a cat statement."
+ (interactive)
+ (smarty-template-generic-modifier "cat" '("value") 0))
+
+(defun smarty-template-count-characters ()
+ "Insert a count_characters statement."
+ (interactive)
+ (smarty-template-generic-modifier "count_characters" '("include_whitespace") 0))
+
+(defun smarty-template-count-paragraphs ()
+ "Insert a count_paragraphs statement."
+ (interactive)
+ (smarty-template-generic-modifier "count_paragraphs" '() 0))
+
+(defun smarty-template-count-sentences ()
+ "Insert a count_sentences statement."
+ (interactive)
+ (smarty-template-generic-modifier "count_sentences" '() 0))
+
+(defun smarty-template-count-words ()
+ "Insert a count_words statement."
+ (interactive)
+ (smarty-template-generic-modifier "count_words" '() 0))
+
+(defun smarty-template-date-format ()
+ "Insert a date_format statement."
+ (interactive)
+ (smarty-template-generic-modifier "date_format" '("format" "default") 0))
+
+(defun smarty-template-default ()
+ "Insert a default statement."
+ (interactive)
+ (smarty-template-generic-modifier "default" '("value") 0))
+
+(defun smarty-template-escape ()
+ "Insert a escape statement."
+ (interactive)
+ (smarty-template-generic-modifier "escape" '("html|htmlall|url|urlpathinfo|quotes|hex|hexentity|javascript|mail" "charset") 0))
+
+(defun smarty-template-indent ()
+ "Insert a indent statement."
+ (interactive)
+ (smarty-template-generic-modifier "indent" '("value" "character") 0))
+
+(defun smarty-template-lower ()
+ "Insert a lower statement."
+ (interactive)
+ (smarty-template-generic-modifier "lower" '() 0))
+
+(defun smarty-template-nl2br ()
+ "Insert a nl2br statement."
+ (interactive)
+ (smarty-template-generic-modifier "nl2br" '() 0))
+
+(defun smarty-template-regex-replace ()
+ "Insert a regex_replace statement."
+ (interactive)
+ (smarty-template-generic-modifier "regex_replace" '("regexp" "string_to_replace") 2))
+
+(defun smarty-template-replace ()
+ "Insert a replace statement."
+ (interactive)
+ (smarty-template-generic-modifier "replace" '("string" "string_to_replace_with") 2))
+
+(defun smarty-template-spacify ()
+ "Insert a spacify statement."
+ (interactive)
+ (smarty-template-generic-modifier "spacify" '("character") 0))
+
+(defun smarty-template-string-format ()
+ "Insert a string_format statement."
+ (interactive)
+ (smarty-template-generic-modifier "string_format" '("format") 1))
+
+(defun smarty-template-vstrip ()
+ "Insert a strip statement."
+ (interactive)
+ (smarty-template-generic-modifier "strip" '() 0))
+
+(defun smarty-template-strip-tags ()
+ "Insert a strip_tags statement."
+ (interactive)
+ (smarty-template-generic-modifier "strip_tags" '("replace_by_space") 0))
+
+(defun smarty-template-truncate ()
+ "Insert a truncate statement."
+ (interactive)
+ (smarty-template-generic-modifier "truncate" '("count" "text_to_replace" "character_boundary" "middle_string") 0))
+
+(defun smarty-template-upper ()
+ "Insert a upper statement."
+ (interactive)
+ (smarty-template-generic-modifier "upper" '() 0))
+
+(defun smarty-template-wordwrap ()
+ "Insert a wordwrap statement."
+ (interactive)
+ (smarty-template-generic-modifier "wordwrap" '("count" "string" "character_boundary") 0))
+
+
+(defun smarty-template-validate ()
+ "Insert a validate statement."
+ (interactive)
+ (smarty-template-generic-function "validate" nil '("field" "criteria" "message" "form" "transform" "trim" "empty" "halt" "assign" "append" "page") 3))
+
+(defun smarty-template-formtool-checkall ()
+ "Insert a formtool_checkall statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_checkall" nil '("name" "class" "style") 1))
+
+(defun smarty-template-formtool-copy ()
+ "Insert a formtool_copy statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_copy" nil '("from" "to" "save" "button_text" "all" "counter" "class" "style") 3))
+
+(defun smarty-template-formtool-count-chars ()
+ "Insert a formtool_count_chars statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_count_chars" nil '("name" "limit" "alert") 3))
+
+(defun smarty-template-formtool-init ()
+ "Insert a formtool_init statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_init" nil '("src") 1))
+
+(defun smarty-template-formtool-move ()
+ "Insert a formtool_move statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_move" nil '("from" "to" "save_from" "save_to" "all" "count_to" "count_from" "class" "style") 4))
+
+(defun smarty-template-formtool-moveall ()
+ "Insert a formtool_moveall statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_moveall" nil '("from" "to" "save_from" "save_to" "all" "count_to" "count_from" "class" "style") 4))
+
+(defun smarty-template-formtool-movedown ()
+ "Insert a formtool_movedown statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_movedown" nil '("save" "name" "class" "style") 2))
+
+(defun smarty-template-formtool-moveup ()
+ "Insert a formtool_moveup statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_moveup" nil '("save" "name" "class" "style") 2))
+
+(defun smarty-template-formtool-remove ()
+ "Insert a formtool_remove statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_remove" nil '("from" "save" "all" "counter" "class" "style") 2))
+
+(defun smarty-template-formtool-rename ()
+ "Insert a formtool_rename statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_rename" nil '("name" "from" "save" "class" "style") 3))
+
+(defun smarty-template-formtool-save ()
+ "Insert a formtool_save statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_save" nil '("from" "name" "save") 3))
+
+(defun smarty-template-formtool-selectall ()
+ "Insert a formtool_selectall statement."
+ (interactive)
+ (smarty-template-generic-function "formtool_selectall" nil '("name" "class" "style") 1))
+
+(defun smarty-template-paginate-first ()
+ "Insert a paginate_first statement."
+ (interactive)
+ (smarty-template-generic-function "paginate_first" nil '("id" "text") 0))
+
+(defun smarty-template-paginate-last ()
+ "Insert a paginate_last statement."
+ (interactive)
+ (smarty-template-generic-function "paginate_last" nil '("id" "text") 0))
+
+(defun smarty-template-paginate-middle ()
+ "Insert a paginate_middle statement."
+ (interactive)
+ (smarty-template-generic-function "paginate_middle" nil '("id" "format" "prefix" "page_limit" "link_prefix" "link_suffix") 0))
+
+(defun smarty-template-paginate-next ()
+ "Insert a paginate_next statement."
+ (interactive)
+ (smarty-template-generic-function "paginate_next" nil '("id" "text") 0))
+
+(defun smarty-template-paginate-prev ()
+ "Insert a paginate_prev statement."
+ (interactive)
+ (smarty-template-generic-function "paginate_prev" nil '("id" "text") 0))
+
+
+(defun smarty-template-btosmilies ()
+ "Insert a B2Smilies statement."
+ (interactive)
+ (smarty-template-generic-modifier "B2Smilies" '() 0))
+
+(defun smarty-template-bbcodetohtml ()
+ "Insert a bbcode2html statement."
+ (interactive)
+ (smarty-template-generic-modifier "bbcode2html" '() 0))
+
+(defun smarty-template-date-formatto ()
+ "Insert a date_format2 statement."
+ (interactive)
+ (smarty-template-generic-modifier "date_format2" '("format" "default") 0))
+
+;;
+
+(defun smarty-resolve-env-variable (string)
+ "Resolve environment variables in STRING."
+ (while (string-match "\\(.*\\)${?\\(\\(\\w\\|_\\)+\\)}?\\(.*\\)" string)
+ (setq string (concat (match-string 1 string)
+ (getenv (match-string 2 string))
+ (match-string 4 string))))
+ string)
+
+(defun smarty-insert-string-or-file (string)
+ "Insert STRING or file contents if STRING is an existing file name."
+ (unless (equal string "")
+ (let ((file-name
+ (progn (string-match "^\\([^\n]+\\)" string)
+ (smarty-resolve-env-variable (match-string 1 string)))))
+ (if (file-exists-p file-name)
+ (forward-char (cadr (insert-file-contents file-name)))
+ (insert string)))))
+
+(defun smarty-template-insert-date ()
+ "Insert date in appropriate format."
+ (interactive)
+ (insert
+ (cond
+ ;; 'american, 'european, 'scientific kept for backward compatibility
+ ((eq smarty-date-format 'american) (format-time-string "%m/%d/%Y" nil))
+ ((eq smarty-date-format 'european) (format-time-string "%d.%m.%Y" nil))
+ ((eq smarty-date-format 'scientific) (format-time-string "%Y/%m/%d" nil))
+ (t (format-time-string smarty-date-format nil)))))
+
+(defun smarty-template-header (&optional file-title)
+ "Insert a Smarty file header."
+ (interactive)
+ (unless (equal smarty-file-header "")
+ (let (pos)
+ (save-excursion
+ (smarty-insert-string-or-file smarty-file-header)
+ (setq pos (point-marker)))
+ (smarty-template-replace-header-keywords
+ (point-min-marker) pos file-title))))
+
+(defun smarty-template-footer ()
+ "Insert a Smarty file footer."
+ (interactive)
+ (unless (equal smarty-file-footer "")
+ (let (pos)
+ (save-excursion
+ (setq pos (point-marker))
+ (smarty-insert-string-or-file smarty-file-footer)
+ (unless (= (preceding-char) ?\n)
+ (insert "\n")))
+ (smarty-template-replace-header-keywords pos (point-max-marker)))))
+
+(defun smarty-template-replace-header-keywords (beg end &optional file-title is-model)
+ "Replace keywords in header and footer."
+ (let ()
+ (smarty-prepare-search-2
+ (save-excursion
+ (goto-char beg)
+ (while (search-forward "<filename>" end t)
+ (replace-match (buffer-name) t t))
+ (goto-char beg)
+ (while (search-forward "<copyright>" end t)
+ (replace-match smarty-copyright-string t t))
+ (goto-char beg)
+ (while (search-forward "<author>" end t)
+ (replace-match "" t t)
+ (insert (user-full-name))
+ (when user-mail-address (insert " <" user-mail-address ">")))
+ (goto-char beg)
+ (while (search-forward "<login>" end t)
+ (replace-match (user-login-name) t t))
+ (goto-char beg)
+ (while (search-forward "<company>" end t)
+ (replace-match smarty-company-name t t))
+ (goto-char beg)
+ ;; Replace <RCS> with $, so that RCS for the source is
+ ;; not over-enthusiastic with replacements
+ (while (search-forward "<RCS>" end t)
+ (replace-match "$" nil t))
+ (goto-char beg)
+ (while (search-forward "<date>" end t)
+ (replace-match "" t t)
+ (smarty-template-insert-date))
+ (goto-char beg)
+ (while (search-forward "<year>" end t)
+ (replace-match (format-time-string "%Y" nil) t t))
+ (goto-char beg)
+ (let (string)
+ (while
+ (re-search-forward "<\\(\\(\\w\\|\\s_\\)*\\) string>" end t)
+ (setq string (read-string (concat (match-string 1) ": ")))
+ (replace-match string t t)))
+ (goto-char beg)
+ (when (and (not is-model) (search-forward "<cursor>" end t))
+ (replace-match "" t t))))))
+
+(provide 'smarty-mode)
+;;; smarty-mode.el ends here \ No newline at end of file
diff --git a/elisp/nxhtml/autostart.el b/elisp/nxhtml/autostart.el
new file mode 100644
index 0000000..44a6901
--- /dev/null
+++ b/elisp/nxhtml/autostart.el
@@ -0,0 +1,194 @@
+;;; autostart.el --- Load nxhtml
+;;
+;; Author: By: Lennart Borgman
+;; Created: Fri Dec 15 2006
+;; Version:
+;; Last-Updated: 2009-04-30 Thu
+;; Keywords:
+;; Compatibility:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Change log:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; 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.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+;; Fix-me: Split out the definitions from this file so it can be
+;; loaded during byte compilation.
+
+;;(eval-when-compile (require 'web-vcs nil t))
+;;(eval-when-compile (require 'nxhtml-web-vcs nil t))
+
+(message "Nxml/Nxhtml Autostart.el loading ...")
+
+(defconst nxhtml-autostart-trace nil)
+(defsubst nxhtml-autostart-trace (format-string &rest args)
+ (when nxhtml-autostart-trace
+ (apply 'message format-string args)))
+
+(defconst nxhtml-load-time-start (float-time))
+
+;; Add this dir to load-path
+(add-to-list 'load-path
+ (file-name-directory (or load-file-name
+ (when (boundp 'bytecomp-filename) bytecomp-filename)
+ buffer-file-name)))
+
+(require 'nxhtml-base)
+(eval-and-compile (when (fboundp 'nxml-mode)
+ (load (expand-file-name "etc/schema/schema-path-patch"
+ nxhtml-install-dir))))
+
+;; (defun nxhtml-custom-load-and-get-value (symbol)
+;; (custom-load-symbol symbol)
+;; (symbol-value symbol))
+
+(defun nxhtml-list-loaded-features (use-message)
+ (interactive (list t))
+ (let ((buf (when use-message ;(called-interactively-p)
+ (get-buffer-create "*nXhtml loaded features*"))))
+ (if buf
+ (with-current-buffer buf (erase-buffer))
+ (message "")
+ (message "=== Loaded at nxhtml/autostart.el end:"))
+ (dolist (feature '(
+ as-external
+ html-chklnk
+ html-imenu
+ html-move
+ html-pagetoc
+ html-quote
+ html-site
+ html-toc
+ html-upl
+ html-wtoc
+ inlimg
+ mumamo
+ nxhtml-bug
+ nxhtml-menu
+ nxhtml-mode
+ nxhtml-mumamo
+ nxhtml-strval
+ nxhtml
+ nxhtml-js
+ nxml-where
+ outline-magic
+ rngalt
+ tidy-xhtml
+ xhtml-help
+ ))
+ (when (featurep feature)
+ (if buf
+ (with-current-buffer buf
+ (insert (format "(feature '%s)=%s\n" feature (featurep feature))))
+ (message "(feature '%s)=%s" feature (featurep feature)))))
+ (if buf
+ (display-buffer buf)
+ (message ""))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Code that will run on loading this file
+
+(if (< emacs-major-version 23)
+ (unless (featurep 'autostart22)
+ (load (expand-file-name "autostart22" nxhtml-install-dir)))
+ ;; Check that the nxml-mode included with Emacs is used. There
+ ;; has been some problems on Debian with this.
+ (let ((nxml-mode-file (locate-library "nxml-mode"))
+ (help-file (locate-library "help")))
+ (unless (string= (expand-file-name ".." help-file)
+ (expand-file-name "../.." nxml-mode-file))
+ (error "Wrong nxml-mode=%s used, please use the one that comes with Emacs" nxml-mode-file))))
+
+(let* ((util-dir (file-name-as-directory (expand-file-name "util" nxhtml-install-dir)))
+ (related-dir (file-name-as-directory (expand-file-name "related" nxhtml-install-dir)))
+ (nxhtml-dir (file-name-as-directory (expand-file-name "nxhtml" nxhtml-install-dir)))
+ ;;(company-dir (file-name-as-directory (expand-file-name "util/nxhtml-company-mode" nxhtml-install-dir)))
+ (tests-dir (file-name-as-directory (expand-file-name "tests" nxhtml-install-dir))))
+ (add-to-list 'load-path nxhtml-dir)
+ (add-to-list 'load-path related-dir)
+ (add-to-list 'load-path util-dir)
+ (add-to-list 'load-path nxhtml-install-dir)
+ ;;(add-to-list 'load-path company-dir)
+ (add-to-list 'load-path tests-dir)
+
+ (nxhtml-autostart-trace "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+ ;; Autoloading etc
+ ;; (unless (featurep 'web-vcs)
+ ;; (load (expand-file-name "web-vcs" nxhtml-install-dir) (not nxhtml-autoload-web)))
+
+ ;; (when (catch 'miss
+ ;; (dolist (file nxhtml-basic-files)
+ ;; (let ((dl-file (expand-file-name file nxhtml-install-dir)))
+ ;; (unless (file-exists-p dl-file)
+ ;; (throw 'miss t))))
+ ;; nil)
+ ;; (nxhtml-setup-auto-download nxhtml-install-dir))
+
+ (unless (featurep 'web-autoload)
+ (load (expand-file-name "web-autoload" nxhtml-install-dir) (not nxhtml-autoload-web)))
+
+ (when nxhtml-autoload-web
+ (ad-activate 'require t))
+
+ ;; Fix-me: Why must as-external be loaded? Why doesn't it work in batch?
+ ;;(unless noninteractive (require 'as-external))
+
+ (unless (featurep 'nxhtml-loaddefs)
+ (load (expand-file-name "nxhtml-loaddefs" nxhtml-install-dir) nxhtml-autoload-web))
+ (nxhtml-autostart-trace "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+ ;; Turn on `nxhtml-menu-mode' unconditionally
+ (nxhtml-autostart-trace "Turn on `nxhtml-menu-mode' unconditionally")
+ (nxhtml-menu-mode 1)
+ (nxhtml-autostart-trace "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+ ;; Patch the rnc include paths
+ (when (fboundp 'rncpp-patch-xhtml-loader) (rncpp-patch-xhtml-loader))
+ (nxhtml-autostart-trace "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+ ;; Load nXhtml
+ (unless (featurep 'nxhtml-autoload)
+ (load (expand-file-name "nxhtml/nxhtml-autoload" nxhtml-install-dir))))
+(nxhtml-autostart-trace "... nXhtml loading %.1f seconds elapsed ..." (- (float-time) nxhtml-load-time-start))
+
+
+(unless (featurep 'nxhtml-autostart)
+ ;; Provide the feature here to avoid loading looping on error.
+ (provide 'nxhtml-autostart)
+
+ ;; Tell what have been loaded of nXhtml:
+ (when nxhtml-autostart-trace (nxhtml-list-loaded-features nil))
+
+ ;; How long time did it all take?
+ (message "Nxml/Nxhtml Autostart.el loaded in %.1f seconds" (- (float-time) nxhtml-load-time-start)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; autostart.el ends here
diff --git a/elisp/nxhtml/autostart22.el b/elisp/nxhtml/autostart22.el
new file mode 100644
index 0000000..2376d43
--- /dev/null
+++ b/elisp/nxhtml/autostart22.el
@@ -0,0 +1,71 @@
+;;; autostart22.el --- Example of autostart file for Emacs22
+;;
+;; Author: Lennart Borgman (lennart O borgman A gmail O com)
+;; Created: 2009-01-01 Thu
+;; Version:
+;; Last-Updated: 2009-01-05 Mon
+;; URL:
+;; Keywords:
+;; Compatibility:
+;;
+;; Features that might be required by this library:
+;;
+;; This file is for Emacs 22 only.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; Change this file according to the path of your nxml-mode dir. If
+;; you do not use nxml-mode then just use autostart.el.
+;;
+;; NOTICE: You need to enter the path to your nxml-mode installation
+;; below.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Change log:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; 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., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+(let ((debug-on-error t))
+ (if (/= emacs-major-version 22)
+ (message "This file (autostart22.el) is for Emacs 22 only")
+
+ (defalias 'Custom-mode 'custom-mode)
+
+ (let* ((this-file (or load-file-name buffer-file-name))
+ (this-dir (file-name-directory this-file))
+ ;; FIX-ME: Download nXml (since it is not included in Emacs
+ ;; 22) and place the path to rng-auto.el in your downloaded
+ ;; nXml HERE:
+ (rng-auto-file (or (locate-library "rng-auto.el")
+ "c:/emacs/u/081231/EmacsW32/nxhtml/nxml-mode-20041004/rng-auto.el")))
+ (unless (file-exists-p rng-auto-file)
+ (error "Can't find rng-auto.el, please edit %s" this-file))
+ (load rng-auto-file))))
+
+(provide 'autostart22)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; autostart22.el ends here
diff --git a/elisp/nxhtml/emacs22.cmd b/elisp/nxhtml/emacs22.cmd
new file mode 100644
index 0000000..d50ac96
--- /dev/null
+++ b/elisp/nxhtml/emacs22.cmd
@@ -0,0 +1 @@
+c:\emacs\emacs-22.3\bin\emacs.exe -Q --debug-init -l autostart.el
diff --git a/elisp/nxhtml/etc/img/pause/pause.jpg b/elisp/nxhtml/etc/img/pause/pause.jpg
new file mode 100644
index 0000000..ff92075
--- /dev/null
+++ b/elisp/nxhtml/etc/img/pause/pause.jpg
Binary files differ
diff --git a/elisp/nxhtml/etc/img/pause/pause2.jpg b/elisp/nxhtml/etc/img/pause/pause2.jpg
new file mode 100644
index 0000000..6411344
--- /dev/null
+++ b/elisp/nxhtml/etc/img/pause/pause2.jpg
Binary files differ
diff --git a/elisp/nxhtml/etc/schema/genshi-old.rnc b/elisp/nxhtml/etc/schema/genshi-old.rnc
new file mode 100644
index 0000000..5384fe1
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/genshi-old.rnc
@@ -0,0 +1,27 @@
+namespace py = "http://genshi.edgewall.org/"
+
+genshi.expr-type = xsd:string { minLength = "1" }
+genshi.with-type = xsd:string { minLength = "1" }
+genshi.choose-type = xsd:string
+genshi.def-type = xsd:string
+genshi.xpath-type = xsd:anyURI
+
+genshi.attrib = attribute py:if { genshi.expr-type }?,
+ attribute py:choose { genshi.choose-type }?,
+ attribute py:when { genshi.expr-type }?,
+ attribute py:otherwise { genshi.expr-type }?,
+ attribute py:for { genshi.expr-type }?,
+ attribute py:def { genshi.def-type }?,
+ attribute py:match { genshi.xpath-type }?,
+ attribute py:with { genshi.with-type }?,
+ attribute py:attrs { genshi.expr-type }?,
+ attribute py:content { genshi.expr-type }?,
+ attribute py:replace { genshi.expr-type }?,
+ attribute py:strip { genshi.expr-type }?
+
+genshi.if.attlist = attribute expr { genshi.expr-type }
+genshi.for.attlist = attribute each { genshi.expr-type }
+genshi.def.attlist = attribute each { genshi.expr-type }
+genshi.with.attlist = attribute vars { genshi.with-type }
+
+
diff --git a/elisp/nxhtml/etc/schema/genshi-schemas.xml b/elisp/nxhtml/etc/schema/genshi-schemas.xml
new file mode 100644
index 0000000..89fe05f
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/genshi-schemas.xml
@@ -0,0 +1,3 @@
+<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
+ <typeId id="XHTML" uri="qtmstr-xhtml.rnc" />
+</locatingRules>
diff --git a/elisp/nxhtml/etc/schema/genshi.rnc b/elisp/nxhtml/etc/schema/genshi.rnc
new file mode 100644
index 0000000..b9ddf76
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/genshi.rnc
@@ -0,0 +1,84 @@
+default namespace = "http://genshi.edgewall.org/"
+namespace py = "http://genshi.edgewall.org/"
+
+include "xinclude.rnc"
+
+# There's no way to just match the text part against a Genshi Python expression
+# See: http://relaxng.org/compact-tutorial-20030326.html#id2814737
+python.expression = text
+
+genshi.expr-type = xsd:string { minLength = "1" }
+genshi.xpath-type = xsd:anyURI
+
+genshi.attrib =
+ attribute py:if { genshi.expr-type }?,
+ attribute py:choose { text }?,
+ attribute py:when { genshi.expr-type }?,
+ attribute py:otherwise { text }?,
+ attribute py:for { genshi.expr-type }?,
+ attribute py:def { genshi.expr-type }?,
+ attribute py:match { genshi.xpath-type}?,
+ attribute py:with { genshi.expr-type }?,
+ attribute py:attrs { genshi.expr-type }?,
+ attribute py:content { text }?,
+ attribute py:replace { genshi.expr-type }?,
+ attribute py:strip { text }?
+
+genshi.if.attlist = attribute test { genshi.expr-type }
+genshi.choose.attlist = attribute test { text }
+genshi.when.attlist = attribute test { genshi.expr-type }
+genshi.for.attlist = attribute each { genshi.expr-type }
+genshi.def.attlist = attribute function { genshi.expr-type }
+genshi.with.attlist = attribute vars { genshi.expr-type }
+genshi.replace.attlist = attribute value { genshi.expr-type }
+genshi.match.attlist =
+ attribute path { genshi.xpath-type },
+ attribute buffer { "true" | "false" }?,
+ attribute once { "true" | "false" }?,
+ attribute recursive { "true" | "false" }?
+
+genshi.choose =
+ element py:choose { genshi.choose.attlist,
+ genshi.model
+ }
+genshi.when =
+ element py:when { genshi.when.attlist,
+ genshi.model
+ }
+genshi.otherwise =
+ element py:otherwise {
+ genshi.model
+ }
+genshi.if =
+ element py:if { genshi.if.attlist,
+ genshi.model
+ }
+genshi.for =
+ element py:for { genshi.for.attlist,
+ genshi.model
+ }
+genshi.def =
+ element py:def { genshi.def.attlist,
+ genshi.model
+ }
+genshi.with =
+ element py:with { genshi.with.attlist,
+ genshi.model
+ }
+genshi.match =
+ element py:match { genshi.match.attlist,
+ genshi.model
+ }
+genshi.replace =
+ element py:replace { genshi.replace.attlist,
+ genshi.model
+ }
+
+genshi.allowed.children = text
+
+genshi.class = genshi.if | genshi.choose | genshi.when | genshi.otherwise
+ | genshi.for | genshi.def | genshi.with | genshi.match | genshi.replace
+ | python.expression
+ | xi.include
+
+genshi.model = genshi.class* | genshi.allowed.children* \ No newline at end of file
diff --git a/elisp/nxhtml/etc/schema/mjt.rnc b/elisp/nxhtml/etc/schema/mjt.rnc
new file mode 100644
index 0000000..b37f01a
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/mjt.rnc
@@ -0,0 +1,74 @@
+include "xhtml-loader.rnc"
+
+MjtAll.attrib =
+ attribute mjt.def { Text.datatype }?,
+ attribute mjt.when { Text.datatype }?,
+ attribute mjt.otherwise { Text.datatype }?,
+ attribute mjt.for { Text.datatype }?,
+ attribute mjt.if { Text.datatype }?,
+ attribute mjt.elif { Text.datatype }?,
+ attribute mjt.else { Text.datatype }?,
+ attribute mjt.script { Text.datatype }?,
+ attribute mjt.choose { Text.datatype }?,
+ attribute mjt.replace { Text.datatype }?,
+ attribute mjt.content { Text.datatype }?,
+ attribute mjt.strip { Text.datatype }?,
+ attribute mjt.src { Text.datatype }?,
+ attribute mjt.style { Text.datatype }?,
+ attribute mjt.class { Text.datatype }?,
+ attribute mjt.id { Text.datatype }?,
+ attribute mjt.attrs { Text.datatype }?,
+ attribute mjt.task { Text.datatype }?
+
+
+a.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?
+area.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?
+form.attlist &=
+ attribute mjt.onreset { Script.datatype }?,
+ attribute mjt.onsubmit { Script.datatype }?
+body.attlist &=
+ attribute mjt.onload { Script.datatype }?,
+ attribute mjt.onunload { Script.datatype }?
+label.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?
+input.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onchange { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?,
+ attribute mjt.onselect { Script.datatype }?
+select.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onchange { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?
+textarea.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onchange { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?,
+ attribute mjt.onselect { Script.datatype }?
+button.attlist &=
+ attribute mjt.onblur { Script.datatype }?,
+ attribute mjt.onfocus { Script.datatype }?
+
+MjtEvents.attrib =
+ attribute mjt.onclick { Script.datatype }?,
+ attribute mjt.ondblclick { Script.datatype }?,
+ attribute mjt.onmousedown { Script.datatype }?,
+ attribute mjt.onmouseup { Script.datatype }?,
+ attribute mjt.onmouseover { Script.datatype }?,
+ attribute mjt.onmousemove { Script.datatype }?,
+ attribute mjt.onmouseout { Script.datatype }?,
+ attribute mjt.onkeypress { Script.datatype }?,
+ attribute mjt.onkeydown { Script.datatype }?,
+ attribute mjt.onkeyup { Script.datatype }?
+
+
+Common.attrib &= MjtAll.attrib
+CommonIdRequired.attrib &= MjtAll.attrib
+
+Common.attrib &= MjtEvents.attrib
+CommonIdRequired.attrib &= MjtEvents.attrib
diff --git a/elisp/nxhtml/etc/schema/nxml-erb.patch b/elisp/nxhtml/etc/schema/nxml-erb.patch
new file mode 100644
index 0000000..362913b
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/nxml-erb.patch
@@ -0,0 +1,37 @@
+--- nxml-mode-orig/xmltok.el 2005-10-16 15:32:53.000000000 -0400
++++ nxml-mode-erb/xmltok.el 2006-09-01 01:02:55.000000000 -0400
+@@ -496,6 +496,9 @@
+ (xmltok+ (xmltok-g markup-declaration "!")
+ (xmltok-g comment-first-dash "-"
+ (xmltok-g comment-open "-") opt) opt))
++ (erb-section
++ (xmltok+ "%"
++ (xmltok-g erb-section-open "[^%]") opt))
+ (cdata-section
+ (xmltok+ "!"
+ (xmltok-g marked-section-open "\\[")
+@@ -526,6 +529,7 @@
+ ;; by default
+ or cdata-section
+ or comment
++ or erb-section
+ or processing-instruction))
+ (xmltok-defregexp
+ xmltok-attribute
+@@ -693,6 +697,16 @@
+ nil
+ "]]>")
+ 'not-well-formed)))
++ ((xmltok-after-lt start erb-section-open)
++ (setq xmltok-type
++ (if (re-search-forward "[^%]%>" nil t)
++ 'erb-section
++ (xmltok-add-error "No closing %>")
++ (xmltok-add-dependent 'xmltok-unclosed-reparse-p
++ nil
++ nil
++ "%>")
++ 'not-well-formed)))
+ ((xmltok-after-lt start processing-instruction-question)
+ (xmltok-scan-after-processing-instruction-open))
+ ((xmltok-after-lt start comment-open)
diff --git a/elisp/nxhtml/etc/schema/old-genshi.rnc b/elisp/nxhtml/etc/schema/old-genshi.rnc
new file mode 100644
index 0000000..5a50385
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/old-genshi.rnc
@@ -0,0 +1,31 @@
+namespace py = "http://genshi.edgewall.org/"
+
+genshi.expr-type = xsd:string { minLength = "1" }
+genshi.with-type = xsd:string { minLength = "1" }
+genshi.choose-type = xsd:string
+genshi.def-type = xsd:string
+genshi.xpath-type = xsd:anyURI
+
+genshi.attrib = attribute py:if { genshi.expr-type }?,
+ attribute py:choose { genshi.choose-type }?,
+ attribute py:when { genshi.expr-type }?,
+ attribute py:otherwise { genshi.expr-type }?,
+ attribute py:for { genshi.expr-type }?,
+ attribute py:def { genshi.def-type }?,
+ attribute py:match { genshi.xpath-type }?,
+ attribute py:with { genshi.with-type }?,
+ attribute py:attrs { genshi.expr-type }?,
+ attribute py:content { genshi.expr-type }?,
+ attribute py:replace { genshi.expr-type }?,
+ attribute py:strip { genshi.expr-type }?
+
+genshi.if.attlist = attribute test { genshi.expr-type }
+genshi.for.attlist = attribute each { genshi.expr-type }
+genshi.def.attlist = attribute function { genshi.expr-type }
+genshi.with.attlist = attribute vars { genshi.with-type }
+genshi.match.attlist = attribute path { genshi.xpath-type },
+ attribute buffer { genshi.expr-type }?,
+ attribute once { genshi.expr-type }?,
+ attribute recursive { genshi.expr-type }?
+
+
diff --git a/elisp/nxhtml/etc/schema/old-qtmstr-xhtml.rnc b/elisp/nxhtml/etc/schema/old-qtmstr-xhtml.rnc
new file mode 100644
index 0000000..b5f84bd
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/old-qtmstr-xhtml.rnc
@@ -0,0 +1,61 @@
+namespace py = "http://genshi.edgewall.org/"
+namespace xi = "http://www.w3.org/2001/XInclude"
+
+include "genshi.rnc"
+include "xinclude.rnc"
+include "xhtml-loader.rnc"
+
+start |= head|body|p|\div|h1|h2|h3|h4|h5|h6|hr|pre|dl|ol|ul|table|form
+
+Common.attrib &= genshi.attrib
+head.attlist &= genshi.attrib
+html.attlist &= genshi.attrib
+
+Head.class = base | isindex | link | meta | script | title | style |
+ if-head | for-head | def-head | with-head
+
+Head.model = Head.class*
+
+head.content &= Head.model*
+
+if-inline = element py:if { genshi.if.attlist, Inline.model }
+if-block = element py:if { genshi.if.attlist, Block.model }
+if-head = element py:if { genshi.if.attlist, Head.model }
+for-inline = element py:for { genshi.for.attlist, Inline.model }
+for-block = element py:for { genshi.for.attlist, Block.model }
+for-head = element py:for { genshi.for.attlist, Head.model }
+def-inline = element py:def { genshi.def.attlist, Inline.model }
+def-block = element py:def { genshi.def.attlist, Block.model }
+def-head = element py:def { genshi.def.attlist, Head.model }
+with-inline = element py:with { genshi.with.attlist, Inline.model }
+with-block = element py:with { genshi.with.attlist, Block.model }
+with-head = element py:with { genshi.with.attlist, Head.model }
+match-inline = element py:match { genshi.match.attlist, Inline.model }
+match-block = element py:match { genshi.match.attlist, Block.model }
+match-head = element py:match { genshi.match.attlist, Head.model }
+
+Inline.class |= if-inline | for-inline | def-inline | with-inline | match-inline
+Block.class |= if-block | for-block | def-block | with-block | match-block
+
+xi-inline = element xi:include {
+ xinclude.include.attlist,
+ element xi:fallback { genshi.attrib,
+ (xi-inline | Inline.model)*
+ }?
+ }
+
+xi-block = element xi:include { xinclude.include.attlist,
+ element xi:fallback { genshi.attrib,
+ (xi-block | Block.model)*
+ }?
+ }
+
+xi-head = element xi:include { xinclude.include.attlist,
+ element xi:fallback { genshi.attrib,
+ (xi-head | Head.model)*
+ }?
+ }
+
+Inline.class |= xi-inline
+Block.class |= xi-block
+Head.class |= xi-head
diff --git a/elisp/nxhtml/etc/schema/old-xinclude.rnc b/elisp/nxhtml/etc/schema/old-xinclude.rnc
new file mode 100644
index 0000000..c45cf0c
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/old-xinclude.rnc
@@ -0,0 +1,11 @@
+namespace xi = "http://www.w3.org/2001/XInclude"
+namespace local = ""
+
+xinclude.include.attlist =
+ attribute href { xsd:anyURI }?,
+ attribute parse { xsd:string }?,
+ attribute xpointer { xsd:string }?,
+ attribute encoding { xsd:string }?,
+ attribute accept { xsd:string }?,
+ attribute accept-language { xsd:string }?
+
diff --git a/elisp/nxhtml/etc/schema/qtmstr-xhtml-old.rnc b/elisp/nxhtml/etc/schema/qtmstr-xhtml-old.rnc
new file mode 100644
index 0000000..61ab89e
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/qtmstr-xhtml-old.rnc
@@ -0,0 +1,58 @@
+namespace py = "http://genshi.edgewall.org/"
+namespace xi = "http://www.w3.org/2001/XInclude"
+
+include "genshi.rnc"
+include "xinclude.rnc"
+include "xhtml-loader.rnc"
+
+start |= head|body|p|\div|h1|h2|h3|h4|h5|h6|hr|pre|dl|ol|ul|table|form
+
+Common.attrib &= genshi.attrib
+head.attlist &= genshi.attrib
+html.attlist &= genshi.attrib
+
+Head.class = base | isindex | link | meta | script | title | style |
+ if-head | for-head | def-head | with-head
+
+Head.model = Head.class*
+
+head.content &= Head.model*
+
+if-inline = element py:if { genshi.if.attlist, Inline.model }
+if-block = element py:if { genshi.if.attlist, Block.model }
+if-head = element py:if { genshi.if.attlist, Head.model }
+for-inline = element py:for { genshi.for.attlist, Inline.model }
+for-block = element py:for { genshi.for.attlist, Block.model }
+for-head = element py:for { genshi.for.attlist, Head.model }
+def-inline = element py:def { genshi.def.attlist, Inline.model }
+def-block = element py:def { genshi.def.attlist, Block.model }
+def-head = element py:def { genshi.def.attlist, Head.model }
+with-inline = element py:with { genshi.with.attlist, Inline.model }
+with-block = element py:with { genshi.with.attlist, Block.model }
+with-head = element py:with { genshi.with.attlist, Head.model }
+
+Inline.class |= if-inline | for-inline | def-inline | with-inline
+Block.class |= if-block | for-block | def-block | with-block
+
+xi-inline = element xi:include {
+ xinclude.include.attlist,
+ element xi:fallback { genshi.attrib,
+ (xi-inline | Inline.model)*
+ }?
+ }
+
+xi-block = element xi:include { xinclude.include.attlist,
+ element xi:fallback { genshi.attrib,
+ (xi-block | Block.model)*
+ }?
+ }
+
+xi-head = element xi:include { xinclude.include.attlist,
+ element xi:fallback { genshi.attrib,
+ (xi-head | Head.model)*
+ }?
+ }
+
+Inline.class |= xi-inline
+Block.class |= xi-block
+Head.class |= xi-head
diff --git a/elisp/nxhtml/etc/schema/qtmstr-xhtml.rnc b/elisp/nxhtml/etc/schema/qtmstr-xhtml.rnc
new file mode 100644
index 0000000..ff5d0a9
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/qtmstr-xhtml.rnc
@@ -0,0 +1,66 @@
+default namespace = "http://www.w3.org/1999/xhtml"
+
+include "genshi.rnc"
+include "xhtml-loader.rnc" {
+ start = html | head | head.content | body | frameset | frame | noframes |
+ Block.class | Inline.class | Table.class | Form.extra.class | genshi.class
+ html = element html { html.attlist, (genshi.model | (head, (body | frameset | genshi.model))) }
+ frameset =
+ element frameset {
+ frameset.attlist,
+ (((frameset | frame)+ & noframes?) | genshi.model)
+ }
+ noframes = element noframes { noframes.attlist, (body | genshi.model) }
+ title = element title { title.attlist, (text | genshi.model)* }
+ script = element script { script.attlist, (text | genshi.model)* }
+ style = element style { style.attlist, (text | genshi.model)* }
+ dl = element dl { dl.attlist, ((dt | dd)+ | genshi.model) }
+ ol = element ol { ol.attlist, (li+ | genshi.model) }
+ ul = element ul { ul.attlist, (li+ | genshi.model) }
+ dir = element dir { dir.attlist, (li.noblock+ | genshi.model) }
+ menu = element menu { menu.attlist, (li.noblock+ | genshi.model) }
+ select = element select { select.attlist, ((option | optgroup)+ | genshi.model) }
+ option =
+ element option {
+ Common.attrib,
+ attribute selected { "selected" }?,
+ attribute value { text }?,
+ (text | genshi.model)*
+ }
+ textarea = element textarea { textarea.attlist, (text & genshi.model)* }
+ optgroup = element optgroup { optgroup.attlist, (option+ | genshi.model) }
+ table =
+ element table {
+ table.attlist,
+ (caption? | genshi.model),
+ (col* | colgroup* | genshi.model),
+ (((thead? | genshi.model),
+ (tfoot? | genshi.model),
+ (tbody+ | genshi.model)) | (tr+ | genshi.model))
+ }
+ colgroup = element colgroup { colgroup.attlist, (col* | genshi.model) }
+ tr = element tr { tr.attlist, ((th | td)+ | genshi.model) }
+ tbody = element tbody { tbody.attlist, (tr+ | genshi.model) }
+ thead = element thead { thead.attlist, (tr+ | genshi.model) }
+ tfoot = element tfoot { tfoot.attlist, (tr+ | genshi.model) }
+}
+
+Table.class = caption | colgroup | col | tbody | thead | tfoot | th | tr | td
+Form.extra.class = option | optgroup | legend
+
+Block.class |= genshi.class
+Inline.class |= genshi.class
+head.content &= genshi.class
+
+Core.attrib &= genshi.attrib
+html.attlist &= genshi.attrib
+head.attlist &= genshi.attrib
+title.attlist &= genshi.attrib
+base.attlist &= genshi.attrib
+meta.attlist &= genshi.attrib
+script.attlist &= genshi.attrib
+param.attlist &= genshi.attrib
+Edit.attrib &= genshi.attrib
+
+genshi.allowed.children |= html | head | head.content | body | frameset | frame
+ | noframes | Inline.class | Block.class | Table.class | Form.extra.class
diff --git a/elisp/nxhtml/etc/schema/schema-path-patch.el b/elisp/nxhtml/etc/schema/schema-path-patch.el
new file mode 100644
index 0000000..a6d59fc
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/schema-path-patch.el
@@ -0,0 +1,95 @@
+;;; schema-path-patch.el --- Patch schema paths
+;;
+;; Author: Lennart Borgman (lennart O borgman A gmail O com)
+;; Created: 2008-08-08T20:21:31+0200 Fri
+;; Version: 0.2
+;; Last-Updated: 2008-08-19T00:21:25+0200 Mon
+;; URL:
+;; Keywords:
+;; Compatibility:
+;;
+;; Features that might be required by this library:
+;;
+;; Cannot open load file: schema-path-patch.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; Schemas here may include parts from nxml and need to know the path.
+;; This file can be used to patch the paths.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Change log:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; 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., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+(defvar rncpp-this-dir
+ (file-name-as-directory
+ (file-name-directory
+ (if load-file-name load-file-name buffer-file-name))))
+
+(defun rncpp-get-nxml-schema-dir ()
+ ;; First look for nxml-mode included with Emacs
+ (let ((schema-dir (file-name-as-directory
+ (expand-file-name "schema" data-directory))))
+ (unless (file-directory-p schema-dir)
+ ;; This is an old nxml-mode, look for its schemas dir.
+ (let ((nxml-mode-dir (file-name-as-directory
+ (file-name-directory (locate-library "nxml-mode")))))
+ (setq schema-dir (file-name-as-directory
+ (expand-file-name "schema" nxml-mode-dir)))))
+ (unless (file-directory-p schema-dir)
+ (error "Can't find schema-dir=%s" schema-dir))
+ schema-dir))
+
+;; Use xhtml-loader.rnc (an idea from Bryan Waite):
+(defun rncpp-patch-xhtml-loader ()
+ "Patch xhtml-loader.rnc so genshi and mjt rnc files works."
+ ;;(interactive)
+ (let* ((default-directory rncpp-this-dir)
+ (loader-path (expand-file-name "xhtml-loader.rnc"))
+ (loader-buf (find-buffer-visiting loader-path))
+ (schema-dir (rncpp-get-nxml-schema-dir))
+ (schema-relative-dir (file-relative-name schema-dir))
+ (loader-string (concat "include \""
+ schema-relative-dir
+ "xhtml.rnc\"\n")))
+ (when loader-buf (kill-buffer loader-buf))
+ (setq loader-buf (find-file-noselect loader-path))
+ (with-current-buffer loader-buf
+ (unless (file-exists-p loader-path)
+ (insert loader-string))
+ ;; Test if correct
+ (if (string= (buffer-substring-no-properties (point-min) (point-max))
+ loader-string)
+ (message "xhtml-loader.rnc was ok")
+ (message "Patching xhtml-loader.rnc")
+ (delete-region (point-min) (point-max))
+ (insert loader-string))
+ (basic-save-buffer)
+ (kill-buffer (current-buffer)))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; schema-path-patch.el ends here
diff --git a/elisp/nxhtml/etc/schema/xinclude.rnc b/elisp/nxhtml/etc/schema/xinclude.rnc
new file mode 100644
index 0000000..cbda979
--- /dev/null
+++ b/elisp/nxhtml/etc/schema/xinclude.rnc
@@ -0,0 +1,35 @@
+default namespace = "http://www.w3.org/2001/XInclude"
+namespace xi = "http://www.w3.org/2001/XInclude"
+
+xi.include.attlist =
+ attribute href { xsd:anyURI }?,
+ attribute parse { "xml" | "text" }?,
+ attribute xpointer { xsd:string }?,
+ attribute encoding { xsd:string }?,
+ attribute accept { xsd:string }?,
+ attribute accept-language { xsd:string }?
+
+xi.include.attlist.extra =
+ attribute * - xi.include.attlist { text }*
+
+xi.include =
+ element xi:include {
+ xi.include.attlist,
+ xi.include.attlist.extra,
+ (xi.fallback? | xi.include.extra)*
+ }
+
+xi.include.extra = notAllowed
+
+xi.fallback.attlist =
+ attribute * { text }*
+
+xi.fallback =
+ element xi:fallback {
+ xi.fallback.attlist,
+ (xi.include | xi.fallback.extra)*
+ }
+
+xi.fallback.extra = notAllowed
+
+xi.class = xi.include | xi.fallback \ No newline at end of file
diff --git a/elisp/nxhtml/etc/templates/rollover-2v.css b/elisp/nxhtml/etc/templates/rollover-2v.css
new file mode 100644
index 0000000..ed10a41
--- /dev/null
+++ b/elisp/nxhtml/etc/templates/rollover-2v.css
@@ -0,0 +1,25 @@
+ROLLOVER_SPEC a {
+ /* Image */
+ display: block;
+ background: transparent url("IMG_URL") 0 0 no-repeat;
+ overflow: hidden;
+ width: IMG_WIDTHpx;
+ /* Text placement and size, etc */
+ CENTER_OR_PAD;
+ padding-top: PADDING_TOPpx;
+ font-size: FONT_SIZEpx;
+ padding-bottom: PADDING_BOTTOMpx;
+ text-decoration: none;
+ white-space: nowrap;
+ border: none;
+ margin: 0;
+}
+ROLLOVER_SPEC a:hover {
+ background-position: 0 -IMG_HEIGHT_2px;
+}
+ROLLOVER_SPEC li {
+ display: inline;
+ padding: 0;
+ margin: 0;
+ HOR_OR_VER;
+}
diff --git a/elisp/nxhtml/etc/viper-tut/0intro b/elisp/nxhtml/etc/viper-tut/0intro
new file mode 100644
index 0000000..3a37e33
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/0intro
@@ -0,0 +1,59 @@
+Viper tutorial #0: Introduction
+
+This Viper tutorial is based on the vi tutorial VILEARN. Some things
+works differently in Emacs and corresponding parts of the tutorial has
+been changed for this. There has also been added some basic
+information about Emacs that are useful to get started if you already
+are a vi user.
+
+This tutorial is a hands-on-tutorial for Viper. If you want more
+information about Viper, please read the VIPER-MANUAL.
+
+Note that if you are using Viper you probably still want to know quite
+a bit about Emacs to use Emacs efficiently. Therefore you can also
+run the Emacs tutorial from here - with special support for
+Viper. This is part 6 below. You should run this part also to get to
+know which Emacs standard key bindings are shadowed by Viper.
+
+The tutorial consists of these parts:
+
+ 0 Introduction
+ (this file)
+
+ 1 Basic Editing
+ Covers the handful of commands required to both navigate all
+ five tutorials and do basic editing.
+
+ 2 Moving Efficiently
+ Covers all of the cursor positioning commands. These are the
+ commands used later as arguments to editing commands.
+
+ 3 Cutting and Pasting
+ Introduces the first compound commands, numbering, and copy
+ buffers.
+
+ 4 Inserting Techniques
+ Continues the discussion of compound commands, while completing
+ the list of insertion commands first discussed in tutorial one.
+
+ 5 Tricks and Timesavers
+ This is less a tutorial than a description of common vi commands
+ which don't fit correctly into normal logic.
+
+ 6 Emacs Tutorial for Viper Users
+ Even Viper users use a lot of keys from Emacs. Therefore you can
+ run the Emacs tutorial here too. It will show you which keys in
+ the tutorial that are changed because you are using Viper. This
+ depends of which Viper state you are in, vi state or some insert
+ state. If you switch Viper state the tutorial will immediately
+ show which keys are affected.
+
+
+BUGS
+Vilearn has the remark that it "Still doesn't cover variables, ex
+commands, or tags. At least one more tutorial is necessary for a
+complete introduction to vi." - I do not think you have to learn those
+parts to use Viper. There are other ways to do these things in Emacs!
+
+For more information about vilearn see the the README-FILE.
+
diff --git a/elisp/nxhtml/etc/viper-tut/1basics b/elisp/nxhtml/etc/viper-tut/1basics
new file mode 100644
index 0000000..aea1fc5
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/1basics
@@ -0,0 +1,187 @@
+Viper tutorial #1: The Basics
+
+This lesson lasts 10-15 minutes and teaches simple editing. Lines
+which begin with >>> mark exercises you should try. When you
+want to exit this tutorial type 'Z''Z' (type capital Z, twice).
+
+When you type commands in vi they do not appear on the screen. If the
+letters you type unexpectedly appear on the screen, press the ESC key.
+
+
+BASIC CURSOR MOVEMENT
+---------------------
+To move through the tutorial use C-d (control d) and C-u (control u).
+
+ C-d Move DOWN one half-screen
+ (depress the control key and type d)
+
+ C-u Move UP one half-screen
+ (depress the control key and type u)
+
+* EMACS-NOTICE: C-u is normally used in Emacs for UNIVERSAL-ARGUMENT.
+ You can in most cases use DIGIT-ARGUMENT instead.
+
+>>> Now type C-d (control d) and C-u (control u) to move down and back up.
+
+When you are done reading a screen, you are expected to type C-d to move
+down to the next screen. You must remember to type C-d throughout the
+tutorial.
+
+To move the cursor line by line, or character by character, use the
+four keys 'h', 'j', 'k', and 'l'.
+
+ 'h' Move left one character
+ 'j' Move down one line
+ 'k' Move up one line
+ 'l' Move right one character
+
+You will notice that these keys are in a straight line on the
+keyboard. Study the diagram below showing the function of h, j, k, l.
+
+ UP
+ ....... ....... ....... .......
+ : : : : : : : :
+ LEFT : h : : j : : k : : l : RIGHT
+ :.....: :.....: :.....: :.....:
+
+ DOWN
+
+>>> Now type 'j' or 'k' a few times to bring the cursor to this line.
+
+>>> Try moving off the right end of a line using 'l' . Notice that
+>>> vi will not allow you to move off the end of the line using 'l' .
+>>> Likewise, you cannot use 'h' and 'l' on a blank line.
+
+>>> Try moving past the bottom of the screen using 'j' . Notice how
+>>> how the screen scrolls downward.
+
+>>> Now practice using 'k' to move up, and 'h' to move left.
+
+
+DELETION
+--------
+To delete characters and lines, use 'x' and 'd''d'.
+
+ 'x' X-OUT one character
+ 'd''d' DELETE one line
+
+To undo your changes, use 'u'.
+
+ 'u' UNDO last change only
+
+>>> Delete this SCRAP line. Move to this line with 'j' or 'k' , now type 'd''d' .
+>>> Try undoing the deletion with 'u' .
+
+>>> Move to this line and x-out the Y's with 'x' : "whY ask whY?"
+
+>>> Try undoing the deletion with 'u' . Try typing 'u' several times.
+>>> Notice that 'u' only undoes the last change.
+
+* EMACS-NOTICE: In Viper you can use the repeat command '.' (just a dot)
+ to undo more changes. This goes in both direction, ie undoing and
+ redoing. Typing just 'u' changes direction.
+
+Here are more lines on which to practice deleting and undoing (use: 'd''d' 'x' 'u' )
+
+ Emacs is a nice creation. Emacs is a nice creation.
+ Emacs is a nice creation. Emacs is a nice creation.
+ Emacs is a nice creation. Emacs is a nice creation.
+
+
+QUIT COMMANDS
+-------------
+(DO NOT QUIT the tutorial at this time.)
+
+To quit a file without saving any changes you have made (for instance,
+with the 'd''d' or 'x' commands) use :q!<RETURN> . To quit and save your
+changes, use 'Z''Z' . When you are editing your own files, you normally
+use 'Z''Z' to quit.
+
+ :q!<RETURN> QUIT without saving changes
+ (type a colon, then the letter q, then an
+ exclamation point, and press RETURN)
+
+ 'Z''Z' Exit and save any changes
+ (type capital Z, twice)
+
+
+
+INSERTION
+---------
+You enter insert mode with 'i' or 'o' . Anything you type during insert
+mode appears on the screen. When you are done inserting, press ESC
+to exit insert mode. Type C-[ (control [ ), if you do not have an ESC key.
+
+ 'o' OPEN a line for inserting text
+ 'i' INSERT starting at the cursor
+
+ ESC ESCAPE from insert mode
+
+During insert mode, use your erase character (usually backspace or
+delete) to delete mistakes. The characters you delete will remain on
+the screen until you press ESC.
+
+>>> Insert your name and phone number below the next blank line. To do this:
+>>> Open a line below using 'o' .
+>>> Type your first and last name. Press RETURN.
+>>> Then type your phone number and press ESC.
+>>> Use 'x' to erase part of your phone number.
+
+>>> Type the date below your phone number. To do this:
+>>> Open another line using 'o' .
+>>> Type the date and press ESC.
+
+>>> Type 'u' to undo the insertion.
+
+>>> Insert a nickname between your first and last names, using 'i'. To do this:
+>>> Move the cursor to the spot between your names using 'h', 'j', 'k', 'l'.
+>>> Press 'i' .
+>>> Type the nickname, use DELETE or BACKSPACE to erase any typos.
+>>> Then press ESC.
+
+On some computers, a line may be longer than the width of the screen.
+This means that a very long line may appear to be two lines on the
+screen. This happens when you keep typing without pressing RETURN at
+the edge of the screen. To avoid any confusion when you're inserting
+text, be sure to press RETURN before reaching the right edge of the
+screen.
+
+
+SUMMARY
+-------
+These are the vi commands you should know after tutorial #1:
+
+ C-d Move DOWN one half-screen
+ (depress the control key and type d)
+
+ C-u Move UP one half-screen
+ (depress the control key and type u)
+
+ 'h' Move left one character
+ 'j' Move down one line
+ 'k' Move up one line
+ 'l' Move right one character
+
+ 'd''d' DELETE one line
+ 'x' X-OUT one character
+
+ 'u' UNDO last change
+
+ :q!<RETURN> QUIT without saving changes
+ (type a colon, then the letter q, then an
+ exclamation point, and press RETURN)
+
+ 'Z''Z' Exit and save any changes
+ (type capital Z, twice)
+
+ 'o' OPEN a line for inserting text
+ 'i' INSERT starting at the cursor
+
+ ESC ESCAPE from insert mode
+
+
+You are now prepared to do simple editing on your own files. Practice
+using vi for a few days. Then take the second vi tutorial to learn
+more powerful and useful vi commands.
+
+Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved.
diff --git a/elisp/nxhtml/etc/viper-tut/2moving b/elisp/nxhtml/etc/viper-tut/2moving
new file mode 100644
index 0000000..8e4148e
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/2moving
@@ -0,0 +1,269 @@
+Viper tutorial #2: Moving Through Files Efficiently
+
+This lesson lasts 15-20 minutes. The material taught here is used in
+tutorial #3: Cutting and Pasting. Lines which begin with >>> mark
+exercises you should try. When you want to exit this tutorial type 'Z''Z'.
+
+
+WORDS
+-----
+There are many ways to move from one word to another. Consider these:
+
+ 'w' Move to the beginning of the next WORD
+ 'e' Move to the END of the next word
+ 'b' Move BACK to the beginning to the previous word
+
+For 'w', 'e', and 'b', a word is delimited by any non-alphanumeric
+character. The capitalized versions, 'W', 'E', and 'B', also move from word
+to word. The difference is that for 'W', 'E', and 'B', a word is delimited
+by any blank space.
+
+>>> Try out 'w', 'b', 'e', on the lines provided below.
+>>> Next practice using 'B', 'W', 'b', 'E' on the lines provided below.
+
+ EX-PER-IMENT on these lines;test moving back &forth.
+ EX-PER-IMENT on these lines;test moving back &forth.
+
+
+ON THE LINE
+-----------
+You can move immediately to any point on the current line.
+
+ '$' Move to the end of the line
+ '^' Move to the first non-white character on the line
+
+ '0' Move to the first column on the line (column zero)
+ #'|' Move to an exact column on the line (column #) e.g. 5| 12|
+
+>>> Experiment with '$' and '^' on the line provided below. Notice
+>>> that '^' moves to the first non-white character, not the beginning.
+
+ This is a PRACTICE LINE. There is white space at the front. END
+
+'0' (zero) will always take you to the far left edge of the screen.
+
+#'|' (number vertical-bar) is for moving to an explicit column on a line.
+Just type any number 1-80 and press | . For example: 5| 20| 30|
+Note that you can't move beyond the last column on a line.
+
+
+FINDING CHARACTERS
+------------------
+Often you want to move to a specific letter or character on a line.
+
+ 'f' char FIND the next occurrence of char on the line
+ 't' char Move 'TIL the next occurrence of char on the line
+
+ 'F' char FIND the previous occurrence of char on the line
+ 'T' char Move 'TIL the previous occurrence of char on the line
+
+ ';' Repeat the last f, t, F, or T
+ ',' Reverse the last f, t, F, or T
+
+'f' and 'F' land on the character. 't' and 'T' land next to the character.
+'f' and 't' move forward, while 'F' and 'T' move backward.
+
+If the specified character is not on the line, vi will beep.
+
+>>> Move to the beginning of the line below, and try out these commands:
+>>> 'f'e 'f'E ';' ';' ',' ',' 't'@ 'T'P 't'e 't'E ',' ';' ',' ';'
+
+ "PRACTICE line?" "Each and Every?" "Find thE char@cter and move to it.END
+
+
+MATCHING
+--------
+vi has a handy way to determine if (), {}, and [] pairs match up.
+
+ '%' Move to matching () or {} or []
+
+>>> On the practice lines below, move your cursor over a (,),{,},[, or ].
+>>> Then type '%' .
+
+ [TRY THIS. ((Whether) the pairs match up is the question.) [One]
+ pair is incomplete]. Can you tell {which one? ]} END
+
+
+WINDOW POSITIONS
+----------------
+You can move the cursor to the top, middle, or bottom of the vi window.
+
+ 'H' Move to the HIGHEST position in the window
+ 'M' Move to the MIDDLE position in the window
+ 'L' Move to the LOWEST position in the window
+
+>>> Try out these commands: type H then M and L and then M again.
+
+
+MARKING LOCATIONS
+-----------------
+You can mark positions in the file and return to them.
+
+ 'm' char MARK this location and name it char
+ ''' char (quote character) return to line named char
+ '''''' (quote quote) return from last movement
+
+char can be any lower case letter, a-z. A mark persists until you:
+ 1) use the same char to mark another location
+ or 2) delete the marked line
+
+>>> Move to this line and type ma to mark it a
+>>> Move to this line and type mb to mark it b
+>>> Move to this line and type mz to mark it z
+>>> Type 'a to return to line a
+>>> Type 'b to return to line b
+>>> Type 'z to return to line z
+
+Certain commands can move you large distances. These commands cause
+your last position to be remembered in the special mark named ' (quote).
+To move to this special mark, just type '' (quote quote).
+
+>>> Try this: 'b to return to line b, and then '' to return here.
+
+
+GO TO A LINE
+------------
+
+ 'G' GO to the last line in the file
+ #'G' GO to line #. (e.g., 3G , 5G , 124G )
+
+Read these directions carefully:
+>>> Type '1''G' to go to the top of the file, and then '''''' (quote quote)
+>>> to return here.
+>>> Now try 'G' to go to the end of the file, and then '''''' to return here.
+
+
+BLOCKS OF TEXT
+--------------
+It is often convenient to move through files jumping from one block of
+text to the next. To do this use braces and parentheses:
+
+ '{' (left brace) Move to the beginning of a paragraph
+ '}' (right brace) Move to the end of a paragraph
+
+ '(' (left paren) Move to the beginning of a sentence
+ ')' (right paren) Move to the beginning of the next sentence
+
+>>> Experiment with '}' and '{' on the two paragraphs provided below.
+>>> Note that paragraphs are separated by a blank line.
+
+ EXPERIMENT on this first paragraph. The quick brown fox jumped
+ over the seven lazy dogs. The fox must have been very large to
+ jump over seven dogs!
+
+ EXPERIMENT on this second paragraph. The quick brown dog
+ jumped over the seven lazy foxes. The dog didn't have to be nearly
+ as large, since foxes aren't too big.
+
+>>> Try out ')' and '(' on the two paragraphs provided above.
+>>> Notice that sentences are separated by two blank spaces.
+
+C programmers find it useful to move by sections, since sections may be
+delimited by a left brace in the first column. By placing the opening
+brace of a C subroutine in the first column, you can move to the top of
+the next subroutine, using '[''[' and ']'']' .
+
+ '[''[' Move to the beginning of a section
+ ']'']' Move to the end of a section
+
+Note that if vi does not find a left brace at the far left, it will
+move to the top or bottom of the file.
+
+>>> Now try ']'']' then ']'']' and '[''[' on the subroutines provided below:
+
+main()
+{
+ helloworld();
+}
+
+helloworld()
+{
+ printf( "Hello world\n" );
+}
+
+
+SEARCHING
+---------
+This enables you to jump to the next occurrence of a string in a file.
+To initially find the string use:
+
+ '/'string Find string looking forward
+ '?'string Find string looking backward
+
+To find additional occurrences of the string type:
+
+ 'n' Repeat last / or ? command
+ 'N' Reverse last / or ? command
+
+vi may search past the bottom of the file and then start again at the top.
+(Or, vi may search past the top and then start again at the bottom.)
+
+>>> You are going to search for a string, find the next three
+>>> occurrences. Then flip directions and find the string until you
+>>> return to this location. To do this:
+>>> Type '/''t''h''e' then press RETURN.
+>>> Type 'n' three times.
+>>> Type 'N' until you return to this location.
+
+* EMACS-NOTICE: Emacs has very powerful SEARCH-COMMANDS which you may
+ want to use in parallell to those above. One of the first you want
+ to try is probably C-s (ISEARCH-FORWARD).
+
+
+SUMMARY
+-------
+
+ 'w' Move to the beginning of the next WORD
+ 'e' Move to the END of the next word
+ 'b' Move BACK to the beginning to the previous word
+
+ '$' Move to the end of the line
+ '^' Move to the first non-white character on the line
+
+ '0' Move to the first column on the line (column zero)
+ #'|' Move to an exact column on the line (column #) e.g. 5| 12|
+
+ 'f' char FIND the next occurrence of char on the line
+ 't' char Move 'TIL the next occurrence of char on the line
+
+ 'F' char FIND the previous occurrence of char on the line
+ 'T' char Move 'TIL the previous occurrence of char on the line
+
+ ';' Repeat the last f, t, F, or T
+ ',' Reverse the last f, t, F, or T
+
+ '%' Show matching () or {} or []
+
+ 'H' Move to the HIGHEST position in the window
+ 'M' Move to the MIDDLE position in the window
+ 'L' Move to the LOWEST position in the window
+
+ 'm' char MARK this location and name it char
+ ''' char (quote character) return to line named char
+ '''''' (quote quote) return from last movement
+
+ 'G' GO to the last line in the file
+ #'G' GO to line #. (e.g., 3G , 5G , 175G )
+
+ '{' (left brace) Move to the beginning of a paragraph
+ '}' (right brace) Move to the end of a paragraph
+
+ '(' (left paren) Move to the beginning of a sentence
+ ')' (right paren) Move to the beginning of the next sentence
+
+ '[''[' Move to the beginning of a section
+ ']'']' Move to the end of a section
+
+ '/'string Find string looking forward
+ '?'string Find string looking backward
+
+ 'n' Repeat last / or ? command
+ 'N' Reverse last / or ? command
+
+You should now be able to move around files very efficiently. These
+commands are especially useful if you are using vi over a slow modem.
+Practice the material in this lesson for a few days and then take
+either the third vi tutorial to learn how to copy, cut, and paste, or
+the forth vi tutorial to learn additional insertion techniques.
+
+Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved.
diff --git a/elisp/nxhtml/etc/viper-tut/3cutpaste b/elisp/nxhtml/etc/viper-tut/3cutpaste
new file mode 100644
index 0000000..6d531d9
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/3cutpaste
@@ -0,0 +1,318 @@
+Viper tutorial #3: Copying, Cutting, and Pasting
+
+This lesson lasts 15-20 minutes. This tutorial assumes full knowledge
+of tutorial #1, and familiarity with tutorial #2. Lines which begin
+with >>> mark exercises you should try.
+
+When you want to exit this tutorial type 'Z''Z' to exit and save your
+changes. Or type :q!<RETURN> to exit without saving changes.
+Remember that typing u will UNDO your last change.
+
+
+CUTTING TEXT
+------------
+The delete command can be combined with any of the movement commands
+taught throughout tutorial #2. The resulting command is of the form:
+
+ 'd'movement DELETE to where the movement command specifies
+
+Consider the following examples:
+
+ 'd''w' DELETE to the beginning of the next WORD
+ 'd''$' DELETE to the end of the line
+ 'd'')' DELETE to the beginning of the next sentence
+ 'd''t'e DELETE 'TIL the next e
+ 'd''d' DELETE a line (dd is a special case of the d command)
+
+>>> Experiment with 'd''w' 'd''$' 'd'')' 'd''t'e 'd''d' on the paragraph provided below:
+
+ PRACTICE here. Now is the time for all good users to learn the
+ editor. The quick brown fox jumped over the seven lazy fish. Now
+ is the time for all good users to learn the editor. The quick
+ brown computer jumped over the seven lazy users. END PRACTICE
+
+* EMACS-NOTICE: In Viper you can also use 'r' and 'R' for Emacs region and
+ Viper line extended region. This is very convenient together with
+ CUA-MODE where the region is visible (it is usually called the
+ selected text or something similar in other applications).
+
+
+PASTING TEXT
+------------
+When text is deleted it is put into a buffer which contains the most
+recently deleted text. To paste the contents of this buffer elsewhere
+in the file use the p or P command.
+
+ 'P' (upper p) PUT the contents of the buffer before the cursor
+ 'p' (lower p) PUT the contents of the buffer after the cursor
+
+>>> Try this sequence of commands on the practice lines below:
+>>> 'd''d' to delete one line
+>>> 'j' to move down a line
+>>> 'p' (lower p) to PUT the deleted text after the cursor
+>>> '}' to move to the end of the paragraph
+>>> 'P' (upper p) to PUT the deleted text before the cursor
+
+ PRACTICE line. Cut and Paste this line to the bottom of the
+ paragraph. Here is some filler, feel free to cut and paste the
+ text in this practice region. Remember that u undoes the last
+ action. END OF PRACTICE
+
+>>> Try this sequence of commands at the beginning of a word:
+>>> 'd''w' 'w' 'P'
+
+The fastest way to swap two letters is to type: 'x''p'
+
+>>> Use xp to correct the misspelled words below:
+
+ PRACTICE. Thier weird quiet recieved an inconvenient shriek.
+ Thier belief is that to recieve grief from nieghbors outwieghs
+ all else. Biege skies lead to wierd science. END.
+
+
+NUMBERING
+---------
+Consider cutting and pasting 3 words. Based on previous exercises you
+would type 'd''w' , move to the new location, and type 'p' , and repeat
+this procedure twice more. There is an easier way to do this:
+
+>>> Using the practice lines below, try the following sequence of commands:
+>>> Move to the beginning of the first sentence.
+>>> Type 'd''3''w' to DELETE 3 WORDS.
+>>> Type 'w' to move ahead one WORD.
+>>> Type 'P' (upper p) to PUT the three words before the cursor.
+
+ PRACTICE Numbering vi commands is easy to do. Now is the time for
+ all good users to learn the editor. The quick brown fox jumped
+ over the seven lazy dogs. Numbering vi commands is easy to do.
+ Now is the time for all good users to learn the editor. END PRACTICE
+
+>>> Type 'd''2''d' to DELETE 2 lines, using the practice paragraph above.
+>>> Move to the top of the paragraph.
+>>> Type 'p' (lower p) to PUT the two lines after of the cursor.
+
+Numbering also works for movement commands.
+
+>>> Now try '4''w' to move ahead 4 WORDs, on the lines provided above.
+>>> Then use '3''b' to move BACK 3 words.
+
+When you type '4''w' THINK "4 words", when you type d4w think "delete 4
+words". In general, we can write
+
+ #movement repeat movement # times
+ d#movement DELETE to where the #movement command specifies
+
+
+COPYING TEXT
+------------
+The YANK command works just like the DELETE command, except 'y' is used
+instead of 'd' .
+
+ 'y'movement YANK to where the movement command specifies
+
+YANK and DELETE are identical except that YANK only copies the specified
+text into the buffer.
+
+>>> Try this sequence of commands on the practice lines below:
+>>> 'y''y' to YANK a line (yy is a special case of the y command)
+>>> '3''j' to move down 3 lines
+>>> 'p' (lower p) to PUT the yanked text after the cursor
+
+ PRACTICE line. Copy and Paste this line to the bottom of the
+ paragraph. Here is some filler, feel free to copy and paste the
+ text in this practice region. Remember that u undoes the last
+ action. END OF PRACTICE
+
+Please note that copy, cutting, and pasting large blocks of text may
+significantly alter the tutorial file. Remember that you can always get
+a new copy of the tutorial file and that u UNDOes your last change.
+
+Here are some examples which show the similarity between y and d .
+
+ 'y''w' YANK to the beginning of the next WORD
+ 'y''$' YANK to the end of the line
+ 'y'')' YANK to the beginning of the next sentence
+ 'y''t'e YANK 'TIL the next e
+ 'y''y' YANK a line
+
+Here are some more examples using commands from tutorial #2.
+
+ 'y''L' YANK from here to the lowest point of the window
+ 'y''/'and YANK from here to the word "and"
+ 'y''2''}' YANK 2 paragraphs
+ 'y''''a YANK from here to the marked line "a" (mark line first)
+
+>>> Experiment with 'y''w' 'y''t'e 'y''4''w' 'y''2''}' 'y''3''y' and 'y''$' on the paragraph
+>>> provided below. Copy text AND use 'p' or 'P' to paste it.
+
+ PRACTICE line. Copy and Paste this line to the bottom of the
+ paragraph. Here is some filler, feel free to copy and paste
+ the text in this practice region. Remember that u undoes the
+ last action. END OF PRACTICE
+
+
+NUMBERED BUFFERS
+----------------
+In all of the previous pasting exercises you've used the "un-named"
+buffer. The un-named buffer contains the text you most recently cut or
+copied. When you make a new cut or copy, the old contents of the
+un-named buffer are moved to one of the "numbered" buffers. The
+buffers are numbered 1-9. Each time you cut or copy text,
+
+ vi saves your current cut or copy in a buffer #1
+ vi saves your 2nd to last cut or copy in a buffer #2
+ The cut or copy before that is saved in a buffer #3 ...
+ vi saves your 8th oldest cut or copy in a buffer #8
+ vi saves your 9th oldest cut or copy in a buffer #9
+
+Note that buffer #1 is the same as the un-named buffer. Here's how to
+paste from the numbered buffers:
+
+ "#P (upper p) PUT contents of buffer # before the cursor
+ "#p (lower p) PUT contents of buffer # after the cursor
+
+For example:
+
+ "1p PUT buffer 1 after the cursor
+ "7p PUT buffer 7 after the cursor
+
+>>> Delete this 1st line with dd
+>>> Delete this 2nd line with dd
+>>> Delete this 3rd block with d2d
+>>> (2nd half of block 3)
+>>> Delete this 4th block with dd
+>>> Now type "1p "2p "3p "4p
+
+If you are using vi and have made accidental deletions, just PUT the
+contents of each numbered buffer to recover the deleted text.
+
+
+NAMED BUFFERS
+-------------
+vi maintains the un-named and numbered buffers automatically. You can
+maintain your own buffers named a-z. That is, you can cut or copy text
+into buffer x and later paste the text from buffer x.
+
+ '"'aDELETE DELETE text into buffer a
+ "aYANK YANK text into buffer a
+ "aPUT PUT text from buffer a
+
+Note, don't actually type 'DELETE', 'YANK', or 'PUT'; type one of the
+DELETE commands, YANK commands, or PUT commands. See the examples below:
+
+ "ad} DELETE paragraph into buffer a
+ "by3y YANK 3 lines into buffer b
+ "cy200G YANK to line 200 into buffer c
+ "dp PUT buffer d after the cursor
+ "zP PUT buffer z before the cursor
+
+The contents of a named buffer are lost if:
+ 1) you store new text in a buffer with the same name
+ or 2) you quit vi (using 'Z''Z' or :q!<RETURN> )
+
+>>> Delete this START line into buffer a by typing "add
+>>> Paste buffer a by typing "ap
+
+>>> Delete this INTERMEDIATE line into buffer b by typing "bdd
+>>> Paste buffer b by typing "bp
+
+To put new material into buffer a
+>>> Delete this FINAL line into buffer a by typing "add
+>>> Paste buffer a by typing "ap
+
+
+SAVING WITHOUT QUITTING
+-----------------------
+With ZZ you save changes and kill the current buffer. (In vi you also
+exit with 'Z''Z'.) With :w you can save and not quit vi. It is a safe
+practice to save changes to a file regularly. This reduces re-typing
+in the event your computer crashes.
+
+ :w<RETURN> WRITE contents of the file (without quitting)
+ (type a colon, type w , then press the RETURN key)
+
+>>> Try :w now. Note the message at the bottom of the screen.
+
+
+PASTING BETWEEN FILES
+---------------------
+
+* EMACS-NOTICE: In Emacs there are no problems editing several
+ files. You can however do it in the more complicated vi way below if
+ you really want to ;-)
+
+This is an extremely useful procedure in vi. Only one new command is
+required for pasting between files, the EDIT command
+
+ :e filename<RETURN> Begin EDITing the file called "filename"
+
+The EDIT command allows you to edit another file without quitting vi.
+This is useful since named buffers are lost when you quit vi.
+
+Let's say you want to copy 6 lines from the file called "3temp" into
+this file which is named "3cutpaste":
+(Note that "3temp" has already been created for you)
+
+ 1) WRITE "3cutpaste". vi will not allow :w (press RETURN)
+ you to edit another file without first
+ saving any changes you've made.
+
+ 2) EDIT "3temp" without quitting vi. :e 3temp (press RETURN)
+
+ 3) YANK 6 lines from "3temp". "ay6y
+
+ 4) Return to "3cutpaste". :e 3cutpaste (press RETURN)
+
+ 5) PUT from buffer a "ap
+
+Note that the un-named and numbered buffers are lost when the EDIT
+command is used. Only named buffers are preserved with EDIT.
+
+>>> Follow the 5-step procedure outlined above. Don't be concerned
+>>> with remembering all 5 steps, the instructions are repeated in
+>>> "3temp". Paste the text from "3temp" near this line of this file,
+>>> "3cutpaste".
+
+You can use this 5-step procedure on any two files, with any cutting or
+copying action (here, y6y is the example).
+
+
+SUMMARY
+-------
+
+ #movement repeat movement # times
+ * EMACS-NOTICE: You may also use 'r' or 'R' in Viper.
+
+ 'd'movement DELETE to where "movement" command specifies
+ 'd'#movement DELETE to where the #movement command specifies
+ (e.g. 'd''w' 'd''3''w' )
+
+ 'y'movement YANK to where "movement" command specifies
+ 'y'#movement YANK to where the #movement command specifies
+ (e.g. 'y''w' 'y''3''w' )
+
+ 'P' (upper p) PUT the contents of the buffer before the cursor
+ 'p' (lower p) PUT the contents of the buffer after the cursor
+
+ '"'#P (upper p) PUT contents of buffer # before the cursor
+ '"'#p (lower p) PUT contents of buffer # after the cursor
+ (e.g. '"''2''p' '"''7''P' )
+
+ '"'aDELETE DELETE text into buffer a
+ '"'aYANK YANK text into buffer a
+ '"'aPUT PUT text from named buffer a
+ (Note, don't actually type 'DELETE', 'YANK', or 'PUT';
+ type one of the DELETE commands, YANK commands, or PUT
+ commands, e.g. '"''a''d''}' '"''b''y''3''y' '"''c''y''2''0''0''G' '"''d''p' '"''z''P' )
+
+ :w<RETURN> WRITE contents of the file (without quitting)
+ (type a colon, type w , then press the RETURN key)
+
+ :e filename<RETURN> Begin EDITing the file called "filename"
+
+
+You are now prepared to handle all cutting, copying and pasting tasks
+which may arise. If you practice what you've learned you'll find editing
+in vi to be fast and convenient.
+
+Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved.
diff --git a/elisp/nxhtml/etc/viper-tut/4inserting b/elisp/nxhtml/etc/viper-tut/4inserting
new file mode 100644
index 0000000..ab2c6a5
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/4inserting
@@ -0,0 +1,180 @@
+Viper tutorial #4: Insertion Techniques
+
+This lesson lasts 5-10 minutes. This tutorial assumes full knowledge
+of tutorial #1, and familiarity with tutorial #2. Lines which begin
+with >>> mark exercises you should try. When you want to exit this
+tutorial type 'Z''Z' .
+
+
+SIMPLE INSERTION
+----------------
+You spend most of your time in vi inserting text. As you might expect,
+there are several commands to begin insertion.
+
+ 'o' OPEN a line below the cursor
+ 'O' OPEN a line above the cursor
+
+ 'i' INSERT starting before the cursor
+ 'I' INSERT at the beginning of the line
+
+ 'a' APPEND starting after the cursor
+ 'A' APPEND at the end of the line
+
+Remember to type ESC to leave insert mode. If you don't have an ESC key
+type C-[ (control [ ).
+
+ ESC ESCAPE from insert mode
+
+>>> Move the cursor to this line. Type 'O' , enter your name. Press ESC.
+>>> Next type 'o' , enter the date. Press ESC.
+
+Note that 'O' opens the line above and puts you in insert mode,
+while 'o' opens the line below and also puts you in insert mode.
+
+>>> Type 'a' on any line above, enter your name. Press ESC. Do the
+>>> same for 'A'.
+
+>>> Read the following. Your goal is to take the sentence fragment below:
+
+ BROWN FOX OVER THE SEVEN LAZY
+
+>>> and convert it to
+
+ THE QUICK BROWN FOX JUMPED OVER THE SEVEN LAZY DOGS.
+
+>>> To do this type:
+>>> 'I' to insert THE QUICK (then press ESC)
+>>> move the cursor to after the X in FOX
+>>> 'a' to insert JUMPED (then press ESC)
+>>> 'A' to insert DOGS. (then press ESC)
+>>> Now move to the sentence fragment and make the changes outlined above.
+
+
+JOINING LINES
+-------------
+Often it is convenient to join two short lines into one line. There
+are several ways to do this. The easiest is the J command. Other
+methods will be explored in tutorial #5.
+
+ 'J' JOIN two lines
+
+>>> Go to the first line in the block below. Type J. Type J again.
+
+ Example: NOW IS THE TIME
+ the walrus said
+ TO THINK OF MANY THINGS
+
+In the event that joining lines creates a line which exceeds the width
+of the screen, you can break the line by typing i and pressing RETURN.
+
+
+SUBSTITUTING TEXT
+-----------------
+Substituting combines the delete command and the insert command into a
+single step.
+
+ #'s' SUBSTITUTE for # characters
+ #'S' SUBSTITUTE for # whole lines
+
+
+In order to substitute text you have to know how much text you want to
+delete. Consider the following examples:
+
+ '3''s' SUBSTITUTE the next 3 characters for what will be typed
+ '7''s' SUBSTITUTE the next 7 characters for what will be typed
+
+>>> Change the SAMPLE DEFINITION below. To do this:
+>>> move the cursor to the T in TWO
+>>> type '3's
+>>> type FOUR then press ESC
+
+ SAMPLE DEFINITION: A string quartet is defined to be
+ a group of TWO musicians.
+
+
+REPLACING TEXT
+--------------
+The 'r' and 'R' commands allow you to directly type over existing text.
+
+ 'r' REPLACE character (NO need to press ESC)
+ 'R' enter over-type mode
+
+>>> Correct each of the TYPOs on the sample line below. To do this:
+>>> move the cursor to the misspelled character
+>>> type 'r'
+>>> type the correct character
+
+ SAMPLE: maintanence conveniance complience applience dilagent
+
+>>> Use the over-type command, 'R' , on the sample line above.
+>>> Type 'R' then type the name of a local restaurant. Press ESC.
+
+
+CHANGING TEXT
+-------------
+The change command combines insertion, deletion, and the movement
+commands. (Recall that the movement commands were taught in tutorial
+#2.) Change is probably more useful than replace or substitute. The
+general form of the change command is:
+
+ 'c'movement CHANGE to where the movement command specifies
+
+Consider the following examples:
+
+ 'c''w' CHANGE to the beginning of the next WORD
+ 'c''$' CHANGE to the end of the line
+ 'c'')' CHANGE to the beginning of the next sentence
+ 'c''t'e CHANGE 'TIL the next e
+ 'c''3''w' CHANGE the next 3 WORDS
+ 'c''c' CHANGE a line (cc is a special case of the c command)
+ 'c''}' CHANGE to the end of the paragraph
+
+>>> Follow these steps:
+>>> 1. move to the desired location in the practice paragraph below
+>>> 2. type 'c''w' (change to the beginning of the next WORD)
+>>> 3. type your name
+>>> 4. press ESC
+
+ PRACTICE here. Now is the time for all good users to learn the
+ editor. The quick red fox jumped over the seven lazy fish. Now
+ is the time for all good users to learn the editor. The quick
+ brown computer jumped over the seven lazy users. END PRACTICE
+
+>>> Experiment by using a variety of options for step #2. Try
+>>> out 'c''$' 'c'')' 'c''t'e 'c''3''w' 'c''c' 'c''}' on the practice paragraph above.
+
+Note that the change command follows the same pattern as the delete
+and yank commands which were explored in tutorial #3.
+
+
+SUMMARY
+-------
+
+ 'o' OPEN a line below the cursor
+ 'O' OPEN a line above the cursor
+
+ 'i' INSERT starting before the cursor
+ 'I' INSERT at the beginning of the line
+
+ 'a' APPEND starting after the cursor
+ 'A' APPEND at the end of the line
+
+ ESC ESCAPE from insert mode
+
+ 'J' JOIN two lines
+
+ #'s' SUBSTITUTE for # characters
+ #'S' SUBSTITUTE for # whole lines
+
+ 'r' REPLACE character (NO need to press ESC)
+ 'R' enter over-type mode
+
+ 'c'movement CHANGE to where the movement commands specifies
+ (e.g. 'c''3''w' 'c''$' 'c''c' )
+
+
+These commands should improve your ability to insert text efficiently.
+The next tutorials deal with advanced commands and tricks which can
+further speed up your editing.
+
+Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved.
diff --git a/elisp/nxhtml/etc/viper-tut/5tricks b/elisp/nxhtml/etc/viper-tut/5tricks
new file mode 100644
index 0000000..c1e414e
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/5tricks
@@ -0,0 +1,229 @@
+Viper tutorial #5: Tricks and Timesavers
+
+This lesson lasts 10-15 minutes. You should have a strong
+understanding of tutorials #1-3 before working through these timesaving
+techniques. Lines which begin with >>> mark exercises you should
+try. When you want to exit this tutorial type 'Z''Z' .
+
+
+CASE CONVERSION
+---------------
+When you want to change an upper-case character to a lower-case
+character (or lower-case to upper-case) there is a single command which
+does both:
+
+ '~' (tilde) Convert case of current character
+
+>>> Move the cursor to be OVER the first character in the example
+>>> line below. Press '~' until you have changed the case of the
+>>> entire line. ( '~' will advance to the right automatically).
+
+ bOB WENT TO pARIS, fRANCE, TO SEE THE #1 CYCLING EVENT. end.
+
+Note that '~' only affects alphabetic characters.
+
+
+UNDOING
+-------
+* EMACS-NOTICE: Uppercase U does the same thing as lowercase u in
+ Viper so this part of the tutorial which was about U has been
+ removed.
+
+
+REPEAT LAST COMMAND
+-------------------
+Often you want to make the same change at multiple locations in the
+file. To help accomplish this, vi remembers your previous action.
+
+ '.' (dot) repeat last change
+
+>>> Go through the example below changing "FISH" to "TOAD":
+>>> Go to the "F" in the first instance of "FISH"
+>>> To change the word: type 'c''w' then type TOAD then press ESC
+>>> Move the cursor to "F" in the second occurence of "FISH"
+>>> Type '.' (dot)
+>>> Move the cursor to "F" in the final occurence of "FISH"
+>>> Type '.' (dot)
+>>> Now move the cursor to each occurence of "CROW"; Type '.' (dot)
+
+ EXAMPLE: The FISH fed the cat. The CROW fed the cat. Example
+ text is FISH to make interesting. The man fed the CROW. The
+ worm fed the FISH. Example text is hard to make CROW. END.
+
+>>> Go through the example above deleting all occurences of "TOAD":
+>>> Move to the beginning of the EXAMPLE paragraph above.
+>>> Type '/''T''O''A''D' and press RETURN (recall tutorial #2)
+>>> Delete the word by typing 'd''w'
+>>> Type 'n' to move to the next occurence of "TOAD"
+>>> Type '.' (dot) to repeat the dw command
+>>> Use 'n''.' to delete the remaining "TOAD"s
+
+Note that '.' only repeats changes, not cursor movements.
+
+* EMACS-NOTICE: In Emacs '.' also repeat undo and redo.
+
+* EMACS-NOTICE: Emacs KEYBOARD-MACROS are very powerful for repeating
+ whole sequences of keyboard commands.
+
+
+WINDOW ACTIONS
+--------------
+You are already familiar with the C-u (depress the control key and
+type u) and C-d commands from tutorial #1.
+
+ C-d Move DOWN one half-screen
+ C-u Move UP one half-screen
+
+There are several related commands:
+
+ C-f Move FORWARD one full-screen
+ C-b Move BACKWARD one full-screen
+
+ C-e Move the window down one line without moving cursor
+ C-y Move the window up one line without moving cursor
+
+The C-e and C-y commands may seem obscure; however, notice that on
+the keyboard, e and y are close to d and u respectively. This
+should help you remember that C-e moves DOWN, and C-y moves UP.
+
+Recall the 'H' 'M' 'L' (HIGH MIDDLE LOW) window commands from Tutorial 2.
+Consider a scenario where you want to yank from the current line to a
+line near the top of the window. You could use C-e and C-y to
+position the text in the window before you use the yH command.
+
+The 'z' command also moves the window without moving your cursor:
+
+ 'z'<RETURN> Position the current line to top of window
+ 'z''.' Position the current line to middle of window
+ 'z''-' Position the current line to bottom of window
+
+>>> Move to this line. Type 'z' and press RETURN. Notice that
+>>> this text and the cursor have moved to the top of the window.
+>>> Try 'z''-' and 'z''.' also.
+
+
+FILE AND DISPLAY CONTROL
+------------------------
+
+* EMACS-NOTICE: In vi C-g shows the status of the current file, but
+ C-g in Emacs in most situation stops what Emacs is doing. To get
+ information about the current file you can use C-c C-g instead when
+ Viper is in vi state.
+
+* EMACS-NOTICE: In vi C-l refreshes the screen, but C-l in Emacs calls
+ the command recenter.
+
+
+SUSPENDING VI
+-------------
+* EMACS-NOTICE: In vi C-z suspends vi. However in Viper C-z is by
+ default the VIPER-TOGGLE-KEY. To suspend or iconify Emacs use C-x
+ C-z.
+
+
+BANG COMMAND
+------------
+* EMACS-NOTICE: Emacs has builtin commands to sort etc.
+
+The exclamation point, '!' (aka BANG), command allows you to feed text
+to any Unix command. The output of the Unix command replaces the
+original text. Here is a useful Unix command to use from within vi:
+
+ !}fmt Format the paragraph, joining and filling lines to
+ produce output lines of up to 72 characters
+
+>>> Move to the example paragraph below. Type !}fmt and press
+>>> RETURN. Notice the paragraph will be reformatted such that
+>>> the lines are of approximately equal length.
+
+ EXAMPLE:
+ So we grow together,
+ Like to a double cherry, seeming parted,
+ But yet an union in partition;
+ Two lovely berries moulded on one stem;
+ So, with two seeming bodies, but one heart;
+ END.
+
+Another useful command is:
+
+ !}sort Sort lines of a paragraph alphabetically
+
+>>> Move to the example text below. Type !}sort and press RETURN.
+
+ OBERON king of the fairies.
+ PUCK or Robin Goodfellow.
+ HERMIA daughter to Egeus, in love with Lysander.
+ HELENA in love with Demetrius.
+ LYSANDER in love with Hermia.
+ DEMETRIUS in love with Hermia.
+
+Remember, any Unix command may be used this way.
+
+
+SHIFTING TEXT
+-------------
+It is possible to shift large blocks of text right and left with the '>'
+and '<' commands.
+
+ '>'movement Shift right to where the movement command specifies
+ '<'movement Shift left to where the movement command specifies
+
+These commands work like the 'd' command. For example:
+
+ '>''}' Shift right to the end of the paragraph
+ '<''}' Shift left to the end of the paragraph
+ '>''>' Shift the current line right
+ '<''<' Shift the current line left
+
+>>> Move the cursor to the first line of the paragraph below.
+>>> Type '>''>' and '<''<' to shift the line back and forth. Next
+>>> try '>''}' to shift the paragraph to the right, then '<''}' to shift
+>>> it left, then type '.' until all four lines start at the left edge.
+
+ THIS IS THE FIRST LINE OF EXAMPLE TEXT
+ IS
+ EXAMPLE
+ TEXT END
+
+
+SUMMARY
+-------
+
+ '~' (tilde) Convert case of current character
+
+ 'U' * EMACS-NOTICE: Same as lowercase u undo in Viper.
+
+ '.' (dot) repeat last change
+
+ C-d Move DOWN one half-screen
+ (depress the control key and type d)
+
+ C-u Move UP one half-screen
+ (depress the control key and type u)
+
+ C-f Move FORWARD one full-screen
+ C-b Move BACKWARD one full-screen
+
+ C-e Move the window down one line without moving cursor
+ C-y Move the window up one line without moving cursor
+
+ 'z'<RETURN> Position the current line to top of window
+ 'z''.' Position the current line to middle of window
+ 'z''-' Position the current line to bottom of window
+
+ C-c C-g Show status of current file
+ C-l Recenter
+
+ '!'}fmt Format the paragraph, joining and filling lines to
+ produce output lines of up to 72 characters
+
+ '!'}sort Sort lines of a paragraph alphabetically
+
+ '>'movement Shift right to where the movement command specifies
+ '<'movement Shift left to where the movement command specifies
+
+
+These commands should significantly speed up your editing. Have a nice
+day. Tutorial 6 contains even more nifty commands.
+
+Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved.
diff --git a/elisp/nxhtml/etc/viper-tut/README b/elisp/nxhtml/etc/viper-tut/README
new file mode 100644
index 0000000..dd39176
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/README
@@ -0,0 +1,49 @@
+Viper Tutorial README
+=====================
+
+To install the Viper tutorial you must do two things:
+
+1) Put viper-tutorial.el in your Emacs load-path.
+
+2) Put the tutorial files (0intro, 1basics etc) in subdirectory to
+ where you put viper-tutorial.el with the name viper-tut.
+ Optionally you may put those file any where and customize the
+ option viper-tut-directory.
+
+The tutorial is started by
+
+ M-x viper-tutorial RET
+
+
+
+
+Viper tutorial is based on vilearn version 1.0 which was downloaded
+from http://vilearn.org.
+
+Below is the original readme from vilearn. Note that the only part
+that applies here is the copyright notice.
+
+---------------------------------------------------
+This is version 1.0 of vilearn, an interactive vi tutorial.
+
+Copyright (c) 1992 Jill Kliger and Wesley Craig. All Rights Reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appears in all copies and that
+the copyright notice, this permission notice, and an explicit record of
+any local changes, appear in supporting documentation. This software
+is supplied as is without expressed or implied warranties of any kind.
+
+To install, edit the Makefile and type
+
+ make install
+
+We have a mailing list, vilearn-admins@terminator.rs.itd.umich.edu. To
+be added to the list, send mail to vilearn-admins-request. The list is
+intended to discuss the tutorials, coordinate projects relating to
+them, and provide help to those who may need it.
+
+Wesley Craig & Jill Kliger
+1317 Packard Street vilearn@terminator.rs.itd.umich.edu
+Ann Arbor, MI 48104
diff --git a/elisp/nxhtml/etc/viper-tut/outline b/elisp/nxhtml/etc/viper-tut/outline
new file mode 100644
index 0000000..9eaa3e4
--- /dev/null
+++ b/elisp/nxhtml/etc/viper-tut/outline
@@ -0,0 +1,131 @@
+
+*
+* tutorial 1 FILENAME: 1basics
+* basics
+*
+
+C-d down
+C-u up
+
+h left
+j down
+k up
+l right
+
+dd delete line
+x x-out character
+
+u undo
+
+:q! force quit
+ZZ good bye
+
+o open
+i insert
+
+*
+* tutorial 2 FILENAME: 2moving
+* objects, finds & marks
+*
+
+w W word
+b B back
+e E end
+
+{ } paragraph
+( ) sentence
+[ ] sections
+
+$ end of line
+^ first non-white
+| column
+0 beginning of line
+
+f F find
+t T to
+; repeat fFtT
+, reverse fFtT
+
+G goto
+
+H high
+M middle
+L low
+
+n N next
+? / regex
+
+% match
+
+' move to marked line
+m mark
+
+
+*
+* tutorial 3 FILENAME: 3cutpaste & 3temp
+*
+* cutting, pasting, buffers, and files
+*
+
+d D deletes
+y Y yank
+p P put
+" buffer
+:e edit
+
+*
+* tutorial 4 FILENAME: 4inserting
+* insertion
+*
+
+a A append
+c C change
+i I insert
+o O open
+r R replace
+s S substitute
+
+J join
+
+*
+* tutorial 5 FILENAME: 5tricks
+* tricks
+*
+
+~ case
+
+u U undo
+
+. do again
+
+C-b back
+C-f forward
+C-e down line
+C-y up line
+z zero
+
+C-g status
+C-l refresh
+
+C-z suspend
+
+C-t pop tag proposed
+C-] follow tag proposed
+
+! command
+
+< > shift
+
+*
+* tutorial 6 PROPOSED
+* commands from hell
+*
+
+: colon commands
+Q quit
+C-r redraw
+@ execute buffer as macro
+& like :&
+
+C-t shift (insert)
+C-d unshift (insert)
diff --git a/elisp/nxhtml/nxhtml-base.el b/elisp/nxhtml/nxhtml-base.el
new file mode 100644
index 0000000..d768a5e
--- /dev/null
+++ b/elisp/nxhtml/nxhtml-base.el
@@ -0,0 +1,150 @@
+;;; nxhtml-base.el --- The very, very basic vars...
+;;
+;; Author: Lennart Borgman (lennart O borgman A gmail O com)
+;; Created: 2010-01-13 Wed
+;; Version:
+;; Last-Updated:
+;; URL:
+;; Keywords:
+;; Compatibility:
+;;
+;; Features that might be required by this library:
+;;
+;; None
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;; Things that always must be loaded and that are often necessary when
+;; byte compiling.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Change log:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; 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 3, 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., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+;;(eval-when-compile (require 'web-vcs nil t))
+(eval-when-compile (require 'flymake-js nil t))
+(eval-when-compile (require 'flymake-css nil t))
+(eval-when-compile (require 'flymake-java-1 nil t))
+
+(defconst nxhtml-menu:version "2.08")
+(setq message-log-max t)
+(setq debug-on-error t)
+
+(defconst nxhtml-install-dir
+ (file-name-directory (or load-file-name
+ (when (boundp 'bytecomp-filename) bytecomp-filename)
+ buffer-file-name))
+ "Installation directory for nXhtml.")
+
+(define-minor-mode nxhtml-autoload-web
+ "If on download elisp files from web when they are needed.
+If t then during `require' nXhtml elisp files can be downloaded
+from the nXhtml repository on the web. This will currently
+download the development sources, latest version.
+
+Other files that are used by a command may also be downloaded.
+
+Note that files are not updated automatically. You have to use
+`nxhtml-update-existing-files' for that."
+ :global t
+ ;;:lighter (propertize " nX" 'face 'font-lock-comment-face)
+ :lighter " nX"
+ :group 'nxhtml)
+
+(defun nxhtml-autoload (fun src &optional docstring interactive type)
+ "Generalized `autoload'. May setup autoload from the web.
+If `nxhtml-autoload-web' is t then setup autoloading from the web.
+Otherwise setup for normal local autoloading."
+ (if nxhtml-autoload-web
+ (progn
+ ;; Do not require this until we really need it.
+ (require 'web-autoload)
+ (web-autoload fun src docstring interactive type))
+ (let ((file src))
+ (when (listp file)
+ (setq file (file-name-nondirectory (nth 2 file))))
+ (autoload fun file docstring interactive type))))
+
+;; Fix-me: web autoload defcustoms.
+;;
+;; I have no good idea how to fix this. It looks like I have to
+;; defadvice `custom-load-symbol'. I thought that should not be
+;; necessary since it does (require load) on line 605 but the web
+;; autoload does not start. Why? Hm, you never know since it is inside
+;; a (condition-case nil ...).
+;;
+;; Ah, found it. The require is only done if custom loads contains a
+;; symbol, not a string. So I changed this to a symbol instead in
+;; nxhtml-loaddefs.el. Maybe `load' instead of `require' should be
+;; advised?
+
+;; What a hell is this below? Have things been rewritten in custom or
+;; did I mix somethintg?
+(defun nxhtml-custom-autoload (symbol load &optional noset)
+ "Like `custom-autoload', but also run :set for defcustoms etc."
+ ;; Fix-me: is-boundp is currently always t because of the order in
+ ;; loaddefs. Hm, so this worked just by chance...
+ (let* ((is-boundp (prog1 (boundp symbol)
+ (custom-autoload symbol load noset)))
+ (standard (get symbol 'standard-value))
+ (saved (get symbol 'saved-value))
+ ;; Fix-me: property custom-set etc are not available
+ (custom-set (get symbol 'custom-set))
+ (custom-initialize (get symbol 'custom-initialize))
+ (set (or custom-set 'custom-set-default))) ;; Fix-me: initialize
+ (setq custom-set t) ;; Not available here
+ (when (or custom-initialize
+ (and saved
+ (not (equal (car saved) (symbol-value symbol)))
+ custom-set))
+ (funcall set symbol (car saved))
+ (custom-load-symbol symbol))))
+
+(defun flymake-init-load-flymakemsg ()
+ (require 'flymakemsg))
+
+(define-minor-mode nxhtml-flymake-setup
+ "Let nXhtml add some addtions to flymake.
+This adds support for CSS and JavaScript files.
+
+It also adds showing of errors in minibuffer when point is on
+them.
+
+If you turn this off you must restart Emacs for it to take
+effect."
+ :group 'nxhtml
+ :group 'flymake
+ (when nxhtml-flymake-setup
+ (flymake-js-load)
+ (flymake-css-load)
+ (flymake-java-1-load)
+ (add-hook 'flymake-mode-hook 'flymake-init-load-flymakemsg)))
+
+
+(provide 'nxhtml-base)
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; nxhtml-base.el ends here
diff --git a/elisp/nxhtml/nxhtml-loaddefs.el b/elisp/nxhtml/nxhtml-loaddefs.el
new file mode 100644
index 0000000..bfa98ee
--- /dev/null
+++ b/elisp/nxhtml/nxhtml-loaddefs.el
@@ -0,0 +1,4490 @@
+;; Autoloads for nXthml
+;;
+;; This file should be updated by `nxhtmlmaint-get-file-autoloads',
+;; `nxhtmlmaint-get-dir-autoloads' or `nxhtmlmaint-get-all-autoloads'.
+(eval-when-compile (require 'nxhtml-base))
+(eval-when-compile (require 'web-vcs))
+
+;;;### (autoloads (cancel-secondary-selection set-secondary-selection
+;;;;;; anchored-transpose) "anchored-transpose" "util/anchored-transpose.el"
+;;;;;; (19333 54924))
+;;; Generated autoloads from util/anchored-transpose.el
+(web-autoload-require 'anchored-transpose 'lp '(nxhtml-download-root-url nil) "util/anchored-transpose" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'anchored-transpose `(lp '(nxhtml-download-root-url nil) "util/anchored-transpose" nxhtml-install-dir) "\
+Transpose portions of the region around an anchor phrase.
+
+`this phrase but not that word' can be transposed into
+`that word but not this phrase'
+
+I want this phrase but not that word.
+ |----------------------------|. .This is the entire phrase.
+ |-------|. . . . . . .This is the anchor phrase.
+
+First select the entire phrase and type \\[anchored-transpose].
+This set the secondary selection.
+
+Then select the anchor phrase and type \\[anchored-transpose]
+again. Alternatively you can do the selections like this:
+
+I want this phrase but not that word.
+ |----------| |---------| Separate phrase selection.
+
+By default the anchor phrase will automatically include
+any surrounding whitespace even if you don't explicitly select
+it. Also, it won't include certain trailing punctuation. See
+`anchored-transpose-do-fuzzy' for details. A prefix arg prior to
+either selection means `no fuzzy logic, use selections
+literally'.
+
+You can select the regions to be swapped separately in any
+order.
+
+After swapping both primary and secondary selection are still
+active. They will be canceled after second next command if you
+do not swap regions again. (Second because this allow you to
+adjust the regions and try again.)
+
+You can also swap text between different buffers this way.
+
+Typing \\[anchored-transpose] with nothing selected clears any
+prior selection, ie secondary selection.
+
+\(fn BEG1 END1 FLG1 &optional BEG2 END2 FLG2 WIN2)" t nil)
+
+(nxhtml-autoload 'set-secondary-selection `(lp '(nxhtml-download-root-url nil) "util/anchored-transpose" nxhtml-install-dir) "\
+Set the secondary selection to the current region.
+This must be bound to a mouse drag event.
+
+\(fn BEG END)" t nil)
+
+(nxhtml-autoload 'cancel-secondary-selection `(lp '(nxhtml-download-root-url nil) "util/anchored-transpose" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (appmenu-mode appmenu-add appmenu) "appmenu" "util/appmenu.el"
+;;;;;; (19275 63380))
+;;; Generated autoloads from util/appmenu.el
+(web-autoload-require 'appmenu 'lp '(nxhtml-download-root-url nil) "util/appmenu" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'appmenu 'custom-loads))) (if (member '"appmenu" loads) nil (put 'appmenu 'custom-loads (cons '"appmenu" loads))))
+
+(nxhtml-autoload 'appmenu-add `(lp '(nxhtml-download-root-url nil) "util/appmenu" nxhtml-install-dir) "\
+Add entry to `appmenu-alist'.
+Add an entry to this list with ID, PRIORITY, TEST, TITLE and
+DEFINITION as explained there.
+
+\(fn ID PRIORITY TEST TITLE DEFINITION)" nil nil)
+
+(defvar appmenu-mode nil "\
+Non-nil if Appmenu mode is enabled.
+See the command `appmenu-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `appmenu-mode'.")
+
+(nxhtml-custom-autoload 'appmenu-mode 'appmenu nil)
+
+(nxhtml-autoload 'appmenu-mode `(lp '(nxhtml-download-root-url nil) "util/appmenu" nxhtml-install-dir) "\
+Use a context sensitive popup menu.
+AppMenu (appmenu.el) is a framework for creating cooperative
+context sensitive popup menus with commands from different major
+and minor modes. Using this different modes may cooperate about
+the use of popup menus.
+
+There is also the command `appmenu-as-help' that shows the key
+bindings at current point in the help buffer.
+
+The popup menu and the help buffer version are on these keys:
+
+\\{appmenu-mode-map}
+
+The variable `appmenu-alist' is where the popup menu entries
+comes from.
+
+If there is a `keymap' property at point then relevant bindings
+from this is also shown in the popup menu.
+
+You can write functions that use whatever information you want in
+Emacs to construct these entries. Since this information is only
+collected when the popup menu is shown you do not have to care as
+much about computation time as for entries in the menu bar.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (as-external-mode as-external-for-wiki as-external-for-mail-mode
+;;;;;; as-external-for-xhtml as-external) "as-external" "util/as-external.el"
+;;;;;; (19292 49706))
+;;; Generated autoloads from util/as-external.el
+(web-autoload-require 'as-external 'lp '(nxhtml-download-root-url nil) "util/as-external" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'as-external 'custom-loads))) (if (member '"as-external" loads) nil (put 'as-external 'custom-loads (cons '"as-external" loads))))
+
+(nxhtml-autoload 'as-external-for-xhtml `(lp '(nxhtml-download-root-url nil) "util/as-external" nxhtml-install-dir) "\
+Setup for Firefox addon It's All Text to edit XHTML.
+It's All Text is a Firefox add-on for editing textareas with an
+external editor.
+See URL `https://addons.mozilla.org/en-US/firefox/addon/4125'.
+
+In this case Emacs is used to edit textarea fields on a web page.
+The text will most often be part of a web page later, like on a
+blog. Therefore turn on these:
+
+- `nxhtml-mode' since some XHTML tags may be allowed.
+- `nxhtml-validation-header-mode' since it is not a full page.
+- `wrap-to-fill-column-mode' to see what you are writing.
+- `html-write-mode' to see it even better.
+
+Also bypass the question for line end conversion when using
+emacsw32-eol.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'as-external-for-mail-mode `(lp '(nxhtml-download-root-url nil) "util/as-external" nxhtml-install-dir) "\
+Setup for Firefox addon It's All Text to edit mail.
+Set normal mail comment markers in column 1 (ie >).
+
+Set `fill-column' to 90 and enable `wrap-to-fill-column-mode' so
+that it will look similar to how it will look in the sent plain
+text mail.
+
+See also `as-external-mode'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'as-external-for-wiki `(lp '(nxhtml-download-root-url nil) "util/as-external" nxhtml-install-dir) "\
+Setup for Firefox addon It's All Text to edit MediaWikis.
+
+\(fn)" t nil)
+
+(defvar as-external-mode nil "\
+Non-nil if As-External mode is enabled.
+See the command `as-external-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `as-external-mode'.")
+
+(nxhtml-custom-autoload 'as-external-mode 'as-external nil)
+
+(nxhtml-autoload 'as-external-mode `(lp '(nxhtml-download-root-url nil) "util/as-external" nxhtml-install-dir) "\
+If non-nil check if Emacs is called as external editor.
+When Emacs is called as an external editor for example to edit
+text areas on a web page viewed with Firefox this library tries
+to help to setup the buffer in a useful way. It may for example
+set major and minor modes for the buffer.
+
+This can for example be useful when blogging or writing comments
+on blogs.
+
+See `as-external-alist' for more information.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (buffer-bg-set-color) "buffer-bg" "util/buffer-bg.el"
+;;;;;; (19254 64104))
+;;; Generated autoloads from util/buffer-bg.el
+(web-autoload-require 'buffer-bg 'lp '(nxhtml-download-root-url nil) "util/buffer-bg" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'buffer-bg-set-color `(lp '(nxhtml-download-root-url nil) "util/buffer-bg" nxhtml-install-dir) "\
+Add an overlay with background color COLOR to buffer BUFFER.
+If COLOR is nil remove previously added overlay.
+
+\(fn COLOR BUFFER)" t nil)
+
+;;;***
+
+;;;### (autoloads (chartg-make-chart chartg-complete) "chartg" "util/chartg.el"
+;;;;;; (19278 15746))
+;;; Generated autoloads from util/chartg.el
+(web-autoload-require 'chartg 'lp '(nxhtml-download-root-url nil) "util/chartg" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'chartg-complete `(lp '(nxhtml-download-root-url nil) "util/chartg" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'chartg-make-chart `(lp '(nxhtml-download-root-url nil) "util/chartg" nxhtml-install-dir) "\
+Try to make a new chart.
+If region is active then make a new chart from data in the
+selected region.
+
+Else if current buffer is in `chartg-mode' then do it from the
+chart specifications in this buffer. Otherwise create a new
+buffer and initialize it with `chartg-mode'.
+
+If the chart specifications are complete enough to make a chart
+then do it and show the resulting chart image. If not then tell
+user what is missing.
+
+NOTE: This is beta, no alpha code. It is not ready.
+
+Below are some examples. To test them mark an example and do
+
+ M-x chartg-make-chart
+
+* Example, simple x-y chart:
+
+ Output-file: \"~/temp-chart.png\"
+ Size: 200 200
+ Data: 3 8 5 | 10 20 30
+ Type: line-chartg-xy
+
+* Example, pie:
+
+ Output-file: \"~/temp-depression.png\"
+ Size: 400 200
+ Data:
+ 2,160,000
+ 3,110,000
+ 1,510,000
+ 73,600
+ 775,000
+ 726,000
+ 8,180,000
+ 419,000
+ Type: pie-3-dimensional
+ Chartg-title: \"Depression hits on Google\"
+ Legends:
+ \"SSRI\"
+ | \"Psychotherapy\"
+ | \"CBT\"
+ | \"IPT\"
+ | \"Psychoanalysis\"
+ | \"Mindfulness\"
+ | \"Meditation\"
+ | \"Exercise\"
+
+
+* Example, pie:
+
+ Output-file: \"~/temp-panic.png\"
+ Size: 400 200
+ Data:
+ 979,000
+ 969,000
+ 500,000
+ 71,900
+ 193,000
+ 154,000
+ 2,500,000
+ 9,310,000
+ Type: pie-3-dimensional
+ Chartg-title: \"Depression hits on Google\"
+ Legends:
+ \"SSRI\"
+ | \"Psychotherapy\"
+ | \"CBT\"
+ | \"IPT\"
+ | \"Psychoanalysis\"
+ | \"Mindfulness\"
+ | \"Meditation\"
+ | \"Exercise\"
+
+
+* Example using raw:
+
+ Output-file: \"~/temp-chartg-slipsen-kostar.png\"
+ Size: 400 130
+ Data: 300 1000 30000
+ Type: bar-chartg-horizontal
+ Chartg-title: \"Vad killen i slips tjänar jämfört med dig och mig\"
+ Google-chartg-raw: \"&chds=0,30000&chco=00cd00|ff4500|483d8b&chxt=y,x&chxl=0:|Killen+i+slips|Partiledarna|Du+och+jag&chf=bg,s,ffd700\"
+
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (css-color-test css-color-global-mode css-color-mode
+;;;;;; css-color) "css-color" "util/css-color.el" (19386 34254))
+;;; Generated autoloads from util/css-color.el
+(web-autoload-require 'css-color 'lp '(nxhtml-download-root-url nil) "util/css-color" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'css-color 'custom-loads))) (if (member '"css-color" loads) nil (put 'css-color 'custom-loads (cons '"css-color" loads))))
+
+(nxhtml-autoload 'css-color-mode `(lp '(nxhtml-download-root-url nil) "util/css-color" nxhtml-install-dir) "\
+Show hex color literals with the given color as background.
+In this mode hexadecimal colour specifications like #6600ff are
+displayed with the specified colour as background.
+
+Certain keys are bound to special colour editing commands when
+point is at a hexadecimal colour:
+
+\\{css-color-map}
+
+\(fn &optional ARG)" t nil)
+
+(defvar css-color-global-mode nil "\
+Non-nil if Css-Color-Global mode is enabled.
+See the command `css-color-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `css-color-global-mode'.")
+
+(nxhtml-custom-autoload 'css-color-global-mode 'css-color nil)
+
+(nxhtml-autoload 'css-color-global-mode `(lp '(nxhtml-download-root-url nil) "util/css-color" nxhtml-install-dir) "\
+Toggle Css-Color mode in every possible buffer.
+With prefix ARG, turn Css-Color-Global mode on if and only if
+ARG is positive.
+Css-Color mode is enabled in all buffers where
+`css-color-turn-on-in-buffer' would do it.
+See `css-color-mode' for more information on Css-Color mode.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'css-color-test `(lp '(nxhtml-download-root-url nil) "util/css-color" nxhtml-install-dir) "\
+Test colors interactively.
+The colors are displayed in the echo area. You can specify the
+colors as any viable css color. Example:
+
+ red
+ #f00
+ #0C0
+ #b0ff00
+ hsla(100, 50%, 25%)
+ rgb(255,100,120)
+
+\(fn FG-COLOR BG-COLOR)" t nil)
+
+;;;***
+
+;;;### (autoloads (css-palette-global-mode css-palette css-palette-mode)
+;;;;;; "css-palette" "util/css-palette.el" (19235 1650))
+;;; Generated autoloads from util/css-palette.el
+(web-autoload-require 'css-palette 'lp '(nxhtml-download-root-url nil) "util/css-palette" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'css-palette-mode `(lp '(nxhtml-download-root-url nil) "util/css-palette" nxhtml-install-dir) "\
+Minor mode for palettes in CSS.
+
+The mode `css-palette-mode' acts on the first COLORS declaration in your
+ file of the form:
+
+COLORS:
+\(
+c0 \"#6f5d25\" ;tainted sand
+c1 \"#000000\" ;Black
+c2 \"#cca42b\" ;goldenslumber
+c3 \"#6889cb\" ;far off sky
+c4 \"#fff\" ;strange aeons
+)
+
+Such declarations should appear inside a block comment, in order
+ to be parsed properly by the LISP reader.
+
+Type \\[css-palette-update-all], and any occurence of
+
+ color: #f55; /*[c3]*/
+
+will be updated with
+
+ color: #6899cb; /*[c3]*/
+
+The following commands are available to insert key-value pairs
+ and palette declarations:
+ \\{css-palette-mode-map}
+
+You can extend or redefine the types of palettes by defining a
+ new palette specification of the form (PATTERN REGEXP
+ REF-FOLLOWS-VALUE), named according to the naming scheme
+ css-palette:my-type, where
+
+PATTERN is a pattern containing two (%s) format directives which
+ will be filled in with the variable and its value,
+
+REGEXP is a regular expression to match a value - variable
+ pattern,
+
+and REF-FOLLOWS-VALUE defined whether or not the reference comes
+ after the value. This allows for more flexibility.
+
+Note that, although the w3c spec at URL
+ `http://www.w3.org/TR/CSS2/syndata.html#comments' says that
+ comments \" may occur anywhere between tokens, and their
+ contents have no influence on the rendering\", Internet
+ Explorer does not think so. Better keep all your comments after
+ a \"statement\", as per the default. This means `css-palette'
+ is ill-suited for use within shorthands.
+
+See variable `css-palette:colors' for an example of a palette
+ type.
+
+The extension mechanism means that palette types can be used to
+ contain arbitrary key-value mappings.
+
+Besides the colors palette, css-palette defines the palette
+ definition variables `css-palette:colors-outside' and
+ `css-palette:files', for colors with the reference outside and
+ for file url()'s respectively.
+
+You can fine-control which palette types css-palette should look
+ at via the variable `css-palette-types'.
+
+\(fn &optional ARG)" t nil)
+
+(let ((loads (get 'css-palette 'custom-loads))) (if (member '"css-palette" loads) nil (put 'css-palette 'custom-loads (cons '"css-palette" loads))))
+
+(defvar css-palette-global-mode nil "\
+Non-nil if Css-Palette-Global mode is enabled.
+See the command `css-palette-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `css-palette-global-mode'.")
+
+(nxhtml-custom-autoload 'css-palette-global-mode 'css-palette nil)
+
+(nxhtml-autoload 'css-palette-global-mode `(lp '(nxhtml-download-root-url nil) "util/css-palette" nxhtml-install-dir) "\
+Toggle Css-Palette mode in every possible buffer.
+With prefix ARG, turn Css-Palette-Global mode on if and only if
+ARG is positive.
+Css-Palette mode is enabled in all buffers where
+`css-palette-turn-on-in-buffer' would do it.
+See `css-palette-mode' for more information on Css-Palette mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (cusnu-export-my-skin-options customize-for-new-user)
+;;;;;; "cus-new-user" "util/cus-new-user.el" (19173 56140))
+;;; Generated autoloads from util/cus-new-user.el
+(web-autoload-require 'cus-new-user 'lp '(nxhtml-download-root-url nil) "util/cus-new-user" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'customize-for-new-user `(lp '(nxhtml-download-root-url nil) "util/cus-new-user" nxhtml-install-dir) "\
+Show special customization page for new user.
+
+\(fn &optional NAME)" t nil)
+
+(nxhtml-autoload 'cusnu-export-my-skin-options `(lp '(nxhtml-download-root-url nil) "util/cus-new-user" nxhtml-install-dir) "\
+Export to file FILE custom options in `cusnu-my-skin-options'.
+The options is exported to elisp code that other users can run to
+set the options that you have added to `cusnu-my-skin-options'.
+
+For more information about this see `cusnu-export-cust-group'.
+
+\(fn FILE)" t nil)
+
+;;;***
+
+;;;### (autoloads (ediff-url) "ediff-url" "util/ediff-url.el" (19362
+;;;;;; 34258))
+;;; Generated autoloads from util/ediff-url.el
+(web-autoload-require 'ediff-url 'lp '(nxhtml-download-root-url nil) "util/ediff-url" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'ediff-url `(lp '(nxhtml-download-root-url nil) "util/ediff-url" nxhtml-install-dir) "\
+Compare current buffer to a web URL using `ediff-buffers'.
+Check URL using `ediff-url-redirects' before fetching the file.
+
+This is for checking downloaded file. A the file may have a comment
+telling the download URL of thise form in the header:
+
+ ;; URL: http://the-server.net/the-path/the-file.el
+
+If not the user is asked for the URL.
+
+\(fn URL)" t nil)
+
+;;;***
+
+;;;### (autoloads (ffip-find-file-in-dirtree ffip-set-current-project)
+;;;;;; "ffip" "util/ffip.el" (19257 25432))
+;;; Generated autoloads from util/ffip.el
+(web-autoload-require 'ffip 'lp '(nxhtml-download-root-url nil) "util/ffip" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'ffip-set-current-project `(lp '(nxhtml-download-root-url nil) "util/ffip" nxhtml-install-dir) "\
+Setup ffip project NAME with top directory ROOT of type TYPE.
+ROOT can either be just a directory or a list of directory where
+the first used just for prompting purposes and the files in the
+rest are read into the ffip project.
+
+Type is a type in `ffip-project-file-types'.
+
+\(fn NAME ROOT TYPE)" nil nil)
+
+(nxhtml-autoload 'ffip-find-file-in-dirtree `(lp '(nxhtml-download-root-url nil) "util/ffip" nxhtml-install-dir) "\
+Find files in directory tree ROOT.
+
+\(fn ROOT)" t nil)
+
+;;;***
+
+;;;### (autoloads (fold-dwim-turn-on-outline-and-hide-all fold-dwim-turn-on-hs-and-hide
+;;;;;; fold-dwim-unhide-hs-and-outline fold-dwim-mode fold-dwim-toggle
+;;;;;; fold-dwim) "fold-dwim" "util/fold-dwim.el" (19218 42180))
+;;; Generated autoloads from util/fold-dwim.el
+(web-autoload-require 'fold-dwim 'lp '(nxhtml-download-root-url nil) "util/fold-dwim" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'fold-dwim 'custom-loads))) (if (member '"fold-dwim" loads) nil (put 'fold-dwim 'custom-loads (cons '"fold-dwim" loads))))
+
+(nxhtml-autoload 'fold-dwim-toggle `(lp '(nxhtml-download-root-url nil) "util/fold-dwim" nxhtml-install-dir) "\
+Toggle visibility or some other visual things.
+Try toggling different visual things in this order:
+
+- Images shown at point with `inlimg-mode'
+- Text at point prettified by `html-write-mode'.
+
+For the rest it unhides if possible, otherwise hides in this
+order:
+
+- `org-mode' header or something else using that outlines.
+- Maybe `fold-dwim-toggle-selective-display'.
+- `Tex-fold-mode' things.
+- In html if `outline-minor-mode' and after heading hide content.
+- `hs-minor-mode' things.
+- `outline-minor-mode' things. (Turns maybe on this.)
+
+It uses `fold-dwim-show' to show any hidden text at point; if no
+hidden fold is found, try `fold-dwim-hide' to hide the
+construction at the cursor.
+
+Note: Also first turn on `fold-dwim-mode' to get the keybinding
+for this function from it.
+
+\(fn)" t nil)
+
+(defvar fold-dwim-mode nil "\
+Non-nil if Fold-Dwim mode is enabled.
+See the command `fold-dwim-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `fold-dwim-mode'.")
+
+(nxhtml-custom-autoload 'fold-dwim-mode 'fold-dwim nil)
+
+(nxhtml-autoload 'fold-dwim-mode `(lp '(nxhtml-download-root-url nil) "util/fold-dwim" nxhtml-install-dir) "\
+Key binding for `fold-dwim-toggle'.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'fold-dwim-unhide-hs-and-outline `(lp '(nxhtml-download-root-url nil) "util/fold-dwim" nxhtml-install-dir) "\
+Unhide everything hidden by Hide/Show and Outline.
+Ie everything hidden by `hs-minor-mode' and
+`outline-minor-mode'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'fold-dwim-turn-on-hs-and-hide `(lp '(nxhtml-download-root-url nil) "util/fold-dwim" nxhtml-install-dir) "\
+Turn on minor mode `hs-minor-mode' and hide.
+If major mode is derived from `nxml-mode' call `hs-hide-block'
+else call `hs-hide-all'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'fold-dwim-turn-on-outline-and-hide-all `(lp '(nxhtml-download-root-url nil) "util/fold-dwim" nxhtml-install-dir) "\
+Turn on `outline-minor-mode' and call `hide-body'.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (foldit-global-mode foldit-mode foldit) "foldit"
+;;;;;; "util/foldit.el" (19275 63380))
+;;; Generated autoloads from util/foldit.el
+(web-autoload-require 'foldit 'lp '(nxhtml-download-root-url nil) "util/foldit" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'foldit 'custom-loads))) (if (member '"foldit" loads) nil (put 'foldit 'custom-loads (cons '"foldit" loads))))
+
+(nxhtml-autoload 'foldit-mode `(lp '(nxhtml-download-root-url nil) "util/foldit" nxhtml-install-dir) "\
+Minor mode providing visual aids for folding.
+Shows some hints about what you have hidden and how to reveal it.
+
+Supports `hs-minor-mode', `outline-minor-mode' and major modes
+derived from `outline-mode'.
+
+\(fn &optional ARG)" t nil)
+
+(defvar foldit-global-mode nil "\
+Non-nil if Foldit-Global mode is enabled.
+See the command `foldit-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `foldit-global-mode'.")
+
+(nxhtml-custom-autoload 'foldit-global-mode 'foldit nil)
+
+(nxhtml-autoload 'foldit-global-mode `(lp '(nxhtml-download-root-url nil) "util/foldit" nxhtml-install-dir) "\
+Toggle Foldit mode in every possible buffer.
+With prefix ARG, turn Foldit-Global mode on if and only if
+ARG is positive.
+Foldit mode is enabled in all buffers where
+`(lambda nil (foldit-mode 1))' would do it.
+See `foldit-mode' for more information on Foldit mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (gimpedit-can-edit gimpedit-edit-buffer gimpedit-edit-file
+;;;;;; gimpedit) "gimpedit" "util/gimpedit.el" (19275 63380))
+;;; Generated autoloads from util/gimpedit.el
+(web-autoload-require 'gimpedit 'lp '(nxhtml-download-root-url nil) "util/gimpedit" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'gimpedit 'custom-loads))) (if (member '"gimpedit" loads) nil (put 'gimpedit 'custom-loads (cons '"gimpedit" loads))))
+
+(nxhtml-autoload 'gimpedit-edit-file `(lp '(nxhtml-download-root-url nil) "util/gimpedit" nxhtml-install-dir) "\
+Edit IMAGE-FILE with GIMP.
+See also `gimpedit-edit-file'.
+
+\(fn IMAGE-FILE &optional EXTRA-ARGS)" t nil)
+
+(nxhtml-autoload 'gimpedit-edit-buffer `(lp '(nxhtml-download-root-url nil) "util/gimpedit" nxhtml-install-dir) "\
+Edit image file in current buffer with GIMP.
+See also `gimpedit-edit-file'.
+
+You may also be interested in gimpedit-mode with which you can edit
+gimp files from within Emacs using GIMP's scripting
+possibilities. See
+
+ URL `http://www.emacswiki.org/emacs/GimpMode'
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'gimpedit-can-edit `(lp '(nxhtml-download-root-url nil) "util/gimpedit" nxhtml-install-dir) "\
+Not documented
+
+\(fn FILE-NAME)" nil nil)
+
+;;;***
+
+;;;### (autoloads (gpl-mode) "gpl" "util/gpl.el" (18795 27308))
+;;; Generated autoloads from util/gpl.el
+(web-autoload-require 'gpl 'lp '(nxhtml-download-root-url nil) "util/gpl" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'gpl-mode `(lp '(nxhtml-download-root-url nil) "util/gpl" nxhtml-install-dir) "\
+Mode for font-locking and editing color palettes of the GPL format.
+
+Such palettes are used and produced by free software applications
+such as the GIMP, Inkscape, Scribus, Agave and on-line tools such
+as http://colourlovers.com.
+
+You can also use
+URL `http://niels.kicks-ass.org/public/elisp/css-palette.el' to import
+such palette into a css-file as hexadecimal color palette.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (hfyview-frame hfyview-window hfyview-region hfyview-buffer
+;;;;;; hfyview-quick-print-in-files-menu) "hfyview" "util/hfyview.el"
+;;;;;; (19400 17335))
+;;; Generated autoloads from util/hfyview.el
+(web-autoload-require 'hfyview 'lp '(nxhtml-download-root-url nil) "util/hfyview" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(defvar hfyview-quick-print-in-files-menu nil "\
+Add Quick print entries to File menu if non-nil.
+If you set this to nil you have to restart Emacs to get rid of
+the Quick Print entry.")
+
+(nxhtml-custom-autoload 'hfyview-quick-print-in-files-menu 'hfyview nil)
+
+(nxhtml-autoload 'hfyview-buffer `(lp '(nxhtml-download-root-url nil) "util/hfyview" nxhtml-install-dir) "\
+Convert buffer to html preserving faces and show in web browser.
+With command prefix ARG also show html source in other window.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'hfyview-region `(lp '(nxhtml-download-root-url nil) "util/hfyview" nxhtml-install-dir) "\
+Convert region to html preserving faces and show in web browser.
+With command prefix ARG also show html source in other window.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'hfyview-window `(lp '(nxhtml-download-root-url nil) "util/hfyview" nxhtml-install-dir) "\
+Convert window to html preserving faces and show in web browser.
+With command prefix ARG also show html source in other window.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'hfyview-frame `(lp '(nxhtml-download-root-url nil) "util/hfyview" nxhtml-install-dir) "\
+Convert frame to html preserving faces and show in web browser.
+Make an XHTML view of the current Emacs frame. Put it in a buffer
+named *hfyview-frame* and show that buffer in a web browser.
+
+If WHOLE-BUFFERS is non-nil then the whole content of the buffers
+is shown in the XHTML page, otherwise just the part that is
+visible currently on the frame.
+
+If you turn on the minor mode `hfyview-frame-mode' you can also
+get the minibuffer/echo area in the output. See this mode for
+details.
+
+With command prefix also show html source in other window.
+
+\(fn WHOLE-BUFFERS)" t nil)
+
+;;;***
+
+;;;### (autoloads (hl-needed-mode hl-needed) "hl-needed" "util/hl-needed.el"
+;;;;;; (19394 16942))
+;;; Generated autoloads from util/hl-needed.el
+(web-autoload-require 'hl-needed 'lp '(nxhtml-download-root-url nil) "util/hl-needed" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'hl-needed 'custom-loads))) (if (member '"hl-needed" loads) nil (put 'hl-needed 'custom-loads (cons '"hl-needed" loads))))
+
+(defvar hl-needed-mode nil "\
+Non-nil if Hl-Needed mode is enabled.
+See the command `hl-needed-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `hl-needed-mode'.")
+
+(nxhtml-custom-autoload 'hl-needed-mode 'hl-needed nil)
+
+(nxhtml-autoload 'hl-needed-mode `(lp '(nxhtml-download-root-url nil) "util/hl-needed" nxhtml-install-dir) "\
+Try to highlight current line and column when needed.
+This is a global minor mode. It can operate in some different
+ways:
+
+- Highlighting can be on always, see `hl-needed-always'.
+
+Or, it can be turned on depending on some conditions. In this
+case highlighting is turned off after each command and turned on
+again in the current window when either:
+
+- A new window was selected, see `hl-needed-on-new-window'.
+- A new buffer was selected, see `hl-needed-on-new-buffer'.
+- Window configuration was changed, see `hl-needed-on-config-change'.
+- Buffer was scrolled see `hl-needed-on-scrolling'.
+- A window was clicked with the mouse, see `hl-needed-on-mouse'.
+
+After this highlighting may be turned off again, normally after a
+short delay, see `hl-needed-flash'.
+
+If either highlighting was not turned on or was turned off again
+it will be turned on when
+
+- Emacs has been idle for `hl-needed-idle-time' seconds.
+
+See also `hl-needed-not-in-modes' and `hl-needed-currently-fun'.
+
+Note 1: For columns to be highlighted vline.el must be available.
+
+Note 2: This mode depends on `hl-line-mode' and `vline-mode' and
+tries to cooperate with them. If you turn on either of these that
+overrides the variables for turning on the respective
+highlighting here.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (html-write-mode html-write) "html-write" "util/html-write.el"
+;;;;;; (19275 63380))
+;;; Generated autoloads from util/html-write.el
+(web-autoload-require 'html-write 'lp '(nxhtml-download-root-url nil) "util/html-write" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-write 'custom-loads))) (if (member '"html-write" loads) nil (put 'html-write 'custom-loads (cons '"html-write" loads))))
+
+(nxhtml-autoload 'html-write-mode `(lp '(nxhtml-download-root-url nil) "util/html-write" nxhtml-install-dir) "\
+Minor mode for convenient display of some HTML tags.
+When this mode is on a tag in `html-write-tag-list' is displayed as
+the inner text of the tag with a face corresponding to the tag.
+By default for example <i>...</i> is displayed as italic and
+<a>...</a> is displayed as an underlined clickable link.
+
+Only non-nested tags are hidden. The idea is just that it should
+be easier to read and write, not that it should look as html
+rendered text.
+
+See the customization group `html-write' for more information about
+faces.
+
+The following keys are defined when you are on a tag handled by
+this minor mode:
+
+\\{html-write-keymap}
+
+IMPORTANT: Most commands you use works also on the text that is
+hidden. The movement commands is an exception, but as soon as
+you edit the buffer you may also change the hidden parts.
+
+Hint: Together with `wrap-to-fill-column-mode' this can make it
+easier to see what text you are actually writing in html parts of
+a web file.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (inlimg-toggle-slicing inlimg-toggle-display inlimg-global-mode
+;;;;;; inlimg-mode inlimg) "inlimg" "util/inlimg.el" (19269 33008))
+;;; Generated autoloads from util/inlimg.el
+(web-autoload-require 'inlimg 'lp '(nxhtml-download-root-url nil) "util/inlimg" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'inlimg 'custom-loads))) (if (member '"inlimg" loads) nil (put 'inlimg 'custom-loads (cons '"inlimg" loads))))
+
+(nxhtml-autoload 'inlimg-mode `(lp '(nxhtml-download-root-url nil) "util/inlimg" nxhtml-install-dir) "\
+Display images inline.
+Search buffer for image tags. Display found images.
+
+Image tags are setup per major mode in `inlimg-mode-specs'.
+
+Images are displayed on a line below the tag referencing them.
+The whole image or a slice of it may be displayed, see
+`inlimg-slice'. Margins relative text are specified in
+`inlimg-margins'.
+
+See also the commands `inlimg-toggle-display' and
+`inlimg-toggle-slicing'.
+
+Note: This minor mode uses `font-lock-mode'.
+
+\(fn &optional ARG)" t nil)
+
+(defvar inlimg-global-mode nil "\
+Non-nil if Inlimg-Global mode is enabled.
+See the command `inlimg-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `inlimg-global-mode'.")
+
+(nxhtml-custom-autoload 'inlimg-global-mode 'inlimg nil)
+
+(nxhtml-autoload 'inlimg-global-mode `(lp '(nxhtml-download-root-url nil) "util/inlimg" nxhtml-install-dir) "\
+Toggle Inlimg mode in every possible buffer.
+With prefix ARG, turn Inlimg-Global mode on if and only if
+ARG is positive.
+Inlimg mode is enabled in all buffers where
+`inlimg--global-turn-on' would do it.
+See `inlimg-mode' for more information on Inlimg mode.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'inlimg-toggle-display `(lp '(nxhtml-download-root-url nil) "util/inlimg" nxhtml-install-dir) "\
+Toggle display of image at point POINT.
+See also the command `inlimg-mode'.
+
+\(fn POINT)" t nil)
+
+(nxhtml-autoload 'inlimg-toggle-slicing `(lp '(nxhtml-download-root-url nil) "util/inlimg" nxhtml-install-dir) "\
+Toggle slicing of image at point POINT.
+See also the command `inlimg-mode'.
+
+\(fn POINT)" t nil)
+
+;;;***
+
+;;;### (autoloads (majmodpri majmodpri-apply-priorities majmodpri-apply
+;;;;;; majmodpri-sort-lists) "majmodpri" "util/majmodpri.el" (19407
+;;;;;; 18407))
+;;; Generated autoloads from util/majmodpri.el
+(web-autoload-require 'majmodpri 'lp '(nxhtml-download-root-url nil) "util/majmodpri" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'majmodpri-sort-lists `(lp '(nxhtml-download-root-url nil) "util/majmodpri" nxhtml-install-dir) "\
+Sort the list used when selecting major mode.
+Only sort those lists choosen in `majmodpri-lists-to-sort'.
+Sort according to priorities in `majmodpri-mode-priorities'.
+Keep the old order in the list otherwise.
+
+The lists can be sorted when loading elisp libraries, see
+`majmodpri-sort-after-load'.
+
+See also `majmodpri-apply-priorities'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'majmodpri-apply `(lp '(nxhtml-download-root-url nil) "util/majmodpri" nxhtml-install-dir) "\
+Sort major mode lists and apply to existing buffers.
+Note: This function is suitable to add to
+`desktop-after-read-hook'. It will restore the multi major modes
+in buffers.
+
+\(fn)" nil nil)
+
+(nxhtml-autoload 'majmodpri-apply-priorities `(lp '(nxhtml-download-root-url nil) "util/majmodpri" nxhtml-install-dir) "\
+Apply major mode priorities.
+First run `majmodpri-sort-lists' and then if CHANGE-MODES is
+non-nil apply to existing file buffers. If interactive ask
+before applying.
+
+\(fn CHANGE-MODES)" t nil)
+
+(let ((loads (get 'majmodpri 'custom-loads))) (if (member '"majmodpri" loads) nil (put 'majmodpri 'custom-loads (cons '"majmodpri" loads))))
+
+;;;***
+
+;;;### (autoloads (markchars-global-mode markchars-mode markchars)
+;;;;;; "markchars" "util/markchars.el" (19372 5886))
+;;; Generated autoloads from util/markchars.el
+(web-autoload-require 'markchars 'lp '(nxhtml-download-root-url nil) "util/markchars" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'markchars 'custom-loads))) (if (member '"markchars" loads) nil (put 'markchars 'custom-loads (cons '"markchars" loads))))
+
+(nxhtml-autoload 'markchars-mode `(lp '(nxhtml-download-root-url nil) "util/markchars" nxhtml-install-dir) "\
+Mark special characters.
+Which characters to mark are defined by `markchars-keywords'.
+
+The default is to mark non-IDN, non-ascii chars with a magenta
+underline.
+
+For information about IDN chars see `idn-is-recommended'.
+
+If you change anything in the customization group `markchars' you
+must restart this minor mode for the changes to take effect.
+
+\(fn &optional ARG)" t nil)
+
+(defvar markchars-global-mode nil "\
+Non-nil if Markchars-Global mode is enabled.
+See the command `markchars-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `markchars-global-mode'.")
+
+(nxhtml-custom-autoload 'markchars-global-mode 'markchars nil)
+
+(nxhtml-autoload 'markchars-global-mode `(lp '(nxhtml-download-root-url nil) "util/markchars" nxhtml-install-dir) "\
+Toggle Markchars mode in every possible buffer.
+With prefix ARG, turn Markchars-Global mode on if and only if
+ARG is positive.
+Markchars mode is enabled in all buffers where
+`(lambda nil (markchars-mode 1))' would do it.
+See `markchars-mode' for more information on Markchars mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (mlinks-global-mode mlinks-mode mlinks) "mlinks"
+;;;;;; "util/mlinks.el" (19364 56214))
+;;; Generated autoloads from util/mlinks.el
+(web-autoload-require 'mlinks 'lp '(nxhtml-download-root-url nil) "util/mlinks" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'mlinks 'custom-loads))) (if (member '"mlinks" loads) nil (put 'mlinks 'custom-loads (cons '"mlinks" loads))))
+
+(nxhtml-autoload 'mlinks-mode `(lp '(nxhtml-download-root-url nil) "util/mlinks" nxhtml-install-dir) "\
+Recognizes certain parts of a buffer as hyperlinks.
+The hyperlinks are created in different ways for different major
+modes with the help of the functions in the list
+`mlinks-mode-functions'.
+
+The hyperlinks can be hilighted when point is over them. Use
+`mlinks-toggle-hilight' to toggle this feature for the current
+buffer.
+
+All keybindings in this mode are by default done under the prefi§x
+key
+
+ C-c RET
+
+which is supposed to be a kind of mnemonic for link (alluding to
+the RET key commonly used in web browser to follow a link).
+\(Unfortunately this breaks the rules in info node `Key Binding
+Conventions'.) Below are the key bindings defined by this mode:
+
+\\{mlinks-mode-map}
+
+For some major modes `mlinks-backward-link' and
+`mlinks-forward-link' will take you to the previous/next link.
+By default the link moved to will be active, see
+`mlinks-active-links'.
+
+\(fn &optional ARG)" t nil)
+
+(defvar mlinks-global-mode nil "\
+Non-nil if Mlinks-Global mode is enabled.
+See the command `mlinks-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `mlinks-global-mode'.")
+
+(nxhtml-custom-autoload 'mlinks-global-mode 'mlinks nil)
+
+(nxhtml-autoload 'mlinks-global-mode `(lp '(nxhtml-download-root-url nil) "util/mlinks" nxhtml-install-dir) "\
+Toggle Mlinks mode in every possible buffer.
+With prefix ARG, turn Mlinks-Global mode on if and only if
+ARG is positive.
+Mlinks mode is enabled in all buffers where
+`mlinks-turn-on-in-buffer' would do it.
+See `mlinks-mode' for more information on Mlinks mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (mumamo-multi-major-modep mumamo-list-defined-multi-major-modes
+;;;;;; mumamo-mark-for-refontification mumamo-hi-lock-faces mumamo
+;;;;;; mumamo-add-to-defined-multi-major-modes define-mumamo-multi-major-mode)
+;;;;;; "mumamo" "util/mumamo.el" (19412 26290))
+;;; Generated autoloads from util/mumamo.el
+(web-autoload-require 'mumamo 'lp '(nxhtml-download-root-url nil) "util/mumamo" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'define-mumamo-multi-major-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo" nxhtml-install-dir) "\
+Define a function that turn on support for multiple major modes.
+Define a function FUN-SYM that set up to divide the current
+buffer into chunks with different major modes.
+
+The documentation string for FUN-SYM should contain the special
+documentation in the string SPEC-DOC, general documentation for
+functions of this type and information about chunks.
+
+The new function will use the definitions in CHUNKS (which is
+called a \"chunk family\") to make the dividing of the buffer.
+
+The function FUN-SYM can be used to setup a buffer instead of a
+major mode function:
+
+- The function FUN-SYM can be called instead of calling a major
+ mode function when you want to use multiple major modes in a
+ buffer.
+
+- The defined function can be used instead of a major mode
+ function in for example `auto-mode-alist'.
+
+- As the very last thing FUN-SYM will run the hook FUN-SYM-hook,
+ just as major modes do.
+
+- There is also a general hook, `mumamo-turn-on-hook', which is
+ run when turning on mumamo with any of these functions. This
+ is run right before the hook specific to any of the functions
+ above that turns on the multiple major mode support.
+
+- The multi major mode FUN-SYM has a keymap named FUN-SYM-map.
+ This overrides the major modes' keymaps since it is handled as
+ a minor mode keymap.
+
+- There is also a special mumamo keymap, `mumamo-map' that is
+ active in every buffer with a multi major mode. This is also
+ handled as a minor mode keymap and therefor overrides the major
+ modes' keymaps.
+
+- However when this support for multiple major mode is on the
+ buffer is divided into chunks, each with its own major mode.
+
+- The chunks are fontified according the major mode assigned to
+ them for that.
+
+- Indenting is also done according to the major mode assigned to
+ them for that.
+
+- The actual major mode used in the buffer is changed to the one
+ in the chunk when moving point between these chunks.
+
+- When major mode is changed the hooks for the new major mode,
+ `after-change-major-mode-hook' and `change-major-mode-hook' are
+ run.
+
+- There will be an alias for FUN-SYM called mumamo-alias-FUN-SYM.
+ This can be used to check whic multi major modes have been
+ defined.
+
+** A little bit more technical description:
+
+The dividing of a buffer into chunks is done during fontification
+by `mumamo-get-chunk-at'.
+
+The name of the function is saved in in the buffer local variable
+`mumamo-multi-major-mode' when the function is called.
+
+All functions defined by this macro is added to the list
+`mumamo-defined-multi-major-modes'.
+
+Basically Mumamo handles only major modes that uses jit-lock.
+However as a special effort also `nxml-mode' and derivatives
+thereof are handled. Since it seems impossible to me to restrict
+those major modes fontification to only a chunk without changing
+`nxml-mode' the fontification is instead done by
+`html-mode'/`sgml-mode' for chunks using `nxml-mode' and its
+derivates.
+
+CHUNKS is a list where each entry have the format
+
+ (CHUNK-DEF-NAME MAIN-MAJOR-MODE SUBMODE-CHUNK-FUNCTIONS)
+
+CHUNK-DEF-NAME is the key name by which the entry is recognized.
+MAIN-MAJOR-MODE is the major mode used when there is no chunks.
+If this is nil then `major-mode' before turning on this mode will
+be used.
+
+SUBMODE-CHUNK-FUNCTIONS is a list of the functions that does the
+chunk division of the buffer. They are tried in the order they
+appear here during the chunk division process.
+
+If you want to write new functions for chunk divisions then
+please see `mumamo-find-possible-chunk'. You can perhaps also
+use `mumamo-quick-static-chunk' which is more easy-to-use
+alternative. See also the file mumamo-fun.el where there are
+many routines for chunk division.
+
+When you write those new functions you may want to use some of
+the functions for testing chunks:
+
+ `mumamo-test-create-chunk-at' `mumamo-test-create-chunks-at-all'
+ `mumamo-test-easy-make' `mumamo-test-fontify-region'
+
+These are in the file mumamo-test.el.
+
+\(fn FUN-SYM SPEC-DOC CHUNKS)" nil (quote macro))
+
+(nxhtml-autoload 'mumamo-add-to-defined-multi-major-modes `(lp '(nxhtml-download-root-url nil) "util/mumamo" nxhtml-install-dir) "\
+Not documented
+
+\(fn ENTRY)" nil nil)
+
+(let ((loads (get 'mumamo 'custom-loads))) (if (member '"mumamo" loads) nil (put 'mumamo 'custom-loads (cons '"mumamo" loads))))
+
+(let ((loads (get 'mumamo-hi-lock-faces 'custom-loads))) (if (member '"mumamo" loads) nil (put 'mumamo-hi-lock-faces 'custom-loads (cons '"mumamo" loads))))
+
+(nxhtml-autoload 'mumamo-mark-for-refontification `(lp '(nxhtml-download-root-url nil) "util/mumamo" nxhtml-install-dir) "\
+Mark region between MIN and MAX for refontification.
+
+\(fn MIN MAX)" nil nil)
+
+(nxhtml-autoload 'mumamo-list-defined-multi-major-modes `(lp '(nxhtml-download-root-url nil) "util/mumamo" nxhtml-install-dir) "\
+List currently defined multi major modes.
+If SHOW-DOC is non-nil show the doc strings added when defining
+them. (This is not the full doc string. To show the full doc
+string you can click on the multi major mode in the list.)
+
+If SHOW-CHUNKS is non-nil show the names of the chunk dividing
+functions each multi major mode uses.
+
+If MATCH then show only multi major modes whos names matches.
+
+\(fn SHOW-DOC SHOW-CHUNKS MATCH)" t nil)
+
+(nxhtml-autoload 'mumamo-multi-major-modep `(lp '(nxhtml-download-root-url nil) "util/mumamo" nxhtml-install-dir) "\
+Return t if VALUE is a multi major mode function.
+
+\(fn VALUE)" nil nil)
+
+;;;***
+
+;;;### (autoloads (python-rst-mumamo-mode latex-haskell-mumamo-mode
+;;;;;; latex-clojure-mumamo-mode markdown-html-mumamo-mode xsl-sgml-mumamo-mode
+;;;;;; xsl-nxml-mumamo-mode mako-html-mumamo-mode org-mumamo-mode
+;;;;;; asp-html-mumamo-mode noweb2-mumamo-mode mumamo-noweb2 csound-sgml-mumamo-mode
+;;;;;; laszlo-nxml-mumamo-mode metapost-mumamo-mode ruby-heredoc-mumamo-mode
+;;;;;; python-heredoc-mumamo-mode cperl-heredoc-mumamo-mode perl-heredoc-mumamo-mode
+;;;;;; php-heredoc-mumamo-mode sh-heredoc-mumamo-mode eruby-javascript-mumamo-mode
+;;;;;; eruby-html-mumamo-mode eruby-mumamo-mode jsp-html-mumamo-mode
+;;;;;; gsp-html-mumamo-mode ssjs-html-mumamo-mode smarty-html-mumamo-mode
+;;;;;; mjt-html-mumamo-mode genshi-html-mumamo-mode django-html-mumamo-mode
+;;;;;; embperl-html-mumamo-mode mason-html-mumamo-mode nxml-mumamo-mode
+;;;;;; html-mumamo-mode mumamo-define-html-file-wide-keys) "mumamo-fun"
+;;;;;; "util/mumamo-fun.el" (19410 22971))
+;;; Generated autoloads from util/mumamo-fun.el
+(web-autoload-require 'mumamo-fun 'lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'mumamo-define-html-file-wide-keys `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Define keys in multi major mode keymap for html files.
+
+\(fn)" nil nil)
+
+(nxhtml-autoload 'html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for (X)HTML with main mode `html-mode'.
+This covers inlined style and javascript and PHP." t)
+
+(nxhtml-autoload 'nxml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for (X)HTML with main mode `nxml-mode'.
+This covers inlined style and javascript and PHP.
+
+See also `mumamo-alt-php-tags-mode'." t)
+
+(nxhtml-autoload 'mason-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Mason using main mode `html-mode'.
+This covers inlined style and javascript." t)
+
+(nxhtml-autoload 'embperl-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Embperl files with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'django-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Django with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'genshi-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Genshi with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'mjt-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for MJT with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'smarty-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Smarty with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'ssjs-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for SSJS with main mode `html-mode'.
+This covers inlined style and javascript." t)
+
+(nxhtml-autoload 'gsp-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for GSP with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'jsp-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for JSP with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'eruby-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major mode for eRuby with unspecified main mode.
+Current major-mode will be used as the main major mode." t)
+
+(nxhtml-autoload 'eruby-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for eRuby with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'eruby-javascript-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for eRuby with main mode `javascript-mode'." t)
+
+(nxhtml-autoload 'sh-heredoc-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for sh heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(nxhtml-autoload 'php-heredoc-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for PHP heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(nxhtml-autoload 'perl-heredoc-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Perl heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(nxhtml-autoload 'cperl-heredoc-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Perl heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(nxhtml-autoload 'python-heredoc-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Perl heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(nxhtml-autoload 'ruby-heredoc-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Ruby heredoc document.
+See `mumamo-heredoc-modes' for how to specify heredoc major modes." t)
+
+(nxhtml-autoload 'metapost-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for MetaPost." t)
+
+(nxhtml-autoload 'laszlo-nxml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for OpenLaszlo." t)
+
+(nxhtml-autoload 'csound-sgml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on mutiple major modes for CSound orc/sco Modes." t)
+
+(let ((loads (get 'mumamo-noweb2 'custom-loads))) (if (member '"mumamo-fun" loads) nil (put 'mumamo-noweb2 'custom-loads (cons '"mumamo-fun" loads))))
+
+(nxhtml-autoload 'noweb2-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Multi major mode for noweb files." t)
+
+(nxhtml-autoload 'asp-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for ASP with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'org-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for `org-mode' files with main mode `org-mode'.
+** Note about HTML subchunks:
+Unfortunately this only allows `html-mode' (not `nxhtml-mode') in
+sub chunks." t)
+
+(nxhtml-autoload 'mako-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Mako with main mode `html-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'xsl-nxml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multi major mode for XSL with main mode `nxml-mode'.
+This covers inlined style and javascript." t)
+
+(nxhtml-autoload 'xsl-sgml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multi major mode for XSL with main mode `sgml-mode'.
+This covers inlined style and javascript." t)
+
+(nxhtml-autoload 'markdown-html-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multi major markdown mode in buffer.
+Main major mode will be `markdown-mode'.
+Inlined html will be in `html-mode'.
+
+You need `markdown-mode' which you can download from URL
+`http://jblevins.org/projects/markdown-mode/'." t)
+
+(nxhtml-autoload 'latex-clojure-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multi major mode latex+clojure.
+Main major mode will be `latex-mode'.
+Subchunks will be in `clojure-mode'.
+
+You will need `clojure-mode' which you can download from URL
+`http://github.com/jochu/clojure-mode/tree'." t)
+
+(nxhtml-autoload 'latex-haskell-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multi major mode latex+haskell.
+Main major mode will be `latex-mode'.
+Subchunks will be in `haskell-mode'.
+
+You will need `haskell-mode' which you can download from URL
+`http://projects.haskell.org/haskellmode-emacs/'." t)
+
+(nxhtml-autoload 'python-rst-mumamo-mode `(lp '(nxhtml-download-root-url nil) "util/mumamo-fun" nxhtml-install-dir) "\
+Turn on multiple major modes for Python with RestructuredText docstrings." t)
+
+;;;***
+
+;;;### (autoloads (mumamo-add-region-from-string mumamo-add-region)
+;;;;;; "mumamo-regions" "util/mumamo-regions.el" (19275 63380))
+;;; Generated autoloads from util/mumamo-regions.el
+(web-autoload-require 'mumamo-regions 'lp '(nxhtml-download-root-url nil) "util/mumamo-regions" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'mumamo-add-region `(lp '(nxhtml-download-root-url nil) "util/mumamo-regions" nxhtml-install-dir) "\
+Add a mumamo region from selection.
+Mumamo regions are like another layer of chunks above the normal chunks.
+They does not affect the normal chunks, but they overrides them.
+
+To create a mumamo region first select a visible region and then
+call this function.
+
+If the buffer is not in a multi major mode a temporary multi
+major mode will be created applied to the buffer first.
+To get out of this and get back to a single major mode just use
+
+ M-x normal-mode
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'mumamo-add-region-from-string `(lp '(nxhtml-download-root-url nil) "util/mumamo-regions" nxhtml-install-dir) "\
+Add a mumamo region from string at point.
+Works as `mumamo-add-region' but for string or comment at point.
+
+Buffer must be fontified.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (n-back-game n-back) "n-back" "util/n-back.el"
+;;;;;; (19278 15746))
+;;; Generated autoloads from util/n-back.el
+(web-autoload-require 'n-back 'lp '(nxhtml-download-root-url nil) "util/n-back" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'n-back 'custom-loads))) (if (member '"n-back" loads) nil (put 'n-back 'custom-loads (cons '"n-back" loads))))
+
+(nxhtml-autoload 'n-back-game `(lp '(nxhtml-download-root-url nil) "util/n-back" nxhtml-install-dir) "\
+Emacs n-Back game.
+This game is supposed to increase your working memory and fluid
+intelligence.
+
+In this game something is shown for half a second on the screen
+and maybe a sound is played. You should then answer if parts of
+it is the same as you have seen or heard before. This is
+repeated for about 20 trials.
+
+You answer with the keys shown in the bottom window.
+
+In the easiest version of the game you should answer if you have
+just seen or heard what is shown now. By default the game gets
+harder as you play it with success. Then first the number of
+items presented in a trial grows. After that it gets harder by
+that you have to somehow remember not the last item, but the item
+before that (or even earlier). That is what \"n-Back\" stands
+for.
+
+Note that remember does not really mean remember clearly. The
+game is for training your brain getting used to keep those things
+in the working memory, maybe as a cross-modal unit. You are
+supposed to just nearly be able to do what you do in the game.
+And you are supposed to have fun, that is what your brain like.
+
+You should probably not overdue this. Half an hour a day playing
+might be an optimal time according to some people.
+
+The game is shamelessly modeled after Brain Workshop, see URL
+`http://brainworkshop.sourceforge.net/' just for the fun of
+getting it into Emacs. The game resembles but it not the same as
+that used in the report by Jaeggi mentioned at the above URL.
+
+Not all features in Brain Workshop are implemented here, but some
+new are maybe ... - and you have it available here in Emacs.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtmltest-run nxhtmltest-run-indent) "nxhtmltest-suites"
+;;;;;; "tests/nxhtmltest-suites.el" (19360 6294))
+;;; Generated autoloads from tests/nxhtmltest-suites.el
+(web-autoload-require 'nxhtmltest-suites 'lp '(nxhtml-download-root-url nil) "tests/nxhtmltest-suites" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtmltest-run-indent `(lp '(nxhtml-download-root-url nil) "tests/nxhtmltest-suites" nxhtml-install-dir) "\
+Run indentation tests.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'nxhtmltest-run `(lp '(nxhtml-download-root-url nil) "tests/nxhtmltest-suites" nxhtml-install-dir) "\
+Run all tests defined for nXhtml.
+Currently there are only tests using ert.el defined.
+
+Note that it is currently expected that the following tests will
+fail (they corresponds to known errors in nXhtml/Emacs):
+
+ `nxhtml-ert-nxhtml-changes-jump-back-10549'
+ `nxhtml-ert-nxhtml-changes-jump-back-7014'
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtmltest-run-Q) "nxhtmltest-Q" "tests/nxhtmltest-Q.el"
+;;;;;; (19264 36684))
+;;; Generated autoloads from tests/nxhtmltest-Q.el
+(web-autoload-require 'nxhtmltest-Q 'lp '(nxhtml-download-root-url nil) "tests/nxhtmltest-Q" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtmltest-run-Q `(lp '(nxhtml-download-root-url nil) "tests/nxhtmltest-Q" nxhtml-install-dir) "\
+Run all tests defined for nXhtml in fresh Emacs.
+See `nxhtmltest-run' for more information about the tests.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (ert-run-tests-interactively ert-deftest) "ert"
+;;;;;; "tests/ert.el" (19173 56140))
+;;; Generated autoloads from tests/ert.el
+(web-autoload-require 'ert 'lp '(nxhtml-download-root-url nil) "tests/ert" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'ert-deftest `(lp '(nxhtml-download-root-url nil) "tests/ert" nxhtml-install-dir) "\
+Define NAME (a symbol) as a test.
+
+\(fn NAME () [:documentation DOCSTRING] [:expected-result TYPE] BODY...)" nil (quote macro))
+
+(nxhtml-autoload 'ert-run-tests-interactively `(lp '(nxhtml-download-root-url nil) "tests/ert" nxhtml-install-dir) "\
+Run the tests specified by SELECTOR and display the results in a buffer.
+
+\(fn SELECTOR &optional OUTPUT-BUFFER-NAME MESSAGE-FN)" t nil)
+
+;;;***
+
+;;;### (autoloads (ocr-user-mode) "ocr-user" "util/ocr-user.el" (19290
+;;;;;; 21626))
+;;; Generated autoloads from util/ocr-user.el
+(web-autoload-require 'ocr-user 'lp '(nxhtml-download-root-url nil) "util/ocr-user" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'ocr-user-mode `(lp '(nxhtml-download-root-url nil) "util/ocr-user" nxhtml-install-dir) "\
+Color up digits three by three.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (ourcomments-warning ourcomments-M-x-menu-mode
+;;;;;; ourcomments-paste-with-convert-mode use-custom-style info-open-file
+;;;;;; replace-read-files rdir-query-replace ldir-query-replace
+;;;;;; grep-query-replace emacs-Q-nxhtml emacs-Q emacs--no-desktop
+;;;;;; emacs--debug-init emacs-buffer-file emacs emacs-restart ourcomments-ido-ctrl-tab
+;;;;;; ourcomments-ido-buffer-raise-frame ourcomments-ido-buffer-other-frame
+;;;;;; ourcomments-ido-buffer-other-window describe-symbol describe-defstruct
+;;;;;; describe-custom-group narrow-to-comment buffer-narrowed-p
+;;;;;; describe-command ourcomments-ediff-files find-emacs-other-file
+;;;;;; ourcomments-insert-date-and-time describe-timers ourcomments-copy+paste-set-point
+;;;;;; better-fringes-mode describe-key-and-map-briefly ourcomments-move-end-of-line
+;;;;;; ourcomments-move-beginning-of-line ourcomments-mark-whole-buffer-or-field
+;;;;;; fill-dwim unfill-individual-paragraphs unfill-region unfill-paragraph
+;;;;;; define-toggle-old define-toggle popup-menu-at-point ourcomments-indirect-fun)
+;;;;;; "ourcomments-util" "util/ourcomments-util.el" (19411 29548))
+;;; Generated autoloads from util/ourcomments-util.el
+(web-autoload-require 'ourcomments-util 'lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'ourcomments-indirect-fun `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Get the alias symbol for function FUN if any.
+
+\(fn FUN)" nil nil)
+
+(nxhtml-autoload 'popup-menu-at-point `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Popup the given menu at point.
+This is similar to `popup-menu' and MENU and PREFIX has the same
+meaning as there. The position for the popup is however where
+the window point is.
+
+\(fn MENU &optional PREFIX)" nil nil)
+
+(nxhtml-autoload 'define-toggle `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Declare SYMBOL as a customizable variable with a toggle function.
+The purpose of this macro is to define a defcustom and a toggle
+function suitable for use in a menu.
+
+The arguments have the same meaning as for `defcustom' with these
+restrictions:
+
+- The :type keyword cannot be used. Type is always 'boolean.
+- VALUE must be t or nil.
+
+DOC and ARGS are just passed to `defcustom'.
+
+A `defcustom' named SYMBOL with doc-string DOC and a function
+named SYMBOL-toggle is defined. The function toggles the value
+of SYMBOL. It takes no parameters.
+
+To create a menu item something similar to this can be used:
+
+ (define-key map [SYMBOL]
+ (list 'menu-item \"Toggle nice SYMBOL\"
+ 'SYMBOL-toggle
+ :button '(:toggle . SYMBOL)))
+
+\(fn SYMBOL VALUE DOC &rest ARGS)" nil (quote macro))
+
+(nxhtml-autoload 'define-toggle-old `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Not documented
+
+\(fn SYMBOL VALUE DOC &rest ARGS)" nil (quote macro))
+
+(nxhtml-autoload 'unfill-paragraph `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Unfill the current paragraph.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'unfill-region `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Unfill the current region.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'unfill-individual-paragraphs `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Unfill individual paragraphs in the current region.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'fill-dwim `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Fill or unfill paragraph or region.
+With prefix ARG fill only current line.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'ourcomments-mark-whole-buffer-or-field `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Mark whole buffer or editable field at point.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'ourcomments-move-beginning-of-line `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Move point to beginning of line or indentation.
+See `beginning-of-line' for ARG.
+
+If `line-move-visual' is non-nil then the visual line beginning
+is first tried.
+
+If in a widget field stay in that.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'ourcomments-move-end-of-line `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Move point to end of line or after last non blank char.
+See `end-of-line' for ARG.
+
+Similar to `ourcomments-move-beginning-of-line' but for end of
+line.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'describe-key-and-map-briefly `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Try to print names of keymap from which KEY fetch its definition.
+Look in current active keymaps and find keymap variables with the
+same value as the keymap where KEY is bound. Print a message
+with those keymap variable names. Return a list with the keymap
+variable symbols.
+
+When called interactively prompt for KEY.
+
+INSERT and UNTRANSLATED should normall be nil (and I am not sure
+what they will do ;-).
+
+\(fn &optional KEY INSERT UNTRANSLATED)" t nil)
+
+(defvar better-fringes-mode nil "\
+Non-nil if Better-Fringes mode is enabled.
+See the command `better-fringes-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `better-fringes-mode'.")
+
+(nxhtml-custom-autoload 'better-fringes-mode 'ourcomments-util nil)
+
+(nxhtml-autoload 'better-fringes-mode `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Choose another fringe bitmap color and bottom angle.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'ourcomments-copy+paste-set-point `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Set point for copy+paste here.
+Enable temporary minor mode `ourcomments-copy+paste-mode'.
+However if point for copy+paste already is set then cancel it and
+disable the minor mode.
+
+The purpose of this command is to make it easy to grab a piece of
+text and paste it at current position. After this command you
+should select a piece of text to copy and then call the command
+`ourcomments-copy+paste'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'describe-timers `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Show timers with readable time format.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'ourcomments-insert-date-and-time `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Insert date and time.
+See option `ourcomments-insert-date-and-time' for how to
+customize it.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'find-emacs-other-file `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Find corresponding file to source or installed elisp file.
+If you have checked out and compiled Emacs yourself you may have
+Emacs lisp files in two places, the checked out source tree and
+the installed Emacs tree. If buffer contains an Emacs elisp file
+in one of these places then find the corresponding elisp file in
+the other place. Return the file name of this file.
+
+Rename current buffer using your `uniquify-buffer-name-style' if
+it is set.
+
+When DISPLAY-FILE is non-nil display this file in other window
+and go to the same line number as in the current buffer.
+
+\(fn DISPLAY-FILE)" t nil)
+
+(nxhtml-autoload 'ourcomments-ediff-files `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+In directory DEF-DIR run `ediff-files' on files FILE-A and FILE-B.
+The purpose of this function is to make it eaiser to start
+`ediff-files' from a shell through Emacs Client.
+
+This is used in EmacsW32 in the file ediff.cmd where Emacs Client
+is called like this:
+
+ @%emacs_client% -e \"(setq default-directory \\\"%emacs_cd%\\\")\"
+ @%emacs_client% -n -e \"(ediff-files \\\"%f1%\\\" \\\"%f2%\\\")\"
+
+It can of course be done in a similar way with other shells.
+
+\(fn DEF-DIR FILE-A FILE-B)" nil nil)
+
+(nxhtml-autoload 'describe-command `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Like `describe-function', but prompts only for interactive commands.
+
+\(fn COMMAND)" t nil)
+
+(nxhtml-autoload 'buffer-narrowed-p `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Return non-nil if the current buffer is narrowed.
+
+\(fn)" nil nil)
+
+(nxhtml-autoload 'narrow-to-comment `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'describe-custom-group `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Describe customization group SYMBOL.
+
+\(fn SYMBOL)" t nil)
+
+(nxhtml-autoload 'describe-defstruct `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Not documented
+
+\(fn SYMBOL)" t nil)
+
+(nxhtml-autoload 'describe-symbol `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Show information about SYMBOL.
+Show SYMBOL plist and whether is is a variable or/and a
+function.
+
+\(fn SYMBOL)" t nil)
+
+(nxhtml-autoload 'ourcomments-ido-buffer-other-window `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Show buffer in other window.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'ourcomments-ido-buffer-other-frame `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Show buffer in other frame.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'ourcomments-ido-buffer-raise-frame `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Raise frame showing buffer.
+
+\(fn)" t nil)
+
+(defvar ourcomments-ido-ctrl-tab nil "\
+Non-nil if Ourcomments-Ido-Ctrl-Tab mode is enabled.
+See the command `ourcomments-ido-ctrl-tab' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `ourcomments-ido-ctrl-tab'.")
+
+(nxhtml-custom-autoload 'ourcomments-ido-ctrl-tab 'ourcomments-util nil)
+
+(nxhtml-autoload 'ourcomments-ido-ctrl-tab `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Enable buffer switching using C-Tab with function `ido-mode'.
+This changes buffer switching with function `ido-mode' the
+following way:
+
+- You can use C-Tab.
+
+- You can show the selected buffer in three ways independent of
+ how you entered function `ido-mode' buffer switching:
+
+ * S-return: other window
+ * C-return: other frame
+ * M-return: raise frame
+
+Those keys are selected to at least be a little bit reminiscent
+of those in for example common web browsers.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'emacs-restart `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Restart Emacs and start `server-mode' if on before.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'emacs `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Start a new Emacs with default parameters.
+Additional ARGS are passed to the new Emacs.
+
+See also `ourcomments-started-emacs-use-output-buffer'.
+
+\(fn &rest ARGS)" t nil)
+
+(nxhtml-autoload 'emacs-buffer-file `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Start a new Emacs showing current buffer file.
+Go to the current line and column in that file.
+If there is no buffer file then instead start with `dired'.
+
+This calls the function `emacs' with argument --no-desktop and
+the file or a call to dired.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'emacs--debug-init `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Start a new Emacs with --debug-init parameter.
+This calls the function `emacs' with added arguments ARGS.
+
+\(fn &rest ARGS)" t nil)
+
+(nxhtml-autoload 'emacs--no-desktop `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Start a new Emacs with --no-desktop parameter.
+This calls the function `emacs' with added arguments ARGS.
+
+\(fn &rest ARGS)" t nil)
+
+(nxhtml-autoload 'emacs-Q `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Start a new Emacs with -Q parameter.
+Start new Emacs without any customization whatsoever.
+This calls the function `emacs' with added arguments ARGS.
+
+\(fn &rest ARGS)" t nil)
+
+(nxhtml-autoload 'emacs-Q-nxhtml `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Start new Emacs with -Q and load nXhtml.
+This calls the function `emacs' with added arguments ARGS.
+
+\(fn &rest ARGS)" t nil)
+
+(nxhtml-autoload 'grep-query-replace `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Do `query-replace-regexp' of FROM with TO, on all files in *grep*.
+Third arg DELIMITED (prefix arg) means replace only word-delimited matches.
+If you exit (\\[keyboard-quit], RET or q), you can resume the query replace
+with the command \\[tags-loop-continue].
+
+\(fn FROM TO &optional DELIMITED)" t nil)
+
+(nxhtml-autoload 'ldir-query-replace `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Replace FROM with TO in FILES in directory DIR.
+This runs `query-replace-regexp' in files matching FILES in
+directory DIR.
+
+See `tags-query-replace' for DELIMETED and more information.
+
+\(fn FROM TO FILES DIR &optional DELIMITED)" t nil)
+
+(nxhtml-autoload 'rdir-query-replace `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Replace FROM with TO in FILES in directory tree ROOT.
+This runs `query-replace-regexp' in files matching FILES in
+directory tree ROOT.
+
+See `tags-query-replace' for DELIMETED and more information.
+
+\(fn FROM TO FILE-REGEXP ROOT &optional DELIMITED)" t nil)
+
+(nxhtml-autoload 'replace-read-files `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Read files arg for replace.
+
+\(fn REGEXP &optional REPLACE)" nil nil)
+
+(nxhtml-autoload 'info-open-file `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Open an info file in `Info-mode'.
+
+\(fn INFO-FILE)" t nil)
+
+(nxhtml-autoload 'use-custom-style `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Setup like in `Custom-mode', but without things specific to Custom.
+
+\(fn)" nil nil)
+
+(defvar ourcomments-paste-with-convert-mode nil "\
+Non-nil if Ourcomments-Paste-With-Convert mode is enabled.
+See the command `ourcomments-paste-with-convert-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `ourcomments-paste-with-convert-mode'.")
+
+(nxhtml-custom-autoload 'ourcomments-paste-with-convert-mode 'ourcomments-util nil)
+
+(nxhtml-autoload 'ourcomments-paste-with-convert-mode `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Pasted text may be automatically converted in this mode.
+The functions in `ourcomments-paste-with-convert-hook' are run
+after commands in `ourcomments-paste-with-convert-commands' if any
+of the functions returns non-nil that text is inserted instead of
+the original text.
+
+For exampel when this mode is on and you paste an html link in an
+`org-mode' buffer it will be directly converted to an org style
+link. (This is the default behaviour.)
+
+Tip: The Firefox plugin Copy as HTML Link is handy, see URL
+ `https://addons.mozilla.org/en-US/firefox/addon/2617'.
+
+Note: This minor mode will defadvice the paste commands.
+
+\(fn &optional ARG)" t nil)
+
+(defvar ourcomments-M-x-menu-mode nil "\
+Non-nil if Ourcomments-M-X-Menu mode is enabled.
+See the command `ourcomments-M-x-menu-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `ourcomments-M-x-menu-mode'.")
+
+(nxhtml-custom-autoload 'ourcomments-M-x-menu-mode 'ourcomments-util nil)
+
+(nxhtml-autoload 'ourcomments-M-x-menu-mode `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Add commands started from Emacs menus to M-x history.
+The purpose of this is to make it easier to redo them and easier
+to learn how to do them from the command line (which is often
+faster if you know how to do it).
+
+Only commands that are not already in M-x history are added.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'ourcomments-warning `(lp '(nxhtml-download-root-url nil) "util/ourcomments-util" nxhtml-install-dir) "\
+Not documented
+
+\(fn FORMAT-STRING &rest ARGS)" nil nil)
+
+;;;***
+
+;;;### (autoloads (major-modep major-or-multi-majorp) "ourcomments-widgets"
+;;;;;; "util/ourcomments-widgets.el" (19275 63380))
+;;; Generated autoloads from util/ourcomments-widgets.el
+(web-autoload-require 'ourcomments-widgets 'lp '(nxhtml-download-root-url nil) "util/ourcomments-widgets" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+ (nxhtml-autoload 'command "ourcomments-widgets")
+
+(nxhtml-autoload 'major-or-multi-majorp `(lp '(nxhtml-download-root-url nil) "util/ourcomments-widgets" nxhtml-install-dir) "\
+Return t if VALUE is a major or multi major mode function.
+
+\(fn VALUE)" nil nil)
+
+(nxhtml-autoload 'major-modep `(lp '(nxhtml-download-root-url nil) "util/ourcomments-widgets" nxhtml-install-dir) "\
+Return t if VALUE is a major mode function.
+
+\(fn VALUE)" nil nil)
+ (nxhtml-autoload 'major-mode-function "ourcomments-widgets")
+
+;;;***
+
+;;;### (autoloads (pause-start-in-new-emacs pause-mode pause) "pause"
+;;;;;; "util/pause.el" (19335 58922))
+;;; Generated autoloads from util/pause.el
+(web-autoload-require 'pause 'lp '(nxhtml-download-root-url nil) "util/pause" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'pause 'custom-loads))) (if (member '"pause" loads) nil (put 'pause 'custom-loads (cons '"pause" loads))))
+
+(defvar pause-mode nil "\
+Non-nil if Pause mode is enabled.
+See the command `pause-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `pause-mode'.")
+
+(nxhtml-custom-autoload 'pause-mode 'pause nil)
+
+(nxhtml-autoload 'pause-mode `(lp '(nxhtml-download-root-url nil) "util/pause" nxhtml-install-dir) "\
+This minor mode tries to make you take a break.
+It will jump up and temporary stop your work - even if you are
+not in Emacs. If you are in Emacs it will however try to be
+gentle and wait until you have been idle with the keyboard for a
+short while. (If you are not in Emacs it can't be gentle. How
+could it?)
+
+Then it will show you a special screen with a link to a yoga
+exercise you can do when you pause.
+
+After the pause you continue your work where you were
+interrupted.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'pause-start-in-new-emacs `(lp '(nxhtml-download-root-url nil) "util/pause" nxhtml-install-dir) "\
+Start pause with interval AFTER-MINUTES in a new Emacs instance.
+The new Emacs instance will be started with -Q. However if
+`custom-file' is non-nil it will be loaded so you can still
+customize pause.
+
+One way of using this function may be to put in your .emacs
+something like
+
+ ;; for just one Emacs running pause
+ (when server-mode (pause-start-in-new-emacs 15))
+
+See `pause-start' for more info.
+
+\(fn AFTER-MINUTES)" t nil)
+
+;;;***
+
+;;;### (autoloads (global-pointback-mode pointback-mode) "pointback"
+;;;;;; "util/pointback.el" (19023 47096))
+;;; Generated autoloads from util/pointback.el
+(web-autoload-require 'pointback 'lp '(nxhtml-download-root-url nil) "util/pointback" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'pointback-mode `(lp '(nxhtml-download-root-url nil) "util/pointback" nxhtml-install-dir) "\
+Restore previous window point when switching back to a buffer.
+
+\(fn &optional ARG)" t nil)
+
+(defvar global-pointback-mode nil "\
+Non-nil if Global-Pointback mode is enabled.
+See the command `global-pointback-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-pointback-mode'.")
+
+(nxhtml-custom-autoload 'global-pointback-mode 'pointback nil)
+
+(nxhtml-autoload 'global-pointback-mode `(lp '(nxhtml-download-root-url nil) "util/pointback" nxhtml-install-dir) "\
+Toggle Pointback mode in every possible buffer.
+With prefix ARG, turn Global-Pointback mode on if and only if
+ARG is positive.
+Pointback mode is enabled in all buffers where
+`pointback-on' would do it.
+See `pointback-mode' for more information on Pointback mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (popcmp-completing-read popcmp-completion-style
+;;;;;; popcmp) "popcmp" "util/popcmp.el" (19365 33760))
+;;; Generated autoloads from util/popcmp.el
+(web-autoload-require 'popcmp 'lp '(nxhtml-download-root-url nil) "util/popcmp" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'popcmp 'custom-loads))) (if (member '"popcmp" loads) nil (put 'popcmp 'custom-loads (cons '"popcmp" loads))))
+
+(defvar popcmp-completion-style (cond (t 'popcmp-popup)) "\
+Completion style.
+The currently available completion styles are:
+
+- popcmp-popup: Use OS popup menus (default).
+- emacs-default: Emacs default completion.
+- Company Mode completion.
+- anything: The Anything elisp lib completion style.
+
+The style of completion set here is not implemented for all
+completions. The scope varies however with which completion
+style you have choosen.
+
+For information about Company Mode and how to use it see URL
+`http://www.emacswiki.org/emacs/CompanyMode'.
+
+For information about Anything and how to use it see URL
+`http://www.emacswiki.org/emacs/Anything'.
+
+See also the options `popcmp-short-help-beside-alts' and
+`popcmp-group-alternatives' which are also availabe when popup
+completion is available.")
+
+(nxhtml-custom-autoload 'popcmp-completion-style 'popcmp nil)
+
+(nxhtml-autoload 'popcmp-completing-read `(lp '(nxhtml-download-root-url nil) "util/popcmp" nxhtml-install-dir) "\
+Read a string in the minubuffer with completion, or popup a menu.
+This function can be used instead `completing-read'. The main
+purpose is to provide a popup style menu for completion when
+completion is tighed to text at point in a buffer. If a popup
+menu is used it will be shown at window point. Whether a popup
+menu or minibuffer completion is used is governed by
+`popcmp-completion-style'.
+
+The variables PROMPT, TABLE, PREDICATE, REQUIRE-MATCH,
+INITIAL-INPUT, POP-HIST, DEF and INHERIT-INPUT-METHOD all have the
+same meaning is for `completing-read'.
+
+ALT-HELP should be nil or a hash variable or an association list
+with the completion alternative as key and a short help text as
+value. You do not need to supply help text for all alternatives.
+The use of ALT-HELP is set by `popcmp-short-help-beside-alts'.
+
+ALT-SETS should be nil or an association list that has as keys
+groups and as second element an alternative that should go into
+this group.
+
+\(fn PROMPT TABLE &optional PREDICATE REQUIRE-MATCH INITIAL-INPUT POP-HIST DEF INHERIT-INPUT-METHOD ALT-HELP ALT-SETS)" nil nil)
+
+;;;***
+
+;;;### (autoloads (rebind-keys-mode rebind) "rebind" "util/rebind.el"
+;;;;;; (19292 11678))
+;;; Generated autoloads from util/rebind.el
+(web-autoload-require 'rebind 'lp '(nxhtml-download-root-url nil) "util/rebind" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'rebind 'custom-loads))) (if (member '"rebind" loads) nil (put 'rebind 'custom-loads (cons '"rebind" loads))))
+
+(defvar rebind-keys-mode nil "\
+Non-nil if Rebind-Keys mode is enabled.
+See the command `rebind-keys-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `rebind-keys-mode'.")
+
+(nxhtml-custom-autoload 'rebind-keys-mode 'rebind nil)
+
+(nxhtml-autoload 'rebind-keys-mode `(lp '(nxhtml-download-root-url nil) "util/rebind" nxhtml-install-dir) "\
+Rebind keys as defined in `rebind-keys'.
+The key bindings will override almost all other key bindings
+since it is put on emulation level, like for example ``cua-mode'
+and `viper-mode'.
+
+This is for using for example C-a to mark the whole buffer (or a
+field). There are some predifined keybindings for this.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (rnc-mode) "rnc-mode" "util/rnc-mode.el" (18775
+;;;;;; 60004))
+;;; Generated autoloads from util/rnc-mode.el
+(web-autoload-require 'rnc-mode 'lp '(nxhtml-download-root-url nil) "util/rnc-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'rnc-mode `(lp '(nxhtml-download-root-url nil) "util/rnc-mode" nxhtml-install-dir) "\
+Major mode for editing RELAX NG Compact Syntax schemas.
+\\{rnc-mode-map}
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (search-form) "search-form" "util/search-form.el"
+;;;;;; (19275 63380))
+;;; Generated autoloads from util/search-form.el
+(web-autoload-require 'search-form 'lp '(nxhtml-download-root-url nil) "util/search-form" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'search-form `(lp '(nxhtml-download-root-url nil) "util/search-form" nxhtml-install-dir) "\
+Display a form for search and replace.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (sex-mode sex) "sex-mode" "util/sex-mode.el" (19218
+;;;;;; 42182))
+;;; Generated autoloads from util/sex-mode.el
+(web-autoload-require 'sex-mode 'lp '(nxhtml-download-root-url nil) "util/sex-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'sex 'custom-loads))) (if (member '"sex-mode" loads) nil (put 'sex 'custom-loads (cons '"sex-mode" loads))))
+
+(defvar sex-mode nil "\
+Non-nil if Sex mode is enabled.
+See the command `sex-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `sex-mode'.")
+
+(nxhtml-custom-autoload 'sex-mode 'sex-mode nil)
+
+(nxhtml-autoload 'sex-mode `(lp '(nxhtml-download-root-url nil) "util/sex-mode" nxhtml-install-dir) "\
+Open certain files in external programs.
+See `sex-get-file-open-cmd' for how to determine which files to
+open by external applications. Note that this selection is
+nearly the same as in `org-mode'. The main difference is that
+the fallback always is to open a file in Emacs. (This is
+necessary to avoid to disturb many of Emacs operations.)
+
+This affects all functions that opens files, like `find-file',
+`find-file-noselect' etc.
+
+However it does not affect files opened through Emacs client.
+
+Urls can also be handled, see `sex-handle-urls'.
+
+When opening a file with the shell a (temporary) dummy buffer is
+created in Emacs with major mode `sex-file-mode' and an external
+program is called to handle the file. How this dummy buffer is
+handled is governed by `sex-keep-dummy-buffer'.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (sml-modeline-mode sml-modeline) "sml-modeline"
+;;;;;; "util/sml-modeline.el" (19362 49086))
+;;; Generated autoloads from util/sml-modeline.el
+(web-autoload-require 'sml-modeline 'lp '(nxhtml-download-root-url nil) "util/sml-modeline" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'sml-modeline 'custom-loads))) (if (member '"sml-modeline" loads) nil (put 'sml-modeline 'custom-loads (cons '"sml-modeline" loads))))
+
+(defvar sml-modeline-mode nil "\
+Non-nil if Sml-Modeline mode is enabled.
+See the command `sml-modeline-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `sml-modeline-mode'.")
+
+(nxhtml-custom-autoload 'sml-modeline-mode 'sml-modeline nil)
+
+(nxhtml-autoload 'sml-modeline-mode `(lp '(nxhtml-download-root-url nil) "util/sml-modeline" nxhtml-install-dir) "\
+Show buffer size and position like scrollbar in mode line.
+You can customize this minor mode, see option `sml-modeline-mode'.
+
+Note: If you turn this mode on then you probably want to turn off
+option `scroll-bar-mode'.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (tabkey2-emma-without-tabkey2 tabkey2-mode tabkey2)
+;;;;;; "tabkey2" "util/tabkey2.el" (19277 65356))
+;;; Generated autoloads from util/tabkey2.el
+(web-autoload-require 'tabkey2 'lp '(nxhtml-download-root-url nil) "util/tabkey2" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'tabkey2 'custom-loads))) (if (member '"tabkey2" loads) nil (put 'tabkey2 'custom-loads (cons '"tabkey2" loads))))
+
+(defvar tabkey2-mode nil "\
+Non-nil if Tabkey2 mode is enabled.
+See the command `tabkey2-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `tabkey2-mode'.")
+
+(nxhtml-custom-autoload 'tabkey2-mode 'tabkey2 nil)
+
+(nxhtml-autoload 'tabkey2-mode `(lp '(nxhtml-download-root-url nil) "util/tabkey2" nxhtml-install-dir) "\
+More fun with Tab key number two (completion etc).
+This global minor mode by default binds Tab in a way that let you
+do completion with Tab in all buffers (where it is possible).
+
+The Tab key is easy to type on your keyboard. Then why not use
+it for completion, something that is very useful? Shells usually
+use Tab for completion so many are used to it. This was the idea
+of Smart Tabs and this is a generalization of that idea.
+
+However in Emacs the Tab key is usually used for indentation.
+The idea here is that if Tab has been pressed once for
+indentation, then as long as point stays further Tab keys might
+as well do completion.
+
+So you kind of do Tab-Tab for first completion (and then just
+Tab for further completions as long as point is not moved).
+
+And there is even kind of Tab-Tab-Tab completion: If completion
+fails the next completion function will be the one you try with
+next Tab. (You get some notification of this, of course.)
+
+See `tabkey2-first' for more information about usage.
+
+Note: If you do not want the Tab-Tab behaviour above, but still
+want an easy way to reach the available completion functions,
+then you can instead of turning on tabkey2-mode enter this in
+your .emacs:
+
+ (global-set-key [f8] 'tabkey2-cycle-completion-functions)
+
+After hitting f8 you will then be in the same state as after the
+first in tabkey2-mode.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'tabkey2-emma-without-tabkey2 `(lp '(nxhtml-download-root-url nil) "util/tabkey2" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (tyda-mode) "tyda" "util/tyda.el" (19275 63380))
+;;; Generated autoloads from util/tyda.el
+(web-autoload-require 'tyda 'lp '(nxhtml-download-root-url nil) "util/tyda" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(defvar tyda-mode nil "\
+Non-nil if Tyda mode is enabled.
+See the command `tyda-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `tyda-mode'.")
+
+(nxhtml-custom-autoload 'tyda-mode 'tyda nil)
+
+(nxhtml-autoload 'tyda-mode `(lp '(nxhtml-download-root-url nil) "util/tyda" nxhtml-install-dir) "\
+Minor mode for key bindings for `tyda-lookup-word'.
+It binds Alt-Mouse-1 just as the Tyda add-on does in Firefox.
+Here are all key bindings
+
+\\{tyda-mode-map}
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (udev-call-first-step) "udev" "util/udev.el" (19412
+;;;;;; 25976))
+;;; Generated autoloads from util/udev.el
+(web-autoload-require 'udev 'lp '(nxhtml-download-root-url nil) "util/udev" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'udev-call-first-step `(lp '(nxhtml-download-root-url nil) "util/udev" nxhtml-install-dir) "\
+Set up and call first step.
+Set up buffer LOG-BUFFER to be used for log messages and
+controling of the execution of the functions in list STEPS which
+are executed one after another.
+
+Write HEADER at the end of LOG-BUFFER.
+
+Call first step.
+
+If FINISH-FUN non-nil it should be a function. This is called
+after last step with LOG-BUFFER as parameter.
+
+\(fn LOG-BUFFER STEPS HEADER FINISH-FUN)" nil nil)
+
+;;;***
+
+;;;### (autoloads (udev-ecb-customize-startup udev-ecb-update) "udev-ecb"
+;;;;;; "util/udev-ecb.el" (19256 5410))
+;;; Generated autoloads from util/udev-ecb.el
+(web-autoload-require 'udev-ecb 'lp '(nxhtml-download-root-url nil) "util/udev-ecb" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'udev-ecb-update `(lp '(nxhtml-download-root-url nil) "util/udev-ecb" nxhtml-install-dir) "\
+Fetch and install ECB from the devel sources.
+To determine where to store the sources see `udev-ecb-dir'.
+For how to start ECB see `udev-ecb-load-ecb'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'udev-ecb-customize-startup `(lp '(nxhtml-download-root-url nil) "util/udev-ecb" nxhtml-install-dir) "\
+Customize ECB dev nXhtml startup group.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (udev-rinari-update) "udev-rinari" "util/udev-rinari.el"
+;;;;;; (19256 5410))
+;;; Generated autoloads from util/udev-rinari.el
+(web-autoload-require 'udev-rinari 'lp '(nxhtml-download-root-url nil) "util/udev-rinari" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'udev-rinari-update `(lp '(nxhtml-download-root-url nil) "util/udev-rinari" nxhtml-install-dir) "\
+Fetch and install Rinari from the devel sources.
+To determine where to store the sources and how to start rinari
+see `udev-rinari-dir' and `udev-rinari-load-rinari'.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (viper-tutorial) "viper-tut" "util/viper-tut.el"
+;;;;;; (19388 44990))
+;;; Generated autoloads from util/viper-tut.el
+(web-autoload-require 'viper-tut 'lp '(nxhtml-download-root-url nil) "util/viper-tut" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'viper-tutorial `(lp '(nxhtml-download-root-url nil) "util/viper-tut" nxhtml-install-dir) "\
+Run a tutorial for Viper.
+
+A simple classic tutorial in 5 parts that have been used by many
+people starting to learn vi keys. You may learn enough to start
+using `viper-mode' in Emacs.
+
+Some people find that vi keys helps against repetetive strain
+injury, see URL
+
+ `http://www.emacswiki.org/emacs/RepeatedStrainInjury'.
+
+Note: There might be a few clashes between vi key binding and
+Emacs standard key bindings. You will be notified about those in
+the tutorial. Even more, if your own key bindings comes in
+between you will be notified about that too.
+
+\(fn PART &optional DONT-ASK-FOR-REVERT)" t nil)
+
+;;;***
+
+;;;### (autoloads (vline-global-mode vline-mode) "vline" "util/vline.el"
+;;;;;; (19157 2168))
+;;; Generated autoloads from util/vline.el
+(web-autoload-require 'vline 'lp '(nxhtml-download-root-url nil) "util/vline" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'vline-mode `(lp '(nxhtml-download-root-url nil) "util/vline" nxhtml-install-dir) "\
+Display vertical line mode.
+
+\(fn &optional ARG)" t nil)
+
+(defvar vline-global-mode nil "\
+Non-nil if Vline-Global mode is enabled.
+See the command `vline-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `vline-global-mode'.")
+
+(nxhtml-custom-autoload 'vline-global-mode 'vline nil)
+
+(nxhtml-autoload 'vline-global-mode `(lp '(nxhtml-download-root-url nil) "util/vline" nxhtml-install-dir) "\
+Display vertical line mode as globally.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (whelp) "whelp" "util/whelp.el" (19277 65356))
+;;; Generated autoloads from util/whelp.el
+(web-autoload-require 'whelp 'lp '(nxhtml-download-root-url nil) "util/whelp" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'whelp 'custom-loads))) (if (member '"whelp" loads) nil (put 'whelp 'custom-loads (cons '"whelp" loads))))
+
+;;;***
+
+;;;### (autoloads (wikipedia-draft-buffer wikipedia-draft-page wikipedia-draft
+;;;;;; wikipedia-mode) "wikipedia-mode" "related/wikipedia-mode.el"
+;;;;;; (19277 65356))
+;;; Generated autoloads from related/wikipedia-mode.el
+(web-autoload-require 'wikipedia-mode 'lp '(nxhtml-download-root-url nil) "related/wikipedia-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'wikipedia-mode `(lp '(nxhtml-download-root-url nil) "related/wikipedia-mode" nxhtml-install-dir) "\
+Major mode for editing wikimedia style wikis.
+Major mode for editing articles written in the markup language
+used by Wikipedia, the free on-line
+encyclopedia (see URL `http://www.wikipedia.org').
+
+There are several ways to use wikipedia-mode:
+
+- You can simply cut and paste articles between Emacs and your
+ web browser's text box.
+- If you are using Firefox you can use the It's All Text add-on
+ for Firefox.
+- You can use MozEx, a Mozilla/Firefox web browser extension that
+ allows you to call Emacs from a text
+ box (see URL `http://mozex.mozdev.org/').
+- Another way is to use the PERL script ee-helper, which allows
+ you to up and download wiki texts.
+
+Wikipedia articles are usually unfilled: newline characters are not
+used for breaking paragraphs into lines. Unfortunately, Emacs does not
+handle word wrapping yet. As a workaround, wikipedia-mode turns on
+longlines-mode automatically. In case something goes wrong, the
+following commands may come in handy:
+
+\\[wikipedia-fill-article] fills the buffer.
+\\[wikipedia-unfill-article] unfills the buffer.
+Be warned that function can be dead slow, better use wikipedia-unfill-paragraph-or-region.
+\\[wikipedia-unfill-paragraph-or-region] unfills the paragraph
+\\[wikipedia-unfill-paragraph-simple] doehe same but simpler.
+
+
+
+The following commands put in markup structures.
+
+\\[wikipedia-insert-bold-italic] bold+italic
+\\[wikipedia-insert-bold] bold text
+\\[wikipedia-insert-italics] italics
+\\[wikipedia-insert-nowiki] no wiki markup
+\\[wikipedia-insert-link-wiki] inserts a link
+
+The following commands are also defined:
+\\[wikipedia-insert-user] inserts user name
+\\[wikipedia-insert-signature] inserts ~~~~
+\\[wikipedia-insert-enumerate] inserts enumerate type structures
+\\[wikipedia-insert-itemize] inserts itemize type structures
+\\[wikipedia-insert-hline] inserts a hline
+
+The draft functionality
+\\[wikipedia-draft]
+\\[wikipedia-draft-region]
+\\[wikipedia-draft-view-draft]
+\\[wikipedia-draft-page]
+\\[wikipedia-draft-buffer]
+
+Replying and sending functionality
+\\[wikipedia-reply-at-point-simple]
+\\[wikipedia-draft-reply]
+
+
+The register functionality
+\\[wikipedia-copy-page-to-register]
+\\[defun wikipedia-insert-page-to-register]
+
+
+Some simple editing commands.
+\\[wikipedia-enhance-indent]
+\\[wikipedia-yank-prefix]
+\\[wikipedia-unfill-paragraph-or-region]
+
+
+
+\\[wikipedia-terminate-paragraph] starts a new list item or paragraph in a context-aware manner.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'wikipedia-draft `(lp '(nxhtml-download-root-url nil) "related/wikipedia-mode" nxhtml-install-dir) "\
+Open a temporary buffer in wikipedia mode for editing an
+ wikipedia draft, which an arbitrary piece of data. After
+ finishing the editing either use \\[wikipedia-draft-buffer] to
+ send the data into the wikipedia-draft-data-file, or send the
+ buffer using `wikipedia-draft-send-to-mozex' and insert it later
+ into a wikipedia article.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'wikipedia-draft-page `(lp '(nxhtml-download-root-url nil) "related/wikipedia-mode" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'wikipedia-draft-buffer `(lp '(nxhtml-download-root-url nil) "related/wikipedia-mode" nxhtml-install-dir) "\
+Wikipedia-draft-buffer sends the contents of the current (temporary)
+buffer to the wikipedia-draft-buffer, see the variable
+wikipedia-draft-data-file.
+
+\(fn)" t nil)
+
+(defvar wikipedia-draft-send-archive t "\
+*Archive the reply.")
+
+;;;***
+
+;;;### (autoloads (visual-basic-mode) "visual-basic-mode" "related/visual-basic-mode.el"
+;;;;;; (19235 1650))
+;;; Generated autoloads from related/visual-basic-mode.el
+(web-autoload-require 'visual-basic-mode 'lp '(nxhtml-download-root-url nil) "related/visual-basic-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'visual-basic-mode `(lp '(nxhtml-download-root-url nil) "related/visual-basic-mode" nxhtml-install-dir) "\
+A mode for editing Microsoft Visual Basic programs.
+Features automatic indentation, font locking, keyword capitalization,
+and some minor convenience functions.
+Commands:
+\\{visual-basic-mode-map}
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (tt-mode) "tt-mode" "related/tt-mode.el" (18603
+;;;;;; 15792))
+;;; Generated autoloads from related/tt-mode.el
+(web-autoload-require 'tt-mode 'lp '(nxhtml-download-root-url nil) "related/tt-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'tt-mode `(lp '(nxhtml-download-root-url nil) "related/tt-mode" nxhtml-install-dir) "\
+Major mode for editing Template Toolkit files.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (smarty-mode smarty) "smarty-mode" "related/smarty-mode.el"
+;;;;;; (19235 1650))
+;;; Generated autoloads from related/smarty-mode.el
+(web-autoload-require 'smarty-mode 'lp '(nxhtml-download-root-url nil) "related/smarty-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'smarty 'custom-loads))) (if (member '"smarty-mode" loads) nil (put 'smarty 'custom-loads (cons '"smarty-mode" loads))))
+
+(nxhtml-autoload 'smarty-mode `(lp '(nxhtml-download-root-url nil) "related/smarty-mode" nxhtml-install-dir) "\
+Smarty Mode
+***********
+
+Smarty Mode is a GNU XEmacs major mode for editing Smarty templates.
+
+1 Introduction
+**************
+
+Smarty-Mode is a mode allowing easy edit of Smarty templates:
+highlight, templates, navigation into source files...
+
+
+
+Features (new features in bold) :
+
+ * Completion
+
+ * Customizable
+
+ * Highlight
+
+ * Menu
+
+ * Stuttering
+
+ * Templates
+ - Built-in Functions
+
+ - User Functions
+
+ - Variable Modifiers
+
+ - Plugin (Functions)
+ * BlockRepeatPlugin
+
+ * ClipCache
+
+ * Smarty Formtool
+
+ * Smarty Paginate
+
+ * Smarty Validate
+
+ - Plugin (Variable Modifiers)
+ * AlternativeDateModifierPlugin
+
+ * B2Smilies
+
+ * BBCodePlugin
+
+ - Fonctions Non-Smarty
+
+
+
+This manual describes Smarty Mode version 0.0.5.
+
+2 Installation
+**************
+
+2.1 Requirements
+================
+
+Smarty Mode is a XEmacs major mode that needs the following
+software/packages:
+
+ * XEmacs (http://www.xemacs.org/).
+
+ * `font-lock' mode generaly installed with XEmacs.
+
+ * `assoc' mode generaly installed with XEmacs.
+
+ * `easymenu' mode generaly installed with XEmacs.
+
+ * `hippie-exp' mode generaly installed with XEmacs.
+
+Before continuing, you must be sure to have all this packages
+installed.
+
+2.2 Download
+============
+
+Two internet address to download Smarty Mode :
+
+ * Principal: Smarty-Mode 0.0.5
+ (http://deboutv.free.fr/lisp/smarty/download/smarty-0.0.5.tar.gz)
+ (http://deboutv.free.fr/lisp/smarty/)
+
+ * Secondary: Smarty-Mode 0.0.5
+ (http://www.morinie.fr/lisp/smarty/download/smarty-0.0.5.tar.gz)
+ (http://www.morinie.fr/lisp/smarty/)
+
+ * Old releases: Smarty-Mode
+ (http://deboutv.free.fr/lisp/smarty/download.php)
+ (http://deboutv.free.fr/lisp/smarty/)
+
+2.3 Installation
+================
+
+2.3.1 Installation
+------------------
+
+To install Smarty Mode you need to choose an installation directory
+\(for example `/usr/local/share/lisp' or `c:lisp'). The administrator
+must have the write rights on this directory.
+
+With your favorite unzip software, unzip the archive in the
+installation directory.
+
+Example:
+ cd /usr/local/share/lisp
+ tar zxvf smarty-0.0.5.tar.gz
+Now you have a `smarty' directory in the installation directory. This
+directory contains 2 files `smarty-mode.el' and `smarty-mode.elc' and
+another directory `docs' containing the documentation.
+
+You need to configure XEmacs. open you initialization file `init.el'
+\(open the file or start XEmacs then choose the Options menu and Edit
+Init File). Add the following lines (the installation directory in
+this example is `/usr/local/share/lisp') :
+
+ (setq load-path
+ (append (list \"/usr/local/share/lisp/\") load-path))
+ (nxhtml-autoload 'smarty-mode \"smarty-mode\" \"Smarty Mode\" t)
+
+2.3.2 Update
+------------
+
+The update is easy. You need to unzip the archive in the installation
+directory to remove the old release.
+
+Example:
+ cd /usr/local/share/lisp
+ rm -rf smarty
+ tar zxvf smarty-0.0.5.tar.gz
+
+2.4 Invoke Smarty-Mode
+======================
+
+You have two possibilities to invoke the Smarty Mode.
+
+ - Manually: At each file opening you need to launch Smarty Mode
+ with the following command:
+
+ `M-x smarty-mode'
+
+ - Automatically: Add the following linesin your initialization
+ file `init.el' :
+
+ (setq auto-mode-alist
+ (append
+ '((\"\\.tpl$\" . smarty-mode))
+ auto-mode-alist))
+
+
+3 Customization
+***************
+
+This chapter describes the differents parameters and functions that
+you can change to customize Smarty Mode. To do that, open a Smarty
+file, click on the Smarty menu and choose Options then Browse
+Options....
+
+3.1 Parameters
+==============
+
+3.1.1 Mode
+----------
+
+Smarty Mode has 2 modes allowing to simplify the writing of Smarty
+templates. You can enable/disable each mode individually.
+
+`smarty-electric-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable automatic generation of template.
+ If `nil'; template generators can still be invoked through key
+ bindings and menu. Is indicated in the modeline by \"/e\" after
+ the mode name and can be toggled by `smarty-electric-mode'.
+
+`smarty-stutter-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable the stuttering. Is indicated in the
+ modeline by \"/s\" after the mode name and can be toggled by
+ `smarty-stutter-mode'.
+
+3.1.2 Menu
+----------
+
+Smarty Mode has also 1 menu that you can enable/disable. The menu
+Sources is specific to each Smarty files opened.
+
+`smarty-source-file-menu'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; the Sources menu is enabled. This menu
+ contains the list of Smarty file located in the current
+ directory. The Sources menu scans the directory when a file is
+ opened.
+
+3.1.3 Menu
+----------
+
+`smarty-highlight-plugin-functions'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; the functions described in the smarty
+ plugins are highlighted.
+
+3.1.4 Templates
+---------------
+
+3.1.4.1 Header
+..............
+
+`smarty-file-header'
+ Type: string
+ Default value: `\"\"'
+ Description: String or file to insert as file header. If the
+ string specifies an existing file name the contents of the file
+ is inserted; otherwise the string itself is inserted as file
+ header.
+ Type `C-j' for newlines.
+ The follonwing keywords are supported:
+ <filename>: replaced by the file name.
+ <author>: replaced by the user name and email address.
+ <login>: replaced by `user-login-name'.
+ <company>: replaced by `smarty-company-name' content.
+ <date>: replaced by the current date.
+ <year>: replaced by the current year.
+ <copyright>: replaced by `smarty-copyright-string' content.
+ <cursor>: final cursor position.
+
+`smarty-file-footer'
+ Type: string
+ Default value: `\"\"'
+ Description: String or file to insert as file footer. See
+ `smarty-file-header'
+
+`smarty-company-name'
+ Type: string
+ Default value: `\"\"'
+ Description: Name of the company to insert in file header.
+
+`smarty-copyright-string'
+ Type: string
+ Default value: `\"\"'
+ Description: Coryright string to insert in file header.
+
+`smarty-date-format'
+ Type: string
+ Default value: `\"%Y-%m-%d\"'
+ Description: Date format.
+
+`smarty-modify-date-prefix-string'
+ Type: string
+ Default value: `\"\"'
+ Description: Prefix string of modification date in Smarty file
+ header.
+
+`smarty-modify-date-on-saving'
+ Type: bool
+ Default value: `nil'
+ Description: If `t'; update the modification date when the
+ buffer is saved.
+
+3.1.5 Miscellaneous
+-------------------
+
+`smarty-left-delimiter'
+ Type: string
+ Default value: `\"\"'
+ Description: Left escaping delimiter for Smarty templates.
+
+`smarty-right-delimiter'
+ Type: string
+ Default value: `\"\"'
+ Description: Right escaping delimiter for Smarty templates.
+
+`smarty-intelligent-tab'
+ Type: bool
+ Default value: `t'
+ Description: If `t'; TAB does indentation; completion and insert
+ tabulations. If `nil'; TAB does only indentation.
+
+`smarty-word-completion-in-minibuffer'
+ Type: bool
+ Default value: `t'
+ Description: If `t'; enable completion in the minibuffer.
+
+`smarty-word-completion-case-sensitive'
+ Type: bool
+ Default value: `nil'
+ Description: If `t'; completion is case sensitive.
+
+3.2 Functions
+=============
+
+3.2.1 Mode
+----------
+
+`smarty-electric-mode'
+ Menu: Smarty -> Options -> Mode -> Electric Mode
+ Keybinding: `C-c C-m C-e'
+ Description: This functions is used to enable/disable the
+ electric mode.
+
+`smarty-stutter-mode'
+ Menu: Smarty -> Options -> Mode -> Stutter Mode
+ Keybinding: `C-c C-m C-s'
+ Description: This function is used to enable/disable the stutter
+ mode.
+
+4 Menus
+*******
+
+There are 2 menus: Smarty and Sources. All theses menus can be
+accessed from the menubar or from the right click. This chapter
+describes each menus.
+
+4.1 Smarty
+==========
+
+This is the main menu of Smarty Mode. It allows an easy access to the
+main features of the Smarty Mode: Templates (see *Note Templates::)
+and Options (see *Note Customization::).
+
+This menu contains also 3 functions that are discussed in the next
+part.
+
+4.1.1 Functions
+---------------
+
+`smarty-show-messages'
+ Menu: Smarty -> Show Messages
+ Keybinding: `C-c M-m'
+ Description: This function opens the *Messages* buffer to
+ display previous error messages.
+
+`smarty-doc-mode'
+ Menu: Smarty -> Smarty Mode Documentation
+ Keybinding: `C-c C-h'
+ Description: This function opens the *Help* buffer and prints in
+ it the Smarty Mode documentation.
+
+`smarty-version'
+ Menu: Smarty -> Version
+ Keybinding: `C-c C-v'
+ Description: This function displays in the minibuffer the
+ current Smarty Mode version with the timestamp.
+
+4.2 Sources
+===========
+
+The Sources menu shows the Smarty files in the current directory. If
+you add or delete a file in the current directory, you need to
+refresh the menu.
+
+4.2.1 Customization
+-------------------
+
+`smarty-source-file-menu'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; the Sources menu is enabled. This menu
+ contains the list of Smarty file located in the current
+ directory. The Sources menu scans the directory when a file is
+ opened.
+
+4.2.2 Functions
+---------------
+
+`smarty-add-source-files-menu'
+ Menu: Sources -> *Rescan*
+ Keybinding: `C-c C-s C-u'
+ Description: This function is used to refresh the Sources menu.
+
+5 Stuttering
+************
+
+The stutter mode is a mode that affects a function to a key. For
+example, when you use the `ENTER' key, the associated function will
+create a new line and indent it.
+
+5.1 Customization
+=================
+
+`smarty-stutter-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable the stuttering. Is indicated in the
+ modeline by \"/s\" after the mode name and can be toggled by
+ `smarty-stutter-mode'.
+
+5.2 Functions
+=============
+
+`SPACE'
+ If in comment, indent the comment and add new line if necessary.
+ In other case, add a space.
+
+`('
+ If the previous character is a `(', the `((' will be replaced by
+ `['.
+ If the previous character is a `[', the `[(' will be replaced by
+ `{'.
+ In other case, insert a `('.
+
+`)'
+ If the previous character is a `)', the `))' will be replaced by
+ `]'.
+ If the previous character is a `]', the `])' will be replaced by
+ `}'.
+ In other case, insert a `)'.
+
+6 Templates
+***********
+
+In the Smarty Mode, the Smarty functions (like if, while, for, fopen,
+fclose) are predefined in functions called \"Templates\".
+
+Each template can be invoked by the function name or by using the
+<SPACE> key after the Smarty function name in the buffer (Note, using
+`M-<SPACE>' disable the template).
+
+A template can be aborted by using the `C-g' or by lefting empty the
+tempate prompt (in the minibuffer).
+
+6.1 Customization
+=================
+
+`smarty-electric-mode'
+ Type: boolean
+ Default value: `t'
+ Description: If `t'; enable automatic generation of template.
+ If `nil'; template generators can still be invoked through key
+ bindings and menu. Is indicated in the modeline by \"/e\" after
+ the mode name and can be toggled by `smarty-electric-mode'.
+
+For a complete description of the template customizable variables,
+see *Note Cu01-Pa01-Template::
+
+6.2 Functions
+=============
+
+6.2.1 Smarty Functions
+----------------------
+
+For Smarty functions, see PDF or HTML documentation.
+
+6.2.2 Non-Smarty Functions
+--------------------------
+
+`smarty-template-header'
+ Menu: Smarty -> Templates -> Insert Header
+ Keybinding: `C-c C-t C-h'
+ Description: This function is used to insert a header in the
+ current buffer.
+
+`smarty-template-footer'
+ Menu: Smarty -> Templates -> Insert Footer
+ Keybinding: `C-c C-t C-f'
+ Description: This function is used to insert a footer in the
+ current buffer.
+
+`smarty-template-insert-date'
+ Menu: Smarty -> Templates -> Insert Date
+ Keybinding: `C-c C-t C-d i'
+ Description: This function is used to insert the date in the
+ current buffer.
+
+`smarty-template-modify'
+ Menu: Smarty -> Templates -> Modify Date
+ Keybinding: `C-c C-t C-d m'
+ Description: This function is used to modify the last
+ modification date in the current buffer.
+
+7 Bugs, Help
+************
+
+ * To report bugs: Bugtracker
+ (http://bugtracker.morinie.fr/lisp/set_project.php?project_id=2)
+
+ * To obtain help you can post on the dedicated forum: Forum
+ (http://forum.morinie.fr/lisp/)
+
+8 Key bindings
+**************
+
+\\{smarty-mode-map}
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (php-mode php-file-patterns php) "php-mode" "related/php-mode.el"
+;;;;;; (19218 42180))
+;;; Generated autoloads from related/php-mode.el
+(web-autoload-require 'php-mode 'lp '(nxhtml-download-root-url nil) "related/php-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'php 'custom-loads))) (if (member '"php-mode" loads) nil (put 'php 'custom-loads (cons '"php-mode" loads))))
+
+(defvar php-file-patterns '("\\.php[s34]?\\'" "\\.phtml\\'" "\\.inc\\'") "\
+List of file patterns for which to automatically invoke `php-mode'.")
+
+(nxhtml-custom-autoload 'php-file-patterns 'php-mode nil)
+
+(nxhtml-autoload 'php-mode `(lp '(nxhtml-download-root-url nil) "related/php-mode" nxhtml-install-dir) "\
+Major mode for editing PHP code.
+
+\\{php-mode-map}
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (global-mozadd-mirror-mode mozadd-mirror-mode global-mozadd-refresh-edited-on-save-mode
+;;;;;; mozadd-refresh-edited-on-save-mode) "mozadd" "related/mozadd.el"
+;;;;;; (19235 1650))
+;;; Generated autoloads from related/mozadd.el
+(web-autoload-require 'mozadd 'lp '(nxhtml-download-root-url nil) "related/mozadd" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'mozadd-refresh-edited-on-save-mode `(lp '(nxhtml-download-root-url nil) "related/mozadd" nxhtml-install-dir) "\
+Refresh mozadd edited file in Firefox when saving file.
+The mozadd edited file is the file in the last buffer visited in
+`mozadd-mirror-mode'.
+
+You can use this for example when you edit CSS files.
+
+The mozadd edited file must be shown in Firefox and visible.
+
+\(fn &optional ARG)" t nil)
+
+(defvar global-mozadd-refresh-edited-on-save-mode nil "\
+Non-nil if Global-Mozadd-Refresh-Edited-On-Save mode is enabled.
+See the command `global-mozadd-refresh-edited-on-save-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-mozadd-refresh-edited-on-save-mode'.")
+
+(nxhtml-custom-autoload 'global-mozadd-refresh-edited-on-save-mode 'mozadd nil)
+
+(nxhtml-autoload 'global-mozadd-refresh-edited-on-save-mode `(lp '(nxhtml-download-root-url nil) "related/mozadd" nxhtml-install-dir) "\
+Toggle Mozadd-Refresh-Edited-On-Save mode in every possible buffer.
+With prefix ARG, turn Global-Mozadd-Refresh-Edited-On-Save mode on if and only if
+ARG is positive.
+Mozadd-Refresh-Edited-On-Save mode is enabled in all buffers where
+`(lambda nil (when (or (derived-mode-p (quote css-mode)) (mozadd-html-buffer-file-p)) (mozadd-refresh-edited-on-save-mode 1)))' would do it.
+See `mozadd-refresh-edited-on-save-mode' for more information on Mozadd-Refresh-Edited-On-Save mode.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'mozadd-mirror-mode `(lp '(nxhtml-download-root-url nil) "related/mozadd" nxhtml-install-dir) "\
+Mirror content of current file buffer immediately in Firefox.
+When you turn on this mode the file will be opened in Firefox.
+Every change you make in the buffer will trigger a redraw in
+Firefox - regardless of if you save the file or not.
+
+For the mirroring to work the edited file must be shown in
+Firefox and visible.
+
+If `nxml-where-mode' is on the marks will also be shown in
+Firefox as CSS outline style. You can customize the style
+through the option `mozadd-xml-path-outline-style'.
+
+See also `mozadd-refresh-edited-on-save-mode'.
+
+\(fn &optional ARG)" t nil)
+
+(defvar global-mozadd-mirror-mode nil "\
+Non-nil if Global-Mozadd-Mirror mode is enabled.
+See the command `global-mozadd-mirror-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `global-mozadd-mirror-mode'.")
+
+(nxhtml-custom-autoload 'global-mozadd-mirror-mode 'mozadd nil)
+
+(nxhtml-autoload 'global-mozadd-mirror-mode `(lp '(nxhtml-download-root-url nil) "related/mozadd" nxhtml-install-dir) "\
+Toggle Mozadd-Mirror mode in every possible buffer.
+With prefix ARG, turn Global-Mozadd-Mirror mode on if and only if
+ARG is positive.
+Mozadd-Mirror mode is enabled in all buffers where
+`(lambda nil (when (mozadd-html-buffer-file-p) (mozadd-mirror-mode 1)))' would do it.
+See `mozadd-mirror-mode' for more information on Mozadd-Mirror mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (inferior-moz-mode moz-minor-mode) "moz" "related/moz.el"
+;;;;;; (19048 2102))
+;;; Generated autoloads from related/moz.el
+(web-autoload-require 'moz 'lp '(nxhtml-download-root-url nil) "related/moz" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'moz-minor-mode `(lp '(nxhtml-download-root-url nil) "related/moz" nxhtml-install-dir) "\
+MozRepl minor mode for interaction with Firefox.
+With no argument, this command toggles the mode.
+Non-null prefix argument turns on the mode.
+Null prefix argument turns off the mode.
+
+When this minor mode is enabled, some commands become available
+to send current code area (as understood by c-mark-function) or
+region or buffer to an inferior MozRepl process (which will be
+started as needed).
+
+The following keys are bound in this minor mode:
+
+\\{moz-minor-mode-map}
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'inferior-moz-mode `(lp '(nxhtml-download-root-url nil) "related/moz" nxhtml-install-dir) "\
+Major mode for interacting with Firefox via MozRepl.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (iss-mumamo-mode) "iss-mumamo" "related/iss-mumamo.el"
+;;;;;; (19294 54042))
+;;; Generated autoloads from related/iss-mumamo.el
+(web-autoload-require 'iss-mumamo 'lp '(nxhtml-download-root-url nil) "related/iss-mumamo" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'iss-mumamo-mode `(lp '(nxhtml-download-root-url nil) "related/iss-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes Inno Setup .iss files.
+The main major mode will be `iss-mode'.
+The [code] section, if any, will be in `pascal-mode'." t)
+
+;;;***
+
+;;;### (autoloads (iss-mode) "iss-mode" "related/iss-mode.el" (19294
+;;;;;; 54042))
+;;; Generated autoloads from related/iss-mode.el
+(web-autoload-require 'iss-mode 'lp '(nxhtml-download-root-url nil) "related/iss-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'iss-mode `(lp '(nxhtml-download-root-url nil) "related/iss-mode" nxhtml-install-dir) "\
+Major mode for editing InnoSetup script files. Upon startup iss-mode-hook is run.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (flymake-js-load flymake-js) "flymake-js" "related/flymake-js.el"
+;;;;;; (19218 42180))
+;;; Generated autoloads from related/flymake-js.el
+(web-autoload-require 'flymake-js 'lp '(nxhtml-download-root-url nil) "related/flymake-js" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'flymake-js 'custom-loads))) (if (member '"flymake-js" loads) nil (put 'flymake-js 'custom-loads (cons '"flymake-js" loads))))
+
+(nxhtml-autoload 'flymake-js-load `(lp '(nxhtml-download-root-url nil) "related/flymake-js" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (flymake-java-1-load) "flymake-java-1" "related/flymake-java-1.el"
+;;;;;; (19264 27004))
+;;; Generated autoloads from related/flymake-java-1.el
+(web-autoload-require 'flymake-java-1 'lp '(nxhtml-download-root-url nil) "related/flymake-java-1" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'flymake-java-1-load `(lp '(nxhtml-download-root-url nil) "related/flymake-java-1" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (flymake-css-load) "flymake-css" "related/flymake-css.el"
+;;;;;; (19292 11678))
+;;; Generated autoloads from related/flymake-css.el
+(web-autoload-require 'flymake-css 'lp '(nxhtml-download-root-url nil) "related/flymake-css" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'flymake-css-load `(lp '(nxhtml-download-root-url nil) "related/flymake-css" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" nil nil)
+
+;;;***
+
+;;;### (autoloads (django-mode) "django" "related/django.el" (19411
+;;;;;; 8520))
+;;; Generated autoloads from related/django.el
+(web-autoload-require 'django 'lp '(nxhtml-download-root-url nil) "related/django" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'django-mode `(lp '(nxhtml-download-root-url nil) "related/django" nxhtml-install-dir) "\
+Simple Django mode for use with mumamo.
+This mode only provides syntax highlighting.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (csharp-mode csharp-mode-hook) "csharp-mode" "related/csharp-mode.el"
+;;;;;; (19410 9973))
+;;; Generated autoloads from related/csharp-mode.el
+(web-autoload-require 'csharp-mode 'lp '(nxhtml-download-root-url nil) "related/csharp-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(add-to-list 'auto-mode-alist '("\\.cs$" . csharp-mode))
+
+(defvar csharp-mode-hook nil "\
+*Hook called by `csharp-mode'.")
+
+(nxhtml-custom-autoload 'csharp-mode-hook 'csharp-mode t)
+
+(nxhtml-autoload 'csharp-mode `(lp '(nxhtml-download-root-url nil) "related/csharp-mode" nxhtml-install-dir) "\
+Major mode for editing C# code. This mode is derived from CC Mode to
+support C#.
+
+The hook `c-mode-common-hook' is run with no args at mode
+initialization, then `csharp-mode-hook'.
+
+This mode will automatically add a regexp for Csc.exe error and warning
+messages to the `compilation-error-regexp-alist'.
+
+Key bindings:
+\\{csharp-mode-map}
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (winring-rename-configuration winring-delete-configuration
+;;;;;; winring-jump-to-configuration winring-prev-configuration
+;;;;;; winring-next-configuration winring-duplicate-configuration
+;;;;;; winring-new-configuration) "winring" "util/winring.el" (19392
+;;;;;; 30980))
+;;; Generated autoloads from util/winring.el
+(web-autoload-require 'winring 'lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'winring-new-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Save the current window configuration and create an empty new one.
+The buffer shown in the new empty configuration is defined by
+`winring-new-config-buffer-name'.
+
+With \\[universal-argument] prompt for the new configuration's name.
+Otherwise, the function in `winring-name-generator' will be called to
+get the new configuration's name.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'winring-duplicate-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Push the current window configuration on the ring, and duplicate it.
+
+With \\[universal-argument] prompt for the new configuration's name.
+Otherwise, the function in `winring-name-generator' will be called to
+get the new configuration's name.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'winring-next-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Switch to the next window configuration for this frame.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'winring-prev-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Switch to the previous window configuration for this frame.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'winring-jump-to-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Go to the named window configuration.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'winring-delete-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Delete the current configuration and switch to the next one.
+With \\[universal-argument] prompt for named configuration to delete.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'winring-rename-configuration `(lp '(nxhtml-download-root-url nil) "util/winring" nxhtml-install-dir) "\
+Rename the current configuration to NAME.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (winsav-switch-config winsav-save-full-config winsav-save-mode
+;;;;;; winsav winsav-put-window-tree) "winsav" "util/winsav.el"
+;;;;;; (19295 38082))
+;;; Generated autoloads from util/winsav.el
+(web-autoload-require 'winsav 'lp '(nxhtml-download-root-url nil) "util/winsav" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'winsav-put-window-tree `(lp '(nxhtml-download-root-url nil) "util/winsav" nxhtml-install-dir) "\
+Put window structure SAVED-TREE into WINDOW.
+Restore a structure SAVED-TREE returned from
+`winsav-get-window-tree' into window WINDOW.
+
+If COPY-WIN-OVL is non-nil then overlays having a 'window
+property pointing to one of the windows in SAVED-TREE where this
+window still is shown will be copied to a new overlay with
+'window property pointing to the corresponding new window.
+
+If WIN-OVL-ALL-BUFS is non-nil then all buffers will be searched
+for overlays with a 'window property of the kind above.
+
+At the very end of this function the hook `winsav-after-put' is
+run.
+
+\(fn SAVED-TREE WINDOW &optional COPY-WIN-OVL WIN-OVL-ALL-BUFS)" nil nil)
+
+(let ((loads (get 'winsav 'custom-loads))) (if (member '"winsav" loads) nil (put 'winsav 'custom-loads (cons '"winsav" loads))))
+
+(defvar winsav-save-mode nil "\
+Non-nil if Winsav-Save mode is enabled.
+See the command `winsav-save-mode' for a description of this minor mode.")
+
+(nxhtml-custom-autoload 'winsav-save-mode 'winsav nil)
+
+(nxhtml-autoload 'winsav-save-mode `(lp '(nxhtml-download-root-url nil) "util/winsav" nxhtml-install-dir) "\
+Toggle winsav configuration saving mode.
+With numeric ARG, turn winsav saving on if ARG is positive, off
+otherwise.
+
+When this mode is turned on, winsav configurations are saved from
+one session to another. A winsav configuration consists of
+frames, windows and visible buffers configurations plus
+optionally buffers and files managed by the functions used by
+option `desktop-save-mode'
+
+By default this is integrated with `desktop-save-mode'. If
+`desktop-save-mode' is on and `winsav-handle-also-desktop' is
+non-nil then save and restore also desktop.
+
+See the command `winsav-switch-config' for more information and
+other possibilities.
+
+Note: If you want to avoid saving when you exit just turn off
+this minor mode.
+
+For information about what is saved and restored and how to save
+and restore additional information see the function
+`winsav-save-configuration'.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'winsav-save-full-config `(lp '(nxhtml-download-root-url nil) "util/winsav" nxhtml-install-dir) "\
+Saved current winsav configuration in directory DIRNAME.
+Then change to this configuration.
+
+See also `winsav-switch-config'.
+
+\(fn DIRNAME)" nil nil)
+
+(nxhtml-autoload 'winsav-switch-config `(lp '(nxhtml-download-root-url nil) "util/winsav" nxhtml-install-dir) "\
+Change to winsav configuration in directory DIRNAME.
+If DIRNAME is the current winsav configuration directory then
+offer to save it or restore it from saved values.
+
+Otherwise, before switching offer to save the current winsav
+configuration. Then finally switch to the new winsav
+configuration, creating it if it does not exist.
+
+If option `desktop-save-mode' is on then buffers and files are also
+restored and saved the same way.
+
+See also option `winsav-save-mode' and command
+`winsav-tell-configuration'.
+
+\(fn DIRNAME)" t nil)
+
+;;;***
+
+;;;### (autoloads (winsav-rotate winsize-set-mode-line-colors winsize-save-window-configuration
+;;;;;; winsize-balance-siblings resize-windows) "winsize" "util/winsize.el"
+;;;;;; (19292 49706))
+;;; Generated autoloads from util/winsize.el
+(web-autoload-require 'winsize 'lp '(nxhtml-download-root-url nil) "util/winsize" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'resize-windows `(lp '(nxhtml-download-root-url nil) "util/winsize" nxhtml-install-dir) "\
+Start window resizing.
+During resizing a window is selected. You can move its
+borders. In the default configuration the arrow keys moves the
+right or bottom border if they are there. To move the opposite
+border use S-arrowkeys.
+
+You can also do other window operations, like splitting, deleting
+and balancing the sizes. The keybindings below describes the key
+bindings during resizing:\\<winsize-keymap>
+
+ `balance-windows' \\[balance-windows]
+ `winsize-balance-siblings' \\[winsize-balance-siblings]
+ `fit-window-to-buffer' \\[fit-window-to-buffer]
+ `shrink-window-if-larger-than-buffer' \\[shrink-window-if-larger-than-buffer]
+
+ `winsav-rotate' \\[winsav-rotate]
+
+ `winsize-move-border-up' \\[winsize-move-border-up]
+ `winsize-move-border-down' \\[winsize-move-border-down]
+ `winsize-move-border-left' \\[winsize-move-border-left]
+ `winsize-move-border-right' \\[winsize-move-border-right]
+
+ `winsize-to-border-or-window-left' \\[winsize-to-border-or-window-left]
+ `winsize-to-border-or-window-up' \\[winsize-to-border-or-window-up]
+ `winsize-to-border-or-window-right' \\[winsize-to-border-or-window-right]
+ `winsize-to-border-or-window-down' \\[winsize-to-border-or-window-down]
+
+ Note that you can also use your normal keys for
+ `forward-char', `backward-char', `next-line', `previous-line'
+ and what you have on HOME and END to move in the windows. That
+ might sometimes be necessary to directly select a
+ window. (You may however also use `other-window' or click
+ with the mouse, see below.)
+
+ `delete-window' \\[delete-window]
+ `delete-other-windows' \\[delete-other-windows]
+ `split-window-vertically' \\[split-window-vertically]
+ `split-window-horizontally' \\[split-window-horizontally]
+ `other-window' \\[other-window]
+
+ `winsize-save-window-configuration' \\[winsize-save-window-configuration]
+ `winsize-next-window-configuration' \\[winsize-next-window-configuration]
+ `winsize-previous-window-configuration' \\[winsize-previous-window-configuration]
+
+ `mouse-set-point' \\[mouse-set-point]
+
+ `winsize-quit' \\[winsize-quit]
+ `winsize-stop-go-back' \\[winsize-stop-go-back]
+ `winsize-stop' \\[winsize-stop]
+ `winsize-stop-and-execute' \\[winsize-stop-and-execute]
+
+ `winsize-help' \\[winsize-help]
+ `describe-key' \\[describe-key]
+ `describe-key-briefly' \\[describe-key-briefly]
+ (All the normal help keys work, and at least those above will
+ play well with resizing.)
+
+Nearly all other keys exits window resizing and they are also
+executed. However, the key sequences in `winsize-let-me-use' and
+dito for commands there are also executed without exiting
+resizing.
+
+The colors of the modelines are changed to those given in
+`winsize-mode-line-colors' to indicate that you are resizing
+windows. To make this indication more prominent the text in the
+selected window is marked with the face hold in the variable
+`winsize-selected-window-face'.
+
+The option `winsize-juris-way' decides how the borders to move
+are selected. If this option is non-nil then the right or bottom
+border are the ones that are moved with the arrow keys and the
+opposite border with shift arrow keys.
+
+If `winsize-juris-way' is nil then the following apply:
+
+As you select other borders or move to new a window the mouse
+pointer is moved inside the selected window to show which borders
+are beeing moved. The mouse jumps a little bit to make its
+position more visible. You can turn this off by customizing
+`winsize-make-mouse-prominent'.
+
+Which borders initially are choosen are controlled by the
+variable `winsize-autoselect-borders'.
+
+** Example: Border selection, movements and windows.
+
+ Suppose you have a frame divided into windows like in the
+ figure below. If window B is selected when you start resizing
+ then (with default settings) the borders marked with 'v' and
+ 'h' will be the ones that the arrow keys moves. To indicate
+ this the mouse pointer is placed in the right lower corner of
+ the selected window B.
+
+ +----------+-----------+--------+
+ | | v |
+ | | v |
+ | A | _B_ v |
+ | | v |
+ | | v |
+ | | x v |
+ +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh+
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ +----------+---------+----------+
+
+ Now if you press M-<left> then the picture below shows what has
+ happened. Note that the selected vertical border is now the one
+ between A and B. The mouse pointer has moved to the
+ corresponding corner in the window B, which is still selected.
+
+ +----------+-----------+--------+
+ | v | |
+ | v | |
+ | A v _B_ | |
+ | v | |
+ | v | |
+ | v x | |
+ +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh+
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ +----------+---------+----------+
+
+ Press M-<left> once again. This gives this picture:
+
+ +----------+-----------+--------+
+ | v | |
+ | v | |
+ | _A_ v B | |
+ | v | |
+ | v | |
+ | x v | |
+ +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh+
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ +----------+---------+----------+
+
+ Note that the window A is now selected. However there is no
+ border that could be moved to the left of this window (which
+ would otherwise be chosen now) so the border between A and B is
+ still the one that <left> and <right> moves. The mouse has
+ moved to A.
+
+ If we now delete window A the new situation will look like
+ this:
+
+ +----------+-----------+--------+
+ | | |
+ | | |
+ | _B_ | |
+ | | |
+ | | |
+ | x | |
+ +hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh+
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ | | |
+ +----------+---------+----------+
+
+
+
+>>>> testing stuff >>>>
+`help-mode-hook'
+`temp-buffer-show-function'
+`view-exit-action'
+<<<<<<<<<<<<<<<<<<<<<<<
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'winsize-balance-siblings `(lp '(nxhtml-download-root-url nil) "util/winsize" nxhtml-install-dir) "\
+Make current window siblings the same height or width.
+It works the same way as `balance-windows', but only for the
+current window and its siblings.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'winsize-save-window-configuration `(lp '(nxhtml-download-root-url nil) "util/winsize" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'winsize-set-mode-line-colors `(lp '(nxhtml-download-root-url nil) "util/winsize" nxhtml-install-dir) "\
+Turn mode line colors on if ON is non-nil, otherwise off.
+
+\(fn ON)" nil nil)
+
+(nxhtml-autoload 'winsav-rotate `(lp '(nxhtml-download-root-url nil) "util/winsize" nxhtml-install-dir) "\
+Rotate window configuration on selected frame.
+MIRROR should be either 'mirror-left-right, 'mirror-top-bottom or
+nil. In the first case the window configuration is mirrored
+vertically and in the second case horizontally. If MIRROR is nil
+the configuration is not mirrored.
+
+If TRANSPOSE is non-nil then the window structure is transposed
+along the diagonal from top left to bottom right (in analogy with
+matrix transosition).
+
+If called interactively MIRROR will is 'mirror-left-right by
+default, but 'mirror-top-bottom if called with prefix. TRANSPOSE
+is t. This mean that the window configuration will be turned one
+quarter clockwise (or counter clockwise with prefix).
+
+\(fn MIRROR TRANSPOSE)" t nil)
+
+;;;***
+
+;;;### (autoloads (wrap-to-fill-column-mode wrap-to-fill-left-marg-modes
+;;;;;; wrap-to-fill-left-marg wrap-to-fill) "wrap-to-fill" "util/wrap-to-fill.el"
+;;;;;; (19306 50510))
+;;; Generated autoloads from util/wrap-to-fill.el
+(web-autoload-require 'wrap-to-fill 'lp '(nxhtml-download-root-url nil) "util/wrap-to-fill" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'wrap-to-fill 'custom-loads))) (if (member '"wrap-to-fill" loads) nil (put 'wrap-to-fill 'custom-loads (cons '"wrap-to-fill" loads))))
+
+(defvar wrap-to-fill-left-marg nil "\
+Left margin handling for `wrap-to-fill-column-mode'.
+Used by `wrap-to-fill-column-mode'. If nil then center the
+display columns. Otherwise it should be a number which will be
+the left margin.")
+
+(nxhtml-custom-autoload 'wrap-to-fill-left-marg 'wrap-to-fill t)
+
+(defvar wrap-to-fill-left-marg-modes '(text-mode fundamental-mode) "\
+Major modes where `wrap-to-fill-left-margin' may be nil.")
+
+(nxhtml-custom-autoload 'wrap-to-fill-left-marg-modes 'wrap-to-fill t)
+
+(nxhtml-autoload 'wrap-to-fill-column-mode `(lp '(nxhtml-download-root-url nil) "util/wrap-to-fill" nxhtml-install-dir) "\
+Use `fill-column' display columns in buffer windows.
+By default the display columns are centered, but see the option
+`wrap-to-fill-left-marg'.
+
+Fix-me:
+Note 1: When turning this on `visual-line-mode' is also turned on. This
+is not reset when turning off this mode.
+
+Note 2: The text properties 'wrap-prefix and 'wrap-to-fill-prefix
+is set by this mode to indent continuation lines.
+
+Key bindings added by this minor mode:
+
+\\{wrap-to-fill-column-mode-map}
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (xhtml-help xhtml-help-show-tag-ref xhtml-help-tag-at-point
+;;;;;; xhtml-help-show-css-ref) "xhtml-help" "nxhtml/xhtml-help.el"
+;;;;;; (19364 56214))
+;;; Generated autoloads from nxhtml/xhtml-help.el
+(web-autoload-require 'xhtml-help 'lp '(nxhtml-download-root-url nil) "nxhtml/xhtml-help" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'xhtml-help-show-css-ref `(lp '(nxhtml-download-root-url nil) "nxhtml/xhtml-help" nxhtml-install-dir) "\
+Show CSS reference for CSS property name at point.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'xhtml-help-tag-at-point `(lp '(nxhtml-download-root-url nil) "nxhtml/xhtml-help" nxhtml-install-dir) "\
+Get xhtml tag name at or before point.
+
+\(fn)" nil nil)
+
+(nxhtml-autoload 'xhtml-help-show-tag-ref `(lp '(nxhtml-download-root-url nil) "nxhtml/xhtml-help" nxhtml-install-dir) "\
+Show xhtml reference for tag name at or before point.
+
+\(fn)" t nil)
+
+(let ((loads (get 'xhtml-help 'custom-loads))) (if (member '"xhtml-help" loads) nil (put 'xhtml-help 'custom-loads (cons '"xhtml-help" loads))))
+
+;;;***
+
+;;;### (autoloads (tidy-build-menu tidy) "tidy-xhtml" "nxhtml/tidy-xhtml.el"
+;;;;;; (19364 56214))
+;;; Generated autoloads from nxhtml/tidy-xhtml.el
+(web-autoload-require 'tidy-xhtml 'lp '(nxhtml-download-root-url nil) "nxhtml/tidy-xhtml" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'tidy 'custom-loads))) (if (member '"tidy-xhtml" loads) nil (put 'tidy 'custom-loads (cons '"tidy-xhtml" loads))))
+
+(nxhtml-autoload 'tidy-build-menu `(lp '(nxhtml-download-root-url nil) "nxhtml/tidy-xhtml" nxhtml-install-dir) "\
+Set up the tidy menu in MAP.
+Used to set up a Tidy menu in your favourite mode.
+
+\(fn &optional MAP)" t nil)
+
+;;;***
+
+;;;### (autoloads (rngalt-set-validation-header) "rngalt" "nxhtml/rngalt.el"
+;;;;;; (19365 33760))
+;;; Generated autoloads from nxhtml/rngalt.el
+(web-autoload-require 'rngalt 'lp '(nxhtml-download-root-url nil) "nxhtml/rngalt" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'rngalt-set-validation-header `(lp '(nxhtml-download-root-url nil) "nxhtml/rngalt" nxhtml-install-dir) "\
+Not documented
+
+\(fn START-OF-DOC)" nil nil)
+
+;;;***
+
+;;;### (autoloads (nxml-where-global-mode nxml-where-mode nxml-where)
+;;;;;; "nxml-where" "nxhtml/nxml-where.el" (19365 33760))
+;;; Generated autoloads from nxhtml/nxml-where.el
+(web-autoload-require 'nxml-where 'lp '(nxhtml-download-root-url nil) "nxhtml/nxml-where" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'nxml-where 'custom-loads))) (if (member '"nxml-where" loads) nil (put 'nxml-where 'custom-loads (cons '"nxml-where" loads))))
+
+(nxhtml-autoload 'nxml-where-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxml-where" nxhtml-install-dir) "\
+Shows path in mode line.
+
+\(fn &optional ARG)" t nil)
+
+(defvar nxml-where-global-mode nil "\
+Non-nil if Nxml-Where-Global mode is enabled.
+See the command `nxml-where-global-mode' for a description of this minor mode.
+Setting this variable directly does not take effect;
+either customize it (see the info node `Easy Customization')
+or call the function `nxml-where-global-mode'.")
+
+(nxhtml-custom-autoload 'nxml-where-global-mode 'nxml-where nil)
+
+(nxhtml-autoload 'nxml-where-global-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxml-where" nxhtml-install-dir) "\
+Toggle Nxml-Where mode in every possible buffer.
+With prefix ARG, turn Nxml-Where-Global mode on if and only if
+ARG is positive.
+Nxml-Where mode is enabled in all buffers where
+`nxml-where-turn-on-in-nxml-child' would do it.
+See `nxml-where-mode' for more information on Nxml-Where mode.
+
+\(fn &optional ARG)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtml-features-check nxhtml-customize nxhtml)
+;;;;;; "nxhtml" "nxhtml/nxhtml.el" (19412 25954))
+;;; Generated autoloads from nxhtml/nxhtml.el
+(web-autoload-require 'nxhtml 'lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'nxhtml 'custom-loads))) (if (member '"nxhtml" loads) nil (put 'nxhtml 'custom-loads (cons '"nxhtml" loads))))
+
+(nxhtml-autoload 'nxhtml-customize `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml" nxhtml-install-dir) "\
+Customize nXhtml.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'nxhtml-features-check `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml" nxhtml-install-dir) "\
+Check if external modules used by nXhtml are found.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (mako-nxhtml-mumamo-mode asp-nxhtml-mumamo-mode
+;;;;;; eruby-nxhtml-mumamo-mode jsp-nxhtml-mumamo-mode gsp-nxhtml-mumamo-mode
+;;;;;; smarty-nxhtml-mumamo-mode mjt-nxhtml-mumamo-mode genshi-nxhtml-mumamo-mode
+;;;;;; mason-nxhtml-mumamo-mode django-nxhtml-mumamo-mode embperl-nxhtml-mumamo-mode
+;;;;;; nxhtml-mumamo-mode) "nxhtml-mumamo" "nxhtml/nxhtml-mumamo.el"
+;;;;;; (19389 57826))
+;;; Generated autoloads from nxhtml/nxhtml-mumamo.el
+(web-autoload-require 'nxhtml-mumamo 'lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for (X)HTML with main mode `nxhtml-mode'.
+This covers inlined style and javascript and PHP.
+
+See also `mumamo-alt-php-tags-mode'." t)
+
+(nxhtml-autoload 'embperl-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for Embperl files with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'django-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for Django with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'mason-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for Mason using main mode `nxhtml-mode'.
+This covers inlined style and javascript." t)
+
+(nxhtml-autoload 'genshi-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for Genshi with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'mjt-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for MJT with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'smarty-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for Smarty with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'gsp-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for GSP with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'jsp-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for JSP with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'eruby-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for eRuby with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'asp-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for ASP with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+(nxhtml-autoload 'mako-nxhtml-mumamo-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mumamo" nxhtml-install-dir) "\
+Turn on multiple major modes for Mako with main mode `nxhtml-mode'.
+This also covers inlined style and javascript." t)
+
+;;;***
+
+;;;### (autoloads (nxhtml-validation-header-mode nxhtml-short-tag-help
+;;;;;; nxhtml-mode) "nxhtml-mode" "nxhtml/nxhtml-mode.el" (19412
+;;;;;; 25947))
+;;; Generated autoloads from nxhtml/nxhtml-mode.el
+(web-autoload-require 'nxhtml-mode 'lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(when (fboundp 'nxml-mode)
+(nxhtml-autoload 'nxhtml-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mode" nxhtml-install-dir) "\
+Major mode for editing XHTML documents.
+It is based on `nxml-mode' and adds some features that are useful
+when editing XHTML files.\\<nxhtml-mode-map>
+
+To see an overview in html format do \\[nxhtml-overview].
+
+* Note: Please observe that when loading nXhtml some file
+ associations are done, see `nxhtml-setup-file-assoc'.
+
+The nXhtml menu is added by this mode (or actually the minor
+mode `nxhtml-menu-mode') and gives quick access and an overview
+of some other important features. These includes:
+
+- multiple major modes, see `define-mumamo-multi-major-mode'
+- easy uploading and viewing of files, see for example
+ `html-upl-upload-file'
+- validation in XHTML part for php etc, see
+ `nxhtml-validation-header-mode' (you probably also want to know about
+ `nxhtml-toggle-visible-warnings' for this!)
+- converting of html to xhtml, see `tidy-buffer'
+
+The XML menu contains functionality added by `nxml-mode' (on
+which this major mode is based). There is also a popup menu
+added to the [apps] key.
+
+The most important features are probably completion and
+validation, which is inherited from `nxml-mode' with some small
+addtions. In very many situation you can use completion. To
+access it type \\[nxml-complete]. Completion has been enhanced in
+the following way:
+
+- If region is active and visible then completion will surround the
+ region with the chosen tag's start and end tag. However only the
+ starting point is checked for validity. If something is wrong after
+ insertion you will however immediately see it if you have validation
+ on.
+- It can in some cases give assistance with attribute values.
+- Completion can be customized, see the menus XHTML - Completion:
+ * You can use a menu popup style completion.
+ * You can have alternatives grouped.
+ * You can get a short help text shown for each alternative.
+- There does not have to be a '<' before point for tag name
+ completion. (`nxml-mode' requires a '<' before point for tag name
+ completion.)
+- Completes xml version and encoding.
+- Completes in an empty buffer, ie inserts a skeleton.
+
+Some smaller, useful, but easy-to-miss features:
+
+* Following links. The href and src attribute names are
+ underlined and a special keymap is bound to
+ them:\\<mlinks-mode-map>
+
+ \\[mlinks-backward-link], \\[mlinks-forward-link] Move
+ between underlined href/src attributes
+
+ \\[mlinks-goto], Mouse-1 Follow link inside Emacs
+ (if possible)
+
+ It is even a little bit quicker when the links are in an active
+ state (marked with the face `isearch'):\\<mlinks-active-hilight-keymap>
+
+ \\[mlinks-backward-link], \\[mlinks-forward-link] Move
+ between underlined href/src attributes
+ \\[mlinks-goto], Mouse-1 Follow link inside Emacs (if possible)
+
+ If the link is not into a file that you can edit (a mailto link
+ for example) you will be prompted for an alternative action.
+
+* Creating links. To make it easier to create links to id/name
+ attribute in different files there are two special
+ functions:\\<nxhtml-mode-map>
+
+ \\[nxhtml-save-link-to-here] copy link to id/name (you must
+ be in the tag to get the link)
+ \\[nxhtml-paste-link-as-a-tag] paste this as an a-tag.
+
+Here are all key bindings in nxhtml-mode itself:
+
+\\{nxhtml-mode-map}
+
+The minor mode `nxhtml-menu-mode' adds some bindings:
+
+\\{nxhtml-menu-mode-map}
+
+Notice that other minor mode key bindings may also be active, as
+well as emulation modes. Do \\[describe-bindings] to get a list
+of all active key bindings. Also, *VERY IMPORTANT*, if mumamo is
+used in the buffer each mumamo chunk has a different major mode
+with different key bindings. You can however still see all
+bindings with \\[describe-bindings], but you have to do that with
+point in the mumamo chunk you want to know the key bindings in.
+
+---------
+* Note: Some of the features supported by this mode are optional
+ and available only if other Emacs modules are found. Use
+ \\[nxhtml-features-check] to get a list of these optional
+ features and modules needed. You should however have no problem
+ with this if you have followed the installation instructions
+ for nXhtml.
+
+\(fn)" t nil))
+
+(nxhtml-autoload 'nxhtml-short-tag-help `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mode" nxhtml-install-dir) "\
+Display description of tag TAG. If TAG is omitted, try tag at point.
+
+\(fn TAG)" t nil)
+
+(when (fboundp 'nxml-mode)
+(nxhtml-autoload 'nxhtml-validation-header-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-mode" nxhtml-install-dir) "\
+If on use a Fictive XHTML Validation Header for the buffer.
+See `nxhtml-set-validation-header' for information about Fictive XHTML Validation Headers.
+
+This mode may be turned on automatically in two ways:
+- If you try to do completion of a XHTML tag or attribute then
+ `nxthml-mode' may ask you if you want to turn this mode on if
+ needed.
+- You can also choose to have it turned on automatically whenever
+ a mumamo multi major mode is used, see
+ `nxhtml-validation-header-if-mumamo' for further information.
+
+\(fn &optional ARG)" t nil))
+
+;;;***
+
+;;;### (autoloads (nxhtml-overview nxhtml-menu-mode nxhtml-browse-region
+;;;;;; nxhtml-browse-file nxhtml-edit-with-gimp) "nxhtml-menu" "nxhtml/nxhtml-menu.el"
+;;;;;; (19412 26360))
+;;; Generated autoloads from nxhtml/nxhtml-menu.el
+(web-autoload-require 'nxhtml-menu 'lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-menu" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtml-edit-with-gimp `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-menu" nxhtml-install-dir) "\
+Edit with GIMP buffer or file at point.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'nxhtml-browse-file `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-menu" nxhtml-install-dir) "\
+View file in web browser.
+
+\(fn FILE)" t nil)
+
+(nxhtml-autoload 'nxhtml-browse-region `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-menu" nxhtml-install-dir) "\
+View region in web browser.
+
+\(fn)" t nil)
+
+(defvar nxhtml-menu-mode nil "\
+Non-nil if Nxhtml-Menu mode is enabled.
+See the command `nxhtml-menu-mode' for a description of this minor mode.")
+
+(nxhtml-custom-autoload 'nxhtml-menu-mode 'nxhtml-menu nil)
+
+(nxhtml-autoload 'nxhtml-menu-mode `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-menu" nxhtml-install-dir) "\
+Minor mode to turn on some key and menu bindings.
+See `nxhtml-mode' for more information.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'nxhtml-overview `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-menu" nxhtml-install-dir) "\
+Show a HTML page with an overview of nXhtml.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtml-report-bug) "nxhtml-bug" "nxhtml/nxhtml-bug.el"
+;;;;;; (19277 65354))
+;;; Generated autoloads from nxhtml/nxhtml-bug.el
+(web-autoload-require 'nxhtml-bug 'lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-bug" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtml-report-bug `(lp '(nxhtml-download-root-url nil) "nxhtml/nxhtml-bug" nxhtml-install-dir) "\
+Report a bug in nXhtml.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (html-wtoc) "html-wtoc" "nxhtml/html-wtoc.el" (19364
+;;;;;; 56214))
+;;; Generated autoloads from nxhtml/html-wtoc.el
+(web-autoload-require 'html-wtoc 'lp '(nxhtml-download-root-url nil) "nxhtml/html-wtoc" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-wtoc 'custom-loads))) (if (member '"html-wtoc" loads) nil (put 'html-wtoc 'custom-loads (cons '"html-wtoc" loads))))
+
+;;;***
+
+;;;### (autoloads (html-upl-ediff-file html-upl-edit-remote-file-with-toc
+;;;;;; html-upl-edit-remote-file html-upl-upload-file html-upl-remote-dired
+;;;;;; html-upl-upload-site html-upl-upload-site-with-toc html-upl)
+;;;;;; "html-upl" "nxhtml/html-upl.el" (19364 56214))
+;;; Generated autoloads from nxhtml/html-upl.el
+(web-autoload-require 'html-upl 'lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-upl 'custom-loads))) (if (member '"html-upl" loads) nil (put 'html-upl 'custom-loads (cons '"html-upl" loads))))
+
+(nxhtml-autoload 'html-upl-upload-site-with-toc `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'html-upl-upload-site `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'html-upl-remote-dired `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Start dired for remote directory or its parent/ancestor.
+
+\(fn DIRNAME)" t nil)
+
+(nxhtml-autoload 'html-upl-upload-file `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Upload a single file in a site.
+For the definition of a site see `html-site-current'.
+
+\(fn FILENAME)" t nil)
+
+(nxhtml-autoload 'html-upl-edit-remote-file `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'html-upl-edit-remote-file-with-toc `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'html-upl-ediff-file `(lp '(nxhtml-download-root-url nil) "nxhtml/html-upl" nxhtml-install-dir) "\
+Run ediff on local and remote file.
+FILENAME could be either the remote or the local file.
+
+\(fn FILENAME)" t nil)
+
+;;;***
+
+;;;### (autoloads (html-toc) "html-toc" "nxhtml/html-toc.el" (19364
+;;;;;; 56214))
+;;; Generated autoloads from nxhtml/html-toc.el
+(web-autoload-require 'html-toc 'lp '(nxhtml-download-root-url nil) "nxhtml/html-toc" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-toc 'custom-loads))) (if (member '"html-toc" loads) nil (put 'html-toc 'custom-loads (cons '"html-toc" loads))))
+
+(defconst html-toc-menu-map (let ((map (make-sparse-keymap))) (define-key map [html-toc-browse-frames-file] (list 'menu-item "Browse Frames File" 'html-toc-browse-frames-file)) (define-key map [html-toc-write-frames-file] (list 'menu-item "Write Frames File" 'html-toc-write-frames-file)) (define-key map [html-toc-write-toc-file] (list 'menu-item "Write TOC File for Frames" 'html-toc-write-toc-file)) (define-key map [html-toc-sep1] (list 'menu-item "--")) (define-key map [html-toc-edit-pages-file] (list 'menu-item "Edit List of Pages for TOC" 'html-site-edit-pages-file)) (define-key map [html-toc-create-pages-file] (list 'menu-item "Write List of Pages for TOC" 'html-toc-create-pages-file)) map))
+
+;;;***
+
+;;;### (autoloads (html-site-query-replace html-site-rgrep html-site-find-file
+;;;;;; html-site-dired-current html-site-set-site html-site-buffer-or-dired-file-name
+;;;;;; html-site) "html-site" "nxhtml/html-site.el" (19364 56214))
+;;; Generated autoloads from nxhtml/html-site.el
+(web-autoload-require 'html-site 'lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-site 'custom-loads))) (if (member '"html-site" loads) nil (put 'html-site 'custom-loads (cons '"html-site" loads))))
+
+(nxhtml-autoload 'html-site-buffer-or-dired-file-name `(lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir) "\
+Return buffer file name or file pointed to in dired.
+
+\(fn)" nil nil)
+
+(nxhtml-autoload 'html-site-set-site `(lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir) "\
+Not documented
+
+\(fn NAME)" t nil)
+
+(nxhtml-autoload 'html-site-dired-current `(lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir) "\
+Open `dired' in current site top directory.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'html-site-find-file `(lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir) "\
+Find file in current site.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'html-site-rgrep `(lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir) "\
+Search current site's files with `rgrep'.
+See `rgrep' for the arguments REGEXP and FILES.
+
+\(fn REGEXP FILES)" t nil)
+
+(nxhtml-autoload 'html-site-query-replace `(lp '(nxhtml-download-root-url nil) "nxhtml/html-site" nxhtml-install-dir) "\
+Query replace in current site's files.
+
+\(fn FROM TO FILE-REGEXP DELIMITED)" t nil)
+
+;;;***
+
+;;;### (autoloads (html-pagetoc-rebuild-toc html-pagetoc-insert-toc
+;;;;;; html-pagetoc) "html-pagetoc" "nxhtml/html-pagetoc.el" (19364
+;;;;;; 56214))
+;;; Generated autoloads from nxhtml/html-pagetoc.el
+(web-autoload-require 'html-pagetoc 'lp '(nxhtml-download-root-url nil) "nxhtml/html-pagetoc" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-pagetoc 'custom-loads))) (if (member '"html-pagetoc" loads) nil (put 'html-pagetoc 'custom-loads (cons '"html-pagetoc" loads))))
+
+(nxhtml-autoload 'html-pagetoc-insert-toc `(lp '(nxhtml-download-root-url nil) "nxhtml/html-pagetoc" nxhtml-install-dir) "\
+Inserts a table of contents for the current html file.
+The html header tags h1-h6 found in the file are inserted into
+this table. MIN-LEVEL and MAX-LEVEL specifies the minimum and
+maximum level of h1-h6 to include. They should be integers.
+
+\(fn &optional MIN-LEVEL MAX-LEVEL)" t nil)
+
+(nxhtml-autoload 'html-pagetoc-rebuild-toc `(lp '(nxhtml-download-root-url nil) "nxhtml/html-pagetoc" nxhtml-install-dir) "\
+Update the table of contents inserted by `html-pagetoc-insert-toc'.
+
+\(fn)" t nil)
+
+(defconst html-pagetoc-menu-map (let ((map (make-sparse-keymap))) (define-key map [html-pagetoc-rebuild-toc] (list 'menu-item "Update Page TOC" 'html-pagetoc-rebuild-toc)) (define-key map [html-pagetoc-insert-style-guide] (list 'menu-item "Insert CSS Style for Page TOC" 'html-pagetoc-insert-style-guide)) (define-key map [html-pagetoc-insert-toc] (list 'menu-item "Insert Page TOC" 'html-pagetoc-insert-toc)) map))
+
+;;;***
+
+;;;### (autoloads (html-chklnk) "html-chklnk" "nxhtml/html-chklnk.el"
+;;;;;; (19364 56214))
+;;; Generated autoloads from nxhtml/html-chklnk.el
+(web-autoload-require 'html-chklnk 'lp '(nxhtml-download-root-url nil) "nxhtml/html-chklnk" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'html-chklnk 'custom-loads))) (if (member '"html-chklnk" loads) nil (put 'html-chklnk 'custom-loads (cons '"html-chklnk" loads))))
+
+;;;***
+
+;;;### (autoloads (web-vcs-investigate-elisp-file web-vcs-byte-compile-file
+;;;;;; web-vcs-message-with-face web-vcs-get-files-from-root web-vcs-log-edit
+;;;;;; web-vcs-default-download-directory) "web-vcs" "web-vcs.el"
+;;;;;; (19412 16397))
+;;; Generated autoloads from web-vcs.el
+(web-autoload-require 'web-vcs 'lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'web-vcs-default-download-directory `(lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir) "\
+Try to find a suitable place.
+Considers site-start.el, site-
+
+\(fn)" nil nil)
+
+(nxhtml-autoload 'web-vcs-log-edit `(lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir) "\
+Open log file.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'web-vcs-get-files-from-root `(lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir) "\
+Download a file tree from VCS system using the web interface.
+Use WEB-VCS entry in variable `web-vcs-links-regexp' to download
+files via http from URL to directory DL-DIR.
+
+Show URL first and offer to visit the page. That page will give
+you information about version control system (VCS) system used
+etc.
+
+\(fn WEB-VCS URL DL-DIR)" nil nil)
+
+(nxhtml-autoload 'web-vcs-message-with-face `(lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir) "\
+Display a colored message at the bottom of the string.
+FACE is the face to use for the message.
+FORMAT-STRING and ARGS are the same as for `message'.
+
+Also put FACE on the message in *Messages* buffer.
+
+\(fn FACE FORMAT-STRING &rest ARGS)" nil nil)
+
+(nxhtml-autoload 'web-vcs-byte-compile-file `(lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir) "\
+Byte compile FILE in a new Emacs sub process.
+EXTRA-LOAD-PATH is added to the front of `load-path' during
+compilation.
+
+FILE is set to `buffer-file-name' when called interactively.
+If LOAD
+
+\(fn FILE &optional LOAD EXTRA-LOAD-PATH COMP-DIR)" t nil)
+
+(nxhtml-autoload 'web-vcs-investigate-elisp-file `(lp '(nxhtml-download-root-url nil) "web-vcs" nxhtml-install-dir) "\
+Not documented
+
+\(fn FILE-OR-BUFFER)" t nil)
+
+;;;***
+
+;;;### (autoloads (nxhtmlmaint-byte-uncompile-all nxhtmlmaint-byte-recompile
+;;;;;; nxhtmlmaint-start-byte-compilation) "nxhtmlmaint" "nxhtmlmaint.el"
+;;;;;; (19378 31293))
+;;; Generated autoloads from nxhtmlmaint.el
+(web-autoload-require 'nxhtmlmaint 'lp '(nxhtml-download-root-url nil) "nxhtmlmaint" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtmlmaint-start-byte-compilation `(lp '(nxhtml-download-root-url nil) "nxhtmlmaint" nxhtml-install-dir) "\
+Start byte compilation of nXhtml in new Emacs instance.
+Byte compiling in general makes elisp code run 5-10 times faster
+which is quite noticeable when you use nXhtml.
+
+This will also update the file nxhtml-loaddefs.el.
+
+You must restart Emacs to use the byte compiled files.
+
+If for some reason the byte compiled files does not work you can
+remove then with `nxhtmlmaint-byte-uncompile-all'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'nxhtmlmaint-byte-recompile `(lp '(nxhtml-download-root-url nil) "nxhtmlmaint" nxhtml-install-dir) "\
+Recompile or compile all nXhtml files in current Emacs.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'nxhtmlmaint-byte-uncompile-all `(lp '(nxhtml-download-root-url nil) "nxhtmlmaint" nxhtml-install-dir) "\
+Delete byte compiled files in nXhtml.
+This will also update the file nxhtml-loaddefs.el.
+
+See `nxhtmlmaint-start-byte-compilation' for byte compiling.
+
+\(fn)" t nil)
+
+;;;***
+
+;;;### (autoloads (zencoding-preview zencoding-expand-yas zencoding-mode
+;;;;;; zencoding-expand-line zencoding) "zencoding-mode" "util/zencoding-mode.el"
+;;;;;; (19275 63380))
+;;; Generated autoloads from util/zencoding-mode.el
+(web-autoload-require 'zencoding-mode 'lp '(nxhtml-download-root-url nil) "util/zencoding-mode" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(let ((loads (get 'zencoding 'custom-loads))) (if (member '"zencoding-mode" loads) nil (put 'zencoding 'custom-loads (cons '"zencoding-mode" loads))))
+
+(nxhtml-autoload 'zencoding-expand-line `(lp '(nxhtml-download-root-url nil) "util/zencoding-mode" nxhtml-install-dir) "\
+Replace the current line's zencode expression with the corresponding expansion.
+If prefix ARG is given or region is visible call `zencoding-preview' to start an
+interactive preview.
+
+Otherwise expand line directly.
+
+For more information see `zencoding-mode'.
+
+\(fn ARG)" t nil)
+
+(nxhtml-autoload 'zencoding-mode `(lp '(nxhtml-download-root-url nil) "util/zencoding-mode" nxhtml-install-dir) "\
+Minor mode for writing HTML and CSS markup.
+With zen coding for HTML and CSS you can write a line like
+
+ ul#name>li.item*2
+
+and have it expanded to
+
+ <ul id=\"name\">
+ <li class=\"item\"></li>
+ <li class=\"item\"></li>
+ </ul>
+
+This minor mode defines keys for quick access:
+
+\\{zencoding-mode-keymap}
+
+Home page URL `http://www.emacswiki.org/emacs/ZenCoding'.
+
+See also `zencoding-expand-line'.
+
+\(fn &optional ARG)" t nil)
+
+(nxhtml-autoload 'zencoding-expand-yas `(lp '(nxhtml-download-root-url nil) "util/zencoding-mode" nxhtml-install-dir) "\
+Not documented
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'zencoding-preview `(lp '(nxhtml-download-root-url nil) "util/zencoding-mode" nxhtml-install-dir) "\
+Expand zencode between BEG and END interactively.
+This will show a preview of the expanded zen code and you can
+accept it or skip it.
+
+\(fn BEG END)" t nil)
+
+;;;***
+
+;;;### (autoloads nil nil ("autostart.el" "autostart22.el" "etc/schema/schema-path-patch.el"
+;;;;;; "nxhtml-base.el" "nxhtml/html-imenu.el" "nxhtml/html-move.el"
+;;;;;; "nxhtml/html-quote.el" "nxhtml/nxhtml-autoload.el" "nxhtml/nxhtml-strval.el"
+;;;;;; "nxhtml/nxhtmljs.el" "nxhtml/outline-magic.el" "nxhtml/wtest.el"
+;;;;;; "related/flymake-helpers.el" "related/flymakemsg.el" "related/flymu.el"
+;;;;;; "related/php-imenu.el" "tests/angus77-setup-jde.el" "tests/emacstest-suites.el"
+;;;;;; "tests/ert2.el" "tests/hfy-test.el" "tests/inemacs/bug1013.el"
+;;;;;; "tests/mumamo-test.el" "tests/nxhtmltest-helpers.el" "tests/temp-test.el"
+;;;;;; "util/appmenu-fold.el" "util/css-simple-completion.el" "util/custsets.el"
+;;;;;; "util/ecb-batch-compile.el" "util/fupd.el" "util/idn.el"
+;;;;;; "util/key-cat.el" "util/mumamo-aspnet.el" "util/mumamo-trace.el"
+;;;;;; "util/new-key-seq-widget.el" "util/nxml-mode-os-additions.el"
+;;;;;; "util/org-panel.el" "util/rxi.el" "util/useful-commands.el"
+;;;;;; "web-autoload.el") (19412 26385 593000))
+
+;;;***
+
+;;;### (autoloads (nxhtml-byte-recompile-file nxhtml-byte-compile-file
+;;;;;; nxhtml-get-missing-files nxhtml-update-existing-files nxhtml-setup-download-all
+;;;;;; nxhtml-setup-auto-download nxhtml-setup-install) "nxhtml-web-vcs"
+;;;;;; "nxhtml-web-vcs.el" (19412 16464))
+;;; Generated autoloads from nxhtml-web-vcs.el
+(web-autoload-require 'nxhtml-web-vcs 'lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir 'nxhtml-byte-compile-file)
+
+
+(nxhtml-autoload 'nxhtml-setup-install `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Setup and start nXhtml installation.
+
+This is for installation and updating directly from the nXhtml
+development sources.
+
+There are two different ways to install:
+
+ (1) Download all at once: `nxhtml-setup-download-all'
+ (2) Automatically download part by part: `nxhtml-setup-auto-download'
+
+You can convert between those ways by calling this function again.
+You can also do this by setting the option `nxhtml-autoload-web' yourself.
+
+When you have nXhtml installed you can update it:
+
+ (3) Update new files in nXhtml: `nxhtml-update-existing-files'
+
+To learn more about nXhtml visit its home page at URL
+`http://www.emacswiki.com/NxhtmlMode/'.
+
+If you want to test auto download (but not use it further) there
+is a special function for that, you answer T here:
+
+ (T) Test automatic download part by part: `nxhtml-setup-test-auto-download'
+
+======
+*Note*
+If you want to download a zip file with latest released version instead then
+please see URL `http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html'.
+
+\(fn WAY)" t nil)
+
+(nxhtml-autoload 'nxhtml-setup-auto-download `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Set up to autoload nXhtml files from the web.
+
+This function will download some initial files and then setup to
+download the rest when you need them.
+
+Files will be downloaded under the directory root you specify in
+DL-DIR.
+
+Note that files will not be upgraded automatically. The auto
+downloading is just for files you are missing. (This may change a
+bit in the future.) If you want to upgrade those files that you
+have downloaded you can just call `nxhtml-update-existing-files'.
+
+You can easily switch between this mode of downloading or
+downloading the whole of nXhtml by once. To switch just call the
+command `nxhtml-setup-install'.
+
+See also the command `nxhtml-setup-download-all'.
+
+Note: If your nXhtml is to old you can't use this function
+ directly. You have to upgrade first, se the function
+ above. Version 2.07 or above is good for this.
+
+\(fn DL-DIR)" t nil)
+
+(nxhtml-autoload 'nxhtml-setup-download-all `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Download or update all of nXhtml.
+
+You can download all if nXhtml with this command.
+
+To update existing files use `nxhtml-update-existing-files'.
+
+If you want to download only those files you are actually using
+then call `nxhtml-setup-auto-download' instead.
+
+See the command `nxhtml-setup-install' for a convenient way to
+call these commands.
+
+For more information about auto download of nXhtml files see
+`nxhtml-setup-auto-download'.
+
+\(fn DL-DIR)" t nil)
+
+(nxhtml-autoload 'nxhtml-update-existing-files `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Update existing nXhtml files from the development sources.
+Only files you already have will be updated.
+
+Note that this works both if you have setup nXhtml to auto
+download files as you need them or if you have downloaded all of
+nXhtml at once.
+
+For more information about installing and updating nXhtml see the
+command `nxhtml-setup-install'.
+
+\(fn)" t nil)
+
+(nxhtml-autoload 'nxhtml-get-missing-files `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Not documented
+
+\(fn SUB-DIR FILE-NAME-LIST)" nil nil)
+
+(nxhtml-autoload 'nxhtml-byte-compile-file `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Not documented
+
+\(fn FILE &optional LOAD)" nil nil)
+
+(nxhtml-autoload 'nxhtml-byte-recompile-file `(lp '(nxhtml-download-root-url nil) "nxhtml-web-vcs" nxhtml-install-dir) "\
+Byte recompile FILE file if necessary.
+For more information see `nxhtml-byte-compile-file'.
+Loading is done if recompiled and LOAD is t.
+
+\(fn FILE &optional LOAD)" t nil)
+
+;;;***
diff --git a/elisp/nxhtml/nxhtml-web-vcs.el b/elisp/nxhtml/nxhtml-web-vcs.el
new file mode 100644
index 0000000..fb0fb09
--- /dev/null
+++ b/elisp/nxhtml/nxhtml-web-vcs.el
@@ -0,0 +1,689 @@
+;;; nxhtml-web-vcs.el --- nXhtml things for web-vcs.el
+;;
+;; Author: Lennart Borgman (lennart O borgman A gmail O com)
+;; Created: 2010-01-13 Wed
+;; Version:
+;; Last-Updated:
+;; URL:
+;; Keywords:
+;; Compatibility:
+;;
+;; Features that might be required by this library:
+;;
+;; None
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Commentary:
+;;
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Change log:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; 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 3, 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., 51 Franklin Street, Fifth
+;; Floor, Boston, MA 02110-1301, USA.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;; Code:
+
+(eval-when-compile (require 'cl))
+(eval-when-compile (require 'nxhtml-base nil t))
+;;(eval-when-compile (require 'nxhtmlmaint nil t))
+(eval-when-compile (require 'web-vcs nil t))
+
+(defvar nxhtml-web-vcs-file (or load-file-name
+ (when (boundp 'bytecomp-filename) bytecomp-filename)
+ buffer-file-name)
+ "This file.")
+
+(defun nxhtml-require-base ()
+ (require 'nxhtml-base nil t)
+ (unless (featurep 'nxhtml-base)
+ ;; At startup, need to load it by hand.
+ (let ((load-path load-path))
+ (add-to-list 'load-path (file-name-directory nxhtml-web-vcs-file))
+ (require 'nxhtml-base))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Repository URL
+
+
+;;(nxhtml-default-download-directory)
+(defun nxhtml-default-download-directory ()
+ (let* ((ur (expand-file-name "" "~"))
+ (ur-len (length ur))
+ (full (if (and (boundp 'nxhtml-install-dir)
+ nxhtml-install-dir)
+ nxhtml-install-dir
+ (file-name-as-directory
+ (expand-file-name ""
+ (web-vcs-default-download-directory)))))
+ (full-len (length full)))
+ (if (and (> full-len ur-len)
+ (string= ur (substring full 0 ur-len)))
+ (concat "~" (substring full ur-len))
+ full)))
+
+
+(defun nxhtml-web-vcs-read-dl-dir (prompt)
+ "Return current nXhtml install dir or read dir."
+ (or (and (boundp 'nxhtml-install-dir)
+ nxhtml-install-dir)
+ (let* ((pr (concat
+ "A directory named 'nxhtml' will be created below the root you give."
+ "\n"
+ prompt))
+ (root (read-directory-name pr (nxhtml-default-download-directory))))
+ (when root
+ (expand-file-name "nxhtml" root)))))
+
+;;(call-interactively 'nxhtml-setup-install)
+;; (read-key "Prompt: ")
+;; (y-or-n-p "Prompt")
+;;;###autoload
+(defun nxhtml-setup-install (way)
+ "Setup and start nXhtml installation.
+
+This is for installation and updating directly from the nXhtml
+development sources.
+
+There are two different ways to install:
+
+ (1) Download all at once: `nxhtml-setup-download-all'
+ (2) Automatically download part by part: `nxhtml-setup-auto-download'
+
+You can convert between those ways by calling this function again.
+You can also do this by setting the option `nxhtml-autoload-web' yourself.
+
+When you have nXhtml installed you can update it:
+
+ (3) Update new files in nXhtml: `nxhtml-update-existing-files'
+
+To learn more about nXhtml visit its home page at URL
+`http://www.emacswiki.com/NxhtmlMode/'.
+
+If you want to test auto download \(but not use it further) there
+is a special function for that, you answer T here:
+
+ (T) Test automatic download part by part: `nxhtml-setup-test-auto-download'
+
+======
+*Note*
+If you want to download a zip file with latest released version instead then
+please see URL `http://ourcomments.org/Emacs/nXhtml/doc/nxhtml.html'."
+ (interactive (let ((curr-cfg (current-window-configuration)))
+ (describe-function 'nxhtml-setup-install)
+ (select-window (get-buffer-window (help-buffer)))
+ (delete-other-windows)
+ (list
+ (let* ((key nil)
+ (has-nxhtml (and (boundp 'nxhtml-install-dir) nxhtml-install-dir))
+ (current-way (if has-nxhtml
+ (if (and (boundp 'nxhtml-autoload-web)
+ nxhtml-autoload-web)
+ "Your current setup is to download part by part from the web."
+ "Your current setup it to download all of nXhtml at once.")
+ "(You have not currently installed nXhtml.)"))
+ (prompt (concat "Setup nXhtml install."
+ "\n" current-way
+ "\n"
+ "\n(1) Download whole at once, or (2) part by part as needed"
+ (if has-nxhtml "\n(3) Update your existing nXhtml" "")
+ "\n(T) For temporary testing downloading part by part"
+ "\n"
+ "\n(? for help, q to quit): "))
+ (allowed-keys (if has-nxhtml
+ '(?1 ?2 ?3 ?T ?q 7)
+ '(?1 ?2 ?T ?q 7)))
+ (please nil))
+ (while (not (member key allowed-keys))
+ (if (not (member key '(??)))
+ (when key
+ (unless please
+ (setq prompt (concat "Please answer with one of the alternatives.\n\n"
+ prompt))
+ (setq please t)))
+ (describe-function 'nxhtml-setup-install)
+ (select-window (get-buffer-window (help-buffer)))
+ (delete-other-windows))
+ (setq key (web-vcs-read-key prompt))
+ ;;(message "key = %S" key) (sit-for 1)
+ )
+ (case key
+ (7 (set-window-configuration curr-cfg)
+ nil)
+ (?1 'whole)
+ (?2 'part-by-part)
+ (?3 'update-existing)
+ (?T 'test-part-by-part)
+ )))))
+ (message "")
+ (case way
+ (whole (call-interactively 'nxhtml-setup-download-all))
+ (part-by-part (call-interactively 'nxhtml-setup-auto-download))
+ (update-existing (call-interactively 'nxhtml-update-existing-files))
+ (test-part-by-part (call-interactively 'nxhtml-setup-test-auto-download))
+ ((eq nil way) nil)
+ (t (error "Unknown way = %S" way))))
+
+(defvar nxhtml-basic-files '(
+ "nxhtml-base.el"
+ "nxhtml-loaddefs.el"
+ "web-autoload.el"
+ "etc/schema/schema-path-patch.el"
+ "nxhtml/nxhtml-autoload.el"
+ "autostart.el"
+ ))
+
+;;;###autoload
+(defun nxhtml-setup-auto-download (dl-dir)
+ "Set up to autoload nXhtml files from the web.
+
+This function will download some initial files and then setup to
+download the rest when you need them.
+
+Files will be downloaded under the directory root you specify in
+DL-DIR.
+
+Note that files will not be upgraded automatically. The auto
+downloading is just for files you are missing. (This may change a
+bit in the future.) If you want to upgrade those files that you
+have downloaded you can just call `nxhtml-update-existing-files'.
+
+You can easily switch between this mode of downloading or
+downloading the whole of nXhtml by once. To switch just call the
+command `nxhtml-setup-install'.
+
+See also the command `nxhtml-setup-download-all'.
+
+Note: If your nXhtml is to old you can't use this function
+ directly. You have to upgrade first, se the function
+ above. Version 2.07 or above is good for this."
+ (interactive (progn
+ (describe-function 'nxhtml-setup-auto-download)
+ (select-window (get-buffer-window (help-buffer)))
+ (delete-other-windows)
+ (nxhtml-check-convert-to-part-by-part)
+ (list
+ (progn
+ (when (and (boundp 'nxhtml-autoload-web)
+ (not nxhtml-autoload-web))
+ (unless (yes-or-no-p "Convert to updating nXhtml part by part? ")
+ (throw 'command-level nil)))
+ (nxhtml-web-vcs-read-dl-dir "Download nXhtml part by part to directory: ")))))
+ (catch 'command-level
+ (if (not dl-dir)
+ (unless (with-no-warnings (called-interactively-p))
+ (error "dl-dir should be a directory"))
+ (nxhtml-check-convert-to-part-by-part)
+ (when (and (boundp 'nxhtml-install-dir)
+ nxhtml-install-dir)
+ (unless (string= (file-truename dl-dir)
+ (file-truename nxhtml-install-dir))
+ (error "Download dir must be same as nxhtml-install-dir=%S" nxhtml-install-dir)))
+ (let* (;; Need some files:
+ (web-vcs-el-src (concat (file-name-sans-extension web-vcs-el-this) ".el"))
+ (web-vcs-el (expand-file-name (file-name-nondirectory web-vcs-el-src)
+ dl-dir))
+ (vcs 'lp)
+ (base-url (nxhtml-download-root-url nil))
+ (byte-comp (if (boundp 'web-autoload-autocompile)
+ web-autoload-autocompile
+ t))
+ (has-nxhtml (and (boundp 'nxhtml-install-dir)
+ nxhtml-install-dir))
+ (web-vcs-folder-cache nil))
+ (setq nxhtml-install-dir dl-dir)
+ (let ((root (file-name-directory dl-dir)))
+ (unless (file-exists-p root)
+ (unless (yes-or-no-p (format "Directory %S does not exist, create it? " root))
+ (error "Aborted by user"))))
+ (make-directory dl-dir t)
+ (setq message-log-max t)
+ (view-echo-area-messages)
+ (message "")
+ (message "")
+ (web-vcs-message-with-face 'web-vcs-green "==== Starting nXhtml part by part state ====")
+ (message "has-nxhtml=%s" has-nxhtml)
+ ;; Fix-me: First copy this file and web-vcs.el to its destination:
+ (unless (string= (file-truename dl-dir)
+ (file-truename (file-name-directory nxhtml-web-vcs-file)))
+ (dolist (f (list web-vcs-el-src nxhtml-web-vcs-file))
+ (copy-file f (expand-file-name (file-name-nondirectory f) dl-dir)
+ 'ok-overwrite)))
+ (when byte-comp (web-vcs-byte-compile-newer-file web-vcs-el t))
+ ;; Get basic file list:
+ (catch 'web-autoload-comp-restart
+ ;;(let ((file-mask (regexp-opt nxhtml-basic-files)))
+ ;; (web-vcs-get-missing-matching-files vcs base-url dl-dir file-mask))
+ (dolist (f nxhtml-basic-files)
+ (web-vcs-get-missing-matching-files vcs base-url dl-dir f))
+ ;; Autostart.el has not run yet, add download dir to load-path.
+ (let ((load-path (cons (file-name-directory web-vcs-el) load-path)))
+ (when byte-comp
+ (dolist (file nxhtml-basic-files)
+ (let ((el-file (expand-file-name file dl-dir)))
+ (web-vcs-byte-compile-newer-file el-file nil)))))
+ (let ((autostart-file (expand-file-name "autostart" dl-dir)))
+ ;;(ad-deactivate 'require)
+ (web-vcs-set&save-option 'nxhtml-autoload-web t)
+ (web-vcs-log nil nil "* nXhtml: Download Part by Part as Needed\n")
+ (load autostart-file)
+ (unless (ad-is-active 'require) (ad-activate 'require))
+ (web-vcs-log-save)
+ (web-vcs-message-with-face 'web-vcs-green "==== Basic files for nXhtml part by part are now installed ====")
+ (web-vcs-display-messages t)
+ (unless has-nxhtml (nxhtml-add-loading-to-custom-file autostart-file t))))))))
+
+;;(call-interactively 'nxhtml-download)
+;;;###autoload
+(defun nxhtml-setup-download-all (dl-dir)
+ "Download or update all of nXhtml.
+
+You can download all if nXhtml with this command.
+
+To update existing files use `nxhtml-update-existing-files'.
+
+If you want to download only those files you are actually using
+then call `nxhtml-setup-auto-download' instead.
+
+See the command `nxhtml-setup-install' for a convenient way to
+call these commands.
+
+For more information about auto download of nXhtml files see
+`nxhtml-setup-auto-download'."
+ (interactive (progn
+ (describe-function 'nxhtml-setup-auto-download)
+ (select-window (get-buffer-window (help-buffer)))
+ (delete-other-windows)
+ ;;(nxhtml-check-convert-to-part-by-part)
+ (list
+ (nxhtml-web-vcs-read-dl-dir "Download whole nXhtml to directory: "))))
+
+ (let ((root (file-name-directory dl-dir)))
+ (unless (file-exists-p root)
+ (unless (yes-or-no-p (format "Directory %S does not exist, create it? " root))
+ (error "Aborted by user"))))
+ (make-directory dl-dir t)
+ (let ((msg (concat "Downloading nXhtml through Launchpad web interface will take rather long\n"
+ "time (5-15 minutes) so you may want to do it in a separate Emacs session.\n\n"
+ "Do you want to download using this Emacs session? "
+ )))
+ (if (not (y-or-n-p msg))
+ (message "Aborted")
+ (setq message-log-max t)
+ (let ((do-byte (y-or-n-p "Do you want to byte compile the files after downloading? ")))
+ (nxhtml-download-1 dl-dir nil do-byte)))))
+
+
+(defun nxhtml-download-1 (dl-dir revision do-byte)
+ "Download nXhtml to directory DL-DIR.
+If REVISION is nil download latest revision, otherwise the
+specified one.
+
+If DO-BYTE is non-nil byte compile nXhtml after download."
+ (let* ((has-nxhtml (and (boundp 'nxhtml-install-dir)
+ nxhtml-install-dir))
+ (base-url nxhtml-web-vcs-base-url)
+ (files-url (concat base-url "files/"))
+ ;;(revs-url (concat base-url "changes/"))
+ (rev-part (if revision (number-to-string revision) "head%3A/"))
+ (full-root-url (concat files-url rev-part))
+ (web-vcs-folder-cache nil)
+ (web-autoload-paranoid nil))
+ ;;(nxhtml-require-base)
+ (when (web-vcs-get-files-from-root 'lp full-root-url dl-dir)
+ (web-vcs-display-messages t)
+ (web-vcs-log nil nil "* nXhtml: Download All\n")
+ (web-vcs-set&save-option 'nxhtml-autoload-web nil)
+ (message "")
+ (web-vcs-message-with-face 'web-vcs-green "==== Starting downloading whole nXhtml ====")
+ (let ((autostart-file (expand-file-name "autostart" dl-dir)))
+ (load autostart-file)
+ (web-vcs-log-save)
+ (web-vcs-message-with-face 'web-vcs-green "==== All files for nXhtml are now installed ====")
+ (nxhtmlmaint-byte-recompile)
+ (unless has-nxhtml (nxhtml-add-loading-to-custom-file autostart-file nil))))))
+
+(defun nxhtml-check-convert-to-part-by-part ()
+ (when (and (boundp 'nxhtml-install-dir)
+ nxhtml-install-dir)
+ (unless (and (boundp 'nxhtml-autoload-web)
+ nxhtml-autoload-web)
+ (if (not (boundp 'nxhtml-menu:version))
+ (error "nxhtml-install-dir set but no version found")
+ (unless (string-match "[\.0-9]+" nxhtml-menu:version)
+ (error "Can't find current version nxhtml-menu:version=%S" nxhtml-menu:version))
+ (let* ((ver-str (match-string 0 nxhtml-menu:version))
+ (ver-num (string-to-number ver-str)))
+ (when (< ver-num 2.07)
+ (web-vcs-message-with-face 'web-vcs-red "Too old nXhtml for download part by part.")
+ (throw 'command-level nil)))))))
+
+
+;;(directory-files default-directory nil "\\el$")
+;;(directory-files default-directory nil "[^#~]$")
+;;;###autoload
+(defun nxhtml-update-existing-files ()
+ "Update existing nXhtml files from the development sources.
+Only files you already have will be updated.
+
+Note that this works both if you have setup nXhtml to auto
+download files as you need them or if you have downloaded all of
+nXhtml at once.
+
+For more information about installing and updating nXhtml see the
+command `nxhtml-setup-install'."
+ ;; Fix-me: download new files too if you are not auto downloading.
+ (interactive)
+ (when (y-or-n-p "Do you want to update your nXhtml files? ")
+ (message "")
+ (web-vcs-display-messages t)
+ (web-vcs-message-with-face 'web-vcs-yellow "*\nStarting updating your nXhtml files.\n*\n")
+ (message nil)
+ (web-vcs-clear-folder-cache)
+ (let ((vcs 'lp)
+ (base-url (nxhtml-download-root-url nil))
+ (dl-dir nxhtml-install-dir)
+ web-vcs-folder-cache)
+ (setq dl-dir (file-name-as-directory dl-dir))
+ (web-vcs-update-existing-files vcs base-url dl-dir dl-dir)
+ (web-vcs-clear-folder-cache))
+ (display-buffer (get-buffer-create "*Compile-Log*"))
+ (nxhtmlmaint-byte-recompile)
+ (web-vcs-log-save)
+ (web-vcs-message-with-face 'web-vcs-yellow "*\nFinished updating your nXhtml files.\n*\n")
+ (message nil)))
+
+
+;;(nxhtml-maybe-download-files (expand-file-name "nxhtml/doc/img/" nxhtml-install-dir) nil)
+;;;###autoload
+(defun nxhtml-get-missing-files (sub-dir file-name-list)
+ (let (file-mask
+ (root-url (nxhtml-download-root-url nil))
+ files-regexp
+ (full-dir (expand-file-name sub-dir nxhtml-install-dir))
+ miss-names)
+ (if file-name-list
+ (progn
+ (dolist (f file-name-list)
+ (let ((full-f (expand-file-name f full-dir)))
+ (unless (file-exists-p full-f)
+ (setq miss-names (cons f miss-names)))))
+ (setq files-regexp (regexp-opt miss-names)))
+ (setq files-regexp ".*"))
+ ;;(unless (file-exists-p full-dir) (make-directory full-dir t))
+ (setq file-mask
+ (concat (file-relative-name (file-name-as-directory full-dir)
+ nxhtml-install-dir)
+ files-regexp))
+ (let ((web-vcs-folder-cache nil))
+ (web-vcs-get-missing-matching-files 'lp root-url nxhtml-install-dir
+ file-mask))))
+
+;; Fix-me: Does not work, Emacs Bug
+;; Maybe use wget? http://gnuwin32.sourceforge.net/packages/wget.htm
+;; http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=5103
+;; (nxhtml-get-release-revision)
+(defun nxhtml-get-release-revision ()
+ "Get revision number for last release."
+ (let* ((all-rev-url "http://code.launchpad.net/%7Enxhtml/nxhtml/main")
+ (url-buf (url-retrieve-synchronously all-rev-url))
+ (vcs-rec (or (assq 'lp web-vcs-links-regexp)
+ (error "Does not know web-vcs 'lp")))
+ (rel-ver-regexp (nth 6 vcs-rec))
+ )
+ (message "%S" url-buf)
+ (with-current-buffer url-buf
+ (when (re-search-forward rel-ver-regexp nil t)
+ (match-string 1)))))
+
+;;;###autoload
+(defun nxhtml-byte-compile-file (file &optional load)
+ (let ((extra-load-path (when nxhtml-install-dir
+ (mapcar (lambda (p)
+ (file-name-as-directory
+ (expand-file-name p nxhtml-install-dir)))
+ '("tests" "related" "nxhtml" "util" ".")))))
+ ;; (message "nxhtml-byte-compile-file:extra-load-path=%s" extra-load-path)
+ (web-vcs-byte-compile-file file load extra-load-path)))
+
+;; fix-me: change web-vcs-byte-compile-file instead
+;;;###autoload
+(defun nxhtml-byte-recompile-file (file &optional load)
+ "Byte recompile FILE file if necessary.
+For more information see `nxhtml-byte-compile-file'.
+Loading is done if recompiled and LOAD is t."
+ (interactive (list (buffer-file-name)
+ t))
+ (let ((elc-file (byte-compile-dest-file file)))
+ (if (file-newer-than-file-p file elc-file)
+ (nxhtml-byte-compile-file file load)
+ (message "Byte compilation of this file is up to date."))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; Add to custom file
+
+
+(defvar nxhtml-handheld-wincfg nil)
+(defun nxhtml-handheld-restore-wincg ()
+ (when nxhtml-handheld-wincfg
+ (set-window-configuration nxhtml-handheld-wincfg)
+ (setq nxhtml-handheld-wincfg nil)))
+
+;;(nxhtml-handheld-add-loading-to-custom-file "TEST-ME")
+(defun nxhtml-handheld-add-loading-to-custom-file (file-to-load)
+ (setq nxhtml-handheld-wincfg (current-window-configuration))
+ (delete-other-windows)
+ (let ((info-buf (get-buffer-create "Information about how to add nXhtml to (custom-file)"))
+ (load-str (format "(load %S)" file-to-load)))
+ (with-current-buffer info-buf
+ (add-hook 'kill-buffer-hook 'nxhtml-handheld-restore-wincg nil t)
+ (insert "Insert the following line to (custom-file), ie the file in the other window:\n\n")
+ (let ((here (point)))
+ (insert " "
+ (propertize load-str 'face 'secondary-selection)
+ "\n")
+ (copy-region-as-kill here (point))
+ (insert "\nThe line above is in the clipboard so you can just paste it where you want it.\n")
+ (insert "When ready kill this buffer.")
+ (goto-char here))
+ (setq buffer-read-only t)
+ (set-buffer-modified-p nil))
+ (set-window-buffer (selected-window) info-buf)
+ (find-file-other-window (custom-file))))
+
+;; (nxhtml-add-loading-to-custom-file "test-file")
+(defun nxhtml-add-loading-to-custom-file (file-to-load part-by-part)
+ (message "")
+ (require 'cus-edit)
+ (if (not (condition-case nil (custom-file) (error nil)))
+ (progn
+ (message "\n\n")
+ (web-vcs-message-with-face
+ 'web-vcs-red
+ (concat "Since you have started this Emacs session without running your init files"
+ "\nthey are unknown and the installation can not add the statement below."
+ "\nTo finish the setup of nXhtml you must add"
+ "\n\n (load %S)"
+ "\n\nto your custom-file if you have not done it yet."
+ "\nYou must also customize the variable `nxhtml-autoload-web' to tell that"
+ (if part-by-part
+ "\nyou want to download nXhml files as you need them."
+ "\nyou do not want to allow automatic downloading of nXhtml files."
+ )
+ "\n")
+ file-to-load)
+ (message "")
+ (web-vcs-display-messages t))
+ (let ((prompt (concat "Basic setup of nXhtml is done, but it must be loaded from (custom-file)."
+ "\nShould I add loading of nXhtml to (custom-file) for you? ")))
+ (if (yes-or-no-p prompt)
+ (nxhtml-add-loading-to-custom-file-auto file-to-load)
+ (if (yes-or-no-p "Should I guide you through how to do it? ")
+ (nxhtml-handheld-add-loading-to-custom-file file-to-load)
+ (web-vcs-message-with-face 'web-vcs-green
+ "OK. You need to add (load %S) to your init file" file-to-load))))))
+
+;; Fix-me: really do this? Is it safe enough?
+(defun nxhtml-add-loading-to-custom-file-auto (file-to-load)
+ (unless (file-name-absolute-p file-to-load)
+ (error "nxhtml-add-loading-to-custom-file: Not abs file name: %S" file-to-load))
+ (let ((old-buf (find-buffer-visiting (custom-file)))
+ (full-to-load (expand-file-name file-to-load)))
+ (with-current-buffer (or old-buf (find-file-noselect (custom-file)))
+ (save-restriction
+ (widen)
+ (catch 'done
+ (while (progn
+ (while (progn (skip-chars-forward " \t\n\^l")
+ (looking-at ";"))
+ (forward-line 1))
+ (not (eobp)))
+ (let ((start (point))
+ (form (read (current-buffer))))
+ (when (eq (nth 0 form) 'load)
+ (let* ((form-file (nth 1 form))
+ (full-form-file (expand-file-name form-file)))
+ (when (string= full-form-file full-to-load)
+ (throw 'done nil))
+ (when (and (string= (file-name-nondirectory full-form-file)
+ (file-name-nondirectory full-to-load))
+ (not (string= full-form-file full-to-load)))
+ (if (yes-or-no-p "Replace current nXhtml loading in (custom-file)? ")
+ (progn
+ (goto-char start) ;; at form start now
+ (forward-char (length "(load "))
+ (skip-chars-forward " \t\n\^l") ;; at start of string
+ (setq start (point))
+ (setq form (read (current-buffer)))
+ (delete-region start (point))
+ (insert (format "%S" full-to-load))
+ (basic-save-buffer))
+ (web-vcs-message-with-face 'web-vcs-red "Can't continue then")
+ (web-vcs-display-messages t)
+ (throw 'command-level nil)))))))
+ ;; At end of file
+ (insert (format "\n(load %S)\n" file-to-load))
+ (basic-save-buffer))
+ (unless old-buf (kill-buffer old-buf))))))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;; Start Testing function
+(defun emacs-Q-no-nxhtml (&rest args)
+ (let* ((old-env-load-path (getenv "EMACSLOADPATH"))
+ sub-env-load-path
+ (elp-list (or (when old-env-load-path
+ ;;(split-string old-env-load-path ";"))
+ (split-string old-env-load-path path-separator))
+ load-path))
+ (sub-elp-list nil)
+ ret
+ (this-emacs-exe (locate-file invocation-name
+ (list invocation-directory)
+ exec-suffixes)))
+ (dolist (p elp-list)
+ (when (file-exists-p p)
+ (unless (string= nxhtml-install-dir p)
+ (let* ((dir (file-name-directory p))
+ (last (file-name-nondirectory p))
+ (last-dir (file-name-nondirectory
+ (directory-file-name dir))))
+ (unless (and (string= "nxhtml" last-dir)
+ (member last '("util" "test" "nxhtml" "related" "alt")))
+ (setq sub-elp-list (cons p sub-elp-list)))))))
+ ;;(setq sub-env-load-path (mapconcat 'identity (reverse sub-elp-list) ";"))
+ (setq sub-env-load-path (mapconcat 'identity (reverse sub-elp-list) path-separator))
+ (setenv "EMACSLOADPATH" sub-env-load-path)
+ (setq ret (apply 'call-process this-emacs-exe nil 0 nil "-Q" args))
+ (setenv "EMACSLOADPATH" old-env-load-path)
+ ret))
+
+;; (call-interactively-p 'nxhtml-setup-test-auto-download)
+;; (nxhtml-setup-test-auto-download "c:/test2/")
+(defun nxhtml-setup-test-auto-download (test-dir)
+ "Test autoload in a new emacs, started with 'emacs -Q'.
+You can choose where to download the files and just delete them
+when you have tested enough."
+ (interactive (list (read-directory-name "Directory for test of auto download of nXhtml: ")))
+ (let ((this-dir (file-name-directory web-vcs-el-this))
+ (this-name (file-name-nondirectory web-vcs-el-this))
+ that-file)
+ (when (and (file-exists-p test-dir)
+ (not (y-or-n-p (format "Directory %S exists, really test there? " test-dir))))
+ (error "Aborted"))