The very unofficial .emacs home EugeneMorozov.vm.el
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
Eugene Morozov
EugeneMorozov.emacs
.custom.xemacs.nomule
.custom.xemacs.nomule
.gnus.el
.vm.el

EugeneMorozov.zip
Latest Additions
local files:
John J. Glynn
David Jolley

linked files:


articles:


links:
The Emacs wiki
;; $Id: EugeneMorozov.vm.el.html,v 1.1.1.1 2003/10/25 21:10:52 ingo Exp $

(defvar running-xemacs (string-match "XEmacs\\|Lucid" emacs-version))

;;{{{ BBDB settings

(bbdb-insinuate-vm)

;;}}}

;;{{{ MIME settings

(cond ((featurep 'mule)
       (setq vm-mime-mule-charset-to-coding-alist
             (append
              '(("koi8-r" koi8-r))
              vm-mime-mule-charset-to-coding-alist))
       (setq vm-mime-mule-charset-to-charset-alist
              '((cyrillic-iso8859-5 "koi8-r")))))

(setq vm-mime-charset-completion-alist
      (append
       '(("koi8-r"))
       vm-mime-charset-completion-alist))
(setq vm-mime-8bit-composition-charset "koi8-r"
      vm-mime-8bit-text-transfer-encoding 'nothing
      vm-mime-attachment-save-directory (expand-file-name "~/")
      vm-auto-decode-mime-messages t
      vm-display-using-mime t
      vm-auto-displayed-mime-content-types
      '("text/plain" "multipart" "image")
      )
(add-to-list 'vm-mime-default-face-charsets "koi8-r")
(add-to-list 'vm-mime-type-converter-alist
             '("application/msword" "text/plain" "catdoc -"))
(add-to-list 'vm-mime-type-converter-alist
             '("text/html" "text/plain" "unhtml"))

;;}}}

;;{{{ Misc settings

(setq vm-visible-headers (append vm-visible-headers
                                 '("User-Agent:" "X-Mailer:")))

;; Mail folders location
(setq vm-folder-directory "~/Mail/"
      vm-primary-inbox "~/Mail/INBOX"
      vm-crash-box "~/Mail/INBOX.CRASH"
      mail-archive-file-name "~/Mail/sent-items"
      )

;; Delete settings
(setq vm-move-after-deleting t
      vm-move-after-undeleting t
      vm-delete-after-archiving t)

;; Signature settings
(setq mail-signature-file "~/.signature"
      mail-signature t)

(setq vm-reply-subject-prefix "Re: ")

;; xlynx is a oneliner: xterm -e lynx $*
(setq vm-url-browser "/home/jmv/bin/xlynx")

;;}}}

;;{{{ Disable creating backup files and fix mailboxes permissions

;; Don't leave backup files lying around for prying eyes:
(add-hook 'vm-visit-folder-hook
          (lambda ()
            (set (make-local-variable 'backup-inhibited) t)))

(defadvice vm-save-folder (after make-private activate)
  "Set the file permissions of the current folder to 600 (rw-------)."
  (save-excursion
    (vm-select-folder-buffer)
    (if (string-match "\\`~/" buffer-file-truename)
        (set-file-modes buffer-file-name ?\600))))

;;}}}

;;{{{ VM Personal Crisis configuration

(setq vmpc-expect-default-signature t)
(setq vmpc-conditions '(
                        ("support message" 
                         (vmpc-header-match "To" 
                                            (regexp-opt '("support@linux-ink.ru"
                                                          "support@usoft")))
                         )))
(setq vmpc-actions '(
                     ("support"
                      (vmpc-substitute-header "From"
                               "\"Linux Ink Support Department\" <support@linux-ink.ru>")
                      (vmpc-signature "~/.support_signature"))
                     ))
(setq vmpc-replies-alist '(
                           ("support message" "support")
                           ))
(setq vmpc-resend-alist '(
                          ))

;;}}}

;;{{{ Hooks

;; Delete .sig out of a replied message buffer
;; and position cursor at a covenient place to type
;; Authors:  Edwin Huffstutler <edwinh@primenet.com> & 
;; John Reynolds <zeek@primenet.com>
(defun citation-yank-kill-sig () 
  "Nuke a .sig from cited mail."
  (interactive)
  (end-of-buffer)
  (search-backward-regexp "^-- ?$" 1 t)
  (let ((end (point)))
    (search-backward-regexp (concat "^" vm-included-text-prefix "-- ?$") 1 t)
    
    (delete-region (point) end)
    (insert "\n")
    (insert "\n")
    (previous-line 2)
    )
  )
(add-hook 'vm-reply-hook 'citation-yank-kill-sig)

;; Sign message before sending
(add-hook 'vm-mail-send-hook '(lambda()
                                (cond ((y-or-n-p "Sign message? ")
                                       (mc-sign 1)))))

;;}}}

;;{{{ Mailcrypt support

(add-hook 'vm-mode-hook 'mc-install-read-mode)
(add-hook 'vm-summary-mode-hook 'mc-install-read-mode)
(add-hook 'vm-virtual-mode-hook 'mc-install-read-mode)
(add-hook 'vm-mail-mode-hook 'mc-install-write-mode)

;;}}}

;;{{{ Local variables

;; Local variables:
;; folded-file: t
;; End:

;;}}}
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:57:07 2005 by Ingo Koch