The very unofficial .emacs home WartanHachaturow.emacs
emacs
Sections
home
what is this all about ?
customization basics
special topics
local dotfiles
dotfiles on the web
new and updated pages
useful sites and pages
search locally
EMacro
OS/2 Emacs
Latest Additions
local files:
John J. Glynn
David Jolley

linked files:


articles:


links:
The Emacs wiki
ODP search for Emacs


dmoz.org
;
;; Portability
;;

;;(setq _switch-keyboard-sound "/usr/lib/xemacs-20.4/etc/sounds/yeep.au")
;;(setq _emacs-info-dir "/usr/info/xemacs-20.4")
(setq _sgml-catalog "/usr/lib/sgml/catalog")
;;
;; *They* say I need it. I do not.
;;

;(setq standard-display-table (make-display-table))
;(set-input-mode nil nil 'We_will_use_eighth_bit_of_input_byte)
;(standard-display-8bit 128 255)
;(standard-display-8bit-1 standard-display-table 128 255)

(modify-syntax-entry ?× "w" text-mode-syntax-table)   ; Hey, xemacs, × is a letter!
(modify-syntax-entry ?÷ "w" text-mode-syntax-table)   ; ÷ too...


;;
;; Key bindings
;;

;;
;; KOI8 keyboard - The Nasty Hack (tm) for using with xkb
;;

(global-set-key [(iso-next-group)]
  '(lambda ()
     (interactive)
;;     (play-sound-file _switch-keyboard-sound)))
))
(global-set-key [(Cyrillic_io)]
   '(lambda ()
        (interactive)
        (insert "£")))
(global-set-key [(Cyrillic_IO)]
   '(lambda ()
        (interactive)
        (insert "³")))
(global-set-key [(Cyrillic_shorti)]
   '(lambda ()
        (interactive)
        (insert "Ê")))
(global-set-key [(Cyrillic_SHORTI)]
   '(lambda ()
        (interactive)
        (insert "ê")))
(global-set-key [(Cyrillic_ya)]
   '(lambda ()
        (interactive)
        (insert "Ñ")))
(global-set-key [(Cyrillic_YA)]
   '(lambda ()
        (interactive)
        (insert "ñ")))
(global-set-key [(Cyrillic_yeru)]
   '(lambda ()
        (interactive)
        (insert "Ù")))
(global-set-key [(Cyrillic_YERU)]
   '(lambda ()
        (interactive)
        (insert "ù")))
(global-set-key [(Cyrillic_ef)]
   '(lambda ()
        (interactive)
        (insert "Æ")))
(global-set-key [(Cyrillic_EF)]
   '(lambda ()
        (interactive)
        (insert "æ")))
(global-set-key [(Cyrillic_tse)]
   '(lambda ()
        (interactive)
        (insert "Ã")))
(global-set-key [(Cyrillic_TSE)]
   '(lambda ()
        (interactive)
        (insert "ã")))
(global-set-key [(Cyrillic_es)]
   '(lambda ()
        (interactive)
        (insert "Ó")))
(global-set-key [(Cyrillic_ES)]
   '(lambda ()
        (interactive)
        (insert "ó")))
(global-set-key [(Cyrillic_che)]
   '(lambda ()
        (interactive)
        (insert "Þ")))
(global-set-key [(Cyrillic_CHE)]
   '(lambda ()
        (interactive)
        (insert "þ")))
(global-set-key [(Cyrillic_ve)]
   '(lambda ()
        (interactive)
        (insert "×")))
(global-set-key [(Cyrillic_VE)]
   '(lambda ()
        (interactive)
        (insert "÷")))
(global-set-key [(Cyrillic_u)]
   '(lambda ()
        (interactive)
        (insert "Õ")))
(global-set-key [(Cyrillic_U)]
   '(lambda ()
        (interactive)
        (insert "õ")))
(global-set-key [(Cyrillic_em)]
   '(lambda ()
        (interactive)
        (insert "Í")))
(global-set-key [(Cyrillic_EM)]
   '(lambda ()
        (interactive)
        (insert "í")))
(global-set-key [(Cyrillic_a)]
   '(lambda ()
        (interactive)
        (insert "Á")))
(global-set-key [(Cyrillic_A)]
   '(lambda ()
        (interactive)
        (insert "á")))
(global-set-key [(Cyrillic_ie)]
   '(lambda ()
        (interactive)
        (insert "Å")))
(global-set-key [(Cyrillic_IE)]
   '(lambda ()
        (interactive)
        (insert "å")))
(global-set-key [(Cyrillic_ka)]
   '(lambda ()
        (interactive)
        (insert "Ë")))
(global-set-key [(Cyrillic_KA)]
   '(lambda ()
        (interactive)
        (insert "ë")))
(global-set-key [(Cyrillic_te)]
   '(lambda ()
        (interactive)
        (insert "Ô")))
(global-set-key [(Cyrillic_TE)]
   '(lambda ()
        (interactive)
        (insert "ô")))
(global-set-key [(Cyrillic_i)]
   '(lambda ()
        (interactive)
        (insert "É")))
(global-set-key [(Cyrillic_I)]
   '(lambda ()
        (interactive)
        (insert "é")))
(global-set-key [(Cyrillic_er)]
   '(lambda ()
        (interactive)
        (insert "Ò")))
(global-set-key [(Cyrillic_ER)]
   '(lambda ()
        (interactive)
        (insert "ò")))
(global-set-key [(Cyrillic_pe)]
   '(lambda ()
        (interactive)
        (insert "Ð")))
(global-set-key [(Cyrillic_PE)]
   '(lambda ()
        (interactive)
        (insert "ð")))
(global-set-key [(Cyrillic_en)]
   '(lambda ()
        (interactive)
        (insert "Î")))
(global-set-key [(Cyrillic_EN)]
   '(lambda ()
        (interactive)
        (insert "î")))
(global-set-key [(Cyrillic_softsign)]
   '(lambda ()
        (interactive)
        (insert "Ø")))
(global-set-key [(Cyrillic_SOFTSIGN)]
   '(lambda ()
        (interactive)
        (insert "ø")))
(global-set-key [(Cyrillic_o)]
   '(lambda ()
        (interactive)
        (insert "Ï")))
(global-set-key [(Cyrillic_O)]
   '(lambda ()
        (interactive)
        (insert "ï")))
(global-set-key [(Cyrillic_ghe)]
   '(lambda ()
        (interactive)
        (insert "Ç")))
(global-set-key [(Cyrillic_GHE)]
   '(lambda ()
        (interactive)
        (insert "ç")))
(global-set-key [(Cyrillic_be)]
   '(lambda ()
        (interactive)
        (insert "Â")))
(global-set-key [(Cyrillic_BE)]
   '(lambda ()
        (interactive)
        (insert "â")))
(global-set-key [(Cyrillic_el)]
   '(lambda ()
        (interactive)
        (insert "Ì")))
(global-set-key [(Cyrillic_EL)]
   '(lambda ()
        (interactive)
        (insert "ì")))
(global-set-key [(Cyrillic_sha)]
   '(lambda ()
        (interactive)
        (insert "Û")))
(global-set-key [(Cyrillic_SHA)]
   '(lambda ()
        (interactive)
        (insert "û")))
(global-set-key [(Cyrillic_shcha)]
   '(lambda ()
        (interactive)
        (insert "Ý")))
(global-set-key [(Cyrillic_SHCHA)]
   '(lambda ()
        (interactive)
        (insert "ý")))
(global-set-key [(Cyrillic_yu)]
   '(lambda ()
        (interactive)
        (insert "À")))
(global-set-key [(Cyrillic_YU)]
   '(lambda ()
        (interactive)
        (insert "à")))
(global-set-key [(Cyrillic_de)]
   '(lambda ()
        (interactive)
        (insert "Ä")))
(global-set-key [(Cyrillic_DE)]
   '(lambda ()
        (interactive)
        (insert "ä")))
(global-set-key [(Cyrillic_zhe)]
   '(lambda ()
        (interactive)
        (insert "Ö")))
(global-set-key [(Cyrillic_ZHE)]
   '(lambda ()
        (interactive)
        (insert "ö")))
(global-set-key [(Cyrillic_ze)]
   '(lambda ()
        (interactive)
        (insert "Ú")))
(global-set-key [(Cyrillic_ZE)]
   '(lambda ()
        (interactive)
        (insert "ú")))
(global-set-key [(Cyrillic_e)]
   '(lambda ()
        (interactive)
        (insert "Ü")))
(global-set-key [(Cyrillic_E)]
   '(lambda ()
        (interactive)
        (insert "ü")))
(global-set-key [(Cyrillic_ha)]
   '(lambda ()
        (interactive)
        (insert "È")))
(global-set-key [(Cyrillic_HA)]
   '(lambda ()
        (interactive)
        (insert "è")))
(global-set-key [(Cyrillic_hardsign)]
   '(lambda ()
        (interactive)
        (insert "ß")))
(global-set-key [(Cyrillic_HARDSIGN)]
   '(lambda ()
        (interactive)
        (insert "ÿ")))

;;
;; Functional keys fun
;;

(global-set-key [f1] 'info)
(global-set-key [f2] 'save-buffer)
(global-set-key [f3] 'find-file)
(global-set-key [f4] 'buffer-menu)
(global-set-key [f5] 'delete-other-windows)
(global-set-key [f6] 'other-window)
(global-set-key [f7] 'replace-string)
(global-set-key [f8] 'next-error)
(global-set-key [f9] 'My-Compile)
(global-set-key [f10] 'delete-frame)
(global-set-key [f11] 'Kill-With-Window)
(global-set-key [f12] 'Kill-Buffer)

;;
;; Keypad
;;

(defun DefineKeyPadKeys ()
  (global-set-key 'kp-1 "1")
  (global-set-key 'kp-2 "2")
  (global-set-key 'kp-3 "3")
  (global-set-key 'kp-4 "4")
  (global-set-key 'kp-5 "5")
  (global-set-key 'kp-6 "6")
  (global-set-key 'kp-7 "7")
  (global-set-key 'kp-8 "8")
  (global-set-key 'kp-9 "9")
  (global-set-key 'kp-0 "0")
  (global-set-key 'kp-decimal ".")
  (global-set-key 'kp-enter "\C-m")
  (global-set-key 'kp-add "+")
  (global-set-key 'kp-subtract "-")
  (global-set-key 'kp-multiply "*")
  (global-set-key 'kp-divide "/")
  )

;;
;; My lovely key binding
;;


;;
;; Defuns for key bindings
;;

(defun Kill-Line ()
  "Kills the whole line under cursor"
  (interactive)
  (beginning-of-line)
  (kill-line)
  )

(defun Kill-Buffer ()
  "Kills the current buffer"
  (interactive)
  (kill-buffer (current-buffer))
  )

(defun Kill-With-Window ()
  "Kills the current buffer and its window"
  (interactive)
  (kill-buffer-and-window)
  )

(defun My-Compile ()
  "Saves all unsaved buffers, and runs 'compile'."
  (interactive)
  (save-some-buffers t)
  (compile compile-command)
  )
(defun MyAutoInsert ()
  "Some autogenerated fun with new files"
  (let ((f-name (buffer-file-name)))
    (if (or (string-match "\\.c$" f-name) (string-match "\\.h$" f-name))
        (insert "/* -*- C -*-\n"
                " * File: " (file-name-nondirectory f-name) "\n"
                " *\n"
                " * Created: " (current-time-string) "\n"
                " */\n"))
    (if (string-match "\\.tei$" f-name)
        (insert "<!doctype tei.2  public '-//TEI//DTD TEI Lite 1.6//EN'>"
                "\n<!--\n"
                "        File:    " (file-name-nondirectory f-name) "\n"
                "\n"
                "        Created: " (current-time-string) "\n"
                "-->\n"))))

(defun MyInsertCodeString ()
        "Inserts code tags in current buffer"
        (interactive)
        (insert "<font size=\"3\" color=\"#666666\"><code>\n")
        )

(defun MyInsertWreskaTStringInt (NumCols)
        "Inserts wreskaT string in current buffer"
        (interactive "sNum Cols:")
        (insert "<!--#include virtual=\"/wreska_t.ssi\"-->\n"
                "<td bgcolor=\"#000000\" colspan=\"" NumCols "\"><font color=\"#FFFFFF\">\n"
        ))
                
(defun MyInsertWreskaString ()
        "Inserts wreska string in current buffer"
        (interactive)
        (insert "<!--#include virtual=\"/wreska.ssi\"-->\n"
        ))
(defun MyInsertNewsTable (secname)
        "Inserts table into news file"
        (interactive "sSection name:")
        (insert "</td></tr></table>\n" 
                "<!--#include virtual=\"/table.ssi\"-->" secname "</b></font></p></td>\n"
        "<\/tr>\n"
        "<tr>\n"
        "<td bgcolor=\"\#FFFFFF\">\n"))
(defun MyTableWizard (NumCols NumRows)  
        "Inserts a table with the specified Cols x Rows"
        (interactive "nNumber of Cols: \nnNumber of Rows: ")
        (insert "\n")
        (do ((currow 0))
            ((= currow NumRows))
            (insert "<tr>\n")
            (do ((curcol 0))
             ((= curcol NumCols))
             (insert "<td></td>\n")
             (setq curcol (+ curcol 1)))
            (insert "</tr>\n")
            (setq currow (+ currow 1))))

;; My beloved defun. This returns a char from the string at place
;; NUM
(defun MyChar (string NUM)
(interactive)
"Extracts Character at num position from string"
(string-to-char (substring string NUM (+ 1 NUM))))

(defun MyList2String (list)
"Converts list of characters into the string"
(interactive)
(setq string (char-to-string (car list)))
(cond ((null (cdr list)) string)
 ('t (concat string (MyList2String(cdr list))))))

;; My beloved defun N2. This replaces a char at place NUM by CHAR
(defun MyReplaceChar (string NUM CHAR)
(interactive)
"Replaces a character in string at position NUM by CHAR"
(setq stringlist (string-to-list string))
(setf (nth NUM stringlist) CHAR)
(MyList2String stringlist))


;; Defuns for recoding from one encoding into another
;; Here, the first arg is a list
;; in the following format:
;; ((symbol-in-1st-encoding same-symbol-in-2nd-encoding) (....) ...)
;; And the rstr is a string to recode
;;(defun MyRecode (rtable rstr curchar)
;;"Recodes a string from one encoding to another"
;;(interactive)
;;((setq curstr (cond ((eq curchar (length rstr)) rstr)
;;                  (('t (MyRecode rtable rstr curchar)))))
 
;;(MyRecode '((?A ?1) (?B ?2)) "AB" 0)
;;(cdr 
;;(caar '((?A ?1) (?B ?2)))

(defun MyMailMode ()
       (interactive)
"My Mail Mode. Just highlights current file"
(highlight-headers (point-min) (point-max) t))    

    

;; No more bindings
;;

;;
;; Let it be
;;

;;(setq Info-default-directory-list
;;        (append Info-default-directory-list (list _emacs-info-dir)))

;;
;; Ispell fun
;;

(setq ispell-dictionary-alist
      (append ispell-dictionary-alist
              (list
               (list
                "russian"
                "[áâ÷çäåöúéêëìíîïðòóôõæèãþûýÿùøüàñÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ]"
                "[^áâ÷çäåöúéêëìíîïðòóôõæèãþûýÿùøüàñÁÂ×ÇÄÅÖÚÉÊËÌÍÎÏÐÒÓÔÕÆÈÃÞÛÝßÙØÜÀÑ]"
                "[-]"
                nil
                nil
                nil)))
      ispell-dictionary "russian")

;;
;; Abbrevs
;;

;;(read-abbrev-file "/home/alexey/.emacs.abbrevs")
;;(abbrev-mode 1)

;;
;; Some fun again
;;
(setq-default tab-width 8)
(load-default-sounds)
(custom-set-faces
 '(info-xref ((t (:bold t :underline t :foreground "DarkGreen"))))
 '(info-node ((t (:bold t :italic nil :foreground "DarkBlue"))))
 '(message-headers ((t (:foreground "forestgreen" :size "15" :bold t))))
 '(message-header-contents ((t (:foreground "rosybrown" :italic t))))
 '(message-highlighted-header-contents ((t (:foreground "red" :bold t :italic t)))))

;;;
;;; -------- Global options
;;;

(setq kill-whole-line t
      default-major-mode 'text-mode
      use-dialog-box nil
      delete-key-deletes-forward t
      options-save-faces t
      )

;;
;; Little hooks
;;

(add-hook 'find-file-not-found-hooks 'MyAutoInsert)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(require 'cc-mode)
(add-hook 'c-mode-common-hook
          '(lambda ()
             (c-set-style "cc-mode")
             (line-number-mode 1)
             (column-number-mode 1)
             (abbrev-mode 1)
             (auto-fill-mode 1)
             (setq tab-width 8)
             )
          )

(add-hook 'html-mode-hook
                '(lambda ()
                        (setq sgml-omittag nil)
                        (setq sgml-shorttag nil)
                        )
                )       
(gnuserv-start)

(setq auto-mode-alist
      (append auto-mode-alist
              '(
                ( "\\html.ru\\'"        . html-mode )
                ( "\\html.en\\'"        . html-mode )
                ( "\\tei\\'"            . sgml-mode )
                )
              )
      )

;;
;; SGML
;;

(load-library "psgml")

(setq sgml-catalog-files 
        (list _sgml-catalog)
        sgml-custom-dtd
        '(("TEI Lite" "<!doctype TEI.2  public '-//TEI//DTD TEI Lite 1.6 //EN'>")
         ("TEI Tools" "<!doctype TEI.2 public '-//TEI//DTD TEI Tools 0.1//EN'>")
         ("HTML 4.0 strict" "<!doctype HTML public '-//W3C//DTD HTML 4.0//EN'>")
         ("DocBook Set" "<!doctype SET public '-//Davenport//DTD DocBook V3.0//EN'>")
         ("DocBook Book" "<!doctype BOOK public '-//Davenport//DTD DocBook V3.0//EN'>")
         ("DocBook Chapter" "<!doctype CHAPTER public '-//Davenport//DTD DocBook V3.0//EN'>")
         ("DocBook Article" "<!doctype ARTICLE public '-//Davenport//DTD DocBook V3.0//EN'>")
          )
)
;; Damn File options
(setq sgml-omittag nil)
(setq sgml-shorttag nil)
;; End of damn thing

(defun My-SGML-keymap ()
  (local-set-key [(meta Cyrillic_sha)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'hi)))
  (local-set-key [(meta Cyrillic_el)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'kw)))
  (local-set-key [(meta Cyrillic_ze)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'p)))
  (local-set-key [(meta Cyrillic_er)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'head)))
  (local-set-key [(alt kp-1)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'div1)))
  (local-set-key [(alt kp-2)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'div2)))
  (local-set-key [(alt kp-3)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'div3)))
  (local-set-key [(alt kp-4)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'div4)))
  (local-set-key [(alt kp-5)]
                 '(lambda()
                    (interactive)
                    (sgml-insert-element 'div5)))
;; m-dash
  (local-set-key [(control kp-subtract)]
                 '(lambda()
                    (interactive)
                    (insert "&nbsp;&mdash; ")))
;; non-breakable space
  (local-set-key [(alt space)]
                 '(lambda()
                    (interactive)
                    (insert "&nbsp;")))
;; stupid tab
  (local-set-key [(iso-left-tab)]
                 '(lambda()
                    (interactive)
                    (insert " -+-TAB-+- ")))
;; My own Table Wizard :-)
  (local-set-key [(control kp_1)]
                 'MyTableWizard)
;; Ventura footnote
  (local-set-key [(control kp_2)]
                 '(lambda()
                    (interactive)
                    (insert "&lt;$F&nbsp;&mdash; <hi>ÐÒÉÍÅÞ.ÐÅÒÅ×.</hi>&gt;")))
;;Insert code string
(local-set-key [(control kp_7)]
                '(lambda()
                        (interactive)
                        (MyInsertCodeString)))
;;Insert WreskaT string
(local-set-key [(control kp_8)]
                'MyInsertWreskaTStringInt)
                
;;Insert Wreska string
(local-set-key [(control kp_9)]
                '(lambda()
                        (interactive)
                        (MyInsertWreskaString)))
;;Insert News Table                       
(local-set-key [(control kp_6)]
                'MyInsertNewsTable)
  )

(add-hook 'sgml-mode-hook
          '(lambda ()
             (make-local-variable 'compile-command)
             (My-SGML-keymap)
             (line-number-mode 1)
             (abbrev-mode 1)
             (column-number-mode 1)
;; Well, I really hate this autofill in sgml mode
      (auto-fill-mode 0)
;; Get rid of X-Symbol here
      (x-symbol-mode 0)
             (setq write-file-hooks (delete 'fix-iso2sgml write-file-hooks)
                   find-file-hooks (delete 'fix-iso2sgml find-file-hooks)
                   sgml-set-face t
                   sgml-insert-missing-element-comment nil
                   compile-command
                   (concat "tei2dvi " (file-name-nondirectory (buffer-file-name)))
                   sgml-live-element-indicator t)
             (let ((ced-file-name
                    (concat (file-name-sans-extension (buffer-file-name)) ".ced"))
                   )
               (if (file-readable-p ced-file-name)
                   (sgml-load-dtd ced-file-name)))))

;;
;; Faces.
;;

(make-face 'sgml-comment-face)
(make-face 'sgml-doctype-face)
(make-face 'sgml-end-tag-face)
(make-face 'sgml-entity-face)
(make-face 'sgml-ignored-face)
(make-face 'sgml-ms-end-face)
(make-face 'sgml-ms-start-face)
(make-face 'sgml-pi-face)
(make-face 'sgml-sgml-face)
(make-face 'sgml-short-ref-face)
(make-face 'sgml-start-tag-face)

(set-face-foreground 'sgml-comment-face "dark green")
(set-face-foreground 'sgml-doctype-face "maroon")
(set-face-foreground 'sgml-end-tag-face "blue2")
(set-face-foreground 'sgml-entity-face "red2")
(set-face-foreground 'sgml-ignored-face "maroon")
(set-face-background 'sgml-ignored-face "wheat")
(set-face-foreground 'sgml-ms-end-face "maroon")
(set-face-foreground 'sgml-ms-start-face "maroon")
(set-face-foreground 'sgml-pi-face "maroon")
(set-face-foreground 'sgml-sgml-face "maroon")
(set-face-foreground 'sgml-short-ref-face "goldenrod")
(set-face-foreground 'sgml-start-tag-face "blue2")

(setq-default sgml-markup-faces
              '((comment . sgml-comment-face)
                (doctype . sgml-doctype-face)
                (end-tag . sgml-end-tag-face)
                (entity . sgml-entity-face)
                (ignored . sgml-ignored-face)
                (ms-end . sgml-ms-end-face)
                (ms-start . sgml-ms-start-face)
                (pi . sgml-pi-face)
                (sgml . sgml-sgml-face)
                (short-ref . sgml-short-ref-face)
                (start-tag . sgml-start-tag-face)))

;;
;; Misc
;;

;; (load-library "gcl")

(setq strokes-use-strokes-buffer nil)

(load-library "time")

(setq display-time-24hr-format t
      display-time-mail-file nil
      display-time-form-list (list 'time)
      display-time-day-and-date t)

(display-time)

(setq next-line-add-newlines nil
      scroll-step 1
      mouse-yank-at-point t
      )

(require 'big-menubar)
(require 'crypt)
(load "recent-files")
(recent-files-initialize)
(require 'filladapt)
(add-hook 'text-mode-hook 'turn-on-filladapt-mode)

;;
;; GNUS
;; 

(defun MyGNUS ()
  (deiconify-frame)
  (gnus)
  )

(defun toolbar-news ()
  "Run Gnus in the frame it was started from."
  (interactive)
  (gnus)
  )

(load-library "supercite")

(setq sc-preferred-header-style 0
      sc-rewrite-header-list '((my-header-line-generator))
      sc-citation-leader " "
      sc-confirm-always-p nil
      sc-preferred-attribution-list 
      '( "x-attribution" "firstname" "initials" "sc-lastchoice" )
      )

(defun my-header-line-generator ()
  (let ((sc-mumble "")
        (whofrom (sc-whofrom)))
    (if whofrom
        (insert sc-reference-tag-string
                (sc-hdr "\"" (sc-mail-field "sc-attribution") "\" == ")
                (sc-hdr ""   (sc-mail-field "sc-author") " ")
                "writes:\n")
      )
    )
  )

(setq gnus-use-sc t
      gnus-select-method '(nnspool "")
      gnus-asynchronous t
      nnspool-active-file "/var/lib/news/active"
      nnspool-active-times-file "/var/lib/news/active.times"
      default-mime-charset 'koi8-r
      mime-setup-use-sc t
      mime-charset-type-list  
      '((koi8-r         8 nil)
        (us-ascii       7 nil)
        (iso-8859-1     8 "quoted-printable")
        (iso-8859-2     8 "quoted-printable")
        (iso-8859-3     8 "quoted-printable")
        (iso-8859-4     8 "quoted-printable")
        (iso-8859-5     8 "quoted-printable")
        (iso-8859-7     8 "quoted-printable")
        (iso-8859-8     8 "quoted-printable")
        (iso-8859-9     8 "quoted-printable")
        (iso-2022-jp    7 "base64")
        (iso-2022-kr    7 "base64")
        (euc-kr         8 "base64")
        (gb2312         8 "quoted-printable")
        (big5           8 "base64")
        (iso-2022-jp-2  7 "base64")
        (iso-2022-int-1 7 "base64")
        )
      mime/field-encoding-method-alist
      '(
        ("Subject" . nil)
        )
      mime-eword/charset-encoding-alist
      '((koi8-r         . nil)
        (us-ascii       . nil)
        )
      )

(require 'gnus-setup)
(require 'gnus-charset)

(gnus-set-newsgroup-default-charset ".*" "koi8-r")

(add-hook 'gnus-article-display-hook
          '(lambda ()
             (gnus-article-highlight)
             (gnus-article-hide-headers-if-wanted)
             (setq gnus-visible-headers 
                   '("^From:" "^X-Comment-To:" "^Comment-To:" "^Subject:" "^Date:" 
                     "^Followup-To:" "^Reply-To:" "^Organization:" "^Summary:" 
                     "^Keywords:" "^To:" "^Cc:" "^Posted-To:" "^Mail-Copies-To:" 
                     "^Apparently-To:" "^Gnus-Warning:" "^Resent-From"
                     )
                   )
             (smiley-buffer)
             (article-emphasize)
             )
          )

(add-hook 'gnus-summary-mode-hook
          '(lambda ()
             (local-set-key [tab] 'gnus-summary-next-unread-article)
             (save-excursion
               (goto-char (point-min))
               (smiley-buffer)
               )
             )
          )

(add-hook 'message-mode-hook
          '(lambda ()
             (auto-fill-mode 1)
             (font-lock-mode 1)
             (setq fill-column 75)
             )
          )

(add-hook 'message-setup-hook
          '(lambda ()
             ;; Add X-Comment-To: field. We need From: field from original
      ;; letter. How to get right? 
      
             (if message-reply-buffer
                 (let ((cur-buffer (current-buffer)) from-field)
                   (save-excursion
                     (set-buffer message-reply-buffer)
                     (if (string-match "^From:" (buffer-string))
                         (progn
                           (setq from-start (+ (match-end 0) 1))
                           (goto-char from-start)
                           (end-of-line)
                           (setq from-field (buffer-substring from-start (point))))))
                   (if from-field
                       (save-excursion
                         (goto-char (point-min))
                         (insert "X-Comment-To: " (Make-Comment-To from-field) "\n")))))
               (setq message-signature 'My-Signature)))

(defun My-Signature ()
  (setq _sign "\n--\n÷ÁÒÔÁÎ.")
  (goto-line 1)
  (if (search-forward-regexp "^Newsgroups:[ \t]*ru.os.cmp" nil t)
;      (setq _sign (concat _sign "\n\nI don't understand what you just said, but in the end it still sucks.\n\t\t\"NT Enterprise Network Design\""))
      (setq _sign (concat _sign "\n\nOn the Internet, no one knows you are using Windows..."))
    (if (search-forward-regexp "^Newsgroups:[ \t]fido7.spb.linux" nil t)
        (setq _sign (concat _sign "\n\nWhy use Windows when there is a door?"))
      (if (search-forward-regexp "^Newsgroups:[ \t]fido7.ru.linux" nil t)
          (setq _sign (concat _sign "\n\nWe are MicroSoft. You will be assimilated. Resistance futile. \n\t\t\"Linux Cookies.\""))
        (if (search-forward-regexp "^Newsgroups:[ \t]fido7.ru.unix.linux" nil t)
            (setq _sign (concat _sign "\n\nðÒÉ×ÅÔ ÒÏÂÏÔÕ ÷ÁÓÅ?:-)"))
        (if (search-forward-regexp "^Newsgroups:[ \t]fido7.spb.music" nil t)
            (setq _sign (concat _sign "\n\nõÖÁÓÎÏ ÖÉÔØ ÓÒÅÄÉ ÎÅ×ÚÇÏÄ... úÄÅÓÔØ ÒÁÓÔÁÍÁÎÁÍ ÎÅÌÅÇËÏ..."))
        (if (search-forward-regexp "^Newsgroups:[ \t]fido7.su.music*" nil t)
            (setq _sign (concat _sign "\n\n...ëÔÏ-ÔÏ ÞÅÒÎÏÊ ÒÕËÏÊ ÐÏÍÅÛÁÌ ÍÏÌÏËÏ..."))
          (setq _sign (concat _sign "\n\n...she mades you tea, ask for your autograph...What a laugh!..."))))))))
  
  (end-of-buffer)
  (insert "\n")
  (insert _sign))

(defun Make-Comment-To (from)
  (if (string-match " *<.*> *" from)
      (concat (substring from 0 (match-beginning 0)) (substring from
                                                                (match-end 0)))
    (if (string-match "\(.*\)" from)
        (substring from (+ (match-beginning 0) 1) (- (match-end 0) 1))
      from
      )
    )
  )

;; Options Menu Settings
;; =====================
(cond
 ((and (string-match "XEmacs" emacs-version)
       (boundp 'emacs-major-version)
       (or (and
            (= emacs-major-version 19)
            (>= emacs-minor-version 14))
           (= emacs-major-version 21))
       (fboundp 'load-options-file))
  (load-options-file "/home/wart/.xemacs-options")))
;; ============================
;; End of Options Menu Settings

;; My own key bindings
(global-set-key [(control delete)] 'x-kill-primary-selection)
;; End of my own key bindings

;;
;; Tobotras HATES it. I just comment out all this stuff.
;;
;(add-spec-list-to-specifier
; (face-property 'default 'font)
; '((global (nil . "-ttf-courier new cyr-medium-r-*-*-*-140-*-*-*-*-koi8-r"))))
;
;(add-hook 'shell-mode-hook 'install-shell-fonts)

(fset 'yes-or-no-p 'y-or-n-p)

(setq _vm-mime-default-face-charsets "koi8-r")
(custom-set-variables
 '(auto-fill-inhibit-regexp "*")
 '(gnus-article-sort-functions (quote (gnus-article-sort-by-date)))
 '(gnus-default-charset (quote koi8-r))
 '(local-holidays (quote ((holiday-fixed 5 4 "My Birthday") (holiday-fixed 12 24 "Breakthrough day"))))
 '(highlight-headers-regexp "Subject[         ]*:\\|From[     ]*:\\|To[       ]*:")
 '(gnus-thread-sort-functions (quote (gnus-thread-sort-by-date)))
 '(gnuserv-program (concat exec-directory "/gnuserv"))
 '(eicq-coding-system nil)
 '(eicq-log-filename "~/elisp/icq-log")
 '(eicq-bridge-filename "~/elisp/udp2tcp")
 '(toolbar-mail-reader (quote mutt))
 '(nnmail-spool-file "/var/spool/mail/$user")
 '(highlight-headers-max-message-size 50000)
 '(mail-user-agent (quote mutt))
 '(eicq-user-alias "MojoMan")
 '(html-helper-new-buffer-template (quote (html-helper-htmldtd-version "<html>
" "  <head>
 " "    <title>" (p "Document Title: " title) "</title>
" "  </head>
" "
" "  <body>
" "<table width=\"60%\"><tr><td>
    <h1>" (s title) "</h1>

" p "

    <hr>
" "    <address>" html-helper-address-string "</address>
" (html-helper-return-created-string) html-helper-timestamp-start html-helper-timestamp-end "
 </td></tr></table> </body>
</html>
")))
 '(gnus-post-method (quote current))
 '(gnus-select-method (quote (nntp "news.dux.ru")))
 '(highlight-headers-highlight-citation-too t)
 '(user-mail-address "wart@softhome.net" t)
 '(gnus-nntp-server "news.dux.ru")
 '(query-user-mail-address nil))

;; For elisp
(add-to-list 'load-path "~/elisp")
(require 'cdplay)
;;(require 'php-mode)

;; My toolbar
(defun my-toolbar-icq ()
  (call-process "licq" nil 0 nil))

(defun my-toolbar-mp3 ()
  (call-process "xterm" nil 0 nil "-e" "mp3blaster"))
;; ZenIRC
(setq zenirc-server-alist '(("irc.ru" nil nil "wart" nil)))

;; Some PPP variables
(setq ppp-provider "Dux1")
(setq ppp-state nil)
(defvar edit-toolbar-added-buttons-alist)

;; Sorry, PPP button must be the last one.
(defun my-toolbar-ppp ()
  
  (cond ((equal ppp-state nil)
         ;; Some deep-hacking on edit-toolbar produced code
  ;; I don't know how to make this damn thing work right
  ;; So, It's a real dirty hack.
  (setf (cdr (nth (- (length edit-toolbar-added-buttons-alist) 1)
                    edit-toolbar-added-buttons-alist)) 
               (list "~/elisp/mybuttons/ppp-down.xpm"))
         (mapcar
          (lambda (cons)
          (setf (symbol-value (car cons)) (toolbar-make-button-list (cdr cons)))
          )
          edit-toolbar-added-buttons-alist)
         ;; Don't know if this is needed
  (set-specifier default-toolbar default-toolbar)
         (call-process "pon" nil 0 nil ppp-provider)
         
         (setq ppp-state 't))

         ((equal ppp-state 't) 
         ;; Some deep-hacking on edit-toolbar produced code
  (setf (cdr (nth (- (length edit-toolbar-added-buttons-alist) 1)
                    edit-toolbar-added-buttons-alist)) 
               (list "~/elisp/mybuttons/ppp-up.xpm"))
         (mapcar
          (lambda (cons)
          (setf (symbol-value (car cons)) (toolbar-make-button-list (cdr cons)))
          )
          edit-toolbar-added-buttons-alist)
         ;; Don't know if this is needed
  (set-specifier default-toolbar default-toolbar)
         (call-process "poff" nil 0 nil)
         (setq ppp-state nil))))
                               

         

;;View-process-mode
(require 'view-process-mode)

(if (and (featurep 'toolbar)
         (fboundp 'console-on-window-system-p)
         (console-on-window-system-p)
         (file-exists-p "~/.xemacs/.toolbar"))
    (load-file (expand-file-name "~/.xemacs/.toolbar")))
(blink-cursor-mode 0)    
All content copyright by the contributors. Website maintained with Emacs , wsmake and html-helper-mode
Emacs community logo by Daniel Lundin Last updated on Sat Jan 22 14:49:24 2005 by Ingo Koch