.emacs-my
changeset 670 d10f2e70ff5e
parent 669 12851e09e1ae
child 671 c8f7a49f06a9
child 672 ec015b06e121
--- a/.emacs-my	Sat Jul 16 10:56:02 2011 +0300
+++ b/.emacs-my	Tue Jul 19 23:14:10 2011 +0300
@@ -53,6 +53,20 @@
 (setenv "ORGANIZATION" (concat user-full-name " <" user-mail-address  ">"))
 
 ;;; ----------------------------------------------------------------
+(message "my defun, defmacro, defvar")
+
+(defmacro my-filter (condfunc list)
+  "Construct list with elements from LIST which satisfy CONDFUNC."
+  `(let (r)
+     (mapc (lambda (item)
+             (when (,condfunc item)
+               (if r
+                   (nconc r (cons item nil))
+                 (setq r (cons item nil)))))
+           ,list)
+     r))
+
+;;; ----------------------------------------------------------------
 (message "mode groups")
 
 (defmacro my-defun-rename-symb-tree (name doc func)
@@ -1584,6 +1598,25 @@
 (message "psgml")
 
 (setq sgml-set-face t)                  ; for highlighting in sgml
+(eval-after-load 'sgml-mode
+  '(progn
+     (setq html-tag-alist
+           (cons
+            '("html" (nil
+                      "\n<head>" \n
+                      "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=" (read-input "Charset: ") "\">" \n
+                      "<title>" (setq str (read-input "Title: ")) "</title>\n"
+                      "</head>\n"
+                      "<body>\n<h1>" str "</h1>"
+                      "\n<address>" \n
+                      "<a href=\"mailto:" user-mail-address "\">" (user-full-name) "</a>" \n
+                      "</address>" \n
+                      "</body>\n"
+                      ))
+            (my-filter
+             (lambda (item) (not (equal (car item) "html")))
+             html-tag-alist)))
+     ))
 
 ;;; ----------------------------------------------------------------
 (message "sh, bash")