Commits

Anonymous committed 5e233d5

Package release 5.9

Comments (0)

Files changed (16)

 Hello,
 
-I've written a new version (5.8) of my html package for the XEmacs 
+I've written a new version (5.9) of my html package for the XEmacs 
 and the GNU Emacs 19. The name of the package is:
 
-		 hm--html-menus-5.8.tar.gz
+		 hm--html-menus-5.9.tar.gz
 
 With this package it is very easy to write html pages for the World Wide 
 Web (WWW). Eg: In most cases the user gets help to construct a specific 
 It is also possible to insert links and images by just clicking on its
 source and destination (drag and drop feature).
 
-The biggest new features compared with release 5.7 are:
-- use of the customize package for customization
-- the header of the main files should no be 'package finder' compatible
-- in the XEmacs a drag and drop mouse pointer will be used
-  during drag and drop
-- the minor mode (hm--html-minor-mode) could now be used in many
-  other major modes
-- better popup menu support for the hm--html-minor-mode in the
-  Emacs 19
-- the emacs start up options -u, -q, -no-site-file are now
-  respected
-- some bug fixes
-Read the NEWS file to see news in detail...
+Read the NEWS file to see what is new in this release.
 
-You should find hm--html-menus-5.8.tar.gz on the following ftp server:
+You should find hm--html-menus-5.9.tar.gz on the following ftp server:
 	sunsite.unc.edu in /pub/Linux/apps/editors/emacs/
 	ftp.tnt.uni-hannover.de in /pub/editors/xemacs/contrib
 
 	html link, info link, gopher link, file link;
 	ftp link, news link, mailbox link, mailto link, wais (direct) link,
 	wais (gateway) link;
-	proggate link, local proggate link, 
+	CGI link, proggate link, local proggate link, 
 	link target;
 2. Frame elements:
 	full html frame with doctype, doctype, html, head, body, title,
+1998-11-18  Heiko Muenkel  <muenkel@tnt.uni-hannover.de>
+
+	* Makefile: Add support for the new etc/* directories.
+
+	* Update the package to hm--html-menus 5.9.
+	  Create the subdirectories etc/template and
+	  etc/idd.
+	
+
 1998-01-25  SL Baur  <steve@altair.xemacs.org>
 
 	* Makefile (VERSION): Update to package standard 1.0.
 	hm--html-keys.elc hm--html-menu.elc hm--html-mode.elc \
 	hm--html-not-standard.elc hm--html.elc html-view.elc \
 	internal-drag-and-drop.elc tmpl-minor-mode.elc
-
+DATA_1_FILES = etc/idd/*
+DATA_1_DEST = $(PACKAGE)/idd
+DATA_2_FILES = etc/templates/*
+DATA_2_DEST = $(PACKAGE)/templates
 INFO_FILES = hm--html-mode.info*
 TEXI_FILES = hm--html-mode.texi umlaute.texi
 MANUAL = hm--html-mode
 
 GENERATED += custom-load.elc
 
+PRELOADS = -l cus-face -l dired 
+
 all:: $(ELCS) auto-autoloads.elc custom-load.elc hm--html-mode.info
 
 srckit: srckit-std
+15.11.98
+	Fixed a bug in `hm--html-sgml-xemacs-get-popup-value'.
+05.11.98
+	Merged XEmacs version with my version:
+	- The feature `menubar' will now be checked before installing
+	  the menus. 
+	- Adds a (require 'adapt) to html-view.el.
+
+	The function `locate-data-directory' will now be
+	used to determine the default value of `idd-data-directory'.
+	=> lib/xemacs-21.2-b3/etc/idd/drop should now be moved
+	to the package specifc directory (eg
+	lib/xemacs-packages/etc/hm--html-menus/idd).
+
+	The variable `tmpl-template-dir-list' defaults now to
+	to the package specifc directory (eg
+	lib/xemacs-packages/etc/hm--html-menus/templates).
+04.11.98
+	Changed the default value of `hm--html-template-dir'.
+	Added the commands `hm--html-add-cgi-link' and
+	`hm--html-add-cgi-link-to-region' together with the variables
+	`hm--html-cgi-hostname:port-alist',
+	`hm--html-cgi-hostname:port-default', `hm--html-cgi-script-alist'
+	and `hm--html-cgi-script-default' to add special links to
+	CGI scripts.
+	Fixed bugs of the variables `hm--html-title-date-format'
+	and `hm--html-log-date-format'.
+21.10.98
+	Removed the variables `hm--hmtl-include-time-after-date'
+	and `hm--html-date-time-separator' and replaced it by
+	the new variable `hm--html-log-date-format' to get a more 
+	flexible date and time format for the log (changed and
+	created) lines. Added also the similar variable
+	`hm--html-title-date-format' to configure the date and time
+	format of the totle and header lines. Using such variables
+	was introduced by Wolfgang K�ting <wkueting@gmx.de> - Thank
+	you Wolfgang for your lisp code. The function `hm--date'
+	is no longer used and the whole hm--date.el file
+	will probably be removed in the future.
+	Updated the texinfo documentation and fixed some overfull box
+	warnings in it.
+	The package uses now the browse-url instead of vm to display
+	a HTML buffer in Netscape. Thanks to Hans-J. Reumerman
+	<reumerma@pfa.research.philips.com> for the hint to make
+	this change.
+15.08.98
+	Addition by Guido.Van.Hoecke@bigfoot.com  on 1998-07-06:
+	Besides the funcion hm--date, a function hm--date-time
+	is defined that will also return the time if
+	hm--hmtl-include-time-after-date is not nil. The time
+        will than be returned in the format "hours:minutes" like
+        23:54 and it will be separated from the date by the value
+        of hm--html-date-time-separator, which has " at " as
+        default.
+	The code to delete old modification line dates did not delete
+	any leading spaces returned by hm--date. This is fixed by
+	Guido.Van.Hoecke@bigfoot.com.
+	Using hm--date-time rather than hm--date in the created
+	and modified comment lines, as well as in the visible 
+	modified line. The user can get the time appended to the
+	date by setting hm--hmtl-include-time-after-date and
+	possibly modifying hm--html-date-time-separator.
+	Thanks to Guido for these bug fixes and changes.
+23.07.98
+	Fixed some formatation bugs in the texinfo manual.
+	Fixed some bugs in the tmpl-minor-mode, which caused trouble
+	using the mode in the auctex mode.
+09.12.97
+	All attribute values should now be inserted as quoted values.
+	Changed the message "WARNING: No HTML User Config File !
+	Look at hm--html-load-config-files !" to 
+	"No HTML user config file loaded.".
+	The `hm--html-minor-mode' sets now the variable
+	`idd-actions' to `hm--html-idd-actions'.
+	Put a call to `redraw-modeline' in the `hm--html-minor-mode'
+	function and in all region mode functions to fix the problem,
+	that the modeline isn't updated immediately after toggling 
+	the minor modes. Thanks to David Bakhash <cadet@sst.ll.mit.edu>
+	for pointing this out.
+	`hm--html-modified-insert-before' is now a user variable.
+07.12.97
+	Fixed a bug in hm--html-menu.el, which caused problems
+	with the minor mode in the html-mode of the psgml package.
+	The function `adapt-emacs19p' returns now also t, if it
+	is the GNU Emacs 20.x. `adapt-emacs19p' is an alias for
+	`adapt-emacsp'. It will be removed in the future.
+	Fixed a bug in `hm--html-popup-minor-html-menu-region'.
+	Thanks to David Bakhash <cadet@sst.ll.mit.edu> for reporting
+	this bug.
+	The minor mode popup menus are now also working, if the
+	`mode-popup-menu' contains a `:filer' entry. 
 20.07.97
 	-- BUILDED the version 5.8 of the package --
 19.07.97
-This README file describes the emacs lisp package hm--html-menus-5.8.
+This README file describes the emacs lisp package hm--html-menus-5.9.
 
 The package provides functions and various popup and pulldown menus
 for a html mode called hm--html-mode, a mode for writing html pages.
       (string-match "XEmacs" emacs-version)))
 
 
-(defun adapt-emacs19p ()
-  "Returns non nil if the editor is the GNU Emacs 19."
+(defun adapt-emacsp ()
+  "Returns non nil if the editor is the GNU Emacs.
+The release number must be greater or equal 19."
   (and 
    (not (adapt-xemacsp))
-   (string= (substring emacs-version 0 2) "19")))
+   (>= (string-to-int (substring emacs-version 0 2)) 19)))
+
+(defalias 'adapt-emacs19p 'adapt-emacsp)
 
 ;;; Functions, which don't exist in both emacs versions
 
 
 
 ;;; Functions, which don't exist in the Emacs 19
-(if (adapt-emacs19p)
+(if (adapt-emacsp)
     (progn
       (load-library "lucid")
 
 	(month (substring time-string 4 7))
 	(year (substring time-string 20 24)))
     (concat day "-" month "-" year)))
+
+(defun hm--date-time ()
+  "Returns the date & time (eg as \"day-month-year at hours:minutes\")
+The format can be changed by the variable `hm--html-log-date-format'."
+  (when (or (boundp 'hm--hmtl-include-time-after-date)
+	    (boundp 'hm--html-date-time-separator))
+    (warn 
+     "You are still using one or both of the no longer supported variables \n"
+     "`hm--hmtl-include-time-after-date' and `hm--html-date-time-separator'."
+     "You are now able to get the same effect by using the new variable\n"
+     "`hm--html-log-date-format'.\n\n."
+     "Type `M-x customize-variable hm--html-log-date-format', if you will\n"
+     "change the variable.\n\n"
+     "Don't forget to remove the old variables from your ~/.emacs or one\n"
+     "of your other emacs configuration files."))
+  (format-time-string hm--html-log-date-format (current-time)))
+
+;(defun hm--date-time ()
+;  "Returns the date & time as \"day-month-year xx hours:minutes\",
+;where xx is specified by the user variable hm--html-date-time-separator.
+;The time and date-time separator portion is only returned if the
+;user variable hm--hmtl-include-time-after-date is not nil."
+;  (let* ((time-string (current-time-string))
+; 	 (time (substring time-string 11 16))
+; 	 (day (substring time-string 8 10))
+; 	 (month (substring time-string 4 7))
+; 	 (year (substring time-string 20 24)))
+;    (if hm--hmtl-include-time-after-date
+; 	(concat day "-" month "-" year 
+; 		hm--html-date-time-separator time)
+;      (concat day "-" month "-" year))))

hm--html-configuration.el

 then the file ~/.hm--html-configuration.el will be used. In this case
 also the variable `init-file-user' will be respected."
   :group 'hm--html-files
-  :type '(choice (const :tag "~/.hm--html-configuration.el" :value nil)
+  :type '(choice (const :tag "No user config file" :value nil)
+		 (const :tag "~/.hm--html-configuration.el" 
+			:value "~/.hm--html-configuration.el")
 		 file))
 
 ;;; The site specific config file
   :type '(repeat cons))
 
 
+;;; For the links to the CGI Scripts
+
+(defcustom hm--html-cgi-hostname:port-alist
+  '(("www.tnt.uni-hannover.de:80")
+    )
+  "*Alist with hostnames and ports for the cgi server."
+  :group 'hm--html-links
+  :type '(repeat string))
+
+(defcustom hm--html-cgi-hostname:port-default "www.tnt.uni-hannover.de:80"
+  "*Default hostname with port for the cgi server."
+  :group 'hm--html-links
+  :type '(repeat string))
+
+(defcustom hm--html-cgi-script-alist
+  '(("/cgi-bin/man-cgi")
+    ("/cgi-bin/man-cgi.tnt")
+    )
+  "*Alist with CGI scripts."
+  :group 'hm--html-links
+  :type '(repeat string))
+
+(defcustom hm--html-cgi-script-default "/cgi-bin/man-cgi.tnt"
+  "*Default CGI script."
+  :group 'hm--html-links
+  :type '(repeat string))
+
 ;;; For links to the mail gateway
 
 (defcustom hm--html-mail-hostname:port-alist '(("www.tnt.uni-hannover.de:8003")
 
 ;;; For the Templates
 
-(defcustom hm--html-template-dir "/data/info/www/tnt/guide/templates"
+(defcustom hm--html-template-dir "/data/www/guide/templates"
   "*A directory with templatefiles.
 It is now also possible to use it as a list of directories.
 Look at the variable `tmpl-template-dir-list' for further descriptions."
 (define-obsolete-variable-alias 'hm--html-automatic-new-date
   'hm--html-automatic-update-title-date)
 
+;;; The following two variables are obsolete, use the
+;;; variable hm--html-log-date-format instead
+
+;(defcustom hm--hmtl-include-time-after-date nil
+;  "*t   => The time of day will be appended to the date 
+;in the created and changed comment lines, as well as in the 
+;visible modified line if these lines are present; the time
+;will never be appended to the date in the title. The separator
+;between date and title is defined with hm--html-date-time-separator."
+;  :group 'hm--html-document-information
+;  :type 'boolean)
+ 
+;(defcustom hm--html-date-time-separator " at "
+;  "The value of the separator between date and time in the
+;created and modified comment lines and in the visible modified
+;line. This is only used if hm--hmtl-include-time-after-date is t."
+;  :group 'hm--html-document-information
+;  :type 'string)
+
+(defcustom hm--html-log-date-format "%d-%b-%Y"
+  "Default output format for date and time in the log lines.
+WARNING: Don't use the character `<' in this string!
+The log lines are the lines with the created and changed comments.
+The format is used as argument of the function `format-time-string'.
+    `%a'
+          This stands for the abbreviated name of the day of week.
+    `%A'
+          This stands for the full name of the day of week.
+    `%b'
+          This stands for the abbreviated name of the month.
+    `%B'
+          This stands for the full name of the month.
+    `%c'
+          This is a synonym for `%x %X'.
+    `%C'
+          This has a locale-specific meaning.  In the default locale
+          (named C), it is equivalent to `%A, %B %e, %Y'.
+    `%d'
+          This stands for the day of month, zero-padded.
+    `%D'
+          This is a synonym for `%m/%d/%y'.
+    `%e'
+          This stands for the day of month, blank-padded.
+    `%h'
+          This is a synonym for `%b'.
+    `%H'
+          This stands for the hour (00-23).
+    `%I'
+          This stands for the hour (00-12).
+    `%j'
+          This stands for the day of the year (001-366).
+    `%k'
+          This stands for the hour (0-23), blank padded.
+    `%l'
+          This stands for the hour (1-12), blank padded.
+    `%m'
+          This stands for the month (01-12).
+    `%M'
+          This stands for the minute (00-59).
+    `%n'
+          This stands for a newline.
+    `%p'
+          This stands for `AM' or `PM', as appropriate.
+    `%r'
+          This is a synonym for `%I:%M:%S %p'.
+    `%R'
+          This is a synonym for `%H:%M'.
+    `%S'
+          This stands for the seconds (00-60).
+    `%t'
+          This stands for a tab character.
+    `%T'
+          This is a synonym for `%H:%M:%S'.
+    `%U'
+          This stands for the week of the year (01-52), assuming that
+          weeks start on Sunday.
+    `%w'
+          This stands for the numeric day of week (0-6).  Sunday is day
+          0.
+    `%W'
+          This stands for the week of the year (01-52), assuming that
+          weeks start on Monday.
+    `%x'
+          This has a locale-specific meaning.  In the default locale
+          (named C), it is equivalent to `%D'.
+    `%X'
+          This has a locale-specific meaning.  In the default locale
+          (named C), it is equivalent to `%T'.
+    `%y'
+          This stands for the year without century (00-99).
+    `%Y'
+          This stands for the year with century.
+    `%Z'
+          This stands for the time zone abbreviation."
+  :group 'hm--html-document-information
+  :type '(choice (const :tag "22-Feb-1997" :value "%d-%b-%Y")
+		 (const :tag "22.02.97" :value "%d.%m.%y")
+		 (const :tag "02/22/97" :value "%D")
+                 (const :tag "97-02-22" :value "%y-%m-%d")
+                 (const :tag "22-Feb-1997 22:30:07" :value "%d-%b-%Y %T")
+		 (const :tag "22-Feb-1997 22:30" :value "%d-%b-%Y %R")
+		 (const :tag "22-Feb-1997 at 22:30" :value "%d-%b-%Y at %R")
+                 (const :tag "22.02.97 22:30:07" :value "%d.%m.%y %T")
+		 (const :tag "02/22/97 22:30:07" :value "%D %T")
+		 (const :tag "02/22/97 10:30:07 PM" :value "%D %r")
+                 (const :tag "97-02-22 22:30:07" :value "%y-%m-%d %T")
+                 string))
+
+(defcustom hm--html-title-date-format "%d-%b-%Y"
+  "Default output format for date and time in the title and main header line.
+WARNING: Don't use the character `<' in this string!
+The format is used as argument of the function `format-time-string'.
+    `%a'
+          This stands for the abbreviated name of the day of week.
+    `%A'
+          This stands for the full name of the day of week.
+    `%b'
+          This stands for the abbreviated name of the month.
+    `%B'
+          This stands for the full name of the month.
+    `%c'
+          This is a synonym for `%x %X'.
+    `%C'
+          This has a locale-specific meaning.  In the default locale
+          (named C), it is equivalent to `%A, %B %e, %Y'.
+    `%d'
+          This stands for the day of month, zero-padded.
+    `%D'
+          This is a synonym for `%m/%d/%y'.
+    `%e'
+          This stands for the day of month, blank-padded.
+    `%h'
+          This is a synonym for `%b'.
+    `%H'
+          This stands for the hour (00-23).
+    `%I'
+          This stands for the hour (00-12).
+    `%j'
+          This stands for the day of the year (001-366).
+    `%k'
+          This stands for the hour (0-23), blank padded.
+    `%l'
+          This stands for the hour (1-12), blank padded.
+    `%m'
+          This stands for the month (01-12).
+    `%M'
+          This stands for the minute (00-59).
+    `%n'
+          This stands for a newline.
+    `%p'
+          This stands for `AM' or `PM', as appropriate.
+    `%r'
+          This is a synonym for `%I:%M:%S %p'.
+    `%R'
+          This is a synonym for `%H:%M'.
+    `%S'
+          This stands for the seconds (00-60).
+    `%t'
+          This stands for a tab character.
+    `%T'
+          This is a synonym for `%H:%M:%S'.
+    `%U'
+          This stands for the week of the year (01-52), assuming that
+          weeks start on Sunday.
+    `%w'
+          This stands for the numeric day of week (0-6).  Sunday is day
+          0.
+    `%W'
+          This stands for the week of the year (01-52), assuming that
+          weeks start on Monday.
+    `%x'
+          This has a locale-specific meaning.  In the default locale
+          (named C), it is equivalent to `%D'.
+    `%X'
+          This has a locale-specific meaning.  In the default locale
+          (named C), it is equivalent to `%T'.
+    `%y'
+          This stands for the year without century (00-99).
+    `%Y'
+          This stands for the year with century.
+    `%Z'
+          This stands for the time zone abbreviation."
+  :group 'hm--html-document-information
+  :type '(choice (const :tag "22-Feb-1997" :value "%d-%b-%Y")
+		 (const :tag "22.02.97" :value "%d.%m.%y")
+		 (const :tag "02/22/97" :value "%D")
+                 (const :tag "97-02-22" :value "%y-%m-%d")
+                 (const :tag "22-Feb-1997 22:30:07" :value "%d-%b-%Y %T")
+		 (const :tag "22-Feb-1997 22:30" :value "%d-%b-%Y %R")
+                 (const :tag "22.02.97 22:30:07" :value "%d.%m.%y %T")
+		 (const :tag "02/22/97 22:30:07" :value "%D %T")
+		 (const :tag "02/22/97 10:30:07 PM" :value "%D %r")
+                 (const :tag "97-02-22 22:30:07" :value "%y-%m-%d %T")
+                 string))
+
 (defcustom hm--html-automatic-changed-comment t
   "*t   => A \"changed comment\" line will be added before filesaving.
 nil => No automatic insertation of a \"changed comment\" line."
 		 string))
 
 (defcustom hm--html-modified-insert-before "</body>"
-  "Insert modified line before this string.
+  "*Insert modified line before this string.
 The search will be done from the end to the beginning."
   :group 'hm--html-document-information
   :type 'string)
 			       (const "Author")
 			       string))))
 
+
+
 ;;; indentation
 
 (defcustom hm--html-disable-indentation nil
 ;;;	Put this file in one of your load path directories.
 ;;;
 
-(if (adapt-emacs19p)
+(if (adapt-emacsp)
     (progn
 
       (defvar hm--html-emacs19-popup-noregion-menu-button [C-down-mouse-3]
     [(control m)] 'hm--html-add-mailto-link)
   (define-key hm--html-noregion-anchor-map "w" 'hm--html-add-direct-wais-link)
   (define-key hm--html-noregion-anchor-map "\C-w" 'hm--html-add-wais-link)
+  (define-key hm--html-noregion-anchor-map "c" 'hm--html-add-cgi-link)
   (define-key hm--html-noregion-anchor-map "p" 'hm--html-add-proggate-link)
   (define-key hm--html-noregion-anchor-map 
     "\C-p" 'hm--html-add-local-proggate-link)
   (define-key hm--html-region-anchor-map 
     "\C-w" 'hm--html-add-wais-link-to-region)
   (define-key hm--html-region-anchor-map 
+    "c" 'hm--html-add-cgi-link-to-region)
+  (define-key hm--html-region-anchor-map 
     "p" 'hm--html-add-proggate-link-to-region)
   (define-key hm--html-region-anchor-map 
     "\C-p" 'hm--html-add-local-proggate-link-to-region)
   (define-key hm--html-region-sub-map "\M-n" hm--html-noregion-sub-map-1)
   (define-key hm--html-region-sub-map "\M-r" hm--html-region-sub-map-1)
 
-  (if (adapt-emacs19p)
+  (if (adapt-emacsp)
       (map-keymap '(lambda (key-description-list binding)
 		     (define-key hm--html-region-sub-map
 		       (vector key-description-list) binding))
   (define-key hm--html-noregion-sub-map "\M-n" hm--html-noregion-sub-map-1)
   (define-key hm--html-noregion-sub-map "\M-r" hm--html-region-sub-map-1)
 
-  (if (adapt-emacs19p)
+  (if (adapt-emacsp)
       (map-keymap '(lambda (key-description-list binding)
 		     (define-key hm--html-noregion-sub-map
 		       (vector key-description-list) binding))
 ;;;  
 ;;;  $Id$
 ;;;
-;;;  Copyright (C) 1993 - 1997  Heiko Muenkel
+;;;  Copyright (C) 1993 - 1998  Heiko Muenkel
 ;;;  email: muenkel@tnt.uni-hannover.de
 ;;;
 ;;;  This program is free software; you can redistribute it and/or modify
 	  ["Wais link (direct)..." hm--html-add-direct-wais-link t]
 	  ["Wais link (gateway)..." hm--html-add-wais-link t]
 	  "----"
+	  ["CGI link..." hm--html-add-cgi-link t]
 	  ["Proggate link..." hm--html-add-proggate-link t]
 	  ["Local Proggate link..." hm--html-add-local-proggate-link t]
 	  "----"
 	  ["WAIS link (direct)..." hm--html-add-direct-wais-link-to-region t]
 	  ["WAIS link (gateway)..." hm--html-add-wais-link-to-region t]
 	  "----"
+	  ["CGI link..." hm--html-add-cgi-link-to-region t]
 	  ["Proggate link..." hm--html-add-proggate-link-to-region t]
 	  ["Local Proggate link..." 
 	   hm--html-add-local-proggate-link-to-region 
 (if (adapt-xemacsp)
     (defun hm--install-html-menu (menu-name)
       (if (and (featurep 'menubar)
-	       current-menubar (not (assoc menu-name current-menubar)))
+	       current-menubar 
+	       (not (assoc menu-name current-menubar)))
 	  (progn
 	    (set-buffer-menubar (copy-sequence current-menubar))
 	    (add-submenu nil
 			      (cdr hm--html-pulldown-menu))))
     ))
 
-(if (adapt-emacs19p)
+(if (adapt-emacsp)
     (progn
 
       (setq hm--html-menu-noregion-expert-map
 
 (if (adapt-xemacsp)
     (progn
+
       (defadvice sgml-xemacs-get-popup-value (around
 					      hm--html-popup-menu-advice
 					      activate)
 	(let ((value nil)
 	      (event nil))
 	  ;; (popup-menu menudesc)
-	  (popup-menu (append hm--html-popup-menu  ; for the hm--html-menu 
-			      (list "=="           ;
-				    (car menudesc) ;
-				    "==")          ;
-			      (cdr menudesc)))     ;
+	  (if (boundp 'hm--html-popup-menu)
+	      (popup-menu (append hm--html-popup-menu  ; for the hm--html-menu 
+				  (list "=="           ;
+					(car menudesc) ;
+					"==")          ;
+				  (cdr menudesc)))     ;
+	    (popup-menu menudesc))
 	  (while (popup-up-p)
 	    (setq event (next-command-event event))
 	    (cond ((misc-user-event-p event)
 		     (signal 'quit nil))
 		    ((eq (event-object event) 'menu-no-selection-hook)
 		     nil)
-		    ((commandp (event-object event))            ; for the 
+		    ((and (commandp (event-object event))       ; for the 
+			  (boundp 'hm--html-mark))		;
 		     (set-mark hm--html-mark)			;
 		     (goto-char hm--html-point)			;
 		     (call-interactively (event-object event))  ; hm--html-menu
-		     (signal 'quit nil))                        ; items
+;		     (signal 'quit nil)                         ; items
+		     )
 		    (t
 		     (eval (event-object event)))))
 		  ((button-release-event-p event) ; don't beep twice
 		  (popup-menu hm--html-menu-noregion-expert)
 		(popup-menu hm--html-menu-noregion-novice))
 	      )
-	  (popup-menu (append  ;mode-popup-menu
-			       ;'("===")
-			       (if hm--html-expert
-				   hm--html-menu-noregion-expert
-				 hm--html-menu-noregion-novice)
-			       (list "==="
-				     (car mode-popup-menu)
-				     "===")
-			       (cdr mode-popup-menu)
-			       ))))
+	  ;; popup-menu will fail, if mode-popup-menu contains a
+	  ;; :filter and mode-popup-menu isn't at the top of
+	  ;; the menu
+	  (popup-menu (append mode-popup-menu
+			      (list "==="
+				    (if hm--html-expert
+					(car hm--html-menu-region-expert)
+				      (car hm--html-menu-region-novice))
+				    "===")
+			      (if hm--html-expert
+				  (cdr hm--html-menu-region-expert)
+				(cdr hm--html-menu-region-novice)
+				)))))
 	    
       
       
 		  (popup-menu hm--html-menu-region-expert)
 		(popup-menu hm--html-menu-region-novice))
 	      )
-	  (popup-menu (append  mode-popup-menu
-			       '("---")
-			       (if hm--html-expert
-				   hm--html-menu-noregion-expert
-				 hm--html-menu-noregion-novice)))))
+	  ;; popup-menu will fail, if mode-popup-menu contains a
+	  ;; :filter and mode-popup-menu isn't at the top of
+	  ;; the menu
+	  (popup-menu (append mode-popup-menu
+			      (list "==="
+				    (if hm--html-expert
+					(car hm--html-menu-region-expert)
+				      (car hm--html-menu-region-novice))
+				    "===")
+			      (if hm--html-expert
+				  (cdr hm--html-menu-region-expert)
+				(cdr hm--html-menu-region-novice)
+			      )))))
       
       ))
 
 ;;; hm--html-mode --- Major mode for editing HTML documents for the WWW
 
-;; Copyright (C) 1996, 1997 Heiko Muenkel
+;; Copyright (C) 1996 - 1998 Heiko Muenkel
 
 ;; Author: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
 ;; Keywords: hypermedia languages help docs wp
 
 (defconst hm--html-menus-package-name "hm--html-menus")
 
-(defconst hm--html-menus-package-version "5.8")
+(defconst hm--html-menus-package-version "5.9")
   
 
 ;;; Generate the help buffer faces
 	    (and (eq major-mode 'hm--html-mode)
 		 (if (null arg) (not hm--html-region-mode)
 		   (> (prefix-numeric-value arg) 0))))
+      (redraw-modeline)
       )
 
     (defun hm--html-region-mode (&optional arg)
 	      hm--html-emacs19-popup-noregion-menu-button
 	      hm--html-menu-noregion-novice-map)))
       )
-
+    (redraw-modeline)
     )
 
 
   (if hm--html-minor-mode
       (progn
 	(hm--install-html-menu hm--html-minor-mode-pulldown-menu-name)
-	(when (adapt-emacs19p)
+
+	;; In the future it may be a good idea to merge the contents
+	;; of the idd-actions of the major mode with the one of the
+	;; minor mode.
+	(setq idd-actions hm--html-idd-actions)
+	(when (adapt-emacsp)
 	  (hm--html-add-major-menu-to-minor-menus)))
     (when (and (featurep 'menubar)
-	       current-menubar (assoc hm--html-minor-mode-pulldown-menu-name
-				      current-menubar))
+	       current-menubar 
+	       (assoc hm--html-minor-mode-pulldown-menu-name
+		      current-menubar))
       (delete-menu-item (list hm--html-minor-mode-pulldown-menu-name)))
-    (when (adapt-emacs19p)
+    (when (adapt-emacsp)
       (hm--html-remove-major-menu-from-minor-menus)))
+  (redraw-modeline)
   )
   
 
 	    (and hm--html-minor-mode
 		 (if (null arg) (not hm--html-minor-region-mode)
 		   (> (prefix-numeric-value arg) 0))))
+      (redraw-modeline)
       )
 
     (defun hm--html-minor-region-mode (&optional arg)
 	      hm--html-emacs19-popup-noregion-menu-button
 	      hm--html-menu-noregion-novice-map)))
       )
+    (redraw-modeline)
     )
 
   

hm--html-mode.texi

 @setchapternewpage odd
 @comment %**end of header (This is for running Texinfo on a region.)
 @comment $Id$
-@direntry
-* Hm--Html-Mode::       mode for writing HTML pages
-@end direntry
-
 @ifinfo
 This file documents the Elisp package @code{hm--html-menus}.
 
-Copyright @copyright{} 1997 Heiko M�nkel
+Copyright @copyright{} 1998 Heiko M�nkel
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
 @sp 4
 @center by Heiko M�nkel
 @sp 4
-@center Version 5.8, July 1997
+@center Version 5.9, July 1998
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1997 Heiko M�nkel
+Copyright @copyright{} 1998 Heiko M�nkel
 @sp 4
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
 @chapter License
 @cindex license to copy hm---html-menus
 @cindex General Public License
-Copyright (C) 1993 - 1997 Heiko M�nkel, muenkel@@tnt.uni-hannover.de
+Copyright (C) 1993 - 1998 Heiko M�nkel, muenkel@@tnt.uni-hannover.de
 @sp 2
 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
 @findex hm--html-mode 
 @findex hm--html-minor-mode 
 
-This document describes the Elisp package @emph{hm---html-menus 5.8}.
+This document describes the Elisp package @emph{hm---html-menus 5.9}.
 
 The version of the document is:@*
 $Id$
 @item Put all the *.el files in one of your XEmacs (or emacs) lisp load
 directories (e.g. site-lisp/hm--html-menus).
 
-@item @emph{For XEmacs only}: Put the files @file{drop} and @file{dropmsk}
+@item @emph{For XEmacs only}: @*
+Put the files @file{drop} and @file{dropmsk}
 in the directory specified by the lisp variable
 @code{idd-data-directory}. By default it is
 @file{<prefix>/lib/xemacs-<version>/etc/idd} (eg: if you have installed
 directory @file{/usr/local/xemacs/lib/xemacs-19.15/etc/idd}.
 
 If you'd like to put the files in another directory, then you must set
-the variable @code{idd-data-directory} to this directory (eg:
-@code{(setq idd-data-directory "/usr/local/data")})
+the variable @code{idd-data-directory} to this directory (eg, to put in
+the directory @file{/usr/local/data}: @code{(setq idd-data-directory
+"/usr/local/data")}
 
 @item Put the following in your .emacs (or default.el or site-init.el):
 @lisp
   "Expands the templates in the region from BEGIN to END.
 If BEGIN and END are nil, then the current region is used."
   t)
-(autoload 'tmpl-insert-template-file-from-fixed-dirs "tmpl-minor-mode"
-  "Inserts a template FILE and expands it, if `tmpl-automatic-expand' is t.
+(autoload 'tmpl-insert-template-file-from-fixed-dirs
+          "tmpl-minor-mode"
+  "Inserts a template FILE and expands it, if 
+`tmpl-automatic-expand' is t.
 This command tries to read the template file from a list of
-predefined directories (look at `tmpl-template-dir-list') and it filters
-the contents of these directories with the regular expression
-`tmpl-filter-regexp' (look also at this variable). 
+predefined directories (look at `tmpl-template-dir-list') and it 
+filters the contents of these directories with the regular 
+expression `tmpl-filter-regexp' (look also at this variable). 
 The command uses a history variable, which could be changed with the
 variable `tmpl-history-variable-name'.
 
   t)
 
 (autoload 'tmpl-insert-template-file "tmpl-minor-mode"
-  "Inserts a template FILE and expand it, if `tmpl-automatic-expand' is t.
+  "Inserts a template FILE and expand it, 
+if `tmpl-automatic-expand' is t.
 Look also at `tmpl-template-dir-list', to specify a default template
-directory. 
-You should also take a look at `tmpl-insert-template-file-from-fixed-dirs'
-which has additional advantages (and disadvantages :-).
+directory. You should also take a look at 
+`tmpl-insert-template-file-from-fixed-dirs', which has additional 
+advantages (and disadvantages :-).
 
 ATTENTION: The interface of this function has changed. The old 
-function had the argument list (&optional TEMPLATE-DIR AUTOMATIC-EXPAND).
-The variables `tmpl-template-dir-list' and `tmpl-automatic-expand' must
-now be used instead of the args TEMPLATE-DIR and AUTOMATIC-EXPAND."
+function had the argument list 
+        (&optional TEMPLATE-DIR AUTOMATIC-EXPAND).
+The variables `tmpl-template-dir-list' and `tmpl-automatic-expand' 
+must now be used instead of the args TEMPLATE-DIR and 
+AUTOMATIC-EXPAND."
   t)
 
 (autoload 'html-view-start-mosaic "html-view" "Start Xmosaic." t)
 tries first to load a compiled version of the file.
 
 If neither the environment variable nor the lisp variable is set, the
-variable @code{init-file-user} will be respected. This means, that
-you'll get the @file{~other-user/.hm--html-configuration.el}, if you've
-started the emacs with the options @code{-u other-user}. In all cases,
-no user specific customization file will be loaded, if the @code{-q}
-option was given to the emacs.
+variable @code{init-file-user} will be respected. Therefore you'll get
+@file{~other-user/.hm--html-configuration.el}, if you've started the
+emacs with the options @code{-u other-user}. In all cases, no user
+specific customization file will be loaded, if the @code{-q} option was
+given to the emacs.
 
 You can also put the user specific customization in your
 @file{.emacs}. It's up to you to decide which way is better.
 * Links To WAIS Gateways::      
 * Links To The Mail Gateway::   
 * Links For Sending Mail::      
+* Links to CGI scripts::        
 * Links To The Program Gateway::  
 * Links To The Local Program Gateway::  
 * URL For Forms And Image Tags::  
 @end itemize
 
 
-@node Links For Sending Mail, Links To The Program Gateway, Links To The Mail Gateway, Defaults Used For Generating Links
+@node Links For Sending Mail, Links to CGI scripts, Links To The Mail Gateway, Defaults Used For Generating Links
 @comment  node-name,  next,  previous,  up
 @subsubsection Links For Sending Mail
 @cindex mailto links 
 @end itemize
 
 
-@node Links To The Program Gateway, Links To The Local Program Gateway, Links For Sending Mail, Defaults Used For Generating Links
+@node Links to CGI scripts, Links To The Program Gateway, Links For Sending Mail, Defaults Used For Generating Links
+@comment  node-name,  next,  previous,  up
+@subsubsection  Links to CGI scripts
+@cindex cgi script links 
+@vindex hm--html-cgi-hostname:port-alist 
+@vindex hm--html-cgi-hostname:port-default 
+@vindex hm--html-cgi-script-alist 
+@vindex hm--html-cgi-script-default 
+
+CGI scripts are available on many WWW servers to start special programs
+(eg: cgi-man, to display man pages). Creating these links can be
+customized with the following varoables.
+
+@itemize @bullet
+@item
+@code{hm--html-cgi-hostname:port-alist}: Alist with hostnames and ports
+for the cgi server. 
+@item
+@code{hm--html-cgi-hostname:port-default}: Default hostname with port for
+the cgi server.
+@item
+@code{hm--html-cgi-script-alist}: Alist with CGI scripts, which are
+available on your server.
+@item
+@code{hm--html-cgi-script-default}: Default CGI script.
+@end itemize
+
+
+@node Links To The Program Gateway, Links To The Local Program Gateway, Links to CGI scripts, Defaults Used For Generating Links
 @comment  node-name,  next,  previous,  up
 @subsubsection  Links To The Program Gateway 
 @cindex program gateway links 
 @vindex hm--html-changed-comment-prefix 
 @vindex hm--html-created-comment-prefix 
 @vindex hm--html-comment-infix 
+@vindex hm--html-date-time-separator
+@vindex hm--html-include-time-after-date
+@vindex hm--html-log-date-format
 @vindex hm--html-modified-prefix 
 @vindex hm--html-modified-end-tag 
 @vindex hm--html-modified-insert-before 
 @vindex hm--html-modified-start-tag 
 
-
 The @code{hm--html-mode} automatically inserts some useful information in
 html pages. This behaviour can be changed by the following variables.
 
 @item
 @code{hm--html-automatic-update-title-date}: t => The date in the title
 line will be updated before file saving.  nil => No automatic update of
-the date. 
+the date.
+@item
+@code{hm--html-title-date-format}: Default output format for date and
+time in the title and main header line. @emph{WARNING}: Don't use the
+character @emph{<} in this string! The format is used as argument of the
+function @code{format-time-string}. The following describes the meanings
+of special %-sequences, as described in the function documentation of
+@code{format-time-string}:
+
+@itemize @bullet
+@item
+@code{%a} This stands for the abbreviated name of the day of week.
+@item
+@code{%A} This stands for the full name of the day of week.
+@item
+@code{%b} This stands for the abbreviated name of the month.
+@item
+@code{%B} This stands for the full name of the month.
+@item
+@code{%c} This is a synonym for `%x %X'.
+@item
+@code{%C} This has a locale-specific meaning.  In the default locale
+(named C), it is equivalent to `%A, %B %e, %Y'.
+@item
+@code{%d} This stands for the day of month, zero-padded.
+@item
+@code{%D} This is a synonym for `%m/%d/%y'.
+@item
+@code{%e} This stands for the day of month, blank-padded.
+@item
+@code{%h} This is a synonym for `%b'.
+@item
+@code{%H} This stands for the hour (00-23).
+@item
+@code{%I} This stands for the hour (00-12).
+@item
+@code{%j} This stands for the day of the year (001-366).
+@item
+@code{%k} This stands for the hour (0-23), blank padded.
+@item
+@code{%l} This stands for the hour (1-12), blank padded.
+@item
+@code{%m} This stands for the month (01-12).
+@item
+@code{%M} This stands for the minute (00-59).
+@item
+@code{%n} This stands for a newline.
+@item
+@code{%p} This stands for `AM' or `PM', as appropriate.
+@item
+@code{%r} This is a synonym for `%I:%M:%S %p'.
+@item
+@code{%R} This is a synonym for `%H:%M'.
+@item
+@code{%S} This stands for the seconds (00-60).
+@item
+@code{%t} This stands for a tab character.
+@item
+@code{%T} This is a synonym for `%H:%M:%S'.
+@item
+@code{%U} This stands for the week of the year (01-52), assuming that
+weeks start on Sunday.
+@item
+@code{%w} This stands for the numeric day of week (0-6). Sunday is day
+0.
+@item
+@code{%W} This stands for the week of the year (01-52), assuming that
+weeks start on Monday.
+@item
+@code{%x} This has a locale-specific meaning. In the default locale
+(named C), it is equivalent to `%D'.
+@item
+@code{%X} This has a locale-specific meaning.  In the default locale
+(named C), it is equivalent to `%T'.
+@item
+@code{%y} This stands for the year without century (00-99).
+@item
+@code{%Y} This stands for the year with century.
+@item
+@code{%Z} This stands for the time zone abbreviation.
+@end itemize
+
+@item
+@code{hm--html-log-date-format}: Default output format string for date
+and time in the log lines. @emph{WARNING}: Don't use the character
+@emph{<} in this string! The log lines are the lines with the created
+and changed comments. The format string is used as argument of the
+function @code{format-time-string}. Please look at the description of
+the function @code{format-time-string} or of the variable
+@code{hm--html-title-date-format} for a description of the format
+string.
+@item
+@code{hm--hmtl-include-time-after-date}: This variable isn't longer
+supported. It is replaced by @code{hm--html-log-date-format}. It's old
+description was:
+
+t => The time of day will be appended to the date in the created and
+changed comment lines, as well as in the visible modified line if these
+lines are present; the time will never be appended to the date in the
+title. The separator between date and title is defined with
+@code{hm--html-date-time-separator}.
+@item
+@code{hm--html-date-time-separator}: This variable isn't longer
+supported. It is replaced by @code{hm--html-log-date-format}. It's old
+description was:
+
+The value of the separator between date and time in the created and
+modified comment lines and in the visible modified line. This is only
+used if @code{hm--hmtl-include-time-after-date} is t. Eg.: " at ".
 @item
 @code{hm--html-automatic-created-comment}: t => A "created comment"
 line will be added.  nil => No automatic insert of a "created
 bold instead of b).
 @item
 To get the right indentation for the new tags you should add an entry
-for them to the variable @code{hm--html-tag-name-alist}, which is defined
-in @file{hm--html-configuration.el}.  Let's assume that the new tagname
-is @samp{foo}. The entry in @code{hm--html-tag-name-alist} should
-be
+for them to the alist of the variable @code{hm--html-tag-name-alist},
+which is defined in the file @file{hm--html-configuration.el}.  Let's
+assume that the new tagname is @samp{foo}. The entry in
+@code{hm--html-tag-name-alist} should be
 @lisp
      ("foo" (:hm--html-one-element-tag t))
 @end lisp
 
 The end of the comment is the end of the line. Therefore it has the same
 syntax as a lisp or C++ comment.
+
+@item
+@emph{Point template} After expanding the templates of a region (or the
+whole buffer), the point will be set at the beginning of this template,
+if such a template was in the region. You should use only one of these
+templates in a region, otherwise the behaviour is undefined. 
+
+@lisp
+The point should be here^@@POINT^@@ after the expansion of the region.
+@end lisp
+
 @end enumerate
 
 By default, a template will be deleted after its expansion, but 
 Before the expansion:
 
 @example
-	Line before the template
-        ^@@C^@@ The Text of a comment template
-	Line after the template
+    Line before the template
+    ^@@C^@@ The Text of a comment template
+    Line after the template
 @end example
 
 After the expansion:
 
-	Line before the template
+    Line before the template
 
-	Line after the template
+    Line after the template
 
 
 Templates can start in any column, and only the template will be deleted
 Before the expansion:
 
 @example
-	Line before the template
-	^@@LISP ((DONT-DELETE t))^@@ (insert-file "~/.cshrc") ^@@END LISP^@@
-	Line after the template
+    Line before the template
+    ^@@LISP ((DONT-DELETE t))^@@ (insert-file "~/.cshrc") ^@@END LISP^@@
+    Line after the template
 @end example
 	
 After the expansion:
 
 @example
-	Line before the template
-	^@@LISP ((DONT-DELETE t))^@@ (insert-file "~/.cshrc") ^@@END LISP^@@
-	Line after the template
+    Line before the template
+    ^@@LISP ((DONT-DELETE t))^@@ (insert-file "~/.cshrc") ^@@END LISP^@@
+    Line after the template
 @end example
 
 It was assumed, that the file @file{~/.cshrc} was empty !
 Before the expansion:
 
 @example
-	Line before the template
-	^@@LISP ((DELETE-LINE t))^@@ (insert-file "~/.cshrc") ^@@END LISP^@@
-	Line after the template
+    Line before the template
+    ^@@LISP ((DELETE-LINE t))^@@ (insert-file "~/.cshrc") ^@@END LISP^@@
+    Line after the template
 @end example
 	
 After the expansion:
 
 @example
-	Line before the template
-	Line after the template
+    Line before the template
+    Line after the template
 @end example
 
 It was assumed, that the file @file{~/.cshrc} was empty !
 @cindex customization
 @cindex configuration 
 @vindex tmpl-template-dir-list 
+@vindex tmpl-template-configuration-file
 @vindex tmpl-automatic-expand 
 @vindex tmpl-filter-regexp 
 @vindex tmpl-sign 
 @code{tmpl-insert-template-file} uses only the car of the list (if it is
 a list.)
 @item
+@code{tmpl-template-configuration-file}: Name of the configuration file
+for the tmpl minor mode.  Its a name without a directory, because the
+file will be searched in all upper directories, until it (one) is found.
+The file must contain loadable Lisp code.
+
+If the command @code{tmpl-insert-template-file-from-fixed-dirs} is
+called, and the variable @code{tmpl-template-dir-list} is nil, the file
+determined by the variable @code{tmpl-template-configuration-file} will
+be searched in all upper directories and in the default one, starting
+with the default directory.  If such a file is found and readable, then
+it is loaded. Therefore you can set the variable
+@code{tmpl-template-dir-list}, if you insert a line like the following
+in such a file:
+
+@code{(setq tmpl-template-dir-list '("~/data/docs/latex/teTeX/templates/"))}
+
+@item
 @code{tmpl-filter-regexp}: This defines a regular expression used for
 filtering out non-template files in template directories. It is used in
 the command @code{tmpl-insert-template-file-from-fixed-dirs} to allow
 in the buffer will be automatically expanded if the variable is set to
 t, which is the default.
 @item
-@code{tmpl-sign}: Thisdetermines the sign which marks the beginning and
+@code{tmpl-sign}: This determines the sign which marks the beginning and
 the end of template expressions. By default it is set to the null
 character (displayed in emacs as ^@@). You can also set this to a
 string. Be careful if you change it, so that the templates will not be
 in the completion list only template files which could be used for the
 current mode.
 
+If the variable @code{tmpl-template-dir-list} is nil, it tries to find a
+file with a name determined by the variable
+@code{tmpl-template-configuration-file}. The file is searched at first in
+the default directory, at second in it's parent directory, at third in
+the parent directory of the parent directory and so on, until it is
+found or the root directory is reached. If such a readable file is found,
+then it is loaded. Therefore you can set this variable by inserting a line
+like the following in such a file:
+ @code{(setq tmpl-template-dir-list '("~/data/docs/latex/teTeX/templates/"))}
+
 If you want to insert a template file with this command, which is not in
 one of the directories from @code{tmpl-template-dir-list}, then you have
 to enter the string @emph{"Change the directory"} instead of a template
 ;;; $Id$
 ;;;
-;;; Copyright (C) 1993 - 1997  Heiko Muenkel
+;;; Copyright (C) 1993 - 1998  Heiko Muenkel
 ;;; email: muenkel@tnt.uni-hannover.de
 ;;;
 ;;;  This program is free software; you can redistribute it and/or modify
   "Adds the HTML tag for a basefont."
   (interactive (list (hm--html-read-font-size t)))
   (hm--html-add-tags 'hm--html-insert-start-tag 
-		     (concat "<BASEFONT SIZE=" size ">")))
+		     (concat "<BASEFONT SIZE=\"" size "\">")))
 
 (defun hm--html-add-line-break ()
   "Adds the HTML tag for a line break."
 			     (if alt
 				 (concat "\nALT=\"" alt "\"")
 			       "")
-			     "\nSHAPE=" shape
+			     "\nSHAPE=\"" shape "\""
 			     "\nCOORDS=\"" coords "\""
 			     ">")))
 
 
-(when (adapt-emacs19p)
+(when (adapt-emacsp)
       (defvar :ask ':ask))
 
 (defvar hm--html-use-image-as-map ':ask
 		 (list href alt alignment mapname)))
   (hm--html-add-tags 
    'hm--html-insert-start-tag
-   (concat "<IMG ALIGN=" alignment
+   (concat "<IMG ALIGN=\"" alignment "\""
 	   "\nHREF=\"" href "\""
 	   (if alt
 	       (concat "\nALT=\"" alt "\"")
 		 (list url (hm--html-read-altenate url))))
   (hm--html-add-tags 
    'hm--html-insert-start-tag 
-   (concat "<IMG ALIGN=BOTTOM SRC=\""
+   (concat "<IMG ALIGN=\"BOTTOM\" SRC=\""
 	   href
 	   (when alt
 	     (concat "\" ALT=\"" alt))
 		 (list url (hm--html-read-altenate url))))
   (hm--html-add-tags 
    'hm--html-insert-start-tag 
-   (concat "<IMG ALIGN=MIDDLE SRC=\""
+   (concat "<IMG ALIGN=\"MIDDLE\" SRC=\""
 	   href
 	   (when alt
 	     (concat "\" ALT=\"" alt))
 		 (list url (hm--html-read-altenate url))))
     (hm--html-add-tags 
      'hm--html-insert-start-tag 
-     (concat "<IMG ALIGN=TOP SRC=\""
+     (concat "<IMG ALIGN=\"TOP\" SRC=\""
 	     href
 	     (when alt
 	       (concat "\" ALT=\"" alt))
   (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
 		     (concat "<FONT"
 			     (if size 
-				 (concat " SIZE=" size)
+				 (concat " SIZE=\"" size "\"")
 			       "")
 			     (if color
-				 (concat " COLOR=" color)
+				 (concat " COLOR=\"" color "\"")
 			       "")
 			     ">")
 		     'hm--html-insert-end-tag-with-newline
   (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
 			       (concat "<FONT"
 				       (if size 
-					   (concat " SIZE=" size)
+					   (concat " SIZE=\"" size "\"")
 					 "")
 				       (if color
-					   (concat " COLOR=" color)
+					   (concat " COLOR=\"" color "\"")
 					 "")
 				       ">")
 			       'hm--html-insert-end-tag-with-newline
 	      (delete-backward-char (- (point) point-after-start-tag))
 	      (let ((start (point)))
 		(if hm--html-automatic-create-title-date
-		    (insert title " (" (hm--date) ")")
+		    (insert title 
+			    " (" 
+			    (format-time-string hm--html-title-date-format
+						(current-time))
+			    ")")
 		  (insert title))
 		(goto-char start))))
 	;; Noch kein <TITLE> im Buffer vorhanden
 			   "</TITLE>"
 			   'insert
 			   (if hm--html-automatic-create-title-date
-			       (concat title " (" (hm--date) ")")
+			       (concat title
+				       " ("
+				       (format-time-string
+					hm--html-title-date-format
+					(current-time))
+				       ")")
 			     title))
 	(forward-char 8)
 	(newline 1)
 	      (goto-char (- (point) 8))
 	      (delete-backward-char (- (point) point-after-start-tag))
 	      (if hm--html-automatic-create-title-date
-		  (insert title " (" (hm--date) ")")
+		  (insert title
+			  " ("
+			  (format-time-string
+			   hm--html-title-date-format
+			   (current-time))
+			  ")")
 		(insert title))))
 	;; Noch kein <TITLE> im Buffer vorhanden
 	(hm--html-set-point-for-title)
 			   "</TITLE>"
 			   'insert
 			   (if hm--html-automatic-create-title-date
-			       (concat title " (" (hm--date) ")")
+			       (concat title
+				       " ("
+				       (format-time-string
+					hm--html-title-date-format
+					(current-time))
+				       ")")
 			     title))
 	(forward-char 8)
 	;(newline 1)
 construct the link."
 ;  (let ((point nil))
   (save-window-excursion
-    (let ((html-buffer (current-buffer))
-	  (html-help-buffer (hm--html-generate-add-link-help-buffer
-			     scheme-parameter-list
-			     host-name:port-parameter-list
-			     servername:port-parameter-list
-			     path+file-parameter-list
-			     anchor-parameter-list))
-	  (scheme (hm--html-completing-read scheme-parameter-list))
-	  (hostname:port (hm--html-completing-read 
-			  host-name:port-parameter-list))
-	  (servername:port (hm--html-completing-read 
-			    servername:port-parameter-list))
-	  (path+file (hm--html-read-filename path+file-parameter-list))
-	  (anchor (hm--html-completing-read anchor-parameter-list))
+    (let* ((html-buffer (current-buffer))
+	   (html-help-buffer (hm--html-generate-add-link-help-buffer
+			      scheme-parameter-list
+			      host-name:port-parameter-list
+			      servername:port-parameter-list
+			      path+file-parameter-list
+			      anchor-parameter-list))
+	   (scheme (hm--html-completing-read scheme-parameter-list))
+	   (hostname:port (if (string= scheme "http")
+			      (hm--html-completing-read 
+			       host-name:port-parameter-list)
+			    ""))
+	   (servername:port (hm--html-completing-read 
+			     servername:port-parameter-list))
+	   (path+file (hm--html-read-filename path+file-parameter-list))
+	   (anchor (hm--html-completing-read anchor-parameter-list))
 ;	  (hrefname (setq html-link-counter (1+ html-link-counter)))
-	  (anchor-seperator 
-	   (hm--html-get-anchor-seperator-from-parameter-list
-	    anchor-parameter-list)))
+	   (anchor-seperator 
+	    (hm--html-get-anchor-seperator-from-parameter-list
+	     anchor-parameter-list)))
       (if (not (string= scheme ""))
 	  (if (string= hostname:port "")
 	      (setq scheme (concat scheme ":"))
   (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
 
 
+(defun hm--html-add-cgi-link-1 (function-add-tags)
+  "Internal function. Adds the HTML tags for a link to a cgi script."
+  (hm--html-add-link function-add-tags
+		     (list		; scheme 
+		      "Scheme (insert nothing for a relative link): "
+		      '(("") ("http"))
+		      "http"
+		      t
+		      "http")
+		     (list		; hostname:port
+		      "Servername and Port: "
+		      hm--html-cgi-hostname:port-alist
+		      hm--html-cgi-hostname:port-default
+		      nil
+		      "www.tnt.uni-hannover.de:80")
+		     (list		; program
+		      "CGI Script Name: "
+		      hm--html-cgi-script-alist
+		      hm--html-cgi-script-default
+		      nil
+		      "/cgi-bin/man-cgi.tnt")
+		     nil		; path/file
+		     (list		; Program Parameter
+		      "Scriptparameter: "
+		      '((""))
+		      nil
+		      nil
+		      "ls+1+/usr/man"
+		      "?")))
+
+
+(defun hm--html-add-cgi-link ()
+  "Adds the HTML tags for a link to a program.
+The program is called via the program gateway.
+Email to muenkel@tnt.uni-hannover.de for information over
+this gateway."
+  (interactive)
+  (hm--html-add-cgi-link-1 'hm--html-add-tags))
+
+
+(defun hm--html-add-cgi-link-to-region ()
+  "Adds the HTML tags for a link to a program to the region.
+The program is called via the program gateway.
+Email to muenkel@tnt.uni-hannover.de for information over
+this gateway."
+  (interactive)
+  (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
+
+
 (defvar hm--html-newsgroup-alist nil
   "Alist with newsgroups for the newsgateway.")
 
 	  (progn
 	    (delete-region (match-beginning 2) (match-end 2))
 	    (goto-char (match-beginning 2))
-	    (insert (hm--date)))))))
+	    (insert (format-time-string hm--html-title-date-format
+					(current-time))))))))
 
 
 (defun hm--html-insert-created-comment (&optional noerror)
 			  comment-infix
 ;			  (or hm--html-username (user-full-name))
 ;			  ", "
-			  (hm--date))))
+			  (hm--date-time))))
 	  (newline)
 	  (hm--html-add-comment)
 	  (insert hm--html-created-comment-prefix
 ;	  (insert "Created by: " 
 ;		  (or hm--html-username (user-full-name))
 ;		  ", "
-		  (hm--date)
+		  (hm--date-time)
 		  ))))))
 
 
   (insert hm--html-changed-comment-prefix
 	  (or hm--html-comment-infix
 	      (concat (or hm--html-username (user-full-name)) ", "))
-	  (hm--date)))
+	  (hm--date-time)))
 
 (defun hm--html-insert-changed-comment (&optional noerror)
   "The function inserts a \"changed comment\".
 	(progn ; old modified line exists
 	  (goto-char (match-end 0))
 	  (if (search-forward-regexp (concat "\\([ \t\n]*\\)"
-					     "\\([^ \t\n<]+\\)"
-					     "\\([ \t\n]*" 
+					     "\\([^<]+\\)"
+;					     "\\([^ \t\n<]+\\)"
+;					     hm--html-date-time-separator
+;					     "\\([^ \t\n<]*\\)"
+					     "\\([ \t\n]*"
 					     hm--html-modified-end-tag
 					     "\\)"))
 	      (progn
-		(delete-region (match-beginning 2) (match-end 2))
-		(goto-char (match-beginning 2))
-		(insert (hm--date)))
-;	      (replace-match (concat "\\1" (hm--date)))
+		;; the nt-emacs version returns a leading space rather
+		;; than a leading zero on day 1 to 9 of the month; the
+		;; match-beginning 2 did not delete this space,
+		;; thereby adding an extra space between
+		;; modified-prefix and date(--time) at every single
+		;; save.  (delete-region (match-beginning 2)
+		;; (match-end 2))
+		(delete-region (match-beginning 0) (match-end 0))
+		(insert (hm--date-time)
+			hm--html-modified-end-tag))
+;		(delete-region (match-beginning 2) (match-end 2))
+;		(goto-char (match-beginning 2))
+;		(insert (hm--date)))
 	    (error "Destroyed \"Modified line\" found!")))
       (search-backward hm--html-modified-insert-before nil t)
       (search-backward "</html>" nil t)
       (indent-according-to-mode)
       (insert hm--html-modified-start-tag
 	      hm--html-modified-prefix
-	      (hm--date)
+	      (format-time-string hm--html-title-date-format (current-time))
 	      hm--html-modified-end-tag))))
 				    
 
 
 ;;; Functions for font lock mode
 
-(if (adapt-emacs19p)
+(if (adapt-emacsp)
     (progn
       (make-face 'font-lock-comment-face)
       (make-face 'font-lock-doc-string-face)
 					 (concat " VALUE=\"" value "\""))
 				     (if checked " CHECKED")
 				     (if (and size (not (string= size "")))
-					 (concat " SIZE=" size))
+					 (concat " SIZE=\"" size "\""))
 				     (if (and maxlength
 					      (not (string= maxlength "")))
-					 (concat " MAXLENGTH=" 
+					 (concat " MAXLENGTH=\"" 
 						 maxlength 
+						 "\""
 						 ))
 				     (if (and src
 					      (not (string= src "")))
 				     (if (= size 20)
 					 ">"
 				       (format
-					" SIZE=%d>"
+					" SIZE=\"%d\">"
 					size)))))
 
 
   (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
 		     (concat "<SELECT NAME=\"" 
 			     name 
-			     "\" SIZE="
+			     "\" SIZE=\""
 			     (int-to-string listsize)
+			     "\""
 			     (if multiple
 				 " MULTIPLE")
 			     ">")
   (hm--html-add-tags 'hm--html-insert-start-tag
 		     (concat "<TEXTAREA NAME=\""
 			     name
-			     "\" ROWS="
+			     "\" ROWS=\""
 			     (int-to-string rows)
-			     " COLS="
+			     "\""
+			     " COLS=\""
 			     (int-to-string columns)
+			     "\""
 			     ">")
 		     'hm--html-insert-end-tag
 		     "</TEXTAREA>"))
   (interactive (list (y-or-n-p "Put the title at the table top? ")))
   (hm--html-add-tags 'hm--html-insert-start-tag
 		     (concat "\n<CAPTION"
-			     (if top " align=top" " align=bottom")
+			     (if top " align=\"top\"" " align=\"bottom\"")
 			     "> ")
 		     'hm--html-insert-end-tag
 		     " </CAPTION>"))
   (interactive (list (y-or-n-p "Put the title at the table top? ")))
   (hm--html-add-tags-to-region 'hm--html-insert-start-tag
 			       (concat "<CAPTION"
-				       (if top " align=top" " align=bottom")
+				       (if top " align=\"top\""
+					 " align=\"bottom\"")
 				       "> ")
 			       'hm--html-insert-end-tag
 			       " </CAPTION>"))
 							&optional 
 							alignment-list)
   "Reads the alignments and the entries for NO-OF-CELLS cells.
-The return is a list with strings of the form: \"align=left> entry\".
+The return is a list with strings of the form: \"align=\\\"left\\\"> entry\".
 CELL-NO is the current cell no.
 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
   (if (> cell-no no-of-cells)
 	  (entry (read-string (format "Entry of the %d. cell: " cell-no))))
       (if (string= "default" alignment)
 	  (setq alignment "")
-	(setq alignment (concat " align=" alignment)))
+	(setq alignment (concat " align=\"" alignment "\"")))
       (cons (concat alignment "> " entry)
 	    (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
 							     no-of-cells
 		(goto-char begin-of-last-row)
 	      (setq alignment-list
 		    (cons
-		     (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
-						(match-end 0)
-						t)
+		     (if (search-forward-regexp 
+			  "\\(align=\"?\\)\\([^\" \t\n>]*\\)"
+			  (match-end 0)
+			  t)
 			 (buffer-substring (match-beginning 2)
 					   (match-end 2))
 		       "default")
 		     (concat "<TD"
 			     (if (string= "default" alignment)
 				 "> "
-			       (concat " align=" alignment "> ")))))
+			       (concat " align=\"" alignment "\"> ")))))
 
 
 (defun hm--html-add-header-entry (alignment)
 		     (concat "<TH"
 			     (if (string= "default" alignment)
 				 "> "
-			       (concat " align=" alignment "> ")))))
+			       (concat " align=\"" alignment "\"> ")))))
 
 
 (defun hm--html-add-row-frame (alignment)
 		     (concat "<TD"
 			     (if (string= "default" alignment)
 				 "> "
-			       (concat " align=" alignment "> ")))
+			       (concat " align=\"" alignment "\"> ")))
 		     'hm--html-insert-end-tag
 		     "<TR>"))
 
 			       (concat "<TD"
 				       (if (string= "default" alignment)
 					   "> "
-					 (concat " align=" alignment "> ")))
+					 (concat " align=\""
+						 alignment
+						 "\"> ")))
 			       'hm--html-insert-end-tag
 			       " <TR>"))
 
     (save-excursion
       (if (and (search-backward "<" nil t)
 	       (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
-	  (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
-				     nil
-				     t)
+	  (if (search-forward-regexp 
+	       "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
+	       nil
+	       t)
 	      (progn
 		(delete-region (match-beginning 2) (match-end 2))
 		(insert (format "\"%d\"" columns)))
 ;   sending the contents of a html buffer to netscape
 ;   (Thanks to Adrian Aichner for providing this function)
 
-(defun hm--html-send-buffer-to-netscape (buffer 
-					 &optional new-netscape new-window)
-  "View html buffer with Netscape.
-This should be changed in the fututure, so that it doesn't need vm."
-  (interactive)
-  (require 'vm)
-  (if new-netscape
-      (vm-run-background-command vm-netscape-program buffer-file-name)
-    (or (equal 0 
-	       (vm-run-command vm-netscape-program 
-			       "-remote" 
-			       (concat "openURL(file://localhost" 
-				       buffer-file-name
-				       (if new-window ", new-window" "")
-				       ")")))
-	(hm--html-send-buffer-to-netscape buffer t new-window))))
+(defun hm--html-send-buffer-to-netscape (buffer)
+;					 &optional new-netscape new-window)
+  "View html buffer with Netscape."
+;This should be changed in the fututure, so that it doesn't need vm."
+  (interactive "bWhich buffer should be viewed in Netscape: ")
+  (require 'browse-url)
+  (if (buffer-file-name buffer)
+      (browse-url-netscape (buffer-file-name buffer))
+    (let ((view-tmp-file (concat "/tmp/netscape.html-"
+				 (user-login-name)
+				 (emacs-pid))))
+      (save-excursion
+	(find-file view-tmp-file)
+	(widen)
+	(delete-region (point-min) (point-max))
+	(insert-buffer buffer)
+	(write-file view-tmp-file)
+	(browse-url-netscape view-tmp-file)))))
+;  (require 'vm)
+;  (if new-netscape
+;      (vm-run-background-command vm-netscape-program buffer-file-name)
+;    (or (equal 0 
+;	       (vm-run-command vm-netscape-program 
+;			       "-remote" 
+;			       (concat "openURL(file://localhost" 
+;				       buffer-file-name
+;				       (if new-window ", new-window" "")
+;				       ")")))
+;	(hm--html-send-buffer-to-netscape buffer t new-window))))
 
 
 
 	   'hm--html-info-hostname:port-default
 	   'hm--html-info-path-alist
 	   'hm--html-local-proggate-path-alist
+	   'hm--html-log-date-format
 	   'hm--html-mail-hostname:port-alist
 	   'hm--html-mail-hostname:port-default
 	   'hm--html-mail-path-alist
 	   'hm--html-server-side-include-command-alist
 	   'hm--html-server-side-include-command-with-parameter-alist
 	   'hm--html-signature-file
+	   'hm--html-title-date-format
 	   'hm--html-template-dir
 	   'hm--html-url-alist
 	   'hm--html-user-config-file
 	   (load-file (expand-file-name
 		       (concat "~"
 			       init-file-user
-			       "~/.hm--html-configuration.elc"))))
+			       "/.hm--html-configuration.elc"))))
 	  ((file-exists-p (expand-file-name 
 			   (concat "~"
 				   init-file-user
-				   "~/.hm--html-configuration.el")))
+				   "/.hm--html-configuration.el")))
 	   (load-file (expand-file-name 
 		       (concat "~"
 			       init-file-user
-			       "~/.hm--html-configuration.el"))))
-	  (t
-	   (message (concat "WARNING: No HTML User Config File ! "
-			    "Look at hm--html-load-config-files !")))
-	  ))
+			       "/.hm--html-configuration.el"))))
+	  (t (message "No HTML user config file loaded.")
+;	   (message (concat "WARNING: No HTML User Config File ! "
+;			    "Look at hm--html-load-config-files !")))
+	   )))
   )
 			  
 
 ;;;	Integrated the changes from the XEmacs distribution.
 ;;; Changed: 20.07.1995 by Heiko M�nkel
 ;;;	Fixed a bug in html-view-goto-url.
+;;; Changed: 05.11.1998 by Heiko M�nkel
+;;;     Added (require 'adapt)
 ;;; 
 ;;; This program is free software; you can redistribute it and/or
 ;;; modify it under the terms of the GNU General Public License as

internal-drag-and-drop.el

 ;;; internal-drag-and-drop.el --- Internal drag and drop interface
 
-;; Copyright (C) 1996, 1997 Heiko Muenkel
+;; Copyright (C) 1996 - 1998 Heiko Muenkel
 
 ;; Author: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
 ;; Keywords: mouse
 		 (const :tag "Press button during mouse move"
 			:value press-button-during-move)))
 
-(defvar idd-global-mouse-keys (if (adapt-emacs19p)
+(defvar idd-global-mouse-keys (if (adapt-emacsp)
 				  (if (eq idd-drag-and-drop-mouse-binding-type
 					  'click)
 				      [(meta control mouse-1)]
 be bind in the right way.")
 
 (defvar idd-global-help-mouse-keys
-  (if (adapt-emacs19p)
+  (if (adapt-emacsp)
       (if (eq idd-drag-and-drop-mouse-binding-type 'click)
 	  [(meta control mouse-3)]
 	[(meta control down-mouse-3)])
   :group 'idd-drag-and-drop
   :type 'file)
 
-(defcustom idd-data-directory (file-name-as-directory 
-			       (expand-file-name "idd" data-directory))
+(defcustom idd-data-directory (or 
+			       (and (fboundp 'locate-data-directory)
+				    (locate-data-directory "hm--html-menus"))
+			       (file-name-as-directory 
+				(expand-file-name "idd" data-directory)))
   "Data directory for the file `idd-mouse-pointer-image'.
 Run the command `idd-make-drag-and-drop-pointer-glyph' after changing
 this variable."
 	  (next-command-event nil drag-and-drop-message))
     (if (button-press-event-p source-event)
 	(progn
-	  (when (and (adapt-emacs19p)
+	  (when (and (adapt-emacsp)
 		     (mouse-event-p source-event)
 		     (eq idd-drag-and-drop-mouse-binding-type 'click))
 	    (while (not (button-release-event-p (next-command-event)))))
 	  (next-command-event nil drag-and-drop-message))
     (message "")
     (cond ((or (button-release-event-p destination-event)
-	       (and (adapt-emacs19p)
+	       (and (adapt-emacsp)
 		    (button-drag-event-p destination-event)))
 	   (setq destination (idd-get-source-or-destination-alist
 			      destination-event))
 	   (setq destination (idd-get-source-or-destination-alist
 			      destination-event))
 	   (idd-set-point destination)
-;	   (when (adapt-emacs19p)
+;	   (when (adapt-emacsp)
 ;	       (while (not (button-release-event-p (next-command-event)))))
 	   (if idd-help-instead-of-action
 	       (idd-display-help-about-action (idd-get-action source
 	     (idd-call-action (idd-get-action source destination idd-actions)
 			      source
 			      destination)))
-	  ((and (adapt-emacs19p)
+	  ((and (adapt-emacsp)
 		(button-click-event-p destination-event))
 	   (setq destination (idd-get-source-or-destination-alist
 			      destination-event))
     (progn
       (setq idd-help-start-action-keymap
 	    (make-sparse-keymap 'idd-help-start-action-keymap))
-      (if (adapt-emacs19p)
+      (if (adapt-emacsp)
 	  (define-key idd-help-start-action-keymap [(mouse-2)]
 	    'idd-help-start-action)
 	(define-key idd-help-start-action-keymap "[(button2)]"

tmpl-minor-mode.el

 ;;; tmpl-minor-mode.el --- Template Minor Mode
 
-;; Copyright (C) 1993 - 1997  Heiko Muenkel
+;; Copyright (C) 1993 - 1998  Heiko Muenkel
 
 ;; Author: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
 ;; Keywords: data tools
 ;;; Code:
 
 (require 'adapt)
+(require 'dired)
 
 (defgroup tmpl-minor nil
   "A package for inserting and expanding templates."
   :group 'data)
 
-(defcustom tmpl-template-dir-list nil
+(defcustom tmpl-template-dir-list (when (and (fboundp 'locate-data-directory)
+					     (locate-data-directory
+					      "hm--html-menus"))
+				    (list
+				     (locate-data-directory "hm--html-menus")))
   "*A list of directories with the template files.
 If it is nil, then the default-directory will be used. 
 If more than one directory is given, then the
   :group 'tmpl-minor
   :type 'string)
 
+(defcustom tmpl-template-configuration-file ".hm-tmpl-configuration.el"
+  "*Name of the configuration file for the tmpl minor mode.
+Its a name without a directory, because the file will be searched in
+all upper directories, until it (one) is found."
+  :group 'tmpl-minor
+  :type 'string)
+
 (defvar tmpl-history-variable-name 'tmpl-history-variable
   "The name of the history variable.
 The history variable is used by the commands `tmpl-insert-template-file'
 (defvar tmpl-name-comment "C" "Name of a comment template.")
 
 
+(defvar tmpl-name-point "POINT" "Name of a point template.")
+
+
 (defvar tmpl-attribute-delete-line 'DELETE-LINE 
   "Attribute name of the attribute `delete-line`.")
 
 (defvar tmpl-end-template "END" "End of a template.")
 
 
+(defvar tmpl-saved-point nil
+  "Set by point template and used in the expand commands to set the point.")
+
+
 (defvar tmpl-white-spaces " 	
 
 
   (template-delete-template begin-of-template template-attribute-list))
   
 
+(defun tmpl-expand-point-template (begin-of-template template-attribute-list)
+  "Expand the point template, which starts at the point BEGIN-OF-TEMPLATE.
+TEMPLATE-ATTRIBUTE-LIST is the attribute list of the template."
+  (setq tmpl-saved-point begin-of-template)
+  (template-delete-template begin-of-template template-attribute-list))
+  
+
 (defun tmpl-get-template-argument ()
   "Return the Text between a start tag and the end tag as symbol.
 The point must be after the `templ-sign' of the start tag.
 	       ;; lisp template found
 	       (tmpl-expand-lisp-template begin-of-template
 					     template-attribute-list))
+	      ((string= tmpl-name-point template-name)
+	       ;; point template found
+	       (tmpl-expand-point-template begin-of-template
+					   template-attribute-list))
 	      (t (widen)
 		 (error "ERROR In Line %d: Wrong Template Name (%s) !"
 			(tmpl-current-line) template-name)))))))
   "Expands the templates in the region from BEGIN to END.
 If BEGIN and END are nil, then the current region is used."
   (interactive)
+  (setq tmpl-saved-point nil)
   (tmpl-save-excursion
     (narrow-to-region (or begin (region-beginning))
 		      (or end (region-end)))
     (goto-char (point-min))
     (while (tmpl-search-next-template-sign)
       (tmpl-expand-template-at-point))
-    (widen)))
+    (widen))
+  (if tmpl-saved-point
+      (goto-char tmpl-saved-point)))
 
 
 ;;;###autoload
       (set history-variable (cons file (eval history-variable))))
     file))
 
+(defun tmpl-eval-template-configuration-file-1 (configuration-file
+						configuration-directory)
+  "Internal function of `tmpl-eval-template-configuration-file'."
+  (cond ((file-readable-p (concat configuration-directory configuration-file))
+	 (load-file (concat configuration-directory configuration-file)))
+	((string= configuration-directory
+		  (directory-file-name configuration-directory)))
+	(t (tmpl-eval-template-configuration-file-1
+	    configuration-file
+	    (file-name-directory (directory-file-name configuration-directory))
+	    ))))
 
+(defun tmpl-eval-template-configuration-file ()
+  "It evaluates (loads) the template-configuration-file, if there is one.
+The name of the file is determined by the variable 
+`tmpl-template-configuration-file'. The file must contain valid Emacs lisp
+code. The file will be search at first in the current directoy, then in
+it's parent directory and so on, until the file is found or the root directory
+is reached."
+  (if tmpl-template-configuration-file
+      (tmpl-eval-template-configuration-file-1 tmpl-template-configuration-file
+					       (default-directory))))
 
 ;;;###autoload
 (defun tmpl-insert-template-file-from-fixed-dirs (file)
 The command uses a history variable, which could be changed with the
 variable `tmpl-history-variable-name'.
 
+If the variable `tmpl-template-dir-list' is nil, it tries to find a
+file with a name determined by the variable
+`tmpl-template-configuration-file'. The file is searched at first in
+the default directory, at second in it's parent directory, at third in
+the parent directory of the parent directory and so on, until it is
+found or the root directory is reached. If such a readable file is found,
+then it is loaded. Therefore you can set this variable by inserting a line
+like the following in such a file:
+ (setq tmpl-template-dir-list '(\"~/data/docs/latex/teTeX/templates/\"))
+
 The user of the command is able to change interactively to another
 directory by entering at first the string \"Change the directory\".
 This may be too difficult for the user. Therefore another command
 called `tmpl-insert-template-file' exist, which doesn't use fixed
 directories and filters."
   (interactive
-   (list (tmpl-read-template-filename tmpl-template-dir-list
+   (list (tmpl-read-template-filename (if tmpl-template-dir-list
+					  tmpl-template-dir-list
+					(tmpl-eval-template-configuration-file)
+					tmpl-template-dir-list)
 				      tmpl-filter-regexp
 				      tmpl-history-variable-name)))
   (insert-file (expand-file-name file))
 ;(set-default 'tmpl-minor-mode nil)
 
 
-(defvar tmpl-old-local-map nil
-  "Local keymap, before the minor-mode tmpl was switched on.")
+;(defvar tmpl-old-local-map nil
+;  "Local keymap, before the minor-mode tmpl was switched on.")
 
 
-(make-variable-buffer-local 'tmpl-old-local-map)
+;(make-variable-buffer-local 'tmpl-old-local-map)
 
 
 
 
 (make-variable-buffer-local 'tmpl-minor-mode-map)
 
+(setq tmpl-minor-mode-map (make-keymap))
 
 (if (adapt-xemacsp)
-    (defun tmpl-define-minor-mode-keymap ()
-      "Defines the minor mode keymap."
+    (progn
+;    (defun tmpl-define-minor-mode-keymap ()
+;      "Defines the minor mode keymap."
       (define-key tmpl-minor-mode-map [(control c) (control c) x] 
 	'tmpl-expand-templates-in-region)
       (define-key tmpl-minor-mode-map [(control c) (control c) (control x)] 
       (define-key tmpl-minor-mode-map
 	[(control c) (control c) (control e)]
 	'tmpl-escape-tmpl-sign-in-buffer))