home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.006 / xemacs-1 / lib / xemacs-19.13 / lisp / hm--html-menus / hm--html-keys.el < prev    next >
Encoding:
Text File  |  1995-08-26  |  27.3 KB  |  661 lines

  1. ;;; hm--html-keys.el
  2. ;;; v1.10; 22-Aug-1995
  3. ;;; Copyright (C) 1995 Heiko Muenkel
  4. ;;; email: muenkel@tnt.uni-hannover.de
  5. ;;;
  6. ;;;  This program is free software; you can redistribute it and/or modify
  7. ;;;  it under the terms of the GNU General Public License as published by
  8. ;;;  the Free Software Foundation; either version 1, or (at your option)
  9. ;;;  any later version.
  10. ;;;
  11. ;;;  This program is distributed in the hope that it will be useful,
  12. ;;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;;;  GNU General Public License for more details.
  15. ;;;
  16. ;;;  You should have received a copy of the GNU General Public License
  17. ;;;  along with this program; if not, write to the Free Software
  18. ;;;  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. ;;;
  20. ;;; 
  21. ;;; Description:
  22. ;;;
  23. ;;;    Defines the new keybindigs for the hm--html-menus package.
  24. ;;;    At the moment it will only be used, if the variable
  25. ;;;    'hm--html-use-old-keymap' in hm--html-configuration.el
  26. ;;;    is set to nil, which is the default.
  27. ;;; 
  28. ;;; Installation: 
  29. ;;;   
  30. ;;;    Put this file in one of your load path directories.
  31. ;;;
  32.  
  33. (provide 'hm--html-keys)
  34.  
  35.  
  36. (defvar hm--html-noregion-anchor-map nil
  37.   "Noregion sub keymap for inserting anchors.")
  38.  
  39. (if hm--html-noregion-anchor-map
  40.     ()
  41.   (setq hm--html-noregion-anchor-map (make-sparse-keymap))
  42.   (define-key hm--html-noregion-anchor-map "h" 'hm--html-add-html-link)
  43.   (define-key hm--html-noregion-anchor-map "i" 'hm--html-add-info-link)
  44.   (define-key hm--html-noregion-anchor-map "g" 'hm--html-add-gopher-link)
  45.   (define-key hm--html-noregion-anchor-map "f" 'hm--html-add-file-link)
  46.   (define-key hm--html-noregion-anchor-map "\C-f" 'hm--html-add-ftp-link)
  47.   (define-key hm--html-noregion-anchor-map "n" 'hm--html-add-news-link)
  48.   (define-key hm--html-noregion-anchor-map "m" 'hm--html-add-mail-link)
  49.   (define-key hm--html-noregion-anchor-map "w" 'hm--html-add-direct-wais-link)
  50.   (define-key hm--html-noregion-anchor-map "\C-w" 'hm--html-add-wais-link)
  51.   (define-key hm--html-noregion-anchor-map "p" 'hm--html-add-proggate-link)
  52.   (define-key hm--html-noregion-anchor-map 
  53.     "\C-p" 'hm--html-add-local-proggate-link)
  54.   (define-key hm--html-noregion-anchor-map "l" 'html-add-normal-link)
  55.   (define-key hm--html-noregion-anchor-map "t" 'hm--html-add-link-target)
  56.   )
  57.  
  58. (defvar hm--html-region-anchor-map nil
  59.   "Region sub keymap for inserting anchors.")
  60.  
  61. (if hm--html-region-anchor-map
  62.     ()
  63.   (setq hm--html-region-anchor-map (make-sparse-keymap))
  64.   (define-key hm--html-region-anchor-map "h" 'hm--html-add-html-link-to-region)
  65.   (define-key hm--html-region-anchor-map "i" 'hm--html-add-info-link-to-region)
  66.   (define-key hm--html-region-anchor-map 
  67.     "g" 'hm--html-add-gopher-link-to-region)
  68.   (define-key hm--html-region-anchor-map "f" 'hm--html-add-file-link-to-region)
  69.   (define-key hm--html-region-anchor-map 
  70.     "\C-f" 'hm--html-add-ftp-link-to-region)
  71.   (define-key hm--html-region-anchor-map "n" 'hm--html-add-news-link-to-region)
  72.   (define-key hm--html-region-anchor-map "m" 'hm--html-add-mail-link-to-region)
  73.   (define-key hm--html-region-anchor-map 
  74.     "w" 'hm--html-add-direct-wais-link-to-region)
  75.   (define-key hm--html-region-anchor-map 
  76.     "\C-w" 'hm--html-add-wais-link-to-region)
  77.   (define-key hm--html-region-anchor-map 
  78.     "p" 'hm--html-add-proggate-link-to-region)
  79.   (define-key hm--html-region-anchor-map 
  80.     "\C-p" 'hm--html-add-local-proggate-link-to-region)
  81.   (define-key hm--html-region-anchor-map 
  82.     "l" 'hm--html-add-normal-link-to-region)
  83.   (define-key hm--html-region-anchor-map 
  84.     "t" 'html-add-reference-to-region)
  85.   )
  86.  
  87. (defvar hm--html-noregion-frame-map nil
  88.   "Noregion sub keymap for inserting frame elements.")
  89.  
  90. (if hm--html-noregion-frame-map
  91.     ()
  92.   (setq    hm--html-noregion-frame-map (make-sparse-keymap))
  93.   (define-key hm--html-noregion-frame-map "f" 'hm--html-add-full-html-frame)
  94.   (define-key hm--html-noregion-frame-map [(control h)] 'hm--html-add-html) 
  95.   (define-key hm--html-noregion-frame-map [(meta h)] 'hm--html-add-head)
  96.   (define-key hm--html-noregion-frame-map "b" 'hm--html-add-body)
  97.   (define-key hm--html-noregion-frame-map 
  98.     [(control t)] 'hm--html-add-title-and-header)
  99.   (define-key hm--html-noregion-frame-map "t" 'hm--html-add-title)
  100.   (define-key hm--html-noregion-frame-map "h" 'hm--html-add-header)
  101.   (define-key hm--html-noregion-frame-map "n" 'hm--html-add-normal-node-link)
  102.   (define-key hm--html-noregion-frame-map "a" 'html-add-address)
  103.   (define-key hm--html-noregion-frame-map "s" 'hm--html-add-signature)
  104.   (define-key hm--html-noregion-frame-map 
  105.     [(control c)] 'hm--html-insert-created-comment)
  106.   (define-key hm--html-noregion-frame-map "c" 'hm--html-insert-changed-comment)
  107.   (define-key hm--html-noregion-frame-map "d" 'hm--html-new-date)
  108.   )
  109.  
  110. (defvar hm--html-region-frame-map nil
  111.   "Region sub keymap for inserting frame elements.")
  112.  
  113. (if hm--html-region-frame-map
  114.     ()
  115.   (setq hm--html-region-frame-map (make-sparse-keymap))
  116.   (define-key hm--html-region-frame-map 
  117.     "f" 'hm--html-add-full-html-frame-with-region)
  118.   (define-key hm--html-region-frame-map 
  119.     [(meta h)] 'hm--html-add-head-to-region)
  120.   (define-key hm--html-region-frame-map "b" 'hm--html-add-body-to-region)
  121.   (define-key hm--html-region-frame-map 
  122.     [(control t)] 'hm--html-add-title-and-header-to-region)
  123.   (define-key hm--html-region-frame-map "t" 'hm--html-add-title-to-region)
  124.   (define-key hm--html-region-frame-map "h" 'hm--html-add-header-to-region)
  125.   (define-key hm--html-region-frame-map "a" 'hm--html-add-address-to-region)
  126.   )
  127.  
  128. (defvar hm--html-noregion-structure-map nil
  129.   "Noregion sub keymap for inserting entities.")
  130.  
  131. (if hm--html-noregion-structure-map
  132.     ()
  133.   (setq hm--html-noregion-structure-map (make-sparse-keymap))
  134.   (define-key hm--html-noregion-structure-map "i" 'html-add-list-or-menu-item)
  135.   (define-key hm--html-noregion-structure-map "m" 'html-add-menu)
  136.   (define-key hm--html-noregion-structure-map "u" 'html-add-list)
  137.   (define-key hm--html-noregion-structure-map "o" 'hm--html-add-numberlist)
  138.   (define-key hm--html-noregion-structure-map "d" 'hm--html-add-directory-list)
  139.   (define-key hm--html-noregion-structure-map 
  140.     "\C-dl" 'html-add-description-list)
  141.   (define-key hm--html-noregion-structure-map 
  142.     "\C-dt" 'hm--html-add-description-title)
  143.   (define-key hm--html-noregion-structure-map 
  144.     "\C-de" 'hm--html-add-only-description-entry)
  145.   (define-key hm--html-noregion-structure-map 
  146.     "\C-d\C-t" 'html-add-description-entry)
  147.   (define-key hm--html-noregion-structure-map
  148.     "\C-tt" 'hm--html-add-table)
  149.   (define-key hm--html-noregion-structure-map 
  150.     "\C-t\C-t" 'hm--html-add-table-title)
  151.   (define-key hm--html-noregion-structure-map 
  152.     "\C-th" 'hm--html-add-table-header)
  153.   (define-key hm--html-noregion-structure-map 
  154.     "\C-tr" 'hm--html-add-first-table-row)
  155.   (define-key hm--html-noregion-structure-map 
  156.     "\C-t\C-r" 'hm--html-add-additional-table-row)
  157.   (define-key hm--html-noregion-structure-map "p" 'hm--html-add-paragraph)
  158.   (define-key hm--html-noregion-structure-map 
  159.     "\C-p" 'hm--html-add-paragraph-separator)
  160.   (define-key hm--html-noregion-structure-map "\C-m" 'hm--html-add-line-break)
  161.   (define-key hm--html-noregion-structure-map 
  162.     "h" 'hm--html-add-horizontal-rule)
  163.   )
  164.  
  165. (defvar hm--html-region-structure-map nil
  166.   "Region sub keymap for inserting entities.")
  167.  
  168. (if hm--html-region-structure-map
  169.     ()
  170.   (setq hm--html-region-structure-map (make-sparse-keymap))
  171.   (define-key hm--html-region-structure-map "m" 'hm--html-add-menu-to-region)
  172.   (define-key hm--html-region-structure-map "u" 'hm--html-add-list-to-region)
  173.   (define-key hm--html-region-structure-map 
  174.     "o" 'hm--html-add-numberlist-to-region)
  175.   (define-key hm--html-region-structure-map 
  176.     "d" 'hm--html-add-directory-list-to-region)
  177.   (define-key hm--html-region-structure-map 
  178.     "\C-dl" 'html-add-description-list-to-region)
  179.   (define-key hm--html-region-structure-map
  180.     "\C-tt" 'hm--html-add-table-to-region)
  181.   (define-key hm--html-region-structure-map 
  182.     "\C-t\C-t" 'hm--html-add-table-title-to-region)
  183.   (define-key hm--html-region-structure-map 
  184.     "p" 'hm--html-add-paragraph-to-region)
  185.   )
  186.  
  187. (defvar hm--html-noregion-formating-paragraph-map nil
  188.   "Noregion sub keymap for inserting paragraph formating elements.")
  189.  
  190. (if hm--html-noregion-formating-paragraph-map
  191.     ()
  192.   (setq hm--html-noregion-formating-paragraph-map (make-sparse-keymap))
  193.   (define-key hm--html-noregion-formating-paragraph-map
  194.     "o" 'html-add-plaintext)
  195.   (define-key hm--html-noregion-formating-paragraph-map
  196.     "w" 'hm--html-add-preformated)
  197.   (define-key hm--html-noregion-formating-paragraph-map
  198.     "b" 'html-add-blockquote)
  199.   (define-key hm--html-noregion-formating-paragraph-map
  200.     "l" 'html-add-listing)
  201.   (define-key hm--html-noregion-formating-paragraph-map
  202.     "a" 'hm--html-add-abstract)
  203.   )
  204.  
  205. (defvar hm--html-region-formating-paragraph-map nil
  206.   "Region sub keymap for inserting paragraph formating elements.")
  207.  
  208. (if hm--html-region-formating-paragraph-map
  209.     ()
  210.   (setq hm--html-region-formating-paragraph-map (make-sparse-keymap))
  211.   (define-key hm--html-region-formating-paragraph-map
  212.     "o" 'hm--html-add-plaintext-to-region)
  213.   (define-key hm--html-region-formating-paragraph-map
  214.     "w" 'hm--html-add-preformated-to-region)
  215.   (define-key hm--html-region-formating-paragraph-map
  216.     "b" 'hm--html-add-blockquote-to-region)
  217.   (define-key hm--html-region-formating-paragraph-map
  218.     "l" 'hm--html-add-listing-to-region)
  219.   (define-key hm--html-region-formating-paragraph-map
  220.     "a" 'hm--html-add-abstract-to-region)
  221.   )
  222.  
  223. ;(defvar hm--html-noregion-entity-map nil
  224. ;  "Noregion sub keymap for inserting entities.")
  225.  
  226. ;(if hm--html-noregion-entity-map
  227. ;    ()
  228. ;  (setq hm--html-noregion-entity-map (make-sparse-keymap))
  229. ;  )
  230.  
  231. ;(defvar hm--html-region-entity-map nil
  232. ;  "Region sub keymap for inserting entities.")
  233.  
  234. ;(if hm--html-region-entity-map
  235. ;    ()
  236. ;  (setq hm--html-region-entity-map (make-sparse-keymap))
  237. ;  )
  238.  
  239. ;(defvar hm--html-noregion-logical-map nil
  240. ;  "Noregion sub keymap for inserting logical text formating elements.")
  241.  
  242. ;(if hm--html-noregion-logical-map
  243. ;    ()
  244. ;  (setq hm--html-noregion-logical-map (make-sparse-keymap))
  245. ;  )
  246.  
  247. ;(defvar hm--html-region-logical-map nil
  248. ;  "Region sub keymap for inserting logical text formating elements.")
  249.  
  250. ;(if hm--html-region-logical-map
  251. ;    ()
  252. ;  (setq hm--html-region-logical-map (make-sparse-keymap))
  253. ;  )
  254.  
  255. (defvar hm--html-noregion-formating-word-map nil
  256.   "Norgion sub keymap for inserting physical text formating elements.")
  257.  
  258. (if hm--html-noregion-formating-word-map
  259.     ()
  260.   (setq hm--html-noregion-formating-word-map (make-sparse-keymap))
  261.   (define-key hm--html-noregion-formating-word-map
  262.     "b" 'hm--html-add-bold)
  263.   (define-key hm--html-noregion-formating-word-map
  264.     "i" 'hm--html-add-italic)
  265.   (define-key hm--html-noregion-formating-word-map
  266.     "u" 'hm--html-add-underline)
  267.   (define-key hm--html-noregion-formating-word-map
  268.     "t" 'html-add-fixed)
  269.   (define-key hm--html-noregion-formating-word-map
  270.     "s" 'hm--html-add-strikethru)
  271.   (define-key hm--html-noregion-formating-word-map
  272.     "\C-p" 'hm--html-add-superscript)
  273.   (define-key hm--html-noregion-formating-word-map
  274.     "\C-b" 'hm--html-add-subscript)
  275.   (define-key hm--html-noregion-formating-word-map
  276.     "e" 'html-add-emphasized)
  277.   (define-key hm--html-noregion-formating-word-map
  278.     "\C-s" 'html-add-strong)
  279.   )
  280.  
  281. (defvar hm--html-region-formating-word-map nil
  282.   "Region sub keymap for inserting word text formating elements.")
  283.  
  284. (if hm--html-region-formating-word-map
  285.     ()
  286.   (setq hm--html-region-formating-word-map (make-sparse-keymap))
  287.   (define-key hm--html-region-formating-word-map
  288.     "b" 'hm--html-add-bold-to-region)
  289.   (define-key hm--html-region-formating-word-map
  290.     "i" 'hm--html-add-italic-to-region)
  291.   (define-key hm--html-region-formating-word-map
  292.     "u" 'hm--html-add-underline-to-region)
  293.   (define-key hm--html-region-formating-word-map
  294.     "t" 'hm--html-add-fixed-to-region)
  295.   (define-key hm--html-region-formating-word-map
  296.     "s" 'hm--html-add-strikethru-to-region)
  297.   (define-key hm--html-region-formating-word-map
  298.     "\C-p" 'hm--html-add-superscript-to-region)
  299.   (define-key hm--html-region-formating-word-map
  300.     "\C-b" 'hm--html-add-subscript-to-region)
  301.   (define-key hm--html-region-formating-word-map
  302.     "e" 'hm--html-add-emphasized-to-region)
  303.   (define-key hm--html-region-formating-word-map
  304.     "\C-s" 'hm--html-add-strong-to-region)
  305.   )
  306.  
  307. ;(defvar hm--html-noregion-header-map nil
  308. ;  "Noregion sub keymap for inserting header elements.")
  309.  
  310. ;(if hm--html-noregion-header-map
  311. ;    ()
  312. ;  (setq hm--html-noregion-header-map (make-sparse-keymap))
  313. ;  )
  314.  
  315. ;(defvar hm--html-region-header-map nil
  316. ;  "Region sub keymap for inserting header elements.")
  317.  
  318. ;(if hm--html-region-header-map
  319. ;    ()
  320. ;  (setq hm--html-region-header-map (make-sparse-keymap))
  321. ;  )
  322.  
  323. ;(defvar hm--html-noregion-head-map nil
  324. ;  "Noregion sub keymap for inserting head elements.")
  325.  
  326. ;(if hm--html-noregion-head-map
  327. ;    ()
  328. ;  (setq hm--html-noregion-head-map (make-sparse-keymap))
  329. ;  )
  330.  
  331. ;(defvar hm--html-region-head-map nil
  332. ;  "Region sub keymap for inserting head elements.")
  333.  
  334. ;(if hm--html-region-head-map
  335. ;    ()
  336. ;  (setq hm--html-region-head-map (make-sparse-keymap))
  337. ;  )
  338.  
  339. ;(defvar hm--html-noregion-list-map nil
  340. ;  "Noregion sub keymap for inserting lists.")
  341.  
  342. ;(if hm--html-noregion-list-map
  343. ;    ()
  344. ;  (setq hm--html-noregion-list-map (make-sparse-keymap))
  345. ;  )
  346.  
  347. ;(defvar hm--html-region-list-map nil
  348. ;  "Region sub keymap for inserting lists.")
  349.  
  350. ;(if hm--html-region-list-map
  351. ;    ()
  352. ;  (setq hm--html-region-list-map (make-sparse-keymap))
  353. ;  )
  354.  
  355. (defvar hm--html-noregion-graphics-map nil
  356.   "Noregion sub keymap for inserting graphics (images).")
  357.  
  358. (if hm--html-noregion-graphics-map
  359.     ()
  360.   (setq hm--html-noregion-graphics-map (make-sparse-keymap))
  361.   )
  362.  
  363. (defvar hm--html-region-graphics-map nil
  364.   "Region sub keymap for inserting graphics (images).")
  365.  
  366. (if hm--html-region-graphics-map
  367.     ()
  368.   (setq hm--html-region-graphics-map (make-sparse-keymap))
  369.   )
  370.  
  371. (defvar hm--html-noregion-text-elements-map nil
  372.   "Noregion sub keymap for inserting text elements.")
  373.  
  374. (if hm--html-noregion-text-elements-map
  375.     ()
  376.   (setq hm--html-noregion-text-elements-map (make-sparse-keymap))
  377.   )
  378.  
  379. (defvar hm--html-region-text-elements-map nil
  380.   "Region sub keymap for inserting text elements.")
  381.  
  382. (if hm--html-region-text-elements-map
  383.     ()
  384.   (setq hm--html-region-text-elements-map (make-sparse-keymap))
  385.   )
  386.  
  387. (defvar hm--html-noregion-forms-map nil
  388.   "Noregion sub keymap for inserting forms.")
  389.  
  390. (if hm--html-noregion-forms-map
  391.     ()
  392.   (setq hm--html-noregion-forms-map (make-sparse-keymap))
  393.   )
  394.  
  395. (defvar hm--html-region-forms-map nil
  396.   "Region sub keymap for inserting forms.")
  397.  
  398. (if hm--html-region-forms-map
  399.     ()
  400.   (setq hm--html-region-forms-map (make-sparse-keymap))
  401.   )
  402.  
  403. (defvar hm--html-region-sub-map-1 nil
  404.   "Region sub keymap for the html-mode.")
  405.  
  406. (if hm--html-region-sub-map-1
  407.     ()
  408.   (setq hm--html-region-sub-map-1 (make-sparse-keymap))
  409. ;  (define-key hm--html-region-sub-map-1 "\C-e" hm--html-region-entity-map)
  410. ;  (define-key hm--html-region-sub-map-1 "\C-l" hm--html-region-logical-map)
  411. ;  (define-key hm--html-region-sub-map-1 "\C-p" hm--html-region-physical-map)
  412. ;  (define-key hm--html-region-sub-map-1 "\C-h" hm--html-region-header-map)
  413.   (define-key hm--html-region-sub-map-1 "\C-o" hm--html-region-forms-map)
  414. ;  (define-key hm--html-region-sub-map-1 "\C-l" hm--html-region-list-map)
  415.   (define-key hm--html-region-sub-map-1 "\C-a" hm--html-region-anchor-map)
  416.   (define-key hm--html-region-sub-map-1 "\C-i" hm--html-region-graphics-map)
  417.   (define-key hm--html-region-sub-map-1 
  418.     "\C-t" hm--html-region-text-elements-map)
  419. ;  (define-key hm--html-region-sub-map-1 "\C-b" hm--html-region-head-map)
  420.   (define-key hm--html-region-sub-map-1 "\C-f" hm--html-region-frame-map)
  421.   (define-key hm--html-region-sub-map-1 "\C-s" hm--html-region-structure-map)
  422.   (define-key hm--html-region-sub-map-1 
  423.     "\C-p" hm--html-region-formating-paragraph-map)
  424.   (define-key hm--html-region-sub-map-1
  425.     "\C-w" hm--html-region-formating-word-map)
  426.   )
  427.  
  428. (defvar hm--html-noregion-sub-map-1 nil
  429.   "Noregion sub keymap for the html-mode.")
  430.  
  431. (if hm--html-noregion-sub-map-1
  432.     ()
  433.   (setq hm--html-noregion-sub-map-1 (make-sparse-keymap))
  434.   
  435.  
  436. ;  (define-key hm--html-noregion-sub-map-1 "\C-e" hm--html-noregion-entity-map)
  437. ;  (define-key hm--html-noregion-sub-map-1 
  438. ;    "\C-l" hm--html-noregion-logical-map)
  439. ;  (define-key hm--html-noregion-sub-map-1 
  440. ;    "\C-p" hm--html-noregion-physical-map)
  441. ;  (define-key hm--html-noregion-sub-map-1 
  442. ;    [(control h)] hm--html-noregion-header-map)
  443.   (define-key hm--html-noregion-sub-map-1 "\C-o" hm--html-noregion-forms-map)
  444. ;  (define-key hm--html-noregion-sub-map-1 "\C-l" hm--html-noregion-list-map)
  445.   (define-key hm--html-noregion-sub-map-1 "\C-a" hm--html-noregion-anchor-map)
  446.   (define-key hm--html-noregion-sub-map-1 
  447.     [(control i)] hm--html-noregion-graphics-map)
  448.   (define-key hm--html-noregion-sub-map-1 
  449.     "\C-t" hm--html-noregion-text-elements-map)
  450. ;  (define-key hm--html-noregion-sub-map-1 "\C-b" hm--html-noregion-head-map)
  451.   (define-key hm--html-noregion-sub-map-1 "\C-f" hm--html-noregion-frame-map)
  452.   (define-key hm--html-noregion-sub-map-1 
  453.     "\C-s" hm--html-noregion-structure-map)
  454.   (define-key hm--html-noregion-sub-map-1
  455.     "\C-p" hm--html-noregion-formating-paragraph-map)
  456.   (define-key hm--html-noregion-sub-map-1
  457.     "\C-w" hm--html-noregion-formating-word-map)
  458.   )
  459.  
  460. (defvar hm--html-region-sub-map nil
  461.   "Region sub keymap for the html-mode.")
  462.  
  463. (if hm--html-region-sub-map
  464.     ()
  465.   (setq hm--html-region-sub-map (make-sparse-keymap))
  466. ;  (define-key hm--html-region-sub-map "\C-n" hm--html-noregion-sub-map-1)
  467. ;  (define-key hm--html-region-sub-map "\C-r" hm--html-region-sub-map-1)
  468.   (define-key hm--html-region-sub-map "\M-n" hm--html-noregion-sub-map-1)
  469.   (define-key hm--html-region-sub-map "\M-r" hm--html-region-sub-map-1)
  470.  
  471.   (map-keymap '(lambda (key-description-list binding)
  472.          (define-key hm--html-region-sub-map
  473.            key-description-list binding))
  474.           hm--html-region-sub-map-1)
  475.   )
  476.  
  477. (defvar hm--html-noregion-sub-map nil
  478.   "Noregion keymap for the html-mode.")
  479.  
  480. (if hm--html-noregion-sub-map
  481.     ()
  482.   (setq hm--html-noregion-sub-map (make-sparse-keymap))
  483. ;  (define-key hm--html-noregion-sub-map "\C-n" hm--html-noregion-sub-map-1)
  484. ;  (define-key hm--html-noregion-sub-map "\C-r" hm--html-region-sub-map-1)
  485.   (define-key hm--html-noregion-sub-map "\M-n" hm--html-noregion-sub-map-1)
  486.   (define-key hm--html-noregion-sub-map "\M-r" hm--html-region-sub-map-1)
  487.  
  488.   (map-keymap '(lambda (key-description-list binding)
  489.          (define-key hm--html-noregion-sub-map
  490.            key-description-list binding))
  491.           hm--html-noregion-sub-map-1)
  492.   )
  493.  
  494. (defvar hm--html-mode-map nil
  495.   "Normal and noregion keymap for the html-mode.")
  496.  
  497. (if hm--html-mode-map
  498.     ()
  499.   (setq hm--html-mode-map (make-sparse-keymap))
  500.   (define-key hm--html-mode-map "\C-c" hm--html-noregion-sub-map)
  501.   (if (adapt-xemacsp)
  502.       (define-key hm--html-mode-map '(button3) 'hm--popup-html-menu)
  503.     (define-key hm--html-mode-map [mouse-3] 'hm--popup-html-menu))
  504.   (define-key hm--html-mode-map '(adiaeresis) 'hm--html_ae)
  505.   (define-key hm--html-mode-map '(odiaeresis) 'hm--html_oe) 
  506.   (define-key hm--html-mode-map '(udiaeresis) 'hm--html_ue) 
  507.   (define-key hm--html-mode-map '(Adiaeresis) 'hm--html_Ae) 
  508.   (define-key hm--html-mode-map '(Odiaeresis) 'hm--html_Oe) 
  509.   (define-key hm--html-mode-map '(Udiaeresis) 'hm--html_Ue) 
  510.   (define-key hm--html-mode-map '(ediaeresis) 'hm--html_ediaeresis) 
  511.   (define-key hm--html-mode-map '(Ediaeresis) 'hm--html_Ediaeresis) 
  512.   (define-key hm--html-mode-map '(idiaeresis) 'hm--html_idiaeresis) 
  513.   (define-key hm--html-mode-map '(Idiaeresis) 'hm--html_Idiaeresis) 
  514.   (define-key hm--html-mode-map '(ssharp) 'hm--html_sz) 
  515.   (define-key hm--html-mode-map '(aacute) 'hm--html_aacute) 
  516.   (define-key hm--html-mode-map '(eacute) 'hm--html_eacute) 
  517.   (define-key hm--html-mode-map '(iacute) 'hm--html_iacute) 
  518.   (define-key hm--html-mode-map '(oacute) 'hm--html_oacute) 
  519.   (define-key hm--html-mode-map '(uacute) 'hm--html_uacute) 
  520.   (define-key hm--html-mode-map '(Aacute) 'hm--html_Aacute) 
  521.   (define-key hm--html-mode-map '(Eacute) 'hm--html_Eacute) 
  522.   (define-key hm--html-mode-map '(Iacute) 'hm--html_Iacute) 
  523.   (define-key hm--html-mode-map '(Oacute) 'hm--html_Oacute) 
  524.   (define-key hm--html-mode-map '(Uacute) 'hm--html_Uacute) 
  525.   (define-key hm--html-mode-map '(agrave) 'hm--html_agrave) 
  526.   (define-key hm--html-mode-map '(egrave) 'hm--html_egrave) 
  527.   (define-key hm--html-mode-map '(igrave) 'hm--html_igrave) 
  528.   (define-key hm--html-mode-map '(ograve) 'hm--html_ograve) 
  529.   (define-key hm--html-mode-map '(ugrave) 'hm--html_ugrave) 
  530.   (define-key hm--html-mode-map '(Agrave) 'hm--html_Agrave) 
  531.   (define-key hm--html-mode-map '(Egrave) 'hm--html_Egrave) 
  532.   (define-key hm--html-mode-map '(Igrave) 'hm--html_Igrave) 
  533.   (define-key hm--html-mode-map '(Ograve) 'hm--html_Ograve) 
  534.   (define-key hm--html-mode-map '(Ugrave) 'hm--html_Ugrave) 
  535.   (define-key hm--html-mode-map '(ccedilla) 'hm--html_ccedilla) 
  536.   (define-key hm--html-mode-map '(Ccedilla) 'hm--html_Ccedilla) 
  537.   (define-key hm--html-mode-map '(acircumflex) 'hm--html_acircumflex) 
  538.   (define-key hm--html-mode-map '(ecircumflex) 'hm--html_ecircumflex) 
  539.   (define-key hm--html-mode-map '(icircumflex) 'hm--html_icircumflex) 
  540.   (define-key hm--html-mode-map '(ocircumflex) 'hm--html_ocircumflex) 
  541.   (define-key hm--html-mode-map '(ucircumflex) 'hm--html_ucircumflex) 
  542.   (define-key hm--html-mode-map '(Acircumflex) 'hm--html_Acircumflex) 
  543.   (define-key hm--html-mode-map '(Ecircumflex) 'hm--html_Ecircumflex) 
  544.   (define-key hm--html-mode-map '(Icircumflex) 'hm--html_Icircumflex) 
  545.   (define-key hm--html-mode-map '(Ocircumflex) 'hm--html_Ocircumflex) 
  546.   (define-key hm--html-mode-map '(Ucircumflex) 'hm--html_Ucircumflex)
  547.   (define-key hm--html-mode-map '(atilde) 'hm--html_atilde) 
  548.   (define-key hm--html-mode-map '(otilde) 'hm--html_otilde) 
  549.   (define-key hm--html-mode-map '(ntilde) 'hm--html_ntilde) 
  550.   (define-key hm--html-mode-map '(Atilde) 'hm--html_Atilde) 
  551.   (define-key hm--html-mode-map '(Otilde) 'hm--html_Otilde) 
  552.   (define-key hm--html-mode-map '(Ntilde) 'hm--html_Ntilde) 
  553.   (define-key hm--html-mode-map '(eth) 'hm--html_eth) 
  554.   (define-key hm--html-mode-map '(ETH) 'hm--html_Eth) 
  555.   (define-key hm--html-mode-map '(thorn) 'hm--html_thorn) 
  556.   (define-key hm--html-mode-map '(THORN) 'hm--html_Thorn) 
  557. ;  (define-key hm--html-mode-map "<" 'html-less-than)
  558. ;  (define-key hm--html-mode-map ">" 'html-greater-than)
  559.   (define-key hm--html-mode-map "<" 'hm--html-smart-less-than)
  560.   (define-key hm--html-mode-map ">" 'hm--html-smart-greater-than)
  561.   (define-key hm--html-mode-map "&" 'html-ampersand)
  562.   )
  563.  
  564. (defvar hm--html-region-mode-map nil
  565.   "Region keymap for the html-mode.")
  566.  
  567. (if hm--html-region-mode-map
  568.     ()
  569.   (setq hm--html-region-mode-map (make-sparse-keymap))
  570.   (define-key hm--html-region-mode-map "\C-c" hm--html-region-sub-map)
  571.   (if (adapt-xemacsp)
  572.       (define-key hm--html-region-mode-map 
  573.     '(button3) 'hm--popup-html-menu-region)
  574.     (define-key hm--html-region-mode-map 
  575.     [mouse-3] 'hm--popup-html-menu-region))
  576.   ;; It maybe a better idea to set the following to undefine in this list...
  577.   (define-key hm--html-region-mode-map '(adiaeresis) 'hm--html_ae)
  578.   (define-key hm--html-region-mode-map '(odiaeresis) 'hm--html_oe) 
  579.   (define-key hm--html-region-mode-map '(udiaeresis) 'hm--html_ue) 
  580.   (define-key hm--html-region-mode-map '(Adiaeresis) 'hm--html_Ae) 
  581.   (define-key hm--html-region-mode-map '(Odiaeresis) 'hm--html_Oe) 
  582.   (define-key hm--html-region-mode-map '(Udiaeresis) 'hm--html_Ue) 
  583.   (define-key hm--html-region-mode-map '(ediaeresis) 'hm--html_ediaeresis) 
  584.   (define-key hm--html-region-mode-map '(Ediaeresis) 'hm--html_Ediaeresis) 
  585.   (define-key hm--html-region-mode-map '(idiaeresis) 'hm--html_idiaeresis) 
  586.   (define-key hm--html-region-mode-map '(Idiaeresis) 'hm--html_Idiaeresis) 
  587.   (define-key hm--html-region-mode-map '(ssharp) 'hm--html_sz) 
  588.   (define-key hm--html-region-mode-map '(aacute) 'hm--html_aacute) 
  589.   (define-key hm--html-region-mode-map '(eacute) 'hm--html_eacute) 
  590.   (define-key hm--html-region-mode-map '(iacute) 'hm--html_iacute) 
  591.   (define-key hm--html-region-mode-map '(oacute) 'hm--html_oacute) 
  592.   (define-key hm--html-region-mode-map '(uacute) 'hm--html_uacute) 
  593.   (define-key hm--html-region-mode-map '(Aacute) 'hm--html_Aacute) 
  594.   (define-key hm--html-region-mode-map '(Eacute) 'hm--html_Eacute) 
  595.   (define-key hm--html-region-mode-map '(Iacute) 'hm--html_Iacute) 
  596.   (define-key hm--html-region-mode-map '(Oacute) 'hm--html_Oacute) 
  597.   (define-key hm--html-region-mode-map '(Uacute) 'hm--html_Uacute) 
  598.   (define-key hm--html-region-mode-map '(agrave) 'hm--html_agrave) 
  599.   (define-key hm--html-region-mode-map '(egrave) 'hm--html_egrave) 
  600.   (define-key hm--html-region-mode-map '(igrave) 'hm--html_igrave) 
  601.   (define-key hm--html-region-mode-map '(ograve) 'hm--html_ograve) 
  602.   (define-key hm--html-region-mode-map '(ugrave) 'hm--html_ugrave) 
  603.   (define-key hm--html-region-mode-map '(Agrave) 'hm--html_Agrave) 
  604.   (define-key hm--html-region-mode-map '(Egrave) 'hm--html_Egrave) 
  605.   (define-key hm--html-region-mode-map '(Igrave) 'hm--html_Igrave) 
  606.   (define-key hm--html-region-mode-map '(Ograve) 'hm--html_Ograve) 
  607.   (define-key hm--html-region-mode-map '(Ugrave) 'hm--html_Ugrave) 
  608.   (define-key hm--html-region-mode-map '(ccedilla) 'hm--html_ccedilla) 
  609.   (define-key hm--html-region-mode-map '(Ccedilla) 'hm--html_Ccedilla) 
  610.   (define-key hm--html-region-mode-map '(acircumflex) 'hm--html_acircumflex) 
  611.   (define-key hm--html-region-mode-map '(ecircumflex) 'hm--html_ecircumflex) 
  612.   (define-key hm--html-region-mode-map '(icircumflex) 'hm--html_icircumflex) 
  613.   (define-key hm--html-region-mode-map '(ocircumflex) 'hm--html_ocircumflex) 
  614.   (define-key hm--html-region-mode-map '(ucircumflex) 'hm--html_ucircumflex) 
  615.   (define-key hm--html-region-mode-map '(Acircumflex) 'hm--html_Acircumflex) 
  616.   (define-key hm--html-region-mode-map '(Ecircumflex) 'hm--html_Ecircumflex) 
  617.   (define-key hm--html-region-mode-map '(Icircumflex) 'hm--html_Icircumflex) 
  618.   (define-key hm--html-region-mode-map '(Ocircumflex) 'hm--html_Ocircumflex) 
  619.   (define-key hm--html-region-mode-map '(Ucircumflex) 'hm--html_Ucircumflex)
  620.   (define-key hm--html-region-mode-map '(atilde) 'hm--html_atilde) 
  621.   (define-key hm--html-region-mode-map '(otilde) 'hm--html_otilde) 
  622.   (define-key hm--html-region-mode-map '(ntilde) 'hm--html_ntilde) 
  623.   (define-key hm--html-region-mode-map '(Atilde) 'hm--html_Atilde) 
  624.   (define-key hm--html-region-mode-map '(Otilde) 'hm--html_Otilde) 
  625.   (define-key hm--html-region-mode-map '(Ntilde) 'hm--html_Ntilde) 
  626.   (define-key hm--html-region-mode-map '(eth) 'hm--html_eth) 
  627.   (define-key hm--html-region-mode-map '(ETH) 'hm--html_Eth) 
  628.   (define-key hm--html-region-mode-map '(thorn) 'hm--html_thorn) 
  629.   (define-key hm--html-region-mode-map '(THORN) 'hm--html_Thorn) 
  630.   (define-key hm--html-region-mode-map "<" 'html-less-than)
  631.   (define-key hm--html-region-mode-map ">" 'html-greater-than)
  632.   (define-key hm--html-region-mode-map "&" 'html-ampersand)
  633.   )
  634.  
  635.  
  636. ;;; -----
  637.  
  638. ;(use-local-map hm--html-mode-map)
  639.  
  640. (or (assq 'hm--html-region-mode minor-mode-alist)
  641.     (setq minor-mode-alist
  642.       (purecopy
  643.        (append minor-mode-alist
  644.            '((hm--html-region-mode " Region"))))))
  645.  
  646.  
  647.  
  648. (defun html-region-mode (on)
  649.   "Turns the minor mode html-region-mode on or off.
  650. The function turns the html-region-mode on, if ON is t and off otherwise."
  651.   (if (string= mode-name "HTML")
  652.       (if on
  653.       ;; html-region-mode on
  654.       (progn
  655.         (setq hm--html-region-mode t)
  656.         (use-local-map hm--html-region-mode-map))
  657.     ;; html-region-mode off
  658.     (setq hm--html-region-mode nil)
  659.     (use-local-map hm--html-mode-map))))
  660.  
  661.