previous ] [ start page ] [ next ]

My personal site-start.el
for Emacs 20.6 under OS/2

Please note: As there is HTML code too in my Emacs setup I had to replace the < and > with &lt; and &gt;. To be on the safe side, I also replaced all " with &quot;. This means that this file is not longer in true elisp syntax. If you would like to copy this file, mark and copy it out of your browser's window, then paste it into an editor to save it. Don't save this file to disk with the FILE - SAVE AS... menu option or <CTRL-S>.
You may also download it as a ZIP archive.

Please also note that there are many things such as user names and e-mail addresses in the following, you will have to adapt at any rate, even if you have the according elisp package available.

Extensions not contained in the standard Emacs distribution have links for easy accessing the according source files or packages.

;;; Startup file for GNU Emacs 20.6 under OS/2 and emx
;;; in ISO-8859-1 coding
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                       The science of setting up Emacs                ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Users of multiuser OS's, please note:
;;;   This file serves as a site-start.el emacs configuration and although
;;;   all OS/2 specific stuff is marked so, it may be that not everything
;;;   herein will fit into the .emacs file in a multiuser environment, i.e.
;;;   you will be *probably* not allowed to do all the things described
;;;   here, if you are not a superuser on your machine.
;;;
;;; Notes on the comment style used in this file:
;;; - All textual comments have at least three ";;;" in front of them.
;;; - All lisp code commented has only two ";;". (Some code shows
;;;   alternatives or even does not make sense in any environment.)
;;; - There are main sections and subsections to let you easily find
;;;   what you are interested in.
;;;
;;; ALTHOUGH THIS IS MY ORIGINAL SITE-START.EL FILE, IT WILL PROBABLY NOT 
;;; FIT YOUR ENVIRONMENT. IF YOU PLAN TO USE IT PLEASE COMMENT EVERY
;;; LINE OF WHICH YOU ARE NOT ABSOLUTELY SURE YOU ARE IN NEED OF AND
;;; MAKE A BACKUP OF YOUR EXISTING FILE.
;;; It is not a very good idea to change your emacs configuration with
;;; lots of new and unknown code, because if your emacs crashes you
;;; will not be able to spot which statement is responsible for it.
;;;
;;; To learn more about the following functions and variables make
;;; use of emacs' describe-mode, describe-function and describe-variable
;;; features.
;;;
;;; Oliver Heidelbach - ohei @ snafu . de - 31.12.2000
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                          Fundamentals                                ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; mostly used for external packages, i.e. for non-standard elisp directories
(setq load-path (append '("x:/emacs/lisp/"
                          "x:/emacs/20.6/lib-src"
                          "x:/emacs/lisp/mailcrypt-3.5.5"
                          "x:/emacs/lisp/bbdb-2.00/lisp"
                          "x:/emacs/lisp/tm")
		     load-path))

;;; Start the Gnuclient server process
(require 'gnuserv)
(gnuserv-start)
(setq gnuserv-frame (selected-frame))
;;(setq gnuserv-frame (raise-frame (selected-frame)))

;;; Start the Emacsclient server process
;;(server-start)

;;; Raise frame to the foreground if emacsclient requests a buffer.
;;
;;(add-hook 'server-request-hook
;;          '(lambda ()
;;             (make-frame-visible)
;;             (focus-frame (selected-frame))))

;;; Fewer garbage collections
;; (setq gc-cons-threshold 1000000)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                             Debugging                                ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;You might need to start emacs with the -q
;;;option, load the .emacs file, and do M-x eval-buffer.
;;(setq debug-on-error t)

;;; For debugging emacs
;;(open-termscript "termscript")
;;(open-dribble-file "dribble")


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                       Fundamental display setup                      ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Load asorted Buffer menu
(load "msb")

;;; Set up a menu displaying the last visited files
(load "edit-history")
(setq ehistory-history-length 25)
(setq ehistory-ignore-regexp "/\\(browse\\|diary\\|site-diary\\|tags\\|.*rmail.*\\|.*\.tmp\\|.*a[d]*ress.*\\|.*-scores\\|.*\.bbdb\\)$")
(ehistory-load-file-list)

;;; Enable 8-bit input.  set-input-mode must be called when running
;;; Emacs -- calling it before dumping doesn't work.

(set-input-mode nil nil 1)

;;; Specify additional frame parameters (under OS/2).
;;; Font WarpSans comes with Warp 4

(if (eq window-system 'pm)
    (setq default-frame-alist
          (append '((altgr-modifier . meta) ;;; AltGr (and AltCar) generate M-
                    (alt-modifier . meta)   ;;; Alt generates M-
;;                  (alt-modifier . alt)
                    (shortcuts . (alt-f4))  ;;; Disable all shortcuts but Alt+F4
                    (width . 81) (height . 43)  ;;; for 1024*768 resolution
                    (top . -2) (left . 280)
;;                    (font . "10.System VIO")  ;;; default: courier
;;                    (menu-font . "2.System VIO")
                    (menu-font . "8.WarpSans Bold"))
                  default-frame-alist)))

;;; display characters 128 through 254 as-is.  without this
;;; statement, octal notation is used for these characters.

(standard-display-8bit 128 255)
(standard-display-european 1)		;;; Eight-bit characters - V19+

;;; Use special symbols (which are not displayed as-is when occurring
;;; in a buffer) for truncated screen lines, continued lines, for
;;; displaying control characters, and for separating side-by-side
;;; windows.

(set-display-table-slot standard-display-table 'truncation      16)
(set-display-table-slot standard-display-table 'wrap            31)
(set-display-table-slot standard-display-table 'control         24)
(set-display-table-slot standard-display-table 'vertical-border 186)

;;; Set it up for correct use with mails, postings etc.
;;; This may seem antique now that Emacs for OS/2 has Mule support,
;;; but it worked for me with Emacs 19.33 and it also works with 20.6
(require 'iso-pc)

;;; This function requires iso-pc.el
;;; and the entry CODEPAGE=437,1004 in the OS/2 config.sys
(defun my-show-current-code-page ()
  "Show active codepage"
  (interactive)
  (if (equal (current-code-page) '1004)
      (message (concat "Active codepage is " (current-code-page) " \(ISO-8859-1\)"))
    (message (concat "Active codepage is " (current-code-page) " \(PC\)"))))

;;; This function requires iso-pc.el
;;; and the entry CODEPAGE=437,1004 in the OS/2 config.sys
(defun my-toggle-code-page ()
  "Toggle codepage between 850 \(PC\) and 1004 \(ISO-8859-1\)"
  (interactive)
  (if (equal (current-code-page) '1004)
      (set-code-page '850)
    (set-code-page '1004))
  (message (concat "Using codepage " (current-code-page))))

;;; This function requires iso-pc.el
;;; and the entry CODEPAGE=437,1004 in the OS/2 config.sys
(defun my-toggle-charset ()
  "Toggle codepage between 850 \(PC\) and 1004 \(ISO-8859-1\)"
  (interactive)
  (if window-system
      (my-toggle-code-page)
    (iso-pc)))
(global-set-key [f9] 'my-toggle-charset)
(global-set-key [C-f9] 'my-show-current-code-page)

;;; This function requires iso-pc.el
;;; and the entry CODEPAGE=437,1004 in the OS/2 config.sys
(defun my-iso-chars-enable ()
  "Enables the ISO-8859-1 charset."
  (if window-system (set-code-page '1004) (iso-pc-enable))
  (message (concat "Using ISO-8859-1 charset.")))
(defun my-iso-chars-disable ()
  "Disables the ISO-8859-1 charset."
  (if window-system (set-code-page '850) (iso-pc-disable))
  (message (concat "Using PC charset.")))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                           Keyboard setup                             ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; The following can be used to load heavily used files via keys
(global-set-key [C-f12] '(lambda () (interactive) 
                  (find-file "x:/emacs/20.6/lisp/site-start.el")))
  
;;; Set goto-line to something apropriate (ALT-g)
(global-set-key "\eg" 'goto-line)

;;; Set sort-lines to something apropriate (ALT-#)
(global-set-key "\e#" 'sort-lines)

;;; Set sort-paragraphs to something apropriate (CONTROL-#)
(global-set-key [?\C-#] 'sort-paragraphs)

;;; Set count-lines-region to something apropriate (ALT-c)
(global-set-key "\ec" 'count-lines-region)

;;; Set capitalize-word to ALT-C
(global-set-key "\eC" 'capitalize-word)

;;; Set reverse-region to something apropriate (ALT-r)
(global-unset-key "\er")
(global-set-key "\er" 'reverse-region)

;;; Make interactive killing available on CONTROL-F4
(global-set-key [C-f4] 'kill-some-buffers)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                         Additional setup                             ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; make emacs blink instead of beep
(setq visible-bell t)

;;; Do not automatically add newlines on (page) down
(setq next-line-add-newlines nil)

;;; make all sorts folded
(setq sort-fold-case t)

;;; Get rid of the message file input
(setq message-log-max 25)

;;; Display full path name if appropriate on mode line.
(add-hook 'find-file-hooks 
	  '(lambda ()
	     (setq mode-line-buffer-identification 'buffer-file-truename)))

;;; fill paragraphs with a single space (only) after each period?
(setq sentence-end "[.?!][]\"')}]*\\($\\|[ \t]\\)[ \t\n]*")
(setq sentence-end-double-space nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                         Calendar setup                               ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Ulrich Müller, Inst. für Kernphysik, Univ. Mainz, D-55099 Mainz
;;; ulm@kph.uni-mainz.de, Tel. +49 6131 39-5812, Fax -2964

;;; Please note that this is strictly a german setup of calendar

(setq calendar-week-start-day 1)        ;;; Monday
(setq european-calendar-style t)
(setq calendar-time-display-form
      '(24-hours ":" minutes (and time-zone (concat " (" time-zone ")"))))
 
(setq calendar-day-name-array
      ["Sonntag" "Montag" "Dienstag" "Mittwoch"
       "Donnerstag" "Freitag" "Samstag"])
(setq calendar-month-name-array
      ["Januar" "Februar" "März" "April" "Mai" "Juni"
       "Juli" "August" "September" "Oktober" "November" "Dezember"])
(setq solar-n-hemi-seasons
      '("Frühlingsanfang" "Sommeranfang" "Herbstanfang" "Winteranfang"))
 
(setq general-holidays
      '((holiday-fixed 1 1 "Neujahr")
        (holiday-fixed 5 1 "1. Mai")
        (holiday-fixed 10 3 "Tag der Deutschen Einheit")))
 
(setq christian-holidays
      '(
        (holiday-float 12 0 -4 "1. Advent" 24)
        (holiday-float 12 0 -3 "2. Advent" 24)
        (holiday-float 12 0 -2 "3. Advent" 24)
        (holiday-float 12 0 -1 "4. Advent" 24)
        (holiday-fixed 12 25 "1. Weihnachtstag")
        (holiday-fixed 12 26 "2. Weihnachtstag")
        (holiday-fixed 1 6 "Heilige Drei Könige")
        ;;; Date of Easter calculation taken from holidays.el.
        (let* ((century (1+ (/ displayed-year 100)))
               (shifted-epact (% (+ 14 (* 11 (% displayed-year 19))
                                    (- (/ (* 3 century) 4))
                                    (/ (+ 5 (* 8 century)) 25)
                                    (* 30 century))
                                 30))
               (adjusted-epact (if (or (= shifted-epact 0)
                                       (and (= shifted-epact 1)
                                            (< 10 (% displayed-year 19))))
                                   (1+ shifted-epact)
                                 shifted-epact))
               (paschal-moon (- (calendar-absolute-from-gregorian
                                 (list 4 19 displayed-year))
                                adjusted-epact))
               (easter (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
          (filter-visible-calendar-holidays
           (mapcar
            (lambda (l)
              (list (calendar-gregorian-from-absolute (+ easter (car l)))
                    (nth 1 l)))
            '(
              ;; (-48 "Rosenmontag")
              ( -2 "Karfreitag")
              (  0 "Ostersonntag")
              ( +1 "Ostermontag")
              (+39 "Christi Himmelfahrt")
              (+49 "Pfingstsonntag")
              (+50 "Pfingstmontag")
              ;; (+60 "Fronleichnam")
             ))))
        ;; (holiday-fixed 8 15 "Mariä Himmelfahrt")
        (holiday-fixed 11 1 "Allerheiligen")
        ;; (holiday-float 11 3 1 "Buß- und Bettag" 16)
        (holiday-float 11 0 1 "Totensonntag" 20)))
 
(setq calendar-holidays
      (append general-holidays local-holidays other-holidays
              christian-holidays solar-holidays))

(setq calendar-latitude 52.3)
(setq calendar-longitude -13.2)
(setq calendar-location-name "Berlin")
 
(setq mark-diary-entries-in-calendar t)
(setq mark-holidays-in-calendar t)
(setq calendar-mark-today "<")

(add-hook 'today-visible-calendar-hook 'calendar-mark-today)

;;; Appointment setup
(add-hook 'diary-hook 'appt-make-list)
(setq display-time-24hr-format t)
(display-time)  ;;; on mode line

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                         Programming modes setup                      ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;
;;; HTML additions ;;;
;;;;;;;;;;;;;;;;;;;;;;
(setq auto-mode-alist (cons '("\\.htm.*$" . html-helper-mode) 
   auto-mode-alist))
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)

(defun my-html-helper-default-insert-timestamp ()
  "Default timestamp insertion function"
  (insert "[<EM>"
	  (current-time-string)
	  "</EM>]\n"))
(setq html-helper-timestamp-hook 'my-html-helper-default-insert-timestamp)

(setq html-helper-new-buffer-template
  '("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML Experimental 19960710//EN\">\n"
    "<!-- comment line 1 -->\n<!-- comment line 2  -->\n"
    "<HTML>\n<HEAD>\n"
    "<LINK REV=\"owns\" TITLE=\"Forename Lastname, Your City, Your Country\" HREF=\"mailto:you\@domain.com\">\n"
    "<META NAME=\"Author\" CONTENT=\"Forename Lastname\">\n"
    "<META NAME=\"DESCRIPTION\" CONTENT=\"******\">\n"  ;;; your page description
    "<META NAME=\"KEYWORDS\" CONTENT=\"******\">\n"     ;;; your page keywords
    "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html;CHARSET=iso8859-1\">\n"
    "<TITLE>" p "</TITLE>\n"
    "</HEAD>\n\n"
    "<BODY>\n"
    "<H1>" p "</H1>\n\n"
    p
    "\n\n<HR>\n"
    "<ADDRESS>" html-helper-address-string "</ADDRESS>\n"
    html-helper-timestamp-start
    html-helper-timestamp-end
    "\n</BODY>\n</HTML>\n"))

(setq html-helper-do-write-file-hooks t
      html-helper-build-new-buffer t
      html-helper-use-expert-menu t
      html-helper-address-string "<B></B>Forename Lastname <A HREF=\"mailto:you@domain.com\">&lt;you@domain.com&gt;</A><BR>The Freie Universit&auml;t is not responsible for the contents of this page."
)
;;; insert "tempo" macros in uppercase
;;(setq tempo-insert-string-functions 'upcase)

(defun german-to-html ()
   "Replace german umlauts with HTML token in current buffer"
   (interactive)
   (save-excursion
   (goto-char (point-min))
   (perform-replace "Ä" "&Auml;" nil nil nil)
   (goto-char (point-min))
   (perform-replace "ä" "&auml;" nil nil nil)
   (goto-char (point-min))
   (perform-replace "Ö" "&Ouml;" nil nil nil)
   (goto-char (point-min))
   (perform-replace "ö" "&ouml;" nil nil nil)
   (goto-char (point-min))
   (perform-replace "Ü" "&Uuml;" nil nil nil)
   (goto-char (point-min))
   (perform-replace "ü" "&uuml;" nil nil nil)
   (goto-char (point-min))
   (perform-replace "ß" "&szlig;" nil nil nil)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                          Setup some modes                            ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;; Mode for internet jargon file
;;; also a good example for the use of regular expressions with emacs
;; (setq auto-mode-alist (cons
;;                        '("[jJ]argon.*\\.\\(txt\\|ascii\\)" . jargon-mode)
;;                        auto-mode-alist))
;; (autoload 'jargon-mode "jargon-mode"
;;           "Major mode for browsing the Jargon File." t)


;; (setq auto-mode-alist
;;       (cons '("\\.\\(arc\\|zip\\|lzh\\|zoo\\)\\'" . archive-mode)
;;             auto-mode-alist))
;; (autoload 'archive-mode "arc-mode" "Major mode for editing archives." t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                         OS/2 specific setup(s)                       ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

setq lpr-switches '("-Phpdj"))  ;;; for HP Deskjet series

;;; OS/2 specific file modes - normal binary mode produces garbage
(emx-add-binary-mode "\\.exe$")
(emx-add-binary-mode "\\.com$")
;;(emx-add-binary-mode "\\.gz$")
;;(emx-add-binary-mode "\\.[Zz]$")

;;; Preserve mixed-case filenames
(setq case-fold-file-names 'preserve)

;;; Extended attributes are kept with edited (new) file
(setq backup-by-copying t)

(autoload 'faces "faces" nil t)
(require 'faces-os2)
(global-font-lock-mode t)
(setq font-lock-support-mode 'fast-lock-mode)
;;(setq font-lock-support-mode 'lazy-lock-mode)

;;; Enable OS/2 on-line help.

(autoload 'os2help "os2help" "OS/2 on-line help" t)
(setq os2help '("x:/Programme/emx/book/emxdev.ndx"
;;                "y:/ibmcpp/help/epmkwhlp.ndx"
                 ))
(global-set-key [C-f1] 'os2help)

;;; Call pm-edit-menu to let the Cut, Copy and Paste choices of the
;;; Edit menu use the OS/2 clipboard.
;;;
;;; Call pm-files-menu to let the `Open File...' and `Save Buffer As...'
;;; choices from the Files menu use OS/2's standard file dialog.
;;;
;;; Call remove-from-window-list to remove emacs.exe (the VIO window)
;;; from the Window List.  You might want to uncomment that statement
;;; if you use the PM interface and don't run Emacs manually.
;;;
;;; Call pm-session-bond to establish a bond between emacs.exe (the VIO
;;; window) and pmemacs.exe (the PM windows).  If you select emacs.exe,
;;; for instance by using the Window List, one of the PM windows will
;;; be selected instead of emacs.exe.
;;;
;;; Set the foreground and background colors of the mode line.
;;;
;;; Use `bold' face instead of `bold-italic' face for info nodes.

(if (eq window-system 'pm)
    (progn
      (pm-edit-menu)
      (pm-files-menu)
;;    (remove-from-window-list)
      (pm-session-bond t)
      (set-face-background 'modeline "cyan")
      (set-face-foreground 'modeline "black")
      (make-face 'info-node)
      (copy-face 'bold 'info-node)))

;;; Switch to ISO 8859-1 if running under X
;;; Type `M-x cp850-iso' to edit OS/2 files (code page 850) under X

;;(if (memq window-system '(x pm))
;;    (progn
;;      (require 'iso-syntax)
;;      (require 'cp850-iso)))

;;; Under OS/2, "~/.netrc" is always world-readable.  Prevent 
;;; angep-ftp from complainining about bad protection of "~/.netrc".

;; (setq ange-ftp-disable-netrc-security-check t)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                  Personal functions, extensions, etc.                ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defun region-new-buffer ()
  "Insert region into a new buffer."
  (interactive)
  (copy-region-as-kill (point) (mark))
  (switch-to-buffer (generate-new-buffer "new"))
  (yank))
(global-set-key [C-f5] '(lambda () (interactive) 
                  (region-new-buffer)))


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                        ELISP packages setup(s)                       ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;
;;; BBDB setup ;;;
;;;;;;;;;;;;;;;;;;

;;; Setup what is to be ignored in BBDB
(setq bbdb/mail-auto-create-p 'bbdb-ignore-some-messages-hook)
(setq bbdb-ignore-some-messages-alist
      '(("From" . "listserv\\|mailer\\|postmaster\\|list\\|[Bb]enutzerservice\\|root\\|[Mm]ail [Dd]elivery\\|[Aa]buse")
;;	("Originator" . "emx\\|glelist")
;;	("Sender" . "emx\\|glelist\\|maiser\\|Finance")
	("To" . "idw\\|info\\|vote")
;;	("Apparently-To" . "emtex")
;;        ("Subject" . "[Cc]onfirm")
;;	("CC" . "info\\|teach\\|supercite\\|gaussian")
;;	("Reply-To" . "trumpet\\|os2ip\\|FINANCE")
))

(setq bbdb-user-mail-names "Forename Lastname")
;;; Use European phone numbers
(setq bbdb-north-american-phone-numbers-p nil)

(require 'bbdb)
;;; set BBDB up for use with rmail (only)
(bbdb-initialize 'rmail)   

;;;;;;;;;;;;;;;;;;;;;;;
;;; MailCrypt setup ;;;
;;;;;;;;;;;;;;;;;;;;;;;

;;; Personal setup
(setq mc-pgp-path "/pgp/pgp")
(setq mc-pgp-alternate-keyring "/pgp/pubring.pgp")
;; (setq mc-pgp-comment nil)
(setq mc-passwd-timeout 600)
(setq user-login-name "Forename Lastname <you@domain.com>")

;;; General setup
(autoload 'mc-install-write-mode "mailcrypt" nil t)
(autoload 'mc-install-read-mode "mailcrypt" nil t)
(add-hook 'mail-mode-hook 'mc-install-write-mode)         ;;; for writing modes
(add-hook 'message-mode-hook 'mc-install-write-mode)      ;;; for writing modes
;;; Rmail
(add-hook 'rmail-mode-hook 'mc-install-read-mode)         ;;; for reading modes
(add-hook 'rmail-summary-mode-hook 'mc-install-read-mode) ;;; for reading modes
;;; GNUS
(add-hook 'gnus-summary-mode-hook 'mc-install-read-mode)  ;;; for reading modes
(add-hook 'news-reply-mode-hook 'mc-install-write-mode)   ;;; for writing modes

(load-library "mailcrypt")
(setq mc-setversion "2.6") ;;; Alternately, "5.0" or "gpg"

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; tm (tiny mime) package
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq mime-setup-use-sc t
      signature-insert-at-eof t
      signature-delete-blank-lines-at-eof t
      default-mime-charset 'iso-8859-1       ;;; use ISO and not x-ctext
      mime-editor/split-message nil          ;;; Don't split messages
)
(require 'mime-setup)
(require 'tm-os2)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                             Online setup                             ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Set up files and directories for IBM TCP/IP 2.0 ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(let ((etc (getenv "ETC"))
      mbox)
  (setq etc (if etc (replace-char-in-string etc ?\\ ?/)
              "x:/mptn/etc/"))
  (setq etc (expand-file-name etc))
  (if (not (string-match "/$" etc))
      (setq etc (concat etc "/")))
  (setq mbox (concat etc "mail/inbox.ndx")   ;;; Lamailer format
;;  (setq mbox (concat etc "mail/ohei")      ;;; Unix format
        rmail-spool-directory (concat etc "mail/")
        rmail-primary-inbox-list (list mbox)
        display-time-mail-file mbox
  )
)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Set up rmail, gnus and supercite ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(setq rmail-secondary-file-regexp ".*\\(RMAIL\\|[Rr]mail\\).*"
      user-mail-address "you@domain.com"
      user-full-name "Forename Lastname"  ;;; for sendmail or feedmail
      mail-default-reply-to "you@seconddomain.com (Forename Lastname)"
)

;;; send back mail or archive mail in ~outgoing (or both)
;; (setq mail-self-blind t)
(setq mail-archive-file-name (expand-file-name "~/outgoing"))

;;; Set height of header window
(setq rmail-summary-window-size 8)

;;(setq rmail-decode-mime-charset nil)
(setq sendmail-coding-system 'iso-latin-1)

;;; set up which headers not to display by default when reading mail
;;; this can be toggled with "t" in rmail
(setq rmail-ignored-headers "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:\\|^nntp-posting-host:\\|^path:\\|^x-char.*:\\|^x-face:\\|^delivered-to:\\|^lines:\\|^mime-version:\\|^content-transfer-encoding:\\|^content-disposition:\\|^x-coding-system:\\|^return-path:\\|^errors-to:\\|^return-receipt-to:\\|^x-accept-language:\\|^x-attribution:\\|^x-distribution:\\|^x-disclaimer:\\|^x-uidl:\\|^x-authenticated-.*:\\|^x-filter:\\|^envelope-to:\\|^x-mimeole:\\|^x-msmail-priority:\\|^priority: normal\\|^priority: bulk")

;;; The following forms cause "r" to respond to message with
;;; just the sender as the TO field. "R" builds a response with a
;;; CC containing all original CCs.

(defun rmail-reply-cc-just-sender ()
  "Reply to the current message. CC just sender."
  (interactive)
  (rmail-reply t))

(add-hook 'rmail-mode-hook '(lambda ()
	       (define-key rmail-mode-map "r" 
		 'rmail-reply-cc-just-sender)
	       (define-key rmail-mode-map "R" 
		 'rmail-reply)
               (local-set-key [M-C-down-mouse-1] 'make-mail-alias-menu)
))


;;; Set up additional header strings for outgoing mail
(defun my-mail-setup ()
  (end-of-buffer) (previous-line 2)
  (insert 
      "Organization: Your Organization\n"
      "X-Mailer: GNU Emacs [version "emacs-version"] for OS/2\n"
      "X-Url: http://www.domain.com/~your-home-page\n"))
(add-hook 'mail-setup-hook 'my-mail-setup)
 
(defun make-office-mail-headers ()
  "Replace (standard) mail headers with office headers."
  (interactive)
  (goto-char (point-min))
  (perform-replace "Reply-to: you@seconddomain.com" 
            "Reply-to: you@office-domain.com" nil nil nil)
  (perform-replace "Organization: Your Organization\n" 
            "Organization: Your Employer's Organization\n" nil nil nil)
  (perform-replace "X-Url: http://www.domain.com/~your-home-page" 
            "X-Url: http://www.office-domain.com/" nil nil nil)
  (perform-replace "FCC: x:/home/outgoing" 
            "FCC: x:/home/outoffice" nil nil nil)
  (move-to-left-margin))

;;; Set up additional signature for mail
(defun signature-office ()
  "Insert office signature."
  (interactive)
      (insert
       "Regards,\n"
       "Forename Lastname\n\n"
       "-- \n"
       "Your office footer here...\n"
       "Contact: Your office addresses here\n"
))

(add-hook 'mail-mode-hook '(lambda ()
               (local-set-key [?\C-c ?i] 'signature-office)
               (local-set-key "\C-c\M-w" '(lambda () (interactive) 
                    (insert-file "x:/home/.sig-office")))
               (local-set-key [?\C-c ?m] 'make-office-mail-headers)
))

(defun replace-quoted-printable ()
   "Replace quoted-printable characters in current buffer.
    Assumes ISO-8859-1 character set is being used.

    Hook this function in where appropriate, i.e. when replying
    to mail, forwarding it etc."
   (interactive)
   (save-excursion
   (goto-char (point-min))
   (perform-replace "=\n" "" nil nil nil)   ;;; must be (re-)placed before '=3D'
   (goto-char (point-min))
   (perform-replace "=09" "\t" nil nil nil) 
   (goto-char (point-min))
   (perform-replace "=20\n" " " nil nil nil)
   (goto-char (point-min))
   (perform-replace "=2E" "..." nil nil nil)
   (goto-char (point-min))
   (perform-replace "=3D" "=" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=85" "…" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=92" "'" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=95" "•" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=96" "–" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=97" "—" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=B4" "´" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=BF" "¿" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=BF" "¿" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C0" "À" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C1" "Á" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C2" "Â" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C3" "Ã" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C4" "Ä" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C5" "Å" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C6" "Æ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C7" "Ç" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C8" "È" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=C9" "É" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=CA" "Ê" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=CB" "Ë" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=CC" "Ì" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=CD" "Í" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=CE" "Î" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=CF" "Ï" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D0" "Ð" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D1" "Ñ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D2" "Ò" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D3" "Ó" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D4" "Ô" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D5" "Õ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D6" "Ö" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D7" "×" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D8" "Ø" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=D9" "Ù" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=DA" "Ú" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=DB" "Û" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=DC" "Ü" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=DD" "Ý" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=DE" "Þ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=DF" "ß" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E0" "à" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E1" "á" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E2" "â" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E3" "ã" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E4" "ä" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E5" "å" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E6" "æ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E7" "ç" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E8" "è" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=E9" "é" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=EA" "ê" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=EB" "ë" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=EC" "ì" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=ED" "í" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=EE" "î" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=EF" "ï" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F0" "ð" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F1" "ñ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F2" "ò" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F3" "ó" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F4" "ô" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F5" "õ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F6" "ö" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F7" "÷" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F8" "ø" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=F9" "ù" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=FA" "ú" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=FB" "û" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=FC" "ü" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=FD" "ý" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=FE" "þ" nil nil nil)
   (goto-char (point-min))
   (perform-replace "=FF" "ÿ" nil nil nil)))

;;; Supercite Setup
;;; Use this if it's not done by another package, e.g. tm 
;;(autoload 'sc-cite-original     "supercite" "Supercite 3.1" t)
;;(autoload 'sc-submit-bug-report "supercite" "Supercite 3.1" t)
;;(add-hook 'mail-citation-hook 'sc-cite-original)

(add-hook 'sc-attribs-preselect-hook 'replace-quoted-printable)
(setq sc-auto-fill-region-p nil)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;                             Test section                             ;;;
;;; From here on no guarantee ;-)                                        ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(my-toggle-charset)
(calendar)
(view-diary-entries 3)


;; End of site-start.el

Download this file as a ZIP archive.

previous ] [ start page ] [ next ]

Oliver Heidelbach <ohei@snafu>
snafu.de is not responsible for the content of this page.
[Tue Oct 23 22:41:21 2001]