annotate lisp/hm--html-menus/hm--html-mode.el @ 203:850242ba4a81 r20-3b28

Import from CVS: tag r20-3b28
author cvs
date Mon, 13 Aug 2007 10:02:21 +0200
parents 6075d714658b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
1 ;;; hm--html-mode --- Major mode for editing HTML documents for the WWW
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
2
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
3 ;; Copyright (C) 1996, 1997 Heiko Muenkel
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
4
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
5 ;; Author: Heiko Muenkel <muenkel@tnt.uni-hannover.de>
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
6 ;; Keywords: hypermedia languages help docs wp
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
7
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
8 ;; $Id: hm--html-mode.el,v 1.7 1997/07/26 22:09:45 steve Exp $
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
9
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
10 ;; This file is part of XEmacs.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
11
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
13 ;; under the terms of the GNU General Public License as published by
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
15 ;; option) any later version.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
16
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
17 ;; This program is distributed in the hope that it will be useful, but
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
20 ;; General Public License for more details.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
21
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
22 ;; You should have received a copy of the GNU General Public License
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
23 ;; along with XEmacs; See the file COPYING. if not, write to the Free
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
25 ;; 02111-1307, USA
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
26
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
27 ;;; Synched up with: Not part of Emacs.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
28
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
29 ;;; Commentary:
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
30
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
31 ;; Description:
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
32
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
33 ;; This file defines the hm--html-mode, a mode for editing html
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
34 ;; files. It is the main file of the package hm--html-menus.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
35 ;; Previous releases had used the file html-mode.el from Marc
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
36 ;; Andreessen. In that times the mode was called html-mode. I've
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
37 ;; changed the name of the mode to distinquish it from other
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
38 ;; html modes. But feel free to set a
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
39 ;; (defalias 'hm--html-mode 'html-mode)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
40 ;; to get back the old name of the mode.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
41
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
42 ;; In the earlier releases of the package the main file was
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
43 ;; hm--html-menu.el. This has been changed to hm--html-mode.el.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
44
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
45
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
46 ;; Installation:
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
47
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
48 ;; Put this file and all the other files of the package
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
49 ;; in one of your load path directories and the
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
50 ;; following lines in your .emacs:
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
51
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
52 ;; (autoload 'hm--html-mode "hm--html-mode" "HTML major mode." t)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
53
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
54 ;; (or (assoc "\\.html$" auto-mode-alist)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
55 ;; (setq auto-mode-alist (cons '("\\.html$" . hm--html-mode)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
56 ;; auto-mode-alist)))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
57 ;; If there is already another html-mode (like psgml in the XEmacs
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
58 ;; 19.14, then you must put the following instead of the last form
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
59 ;; in your .emacs:
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
60 ;; (setq auto-mode-alist (cons '("\\.html$" . hm--html-mode)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
61 ;; auto-mode-alist))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
62
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
63 ;; But you can also use the hm--html-minor-mode as an addition to
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
64 ;; the psgml html modes. For that you've to put the following line in
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
65 ;; your .emacs:
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
66 ;; (add-hook 'html-mode-hook 'hm--html-minor-mode)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
67
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
68 ;; Note: This works only in an XEmacs version greater than 19.14 and
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
69 ;; also not in the XEmacs 20.0.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
70
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
71 ;; Look at the file hm--html-configuration for further installation
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
72 ;; points.
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
73
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
74 ;;; Code:
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
75
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
76 (require 'font-lock)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
77 (require 'cl)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
78 (require 'adapt)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
79 (require 'hm--date)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
80 (require 'hm--html)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
81 ;(require 'hm--html-not-standard)
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
82
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
83 (eval-when-compile
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
84 (require 'hm--html-configuration))
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
85
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
86 (hm--html-load-config-files)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
87 (require 'hm--html-indentation)
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
88
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
89 (defvar hm--html-minor-mode nil
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
90 "Non-nil, if the `hm--html-minor-mode' is active.")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
91
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
92 (require 'hm--html-menu)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
93
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
94 (require 'hm--html-keys)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
95
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
96 ;(defvar hm--html-minor-mode nil
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
97 ; "Non-nil, if the `hm--html-minor-mode' is active.")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
98 ;
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
99 ;(require 'hm--html-menu)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 46
diff changeset
100 (require 'hm--html-drag-and-drop)
46
6a22abad6937 Import from CVS: tag r19-15
cvs
parents: 42
diff changeset
101
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
102
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
103 ;;; The package version
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
104 (defconst hm--html-menus-package-maintainer "muenkel@tnt.uni-hannover.de")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
105
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
106 (defconst hm--html-menus-package-name "hm--html-menus")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
107
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
108 (defconst hm--html-menus-package-version "5.8")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
109
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
110
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
111 ;;; Generate the help buffer faces
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
112 (hm--html-generate-help-buffer-faces)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
113
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
114 ;;; syntax table
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
115
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
116 (defvar hm--html-mode-syntax-table nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
117 "Syntax table used while in html mode.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
118
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
119 (if hm--html-mode-syntax-table
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
120 ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
121 (setq hm--html-mode-syntax-table (make-syntax-table))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
122 ; (modify-syntax-entry ?\" ". " hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
123 ; (modify-syntax-entry ?\\ ". " hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
124 ; (modify-syntax-entry ?' "w " hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
125 (modify-syntax-entry ?\\ "." hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
126 (modify-syntax-entry ?' "w" hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
127 (modify-syntax-entry ?< "(>" hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
128 (modify-syntax-entry ?> ")<" hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
129 (modify-syntax-entry ?\" "\"" hm--html-mode-syntax-table)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
130 (modify-syntax-entry ?= "." hm--html-mode-syntax-table))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
131
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
132
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
133 ;;; abbreviation table
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
134
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
135 (defvar hm--html-mode-abbrev-table nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
136 "Abbrev table used while in html mode.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
137
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
138 (define-abbrev-table 'hm--html-mode-abbrev-table ())
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
139
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
140 ;;; the hm--html-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
141
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
142 (defvar hm--html-mode-name-string "HTML"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
143 "The hm--html-mode name string.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
144
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
145 ;;;###autoload
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
146 (defun hm--html-mode ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
147 "Major mode for editing HTML hypertext documents.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
148 Special commands:\\{hm--html-mode-map}
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
149 Turning on hm--html-mode calls the value of the variable hm--html-mode-hook,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
150 if that value is non-nil."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
151 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
152 (kill-all-local-variables)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
153 (use-local-map hm--html-mode-map)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
154 (setq mode-name hm--html-mode-name-string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
155 (setq major-mode 'hm--html-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
156 (setq local-abbrev-table hm--html-mode-abbrev-table)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
157 (set-syntax-table hm--html-mode-syntax-table)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
158 (make-local-variable 'comment-start)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
159 (make-local-variable 'comment-end)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
160 (setq comment-start "<!--" comment-end "-->")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
161 (make-local-variable 'sentence-end)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
162 (setq sentence-end "[<>.?!][]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*")
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
163 (make-local-variable 'indent-line-function)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
164 (setq indent-line-function 'hm--html-indent-line)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
165 (setq idd-actions hm--html-idd-actions)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
166 (hm--install-html-menu hm--html-mode-pulldown-menu-name)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
167 (make-variable-buffer-local 'write-file-hooks)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
168 (add-hook 'write-file-hooks 'hm--html-maybe-new-date-and-changed-comment)
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
169 (if (adapt-xemacsp)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
170 (put major-mode 'font-lock-defaults '((hm--html-font-lock-keywords
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
171 hm--html-font-lock-keywords-1
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
172 hm--html-font-lock-keywords-2)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
173 t
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
174 t
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
175 nil
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
176 nil))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
177 (make-local-variable 'font-lock-defaults)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
178 (setq font-lock-defaults '((hm--html-font-lock-keywords
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
179 hm--html-font-lock-keywords-1
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
180 hm--html-font-lock-keywords-2)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
181 t
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
182 t
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
183 nil
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
184 nil)))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
185 (run-hooks 'hm--html-mode-hook))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
186
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
187 ;;;; Minor Modes
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
188
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
189 ;;; hm--html-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
190
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
191 (defvar hm--html-region-mode nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
192 "T, if the region is active in the `hm--html-mode'.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
193
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
194 (make-variable-buffer-local 'hm--html-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
195
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
196 (add-minor-mode 'hm--html-region-mode " Region" hm--html-region-mode-map)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
197
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
198 (if (adapt-xemacsp)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
199
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
200 (defun hm--html-region-mode (&optional arg)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
201 "Toggle 'hm--html-region-mode'.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
202 With ARG, turn hm--html-region-mode on iff ARG is positive.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
203
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
204 If the `major-mode' isn't the `hm--html-mode' then the minor
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
205 mode is switched off, regardless of the ARG and the state
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
206 of `hm--html-region-mode'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
207 (interactive "P")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
208 (setq zmacs-regions-stays t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
209 (setq hm--html-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
210 (and (eq major-mode 'hm--html-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
211 (if (null arg) (not hm--html-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
212 (> (prefix-numeric-value arg) 0))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
213 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
214
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
215 (defun hm--html-region-mode (&optional arg)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
216 "Toggle 'hm--html-region-mode'.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
217 With ARG, turn hm--html-region-mode on iff ARG is positive.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
218
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
219 If the `major-mode' isn't the `hm--html-mode' then the minor
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
220 mode is switched off, regardless of the ARG and the state
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
221 of `hm--html-region-mode'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
222 (interactive "P")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
223 (setq hm--html-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
224 (and (eq major-mode 'hm--html-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
225 (if (null arg) (not hm--html-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
226 (> (prefix-numeric-value arg) 0))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
227 (if hm--html-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
228 (define-key hm--html-mode-map
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
229 hm--html-emacs19-popup-noregion-menu-button
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
230 nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
231 (if hm--html-expert
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
232 (define-key hm--html-mode-map
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
233 hm--html-emacs19-popup-noregion-menu-button
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
234 hm--html-menu-noregion-expert-map)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
235 (define-key hm--html-mode-map
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
236 hm--html-emacs19-popup-noregion-menu-button
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
237 hm--html-menu-noregion-novice-map)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
238 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
239
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
240 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
241
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
242
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
243 ;;; hm--html-minor-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
244 (make-variable-buffer-local 'hm--html-minor-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
245
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
246 (add-minor-mode 'hm--html-minor-mode " HM-HTML" hm--html-minor-mode-map)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
247
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
248 ;;;###autoload
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
249 (defun hm--html-minor-mode (&optional arg)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
250 "Toggle hm--html-minor-mode.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
251 With arg, turn hm--html-minor-mode on iff arg is positive."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
252 (interactive "P")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
253 (setq hm--html-minor-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
254 (if (null arg) (not hm--html-minor-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
255 (> (prefix-numeric-value arg) 0)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
256 (if hm--html-minor-mode
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
257 (progn
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
258 (hm--install-html-menu hm--html-minor-mode-pulldown-menu-name)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
259 (when (adapt-emacs19p)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
260 (hm--html-add-major-menu-to-minor-menus)))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
261 (when (and current-menubar (assoc hm--html-minor-mode-pulldown-menu-name
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
262 current-menubar))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
263 (delete-menu-item (list hm--html-minor-mode-pulldown-menu-name)))
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
264 (when (adapt-emacs19p)
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
265 (hm--html-remove-major-menu-from-minor-menus)))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
266 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
267
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
268
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
269 ;;; hm--html-minor-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
270
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
271 (defvar hm--html-minor-region-mode nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
272 "Non-nil, if the `hm--html-minor-region-mode' is active.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
273
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
274 (make-variable-buffer-local 'hm--html-minor-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
275
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
276 (add-minor-mode 'hm--html-minor-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
277 " Region"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
278 hm--html-minor-region-mode-map)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
279
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
280
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
281 (if (adapt-xemacsp)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
282
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
283 (defun hm--html-minor-region-mode (&optional arg)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
284 "Toggle `hm--html-minor-region-mode'.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
285 With arg, turn `hm--html-minor-region-mode' on iff arg is positive.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
286
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
287 But however, if the `hm--html-minor-mode' isn't active, then it
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
288 turns `hm--html-minor-region-mode' off."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
289 (interactive "P")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
290 (setq zmacs-regions-stays t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
291 (setq hm--html-minor-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
292 (and hm--html-minor-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
293 (if (null arg) (not hm--html-minor-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
294 (> (prefix-numeric-value arg) 0))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
295 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
296
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
297 (defun hm--html-minor-region-mode (&optional arg)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
298 "Toggle `hm--html-minor-region-mode'.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
299 With arg, turn `hm--html-minor-region-mode' on iff arg is positive.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
300
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
301 But however, if the `hm--html-minor-mode' isn't active, then it
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
302 turns `hm--html-minor-region-mode' off."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
303 (interactive "P")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
304 (setq hm--html-minor-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
305 (and hm--html-minor-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
306 (if (null arg) (not hm--html-minor-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
307 (> (prefix-numeric-value arg) 0))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
308 (if hm--html-minor-region-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
309 (define-key hm--html-minor-mode-map
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
310 hm--html-emacs19-popup-noregion-menu-button
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
311 nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
312 (if hm--html-expert
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
313 (define-key hm--html-minor-mode-map
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
314 hm--html-emacs19-popup-noregion-menu-button
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
315 hm--html-menu-noregion-expert-map)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
316 (define-key hm--html-minor-mode-map
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
317 hm--html-emacs19-popup-noregion-menu-button
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
318 hm--html-menu-noregion-novice-map)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
319 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
320 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
321
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
322
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
323
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
324 ;;; Hook function for toggling the region minor modes
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
325 (defun hm--html-switch-region-modes-on ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
326 "Switches the region minor modes of the hm--html-menus package on.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
327 This function should be only be used for the `zmacs-activate-region-hook'
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
328 or for the `activate-mark-hook'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
329 (hm--html-region-mode 1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
330 (hm--html-minor-region-mode 1))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
331
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
332 (defun hm--html-switch-region-modes-off ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
333 "Switches the region minor modes of the hm--html-menus package on.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
334 This function should be only be used for the `zmacs-deactivate-region-hook'
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
335 or for the `deactivate-mark-hook'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
336 (hm--html-region-mode -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
337 (hm--html-minor-region-mode -1))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
338
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
339
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
340 ;;; Run the load hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
341 (run-hooks 'hm--html-load-hook)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
342
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
343
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
344 ;;; Announce the feature hm--html-configuration
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
345 (provide 'hm--html-mode)
177
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
346
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
347
6075d714658b Import from CVS: tag r20-3b15
cvs
parents: 153
diff changeset
348 ;;; hm--html-mode.el ends here