Article View: gnu.epoch.misc
Article #1178Here's another sample `dot.emacs' type thing
From: Garrett Wollman
Date: Sun, 25 Oct 1992 00:24
Date: Sun, 25 Oct 1992 00:24
216 lines
7258 bytes
7258 bytes
This is what I do whenever I start up Epoch. Like many people, I
habve enough customizations that loading them takes a considerable
amount of time unless they are byte-compiled. So, my .emacs file
looks like this:
------------------------------------
(setq load-path (cons (expand-file-name "~/bin") load-path))
(load "misc-init")
(load "mail-init")
(load "mode-init")
(if (boundp 'epoch::version)
(load "epoch-init")) ; This is the file reproduced below
;;; Local Options:
(put 'local-options 'packages '(bbdb postscript-mode rcs-mode lispdir crypt dired-extras vm supercite auc-tex ilisp lightbrite superman perl-mode))
(put 'local-options 'imacs 'imacs-complain)
(put 'local-options 'mouse 'use-hyperbole)
(put 'local-options 'suspend 'uvm-suspend)
(put 'local-options 'backspace 'uvm-backspace)
(put 'local-options 'xoff 'xoff-hack)
------------------------------------
I will be posting our local-options.el, default.el, and
emacs-local.texi to gnu.emacs.sources one of these days; anyone who is
interested in that can contact me for more information.
I generated `~/misc/emacs.xbm' through the intercession of `icontopbm
emacs.icon | pbmtoxbm > emacs.xbm', using the `emacs.icon' file
provided in Emacs's `etc' directory. It actually looks a bit more
like a bathroom sink, but it's better than a big `X'.
This is what my epoch-init.el file looks like:
------------------------------------
;;
;; Epoch-specific things to load
;;
(require 'scr-pool) ; screen-pool management
;;
;; I often lose work when I exit Epoch accidentally. This puts in a
;; yes-or-no question to make sure that this doesn't happen. (Now that
;; this is here, I haven't once needed to use it.
;;
(defun safe-save-buffers-kill-emacs ()
(interactive)
(if (yes-or-no-p "Really kill Emacs ")
(save-buffers-kill-emacs)))
(global-set-key "\C-x\C-c" 'safe-save-buffers-kill-emacs)
;;
;; Set up screen-titles.
;;
(load "scr-title")
(setq screen-title-is-buffer-name t)
(setq auto-raise-screen t)
;;
;; I don't really like the way this works just yet.
;;
(defun vm-other-screen ()
(interactive)
(set-buffer (find-file-other-screen vm-primary-inbox))
(vm-mode))
;;
;; Pool of screens to be used for mail sending
;;
(defvar mail-other-screen-pool
nil
"Pool of screens used for dealing with mail messages.")
(setq mail-other-screen-pool
(pool:create 5 'mail-create-screen 'mail-screen-cleanup))
;;
;; This cleanup function is called by the pool-management code.
;;
(defun mail-screen-cleanup (scr)
"Re-cycle a screen in the pool before using it for something else."
(mapraised-screen scr)
(select-screen scr)
(kill-buffer (current-buffer))
(mail)
(mail-make-unique-name "Outgoing Mail"))
;;
;; This function is called by the pool manager to get a new screen.
;;
(defun mail-create-screen ()
"Create a screen for the mail-other-screen-pool."
(let ((scr (create-screen)))
(epoch::icon-pixmap "/usr/include/X11/bitmaps/flagdown" scr)
(mapraised-screen scr)
(warp-mouse 0 0 scr)
(select-screen scr)
(mail)
(mail-make-unique-name "Outgoing Mail")))
(defun mail-make-unique-name (str)
"Rename the buffer to have a unique name starting with STR."
(let ((i 0)
(name str))
(while (get-buffer name)
(setq i (1+ i))
(setq name (format "%s<%d>" str i)))
(rename-buffer name)))
;;
;; How to get rid of a buffer after sending mail. This doesn't work quite
;; right jsut yet.
;;
(defun my-mail-send-and-exit (arg)
(interactive "P")
(pool:mark-screen mail-other-screen-pool (current-screen))
(let ((to (mail-fetch-field "To")))
(mail-make-unique-name (concat "sent mail to " to)))
(mail-send)
(set-buffer-modified-p nil)
(if (not arg)
(unmap-screen (current-screen))))
;;
;; How to send mail in another window. Like mail-other-window,
;; with some aspects of vm-mail, but smarter.
;;
(defun mail-other-screen ()
(interactive)
(pool:get-screen mail-other-screen-pool)
(local-set-key "\C-c\C-c" 'my-mail-send-and-exit)
(setq allowed-screens (list (current-screen))))
;;
;; Set up key bindings...
;;
(global-set-key "\C-x8" 'other-screen-prefix)
(global-set-key "\C-x7" 'epoch-cmds-prefix)
(global-set-key "\C-x8\C-y" 'vm-other-screen)
(global-set-key "\C-x8m" 'mail-other-screen)
(global-unset-key "\C-z")
;;
;; Pretty mode lines
;;
;; Marc A. says that the mode-line bug is gone in 4.2, if only I didn't
;; use different-sized fonts in my mode-line. Grrr.... and awaiting
;; 4.3.
;;
(defvar mode-line-star-style (make-style))
(set-style-background mode-line-star-style "white")
(set-style-foreground mode-line-star-style "#224262")
(defvar mode-line-buffer-style (make-style))
(set-style-foreground mode-line-buffer-style "red")
(set-style-background mode-line-buffer-style "white")
(set-style-font mode-line-buffer-style
"-b&h-lucidabright-demibold-r-*-*-*-120-100-100-*-1")
(defvar mode-line-mode-style (make-style))
(set-style-foreground mode-line-mode-style "green")
(set-style-background mode-line-mode-style "white")
(set-style-font mode-line-mode-style
"-b&h-lucidabright-demibold-r-*-*-*-120-100-100-*-1")
(defvar mode-line-nav-style (make-style))
(set-style-background mode-line-nav-style "white")
(set-style-foreground mode-line-nav-style "#224262")
(set-style-font mode-line-nav-style
"-bitstream-charter-bold-i-*-*-*-120-100-100-*-1")
(setq info-mode-line-format default-mode-line-format)
(setq default-mode-line-format
(list
""
'mode-line-star-style
'mode-line-modified
'mode-line-buffer-style
'mode-line-buffer-identification
'mode-line-star-style
" "
'mode-line-mode-style
'global-mode-string
" %[("
'mode-name 'minor-mode-alist "%n" 'mode-line-process
")%]"
'mode-line-star-style
"----"
'mode-line-nav-style
(cons -3 "%p")
'mode-line-star-style
"-%-"))
(defun my-info-mode-hook ()
"Re-sets Info's mode line to be the old default."
(setq mode-line-format info-mode-line-format))
(epoch::icon-pixmap (expand-file-name "~/misc/emacs.xbm"))
------------------------------------
-GAWollman
--
Garrett A. Wollman | Shashish is simple, it's discreet, it's brief. ...
wollman@emba.uvm.edu | Shashish is the bonding of hearts in spite of distance.
uvm-gen!wollman | It is a bond more powerful than absence. We like people
UVM disagrees. | who like Shashish. - Claude McKenzie + Florent Vollant
Technical Details
Message-ID:
<1992Oct25.002437.11929@uvm.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!emba-news.uvm.edu!trantor.emba.uvm.edu!wollmanShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,d3cdf6a77bcae754,start X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1992-10-24 08:43:56 PST Newsgroups: gnu.epoch.misc Path: arc1-ca.pugleaf.net!sparky!uunet!emba-news.uvm.edu!trantor.emba.uvm.edu!wollman From: wollman@trantor.emba.uvm.edu (Garrett Wollman) Subject: Here's another sample `dot.emacs' type thing Message-ID: <1992Oct25.002437.11929@uvm.edu> Sender: news@uvm.edu Organization: University of Vermont, EMBA Computer Facility Date: Sun, 25 Oct 1992 00:24:37 GMT Lines: 216