Whole document tree
    

Whole document tree

HTML helper mode beta

HTML helper mode beta

This is technically beta code, but is quite stable. Don't let the "beta" scare you. For news and documentation for 2.19.1.1, see the main web page for hhm.

News 5/17/00 Ben Tindale has kindly contributed code for JSP tags.


DOWNLOADING NOTE: some browsers (notably lynx, and some versions of netscape) have trouble saving html-helper-mode correctly: they corrupt files with long lines. You'll have better luck if you can save the file to disk without displaying it first (shift-click in Netscape, capital D in lynx). Sorry about that, can't help buggy browsers.

Major new features

See change log below for more detail.

Todo

  • consider using write-contents-hooks
  • fix indentation code to handle tag attributes (quick fix - match "<li" instead of "<li>", but that has bad potential consequences).
  • decide about doctype string (2.0, 3.0, some hybrid?)
  • decide about </li> and </p>
  • update docs

Notes for various emacsen

GNU emacs 19
I develop this code under emacs 19.29, so it should work fine there. It should work fine on most modern emacs 19s, although some not-so-old versions had a different completion behaviour.

Note if you save your files with C-xC-w (write-file) then local-write-file-hooks isn't run, which means timestamps don't update. (Even worse, the variable is cleared!). C-xC-s (save-file) does run the hook and the timestamps are updated. I don't understand why write-file doesn't run the local-write-file-hooks, but I recommend using save-file instead.

XEmacs 19
I intend this code to work under XEmacs, and I've heard occasional reports that it works.
GNU emacs 18
I think this code still works under emacs 18, but you should definitely upgrade to 19. Now that the FSF boycott of Apple is over, some enterprising person should get cracking on porting emacs 19 to the Macintosh. To run under emacs 18, you will need to have a definition of add-hook loaded, and you will need to have auc-menu.el installed.
Special Menu Note: there are two packages that provide the same menuing interfaces: auc-menu and easymenu. Unfortunately, they don't all work the same. Recent versions of GNU emacs 19 and XEmacs 19 both come with easymenu as part of the standard lisp library. If you are having menu troubles, verify that the shipped easymenu is being loaded: not any versions of auc-menu or easymenu that you might have lying around elsewhere (from auc-tex, in particular). Emacs 18 people still need to use auc-menu (which just stubs the functions so they do nothing).

Changes

2.2 - rms cleanups

  • Improved docstrings, (provide 'html-mode) for 14 character filenames

2.3 - menus

  • Updated my location to @santafe.edu
  • Added menu support (using easymenu)
  • Changed format of cookie database a bit, renamed a few cookies
  • Added timezone to timestamp

2.4 - stupid bug fixes

2.5 - modularization

  • Added quot and # entities
  • Made <p>, <li>, <dd>, <dt> containers. Bleah!
  • Removed extraneous whitespace from <li>, etc. Changed default indentation to account for this.
  • Removed emacs18 support (sorry! Time for you to upgrade.)
  • Reworked the keymap and menu scheme so types are modular, you can add them later.. Lots or reorganization of code, reordered cookie database, etc.

2.6 - emacs18 added in again

  • Added back in emacs18 support, grudgingly. emacs18ers need auc-menu.el installed as "easymenu.el", and some version of the add-hook function.
  • Changed the paragraph tag to include a newline

2.7 - HTML/2.0 compliance

  • Added full HTML/2.0 compliance: removed old tags, added in new ones. Thanks, Marc!

2.8 - new indentation code

  • Added in html-helper-htmldtd-version for the skeleton
  • moved headers to C-cC-h to make C-cC-t free (why not before?)
  • run text-mode-hook, html-mode-hook, html-load-hook
  • change indentation logic around to make it clearer
  • new type of list item, end of items
  • give <select> and <option> stuff indentation like lists
  • new form cookies, courtesy of Marc

2.9 - menu cleanups

  • Added in a novice menu, on by default.
  • Cleaned up the menu presentation
  • MAJOR CHANGE in the cookie format: the 3rd argument is now the menu string (it is also coerced into a symbol to make the function.)

2.10

  • a bit more hilit19 code: headers, titles, forms (no logical styles)
  • move headers back from C-cC-h to C-cC-t. Sorry.
  • Update tempo insertions from (p . foo) to (p foo)
  • now looks in features to check for hilit19
  • if you have 'browse-url loaded (forthcoming code) then M-C-q and a menu item will bring up your current file in your browser. There's also url-at-point, but we'll leave that to the user to bind. Should we save file first? Probably no.
  • skeletons and timestamps now on by default

2.11

  • More hilit19 changes: do comments right, change <h#> colouring
  • Moved timestamp-delimiter to C-cC-zt and browse-url-of-file to C-cC-zv to make things better.
  • Mucked with menus: verbified, added in timestamps and toggling to expert menu.

2.12

  • Better loading of easymenu and/or auc-menu
  • Change logic for checking if browse-url, hilit19 are loaded
  • Bind 'browse-url-at-point into keymap and menu
  • More hilit19 regexp changes
  • Call (easy-menu-add) and (easy-menu-remove) at the right times.

2.13

  • Changed all references to "cookie" into "tag"
  • Cleaned up doc strings
  • Fixed dumb easy-menu bug (affects XEmacs)
  • Look at html-helper-user-menu when building expert menu, allow users to add things in.

2.14

  • Got rid of </p>, </li>, </dd>, </dt>. Best as I can tell, these are optional and too confusing. I might make them into an add-on package.

2.15

  • Added in Ulrik Dickow's font-lock support. Many thanks to him for his great work and infinite patience.

2.16

  • Updated Ulriks' font-lock code.

2.17

  • Added table indentation

2.18

  • small change to hilit19 entity pattern
  • changed html-helper-htmldtd-version meaning to include the entire comment.

2.19

  • Added html-helper-mode-version, changed the version identification in the comments.

2.19.1

  • Included some font-lock regexp changes.

Nelson Minar Created: March 24, 1995
<nelson@media.mit.edu> Updated: May 17, 2000