home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.emacs:3966 gnu.emacs.help:5350
- Newsgroups: comp.emacs,gnu.emacs.help
- Path: sparky!uunet!cs.utexas.edu!torn!skule.ecf!drill.me!ie.utoronto.ca!garym
- From: garym@ie.utoronto.ca (Gary Murphy)
- Subject: Re: model for .emacs file
- Message-ID: <C0s18E.EoA@ie.utoronto.ca>
- Organization: University of Toronto, Department of Industrial Engineering
- References: <1993Jan12.154544.17064@fuug.fi>
- Date: Wed, 13 Jan 1993 05:14:37 GMT
- Lines: 973
-
- an3523@anon.penet.fi writes:
-
- >Where is info available on how to set up an .emacs file
- >(that is, the language/commands necessary)
- >thanks
-
- Why would you post this anonymously? :-)
-
- Ok, here is the .emacs I've used for years, which is actually
- .Emacs.el, and virtually all the parts for this came from
- documentation or from this newsgroup, so it is time I put somethi{g
- back. What follows is the file I start with when I get to a new site,
- and it contains numerous bits and pieces that were fixes and patches
- from other sites; I make no warrantees for the robustness or the
- appropriateness of this for your needs, and obviously, many of those
- reading this will find parts that are just plain broken or missing
- essential pieces.
-
- The good news is this was cleaned up recently for internal
- distribution with a company I was consulting with, and that means it
- comes with instructions ... enjoy ...
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; .Emacs.el -- source for an auto-recompiling .emacs.elc
- ;;
- ;; 1988 by Gary Murphy (garym@cognos.uucp)
- ;; 1992 by Gary Murphy (gary.murphy@software.mitel.com or murphyg)
- ;; 1993 by Gary Murphy (garym@virtual.rose.utoronto.ca)
- ;;
- ;; This is a cleaned-up edition of my personal emacs start-up file, pieced
- ;; together over many difference sites over many years; I won't even pretend
- ;; to understand what most of this stuff means and you are on your own if you
- ;; want to customize anything.
- ;;
- ;; To save time on starting emacs (addressing a key complaint from vi-users)
- ;; I have my start-up stored as a self-recompiling file; the first time you
- ;; compile the file, you will have the overhead of the byte-compiler in memory
- ;; but on subsequent runs, unless the .Emacs.el changes, emacs will start
- ;; more quickly and will load without the compiler (unless you byte-compile
- ;; something else)
- ;;
- ;; useful tip: if you use X-Windows, load xemacs with a '-font screen' option
- ;;
- ;; Installation:
- ;;
- ;; 1) copy this file to .Emacs.el in your root directory
- ;;
- ;; 2) copy any relevant .el files from my home ~/emacs directory*
- ;; in particular, you may want the following:
- ;;
- ;; mail-aliases.el code-stuff.el gnus-speedups.el gnus-wrap.el
- ;; mail-abbrevs.el shell-complete.el
- ;;
- ;; * I am lobbying to have most of this moved to the emacs/lisp/local
- ;; directory where it belongs.
- ;;
- ;; 3) make a home emacs directory and add the following line to your .cshrc file:
- ;;
- ;; setenv EMACSLOADPATH ~/emacs:/usr/tools/emacs/lisp/local:/usr/tools/emacs/lisp
- ;;
- ;; 4) edit this file with emacs, changing occurances of USER to your login name
- ;; this is most easily done with the M-% command
- ;;
- ;; 5) M-x eval-current-buffer
- ;;
- ;; 6) have fun
- ;;
- ;; -- the planning is with the many; the decision is done alone --
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;; detect out of date start-up file and recompile.
- ;; note that this will keep the byte-compiler loaded for the duration
- ;; of the new session.
-
- (defun Wait! ()
- "If ~/.Emacs.el exists and is newer than ~/.emacs, recompile it to ~/.Emacs.elc and move the compiled version to ~/.emacs."
- (cond
- ((file-newer-than-file-p "~/.Emacs.el" "~/.emacs")
- (let ((mode-line-format "") (mode-line-inverse-video nil))
- (message "please standby: recompiling .Emacs.el ...")
- (sit-for 1)
- (byte-compile-file "~/.Emacs.el")
- (rename-file "~/.Emacs.elc" "~/.emacs" t))
- (load "~/.emacs" t t t)
- (message ".emacs recompiled")
- (sit-for 2)
- )))
-
- (Wait!)
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; standard libraries to be included ...
- ;; ------------------------------------------------------------------------
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Rmail -
- ;; This sets your emacs environment to use the M-x rmail command
- ;;
- (setq rmail-primary-inbox-list (list "/usr/mail/garym"
- (expand-file-name "~/Mail/mbox")))
-
- ;; set-up for the rmailout.el
- ;;
- ;; the output list will automagically set the file name when you save messages
- ;; in RMAIL format, something I almost never do ;-)
-
- (setq rmail-output-directory (expand-file-name "~/Mail"))
- (setq rmail-output-files-alist
- '(
- ("Subj.*ISS" "ISS")
- ("-.*begin" "../ppa.new")
- ("To:.*pp[ac]" "mu")
- ("To:.*nativenet" "nn")
- ))
- (load-library "rmailout")
-
- ;; change the quoting char and reply only to sender
-
- (defun new-rmail-reply (recipients-too)
- "Reply to the sender of the current message.
- Prefix argument means CC: all other recipients of original message."
- (interactive "P")
- (rmail-reply (not recipients-too))
- (mail-yank-original 0)
- (goto-char 1)
- (re-search-forward mail-header-separator nil t)
- (replace-regexp "^" ">"))
-
- ;;; set up the z key to reply to sender & include message
- (setq rmail-mode-hook
- '(lambda ()
- (define-key rmail-mode-map "z" 'new-rmail-reply)))
-
-
- ;; minibuffer command history on C-n C-p
- ;; (load-library "site/minibuf-mem")
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; automagically loaded libraries:
- ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ;; You may or may not have these available at your site. If you are interested
- ;; in something here and it doesn't seem to exist, you can take a copy from
- ;; /home/staff/murphyg/emacs (if I have it)
-
- ;; - comments and source files
- (autoload 'code-comment-mode "code-stuff.el"
- "Major mode for adding comments to source code." t)
-
- (autoload 'code-mode "code-stuff.el"
- "Major mode for editing source code." t)
-
- ;; - a shell for each directory
- (autoload 'sh "sh" "Shell mode with buffer per directory" t)
-
- ;; - shell completion
- (autoload 'my-shell-complete "shell-complete" "shell completion" t)
- (autoload 'my-shell-completion-help
- "shell-complete" "shell completion list" t)
-
- ;; - get around the mitel rmail preempting:
- ;; (autoload 'rmail "/usr/tools/emacs/lisp/rmail" nil t)
-
- ;; - filename completion, even in shells or with envirnment vars
- (autoload 'complete-filename "filename" nil t)
- (setq shell-mode-hook
- (function (lambda () (local-set-key "\^I" 'complete-filename))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; GNU Smalltalk system
-
- (setq auto-mode-alist
- (append '(("\\.st" . smalltalk-mode))
- auto-mode-alist))
-
- (autoload 'smalltalk-mode "/system/util/gnu/smalltalk-1.1/st.elc"
- "GNU SmallTalk Version 1.1" t)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; GNUS - emacs news reader
- ;;
- ;; I much prefer gnus over rn for handling my news. Admittedly it is
- ;; many times slower than rn, but if you get a copy of my speedup code
- ;; it is quite acceptable. You shouldn't be reading news anyway ;-)
-
- (autoload 'gnus "gnus-wrap" "Network News." t)
- (autoload 'gnus-post-news "gnuspost" "Posting Network News." t )
-
- ;;; set gnus up
- (setq gnus-default-article-saver 'gnus-Subject-save-in-mail)
- (setq gnus-default-distribution "na")
- (setq gnus-interactive-post nil)
- (setq gnus-auto-select-next "quietly")
- (setq gnus-auto-center-subject nil)
-
- ;;; NOTE NOTE NOTE: the getenv "HOST" below gets an environment
- ;;; variable that is automagically set by the tcsh shell. If you use
- ;;; the csh shell, you can either change the (getenv "HOST") to
- ;;; "yourmachine" or you can add a line to your .login as follows:
- ;;; setenv HOST `hostname`
- (setq gnus-nntp-server (getenv "HOST"))
-
- (setq gnus-your-domain "Software.Mitel.COM")
-
- ;;; define your favorite description of your organization.
- (setq gnus-your-organization "Applications Software II, MITEL Corporation, Kanata, Ontario, Canada")
-
- (setq gnus-nntp-service nil)
- (setq gnus-use-generic-from t)
- (setq nnspool-active-file "/usr/spool/news/lib/active")
- (setq nnspool-history-file "/usr/spool/news/lib/history")
-
- ;;; put your mail directory in here
- (setq gnus-article-save-directory "~/Mail/")
- (setq gnus-novice-user nil)
-
- ;;; hooks - got it from the net, don't remember what it does, but I
- ;;; remember wanting to use it.
- (setq gnus-Article-mode-hook
- '(lambda ()
- (kill-local-variable 'global-mode-string)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; set-up unix and keybinding environment stuff
- ;;
- ;; because I like to use the backspace key, I bind help to M-x
- ;; rather than C-h
-
- (setq lpr-command "print")
- (setq lpr-switches (list "-2r"))
- (setq tab-width 4)
- (global-set-key "\b" 'delete-backward-char)
- (global-set-key "\M-o" 'mark-paragraph)
- (global-set-key "\M-h" 'help-for-help)
- (define-key global-map "\M-s" 'save-buffer)
- (setq default-tab-width 4)
- (setq dired-listing-switches "-algot")
-
- ;some SUN keypad definitions
- (global-set-key "*dr" 'beginning-of-line)
- (global-set-key "*fr" 'end-of-line)
-
- ; extra keys for NeWS and sunview
- ;;(global-set-key "\M-[208z" 'search-forward)
- ;;(global-set-key "\M-[211z" 'search-backward)
- ;;(global-set-key "\M-[209z" 'research-forward)
- ;;(global-set-key "\M-[212z" 'research-backward)
-
- ;some VT220 keypad bindings
- ;(setq term-setup-hook 'my-vt220-keys)
- ;;(if (eq (string-match "vt[123]" (getenv "TERM")) 0)
- ;; (setq term-setup-hook 'my-vt220-keys)
- ;;)
-
- (setq c-mode-hook
- '(lambda ()
- (local-set-key "
- " 'newline-and-indent)
- (local-set-key "OPB" 'compile)
- (local-set-key "OPn" 'next-error)
- (set-fill-column 77)
- (auto-fill-mode 1)
- )
- )
-
- (setq emacs-lisp-mode-hook
- '(lambda ()
- (local-set-key "
- " 'newline-and-indent))
- )
-
- (setq fundamental-mode-hook
- '(lambda ()
- (local-set-key "
- " 'newline-and-indent))
- )
-
- ;;; set up shell mode
-
- (setq shell-mode-hook '(lambda ()
- ; (local-set-key "\C-u" 'kill-shell-input-maybe)
- ; (local-set-key "\C-a" 'shell-beginning-of-line-maybe)
- (local-set-key "^[\C-i" 'my-shell-completion-help)
- (local-set-key "\C-c\C-i" 'my-shell-complete)
- (local-set-key " " 'my-shell-complete))
- )
-
- (setq text-mode-hook
- '(lambda ()
- (set-fill-column 72)
- (auto-fill-mode 1)
- (setq paragraph-start (quote "^$\\|^"))
- (setq indent-line-function 'indent-relative-maybe)
- (setq auto-fill-hook
- '(lambda ()
- (do-auto-fill)
- )
- )
- (setq auto-fill-function
- '(lambda ()
- (do-auto-fill)
- )
- )
- ; (setq fill-prefix (get-fill-prefix))
- ; (setq paragraph-separate (quote "^[.]\\|^@[a-zA-Z][^({[]"))
- )
- )
-
- (defun shell-script-mode ()
- "Major mode for editing shell scripts."
- (interactive)
- (text-mode)
- (set-fill-column 132)
- ; (auto-fill-mode 1)
- (setq mode-name "Shell Script")
- (local-set-key "
- " 'newline-and-indent)
- (setq indent-line-function 'indent-relative-maybe)
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; - RMail mods
- ;(defun mail-read-aliases nil
- ; "Read the mail aliases database from ~/EMACSLOADPATH/mail-aliases.el"
- ; (interactive)
- ; (load "mail-aliases" nil t)
- ; ; The above file defines the association list: imail-aliases
- ; (setq mail-aliases nil) ; Disable the built-in alias mechanism
- ;)
-
- ;(mail-read-aliases)
-
- ;(setq mail-mode-hook
- ; '(lambda nil
- ; (define-key mail-mode-map "\C-c\C-a" 'mail-interactive-insert-alias)
- ; (set-fill-column 72)
- ; (auto-fill-mode 1)
- ; (setq tab-stop-list (list 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90))
- ;; (setq mail-mode-hook nil)
- ; )
- ;)
- ;
- ;(defun mail-interactive-insert-alias nil
- ; "Insert a mail alias."
- ; (interactive)
- ; (insert (or
- ; (cdr-safe (assoc
- ; (completing-read "Pick an alias: "
- ; imail-aliases nil t) imail-aliases))
- ; "")))
-
- ;; modify behaviour of send-mail-function
- (setq send-mail-function (function (lambda ()
- (interactive)
- ; (ding)
- (if (y-or-n-p "Add .signature? ")
- (mail-signature)
- ; (error ".signature not added.")
- )
- (if (y-or-n-p "Really send? ")
- (sendmail-send-it)
- (error "Send Aborted")
- )
- )
- )
- )
-
- ;;You could probably do it with:
- ;; modify behaviour of send-mail-function to add ~/.signature
- ;(setq send-mail-function (function (lambda ()
- ; (interactive)
- ; (mail-signature)
- ; (sendmail-send-it))))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; recording outgoing mail:
-
- (setq mail-archive-file-name "/usr/people/garym/Mail/rmail.out")
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; shell name completion
- (defvar shell-word-regexp "\\s-"
- "*Regexp delimiting words on shell command lines.")
-
- (defun shell-mode-fns ()
- "Add special shell mode functions."
- (define-key shell-mode-map "\C-c." 'copy-last-shell-word)
- (define-key shell-mode-map "\M-\t" 'complete-last-shell-word))
-
- (defun copy-last-shell-word ()
- "Copy the last word from the previous shell input and insert before point."
- (interactive)
- (let ((last-word-start (unwind-protect
- (save-excursion
- (goto-char last-input-end)
- (backward-char 1)
- (re-search-backward shell-word-regexp)
- (forward-char 1)
- (max last-input-start (point-marker))))))
- (insert (buffer-substring last-input-end last-word-start))
- (delete-char -1)))
-
- (defun complete-last-shell-word ()
- "Perform filename completion on the last word of the current line."
- (interactive)
- (let* ((end (point))
- (beg (unwind-protect
- (save-excursion
- (re-search-backward shell-word-regexp)
- (forward-char 1)
- (max (marker-position (process-mark (get-buffer-process
- (current-buffer))))
- (point)))))
- (pattern (buffer-substring beg end))
- (file (file-name-nondirectory pattern))
- (dir (cond ((file-name-directory pattern))
- (default-directory)))
- (completion (file-name-completion file dir)))
- (cond ((eq completion t))
- ((null completion)
- (message "No completions for \"%s\"" pattern)
- (ding))
- ((not (string= file completion))
- (delete-region beg end)
- (insert (concat (file-name-directory pattern) completion)))
- (t
- (message "Making Completion list...")
- (with-output-to-temp-buffer " *Completions*"
- (display-completion-list
- (file-name-all-completions file dir)))
- (message "Making completion list...%s" "done")))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; set the status line to contain the current host
-
- (setq short-hostname
- (substring (system-name) 0 (string-match "\\." (system-name))))
-
- (setq-default mode-line-format
- '("--%1*%1*-" mode-line-buffer-identification " " global-mode-string
- " %[("
- mode-name minor-mode-alist "%n" mode-line-process
- ")%]----"
- (-3 . "%p")
- "----<"
- short-hostname
- ">-%-")
- )
- (display-time)
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Restore previous environment (if any)
- ;;(load-library "em-config.el")
- ;;(emc-restore)
-
- ;; Follow the above with this code to enable saving of Emacs state
- ;; when quitting a session:
-
- (defun save-buffers-kill-emacs (&optional arg)
- "Offer to save each buffer, save file configuration, then kill this Emacs fork.
- With prefix arg, silently save all file-visiting buffers, then kill."
- (interactive "P")
- (save-some-buffers arg t)
- ;; (emc-save)
- (kill-emacs))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; matching braces:
- (defun match-paren (arg)
- "Go to the matching parenthesis if on parenthesis otherwise insert %."
- (interactive "p")
- (cond
- ((looking-at "[([{]") (forward-sexp 1) (backward-char))
- ((looking-at "[])}]") (forward-char) (backward-sexp 1))
- (t (self-insert-command (or arg 1)))))
-
- (global-set-key "%" 'match-paren)
-
- ;;Just put the cursor on a { [ or ( and hit '%' and it'll jump to the
- ;;matching { [ or (.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; all set ... lets go emacs!
- (server-start)
- ;;--
- ;;Gary Lawrence Murphy ---------------- garym@virtual.rose.utoronto.ca
- ;;279 Fifth Avenue/Ottawa Ontario/Canada K1S 2N4 ------ (613) 230-6255
- ;;The true destination is always just here, now ----------------------
-
- From garym@virtual.rose.utoronto.ca Wed Jan 6 14:41:15 1993
- Date: Wed, 6 Jan 1993 13:56:16 -0500
- From: Gary Lawrence Murphy <garym@virtual.rose.utoronto.ca>
- To: garym@ie.utoronto.ca
- Subject: emacs.el
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; .Emacs.el -- source for an auto-recompiling .emacs.elc
- ;;
- ;; 1988 by Gary Murphy (garym@cognos.uucp)
- ;; 1992 by Gary Murphy (gary.murphy@software.mitel.com or murphyg)
- ;; 1993 by Gary Murphy (garym@virtual.rose.utoronto.ca)
- ;;
- ;; This is a cleaned-up edition of my personal emacs start-up file, pieced
- ;; together over many difference sites over many years; I won't even pretend
- ;; to understand what most of this stuff means and you are on your own if you
- ;; want to customize anything.
- ;;
- ;; To save time on starting emacs (addressing a key complaint from vi-users)
- ;; I have my start-up stored as a self-recompiling file; the first time you
- ;; compile the file, you will have the overhead of the byte-compiler in memory
- ;; but on subsequent runs, unless the .Emacs.el changes, emacs will start
- ;; more quickly and will load without the compiler (unless you byte-compile
- ;; something else)
- ;;
- ;; useful tip: if you use X-Windows, load xemacs with a '-font screen' option
- ;;
- ;; Installation:
- ;;
- ;; 1) copy this file to .Emacs.el in your root directory
- ;;
- ;; 2) copy any relevant .el files from my home ~/emacs directory*
- ;; in particular, you may want the following:
- ;;
- ;; mail-aliases.el code-stuff.el gnus-speedups.el gnus-wrap.el
- ;; mail-abbrevs.el shell-complete.el
- ;;
- ;; * I am lobbying to have most of this moved to the emacs/lisp/local
- ;; directory where it belongs.
- ;;
- ;; 3) make a home emacs directory and add the following line to your .cshrc file:
- ;;
- ;; setenv EMACSLOADPATH ~/emacs:/usr/tools/emacs/lisp/local:/usr/tools/emacs/lisp
- ;;
- ;; 4) edit this file with emacs, changing occurances of USER to your login name
- ;; this is most easily done with the M-% command
- ;;
- ;; 5) M-x eval-current-buffer
- ;;
- ;; 6) have fun
- ;;
- ;; -- the planning is with the many; the decision is done alone --
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-
- ;; detect out of date start-up file and recompile.
- ;; note that this will keep the byte-compiler loaded for the duration
- ;; of the new session.
-
- (defun Wait! ()
- "If ~/.Emacs.el exists and is newer than ~/.emacs, recompile it to ~/.Emacs.elc and move the compiled version to ~/.emacs."
- (cond
- ((file-newer-than-file-p "~/.Emacs.el" "~/.emacs")
- (let ((mode-line-format "") (mode-line-inverse-video nil))
- (message "please standby: recompiling .Emacs.el ...")
- (sit-for 1)
- (byte-compile-file "~/.Emacs.el")
- (rename-file "~/.Emacs.elc" "~/.emacs" t))
- (load "~/.emacs" t t t)
- (message ".emacs recompiled")
- (sit-for 2)
- )))
-
- (Wait!)
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; standard libraries to be included ...
- ;; ------------------------------------------------------------------------
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Rmail -
- ;; This sets your emacs environment to use the M-x rmail command
- ;;
- (setq rmail-primary-inbox-list (list "/usr/mail/garym"
- (expand-file-name "~/Mail/mbox")))
-
- ;; set-up for the rmailout.el
- ;;
- ;; the output list will automagically set the file name when you save messages
- ;; in RMAIL format, something I almost never do ;-)
-
- (setq rmail-output-directory (expand-file-name "~/Mail"))
- (setq rmail-output-files-alist
- '(
- ("Subj.*ISS" "ISS")
- ("-.*begin" "../ppa.new")
- ("To:.*pp[ac]" "mu")
- ("To:.*nativenet" "nn")
- ))
- (load-library "rmailout")
-
- ;; change the quoting char and reply only to sender
-
- (defun new-rmail-reply (recipients-too)
- "Reply to the sender of the current message.
- Prefix argument means CC: all other recipients of original message."
- (interactive "P")
- (rmail-reply (not recipients-too))
- (mail-yank-original 0)
- (goto-char 1)
- (re-search-forward mail-header-separator nil t)
- (replace-regexp "^" ">"))
-
- ;;; set up the z key to reply to sender & include message
- (setq rmail-mode-hook
- '(lambda ()
- (define-key rmail-mode-map "z" 'new-rmail-reply)))
-
-
- ;; minibuffer command history on C-n C-p
- ;; (load-library "site/minibuf-mem")
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;;
- ;; automagically loaded libraries:
- ;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ;; You may or may not have these available at your site. If you are interested
- ;; in something here and it doesn't seem to exist, you can take a copy from
- ;; /home/staff/murphyg/emacs (if I have it)
-
- ;; - comments and source files
- (autoload 'code-comment-mode "code-stuff.el"
- "Major mode for adding comments to source code." t)
-
- (autoload 'code-mode "code-stuff.el"
- "Major mode for editing source code." t)
-
- ;; - a shell for each directory
- (autoload 'sh "sh" "Shell mode with buffer per directory" t)
-
- ;; - shell completion
- (autoload 'my-shell-complete "shell-complete" "shell completion" t)
- (autoload 'my-shell-completion-help
- "shell-complete" "shell completion list" t)
-
- ;; - get around the mitel rmail preempting:
- ;; (autoload 'rmail "/usr/tools/emacs/lisp/rmail" nil t)
-
- ;; - get around a bug in the installation at virtual.rose:
- (autoload 'rmail "/usr/local/emacs/lisp/rmail" nil t)
- (autoload 'sendmail "/usr/local/emacs/lisp/sendmail" nil t)
-
- ;; - filename completion, even in shells or with envirnment vars
- (autoload 'complete-filename "filename" nil t)
- (setq shell-mode-hook
- (function (lambda () (local-set-key "\^I" 'complete-filename))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; GNU Smalltalk system
-
- (setq auto-mode-alist
- (append '(("\\.st" . smalltalk-mode))
- auto-mode-alist))
-
- (autoload 'smalltalk-mode "/system/util/gnu/smalltalk-1.1/st.elc"
- "GNU SmallTalk Version 1.1" t)
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; GNUS - emacs news reader
- ;;
- ;; I much prefer gnus over rn for handling my news. Admittedly it is
- ;; many times slower than rn, but if you get a copy of my speedup code
- ;; it is quite acceptable. You shouldn't be reading news anyway ;-)
-
- (autoload 'gnus "gnus-wrap" "Network News." t)
- (autoload 'gnus-post-news "gnuspost" "Posting Network News." t )
-
- ;;; set gnus up
- (setq gnus-default-article-saver 'gnus-Subject-save-in-mail)
- (setq gnus-default-distribution "na")
- (setq gnus-interactive-post nil)
- (setq gnus-auto-select-next "quietly")
- (setq gnus-auto-center-subject nil)
-
- ;;; NOTE NOTE NOTE: the getenv "HOST" below gets an environment
- ;;; variable that is automagically set by the tcsh shell. If you use
- ;;; the csh shell, you can either change the (getenv "HOST") to
- ;;; "yourmachine" or you can add a line to your .login as follows:
- ;;; setenv HOST `hostname`
- (setq gnus-nntp-server (getenv "HOST"))
-
- (setq gnus-your-domain "Software.Mitel.COM")
-
- ;;; define your favorite description of your organization.
- (setq gnus-your-organization "Applications Software II, MITEL Corporation, Kanata, Ontario, Canada")
-
- (setq gnus-nntp-service nil)
- (setq gnus-use-generic-from t)
- (setq nnspool-active-file "/usr/spool/news/lib/active")
- (setq nnspool-history-file "/usr/spool/news/lib/history")
-
- ;;; put your mail directory in here
- (setq gnus-article-save-directory "~/Mail/")
- (setq gnus-novice-user nil)
-
- ;;; hooks - got it from the net, don't remember what it does, but I
- ;;; remember wanting to use it.
- (setq gnus-Article-mode-hook
- '(lambda ()
- (kill-local-variable 'global-mode-string)))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; set-up unix and keybinding environment stuff
- ;;
- ;; because I like to use the backspace key, I bind help to M-x
- ;; rather than C-h
-
- (setq lpr-command "print")
- (setq lpr-switches (list "-2r"))
- (setq tab-width 4)
- (global-set-key "\b" 'delete-backward-char)
- (global-set-key "\M-o" 'mark-paragraph)
- (global-set-key "\M-h" 'help-for-help)
- (define-key global-map "\M-s" 'save-buffer)
- (setq default-tab-width 4)
- (setq dired-listing-switches "-algot")
-
- ;some SUN keypad definitions
- (global-set-key "*dr" 'beginning-of-line)
- (global-set-key "*fr" 'end-of-line)
-
- ; extra keys for NeWS and sunview
- ;;(global-set-key "\M-[208z" 'search-forward)
- ;;(global-set-key "\M-[211z" 'search-backward)
- ;;(global-set-key "\M-[209z" 'research-forward)
- ;;(global-set-key "\M-[212z" 'research-backward)
-
- ;some VT220 keypad bindings
- ;(setq term-setup-hook 'my-vt220-keys)
- ;;(if (eq (string-match "vt[123]" (getenv "TERM")) 0)
- ;; (setq term-setup-hook 'my-vt220-keys)
- ;;)
-
- (setq c-mode-hook
- '(lambda ()
- (local-set-key "
- " 'newline-and-indent)
- (local-set-key "OPB" 'compile)
- (local-set-key "OPn" 'next-error)
- (set-fill-column 77)
- (auto-fill-mode 1)
- )
- )
-
- (setq emacs-lisp-mode-hook
- '(lambda ()
- (local-set-key "
- " 'newline-and-indent))
- )
-
- (setq fundamental-mode-hook
- '(lambda ()
- (local-set-key "
- " 'newline-and-indent))
- )
-
- ;;; set up shell mode
-
- (setq shell-mode-hook '(lambda ()
- ; (local-set-key "\C-u" 'kill-shell-input-maybe)
- ; (local-set-key "\C-a" 'shell-beginning-of-line-maybe)
- (local-set-key "^[\C-i" 'my-shell-completion-help)
- (local-set-key "\C-c\C-i" 'my-shell-complete)
- (local-set-key " " 'my-shell-complete))
- )
-
- (setq text-mode-hook
- '(lambda ()
- (set-fill-column 72)
- (auto-fill-mode 1)
- (setq paragraph-start (quote "^$\\|^"))
- (setq indent-line-function 'indent-relative-maybe)
- (setq auto-fill-hook
- '(lambda ()
- (do-auto-fill)
- )
- )
- (setq auto-fill-function
- '(lambda ()
- (do-auto-fill)
- )
- )
- ; (setq fill-prefix (get-fill-prefix))
- ; (setq paragraph-separate (quote "^[.]\\|^@[a-zA-Z][^({[]"))
- )
- )
-
- (defun shell-script-mode ()
- "Major mode for editing shell scripts."
- (interactive)
- (text-mode)
- (set-fill-column 132)
- ; (auto-fill-mode 1)
- (setq mode-name "Shell Script")
- (local-set-key "
- " 'newline-and-indent)
- (setq indent-line-function 'indent-relative-maybe)
- )
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; - RMail mods
- (defun mail-read-aliases nil
- "Read the mail aliases database from ~/EMACSLOADPATH/mail-aliases.el"
- (interactive)
- (load "mail-aliases" nil t)
- ; The above file defines the association list: imail-aliases
- (setq mail-aliases nil) ; Disable the built-in alias mechanism
- )
-
- (mail-read-aliases)
-
- (setq mail-mode-hook
- '(lambda nil
- (define-key mail-mode-map "\C-c\C-a" 'mail-interactive-insert-alias)
- (set-fill-column 72)
- (auto-fill-mode 1)
- (setq tab-stop-list (list 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90))
- ; (setq mail-mode-hook nil)
- )
- )
-
- (defun mail-interactive-insert-alias nil
- "Insert a mail alias."
- (interactive)
- (insert (or
- (cdr-safe (assoc
- (completing-read "Pick an alias: "
- imail-aliases nil t) imail-aliases))
- "")))
-
- ;; modify behaviour of send-mail-function
- (setq send-mail-function (function (lambda ()
- (interactive)
- ; (ding)
- (if (y-or-n-p "Add .signature? ")
- (mail-signature)
- ; (error ".signature not added.")
- )
- (if (y-or-n-p "Really send? ")
- (sendmail-send-it)
- (error "Send Aborted")
- )
- )
- )
- )
-
- ;;You could probably do it with:
- ;; modify behaviour of send-mail-function to add ~/.signature
- ;(setq send-mail-function (function (lambda ()
- ; (interactive)
- ; (mail-signature)
- ; (sendmail-send-it))))
-
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; recording outgoing mail:
-
- (setq mail-archive-file-name "/home/garym/Mail/rmail.out")
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; shell name completion
- (defvar shell-word-regexp "\\s-"
- "*Regexp delimiting words on shell command lines.")
-
- (defun shell-mode-fns ()
- "Add special shell mode functions."
- (define-key shell-mode-map "\C-c." 'copy-last-shell-word)
- (define-key shell-mode-map "\M-\t" 'complete-last-shell-word))
-
- (defun copy-last-shell-word ()
- "Copy the last word from the previous shell input and insert before point."
- (interactive)
- (let ((last-word-start (unwind-protect
- (save-excursion
- (goto-char last-input-end)
- (backward-char 1)
- (re-search-backward shell-word-regexp)
- (forward-char 1)
- (max last-input-start (point-marker))))))
- (insert (buffer-substring last-input-end last-word-start))
- (delete-char -1)))
-
- (defun complete-last-shell-word ()
- "Perform filename completion on the last word of the current line."
- (interactive)
- (let* ((end (point))
- (beg (unwind-protect
- (save-excursion
- (re-search-backward shell-word-regexp)
- (forward-char 1)
- (max (marker-position (process-mark (get-buffer-process
- (current-buffer))))
- (point)))))
- (pattern (buffer-substring beg end))
- (file (file-name-nondirectory pattern))
- (dir (cond ((file-name-directory pattern))
- (default-directory)))
- (completion (file-name-completion file dir)))
- (cond ((eq completion t))
- ((null completion)
- (message "No completions for \"%s\"" pattern)
- (ding))
- ((not (string= file completion))
- (delete-region beg end)
- (insert (concat (file-name-directory pattern) completion)))
- (t
- (message "Making Completion list...")
- (with-output-to-temp-buffer " *Completions*"
- (display-completion-list
- (file-name-all-completions file dir)))
- (message "Making completion list...%s" "done")))))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; set the status line to contain the current host
-
- (setq short-hostname
- (substring (system-name) 0 (string-match "\\." (system-name))))
-
- (setq-default mode-line-format
- '("--%1*%1*-" mode-line-buffer-identification " " global-mode-string
- " %[("
- mode-name minor-mode-alist "%n" mode-line-process
- ")%]----"
- (-3 . "%p")
- "----<"
- short-hostname
- ">-%-")
- )
- (display-time)
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; Restore previous environment (if any)
- ;;(load-library "em-config.el")
- ;;(emc-restore)
-
- ;; Follow the above with this code to enable saving of Emacs state
- ;; when quitting a session:
-
- (defun save-buffers-kill-emacs (&optional arg)
- "Offer to save each buffer, save file configuration, then kill this Emacs fork.
- With prefix arg, silently save all file-visiting buffers, then kill."
- (interactive "P")
- (save-some-buffers arg t)
- ;; (emc-save)
- (kill-emacs))
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; matching braces:
- (defun match-paren (arg)
- "Go to the matching parenthesis if on parenthesis otherwise insert %."
- (interactive "p")
- (cond
- ((looking-at "[([{]") (forward-sexp 1) (backward-char))
- ((looking-at "[])}]") (forward-char) (backward-sexp 1))
- (t (self-insert-command (or arg 1)))))
-
- (global-set-key "%" 'match-paren)
-
- ;;Just put the cursor on a { [ or ( and hit '%' and it'll jump to the
- ;;matching { [ or (.
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ;; all set ... lets go emacs!
- (server-start)
- ;;--
- ;;Gary Lawrence Murphy ---------------- garym@virtual.rose.utoronto.ca
- ;;279 Fifth Avenue/Ottawa Ontario/Canada K1S 2N4 ------ (613) 230-6255
- ;;The true destination is always just here, now ----------------------
-
- --
- Gary Lawrence Murphy ---------------- garym@virtual.rose.utoronto.ca
- University of Toronto, Industrial Eng Dept fax: (416) 971-1373
- 4 Taddle Creek Rd, Toronto, Ont M5S 1A4 voice: (416) 978-3776
- The true destination is always just here, now ----------------------
-