;must be put here to be included into packages which are loaded later:
(setq load-path (cons (expand-file-name "~/elisp/html-helper-mode") load-path))
(setq load-path (cons (expand-file-name "~/elisp/autoinsert") load-path))
(setq load-path (cons (expand-file-name "~/elisp") load-path))
; This goes in /usr/share/emacs/20.2/lisp/subdirs.el !
;(normal-top-level-add-to-load-path '("apel" "flim" "semi"))
;(xterm-mouse-mode t) ; make mouse work in text windows
(transient-mark-mode t) ; show incremental search results
(setq scroll-step 1) ; don't scroll in large jumps
(setq require-final-newline t) ; every file has at least one new line
(setq inhibit-startup-message t) ; disable start up screen
(global-font-lock-mode t 1) ; enable syntax highlighting
(line-number-mode t) ; show line numbers and time in status line
; show line numbers and time in status line
(setq display-time-24hr-format nil)
(display-time)
; ------- Libraries:
(require 'auto-insert-tkld)
(require 'wicos)
(require 'crypt++)
(require 'filladapt)
;(require 'fa-extras)
(require 'header)
;(require 'flashparen) (flash-matching-mode 1)
(require 'rsearch)
(load-library '"browse")
;(load-library '"comment")
(load-library '"stardate")
;; easy commenting out of lines
(autoload 'comment-out-region "comment" nil t)
(global-set-key "\C-c;" 'comment-region)
(global-set-key "\C-c:" 'uncomment-region)
;;;-------- Autoloads:
;;== perl-mode:
(autoload 'perl-mode "perl"
"alternate mode for editing Perl programs" t)
(setq auto-mode-alist
(append '(("\\.[pP][Llm]$" . perl-mode)) auto-mode-alist ))
(setq interpreter-mode-alist (append interpreter-mode-alist
'(("miniperl" . perl-mode))))
;;== html-helper-mode:
(autoload 'html-helper-mode "html-helper-mode" "Yay HTML" t)
(setq auto-mode-alist (cons '("\\.html$" . html-helper-mode) auto-mode-alist))
(setq html-helper-do-write-file-hooks t)
(setq html-helper-build-new-buffer t)
(setq html-helper-address-string
"J. E. Hetrick
[jhetrick@uop.edu]")
;== cc-mode:
(autoload 'c++-mode "cc-mode" "C++ Editing Mode" t)
(autoload 'c-mode "cc-mode" "C Editing Mode" t)
(setq auto-mode-alist
(append '(("\\.C$" . c++-mode)
("\\.H$" . c++-mode)
; ("\\.cc$" . c++-mode)
("\\.c$" . c-mode) ; to edit C code
("\\.h$" . c-mode) ; to edit C code
) auto-mode-alist))
;(setq c-mode-common-hook
; '(lambda () (or (file-exists-p "makefile") (file-exists-p "Makefile")
; (progn (make-local-variable 'compile-command)
; (setq compile-command
; (concat "make MAIN="
; buffer-file-name))))))
(setq c-basic-offset 3)
(defun cc-fill-para ()
(interactive)
(re-search-backward "^[ \t]*$" nil t nil)
(beginning-of-line)
(next-line 1)
(while (looking-at "^.")
(c-indent-command)
(next-line 1)
(beginning-of-line)))
(setq compilation-finish-function 'jh-end-compile)
(defun jh-end-compile (buf msg)
(message (concat "Compilation: " (substring msg 0 (1- (length msg)))))
(let ((visible-bell nil))
(beep) (sleep-for 1) (beep)))
;== Auto-Insert-TKLD:
(setq auto-insert-path (cons "~/elisp/autoinsert/" auto-insert-path))
(setq auto-insert-alist '(("\\.tex$" . "LaTeX")
("\\.texinfo$" . "TeXinfo")
("\\.cc$" . "C++")
("\\.C$" . "C++")
("\\.c$" . "C")
("\\.H$" . "C Include")
("\\.h[+p]*$" . "C Include")
("\\.el$" . "Emacs Lisp")
("[]>:/]\\..*emacs" . "Emacs Lisp")
("[Mm]akefile" . "Makefile")
("\\.bib$" . "LaTeX")
("\\.sh$" . "Sh")
("\\.csh$" . "Csh")
("\\.[1-8]$" . "Manual Page")
("\\.man$" . "Manual Page")
("\\.pl$" . "Perl")
("\\.prl$" . "Phys Rev Lett: referee report")
("\\.pr[a-e]$" . "Phys Rev A-E: referee report")))
(setq auto-insert-type-alist '(("LaTeX" . "latex-insert.tex")
("TeXinfo" . "texinfo-insert.texinfo")
("C" . "c-insert.c")
("C Include" . "h-insert.h")
("C++" . "c++-insert.C")
("Emacs Lisp" . "elisp-insert.el")
("Makefile" . "makefile.inc")
("Perl" . "perl-insert.pl")
("Tcsh" . "tcsh-insert.csh")
("Csh" . "csh-insert.csh")
("Sh" . "sh-insert.sh")
("Manual Page" . "nroff-insert.man")
("Test" . "test-insert")
("Phys Rev Lett: referee report" .
"prl-insert.prl")
("Phys Rev A-E: referee report" .
"prd-insert.prd")))
;== rsearch:
;(rsearch-highlight t) ; use the 'highlight face
(rsearch-define-key [f7] [S-f7]) ; binds F7 and ShiftS-F7
(rsearch-define-key "\C-cr" "\C-cR")
;== browse:
(autoload 'browse-file "browse" nil t) ;Find file and enter browse mode.
(autoload 'browse-file-other-window "browse" nil t)
(autoload 'browse-mode "browse" nil t) ;Browse mode
;== Mathematica interface:
(autoload 'math "math" "Starts Mathematica" t)
(autoload 'math-mode "math"
"Mode for editing Mathematica. Loading will result in more info." t)
;== ispell -3 !
;(autoload 'ispell-word "ispell3"
; "Check the spelling of word in buffer." t)
;(define-key global-map "\e$" 'ispell-word)
;(autoload 'ispell-region "ispell3"
; "Check the spelling of region." t)
;(autoload 'ispell-buffer "ispell3"
; "Check the spelling of buffer." t)
;(autoload 'ispell-complete-word "ispell3"
; "Look up current word in dictionary and try to complete it." t)
;(autoload 'ispell-change-dictionary "ispell3"
; "Change ispell dictionary." t)
; ---------- various setq's ----------
; --- basic stuff:
(setq inhibit-startup-message t)
(setq default-major-mode 'text-mode)
;(setq text-mode-hook 'turn-on-auto-fill)
(put 'narrow-to-region 'disabled nil)
(setq scroll-step 1)
(setq search-exit-char -1)
(setq line-number-mode t)
; --- browse init !?
;(defvar browse-mode nil)
; --- ange-ftp/efs:
;(setq ange-ftp-generate-anonymous-password "hetrick@physics.arizona.edu")
;; --- Dired:
;(setq dired-listing-switches "-laF")
;(add-hook 'dired-load-hook
; (function
; (lambda ()
; (load "dired-x19")
; (setq dired-tex-unclean-extensions
; '(".toc" ".log" ".dvi" ".aux"))
; (define-key dired-mode-map "\ec" 'dired-do-gzip)
; (define-key dired-mode-map "\eu" 'dired-do-ungzip)
; (define-key dired-mode-map "R" 'dired-do-rename)
; (define-key dired-mode-map "b" 'dired-browse-file)
; (define-key dired-mode-map "r" 'dired-rmail))))
;
;
;
;; --- browse a file from dired
;(defun dired-browse-file ()
; (interactive)
; (if (file-directory-p (dired-get-filename))
; (or (dired-goto-subdir (dired-get-filename))
; (dired (dired-get-filename)))
; (browse-file (dired-get-filename))))
;;; --------------------Regular TeX mode:
;(setq latex-run-command "latex2e")
(setq tex-dvi-view-command "xdvi *")
(setq tex-dvi-print-command "dvips *")
;(setq tex-alt-dvi-print-command "dvips -f * | lpr -Ppopov; lpqnobeep -Pps3")
(setq tex-show-queue-command "lpq")
(setq tex-shell-file-name "/bin/csh")
(setq tex-offer-save nil)
; --- Ep-mode:
;(setq ep-mailer "vm")
;(setq ep-auto-summarize t)
;(setq ep-summary-size "full")
;(setq ep-mailer-autodetect t)
; --- Mathematica mode stuff:
(if (not (string-match "artemis.cop.uop.edu" (or (getenv "MYHOST") "")))
(setq math-remote-host "artemis.cop.uop.edu"))
;(if (string-match "unix:0" (or (getenv "DISPLAY") ""))
(if (or (getenv "DISPLAY") nil)
(setq math-display-var "cliodhna.cop.uop.edu:0")
(setq math-display-var nil))
(setq math-indent-cookie-message "-- emacs: -*- math-mode -*-")
; --- RMAIL stuff
(setq rmail-delete-after-output t)
(setq jh-next-field-switch t)
(defun jh-toggle-next-field ()
"Toggles next-filed-or-newline function on <-> off."
(interactive)
(if jh-next-field-switch
(setq jh-next-field-switch nil)
(setq jh-next-field-switch t))
(message (concat "Auto curson is "
(prin1-to-string jh-next-field-switch))))
(setq mail-setup-hook
(function
(lambda ()
(define-key mail-mode-map "\C-c\C-o" 'jh-toggle-next-field)
(mail-abbrevs-setup))))
;(setq rmail-file-name "~/LET/.rmail")
(setq rmail-file-name "~/LET/.bnl")
(setq rmail-ignored-headers "^X400\\|^Received")
(setq mail-archive-file-name "~/LET/outgoing")
(setq mail-default-reply-to "hetrick@cliodhna.cop.uop.edu")
;--rmailgen.el:
(setq rmail-default-directory "~/LET/") ; must end in slash
(add-hook 'mail-mode-hook
(function (lambda ()
(setq mail-archive-file-name
"~/LET/outgoing"))))
(setq rmail-generate-archive-file-name t)
(setq rmail-generate-downcase t)
(if (not (boundp 'rmail-output-file-alist))
(defvar rmail-output-file-alist nil))
(require 'rmailgen)
;; More Larry Dodd stuff:
(add-hook 'rmail-mode-hook
(function (lambda ()
(define-key rmail-mode-map "m" 'rmail-mail)
(define-key rmail-mode-map "M" 'rmail-mail-no-fcc)
(define-key rmail-mode-map "r"
'rmail-reply-just-to-sender)
(define-key rmail-mode-map "R" 'rmail-reply))))
(defun rmail-reply-just-to-sender (reply-to-everyone)
(interactive "P")
(rmail-reply (not reply-to-everyone)))
(setq rmail-enable-mime t)
; ---------- various handy functions ---------------
(defun browse-url (url)
(shell-command (concat "netscape -remote \'openURL(" url ")\'"))
(message (concat "calling netscape on: " url "...")))
(setq h-filename "")
(defun put-func-in-h-file ()
"Takes line defining function and makes prototype entry in .h file"
(interactive)
(if (string= h-filename "")
(if (string-match "\\.c" (buffer-name))
(setq h-filename
(concat (substring (buffer-name) 0 (match-beginning 0))
".h"))))
(setq h-filename-input (read-string (concat ".h file? [" h-filename "]:")))
(if (not (string= h-filename-input ""))
(setq h-filename h-filename-input))
(push-mark (point) "NOMSG")
(re-search-forward "{" nil t nil)
(kill-new (buffer-substring (region-beginning) (region-end)))
(message (concat "Making prototype in " h-filename))
(pop-mark)
(find-file-other-window h-filename)
(goto-char (point-max))
(re-search-backward ";" nil t nil)
(next-line 1)
(insert-string (current-kill 0))
(re-search-backward ")" nil t nil)
(forward-char 1)
(kill-line)
(insert-string ";\n"))
;; This function by Randal L. Schwartz :
(defun see-key ()
"Displays characters typed, terminated by a 3-second timeout."
(interactive)
(let ((chars "")
(inhibit-quit t))
(message "Enter characters, terminated by 3-second timeout.")
(while (not (sit-for 3))
(setq chars (concat chars (list (read-char)))
quit-flag nil)) ; quit-flag maybe set by C-g
(message "Characters entered: %s" (key-description chars))))
;;; Make multiple TABs scroll completions
;; Morten Welinder, terra@diku.dk
(defun minibuf-tab ()
"Like `minibuffer-complete', but if you use this repeatedly it will scroll
the window showing completions."
(interactive)
(or (eq last-command this-command) (setq minibuffer-scroll-window nil))
(if minibuffer-scroll-window
(save-excursion
(set-buffer (window-buffer minibuffer-scroll-window))
(if (pos-visible-in-window-p (point-max) minibuffer-scroll-window)
(set-window-start minibuffer-scroll-window (point-min))
(scroll-other-window)))
(minibuffer-complete)))
(define-key minibuffer-local-must-match-map "\t" 'minibuf-tab)
(define-key minibuffer-local-completion-map "\t" 'minibuf-tab)
;;; Make the *scratch* buffer behave like "The thing your aunt gave you,
;;; which you don't know what is."
(save-excursion
(set-buffer (get-buffer-create "*scratch*"))
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer))
(defun kill-scratch-buffer ()
(interactive)
;; The next line is just in case someone calls this manually
(set-buffer (get-buffer-create "*scratch*"))
;; Kill the current (*scratch*) buffer
(remove-hook 'kill-buffer-query-functions 'kill-scratch-buffer)
(kill-buffer (current-buffer))
;; Make a brand new *scratch* buffer
(set-buffer (get-buffer-create "*scratch*"))
(lisp-interaction-mode)
(make-local-variable 'kill-buffer-query-functions)
(add-hook 'kill-buffer-query-functions 'kill-scratch-buffer)
;; Since we killed it, don't let caller do that.
nil)
(defun fill-buffer ()
(interactive)
(fill-paragraph nil)
(while (re-search-forward "\n\n" nil t nil)
; (next-line 1)
(fill-paragraph nil)))
(defun mark-here-to-end ()
(interactive)
(set-mark (point))
(goto-char (point-max))
(exchange-point-and-mark)
(message "Marked region: here to end of buffer"))
(defun deb-on ()
(interactive)
(setq debug-on-error t))
(defun shrink-to-fit ()
(interactive)
(if (> (count-lines (window-start) (point-max))
(- (frame-height) window-min-height))
(message "buffer bigger"))
(if (< (count-lines (window-start) (point-max)) (window-height))
(while (pos-visible-in-window-p (point-max) (selected-window))
(shrink-window 1))))
(defun jh-buf-menu ()
(interactive)
(buffer-menu nil))
; (shrink-to-fit))
(setq my-num 0)
(defun insert-n++ (arg)
"Insert the value of my-num and increment it.
Argument not equal to one sets my-num"
(interactive "p")
(if (= arg 1)
(progn
(setq my-num (1+ my-num))
(insert (int-to-string my-num)))
(progn
(setq my-num arg)
(insert (int-to-string my-num)))))
(defun kill-whole-line ()
"Kill whole of line to kill buffer.
Use multiple times to get several lines into kill buffer"
(interactive)
(progn
(beginning-of-line 1)
(kill-line 1)))
(defun copy-line ()
"Copy remainder of line + linefeed to kill buffer.
Use multiple times to copy several lines"
(interactive)
(push-mark (point) "NOMSG")
(next-line 1)
(beginning-of-line 1)
(copy-region-as-kill (region-beginning) (region-end))
(message "line copied")
(pop-mark))
(defun byte-compile-this-one ()
"Save current buffer and byte-compile-file it"
(interactive)
(save-buffer)
(byte-compile-file (buffer-file-name)))
(defun insert-date ()
"Insert current date into buffer"
(interactive)
(progn
(set-mark-command nil)
(shell-command "date" 1)
(exchange-point-and-mark)
(backward-char 1)
(delete-char 1)))
(defun kill-buffers ()
"Kill all buffers, asking permission on unmodified ones."
(interactive)
(let ((list (buffer-list)))
(while list
(let* ((buffer (car list))
(name (buffer-name buffer)))
(and (not (string-equal name ""))
(kill-buffer buffer)))
(setq list (cdr list))))
(cd "~")
(delete-other-windows)
(message "Zap!"))
(defun kill-to-beg ()
(interactive)
(set-mark (point))
(beginning-of-line)
(kill-region (mark) (point)))
(defun top-buf ()
(interactive)
(goto-char (point-min)))
(defun bot-buf ()
(interactive)
(goto-char (point-max)))
(define-key global-map "%" 'match-paren)
(defun match-paren (arg)
"Go to the matching parenthesis if on parenthesis otherwise insert %."
(interactive "p")
(cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
((looking-at "\\s\)") (forward-char 1) (backward-list 1))
(t (self-insert-command (or arg 1)))))
(defun kill-line-twice (&optional numlines)
"Acts like normal kill except kills entire line if at beginning"
(interactive "p")
(cond ( (or (= (current-column) 0) (> numlines 1)) (kill-line numlines) )
( t (kill-line) )))
(defun kill-buffer-and-window ()
"Kills the buffer and its window"
(interactive)
(kill-buffer (current-buffer))
(delete-window))
(defun kill-other-buffer-and-window ()
"Kills the other buffer and its window"
(interactive)
(other-window 1)
(kill-buffer (current-buffer))
(delete-window))
(defun join ()
"Join the next line to the end of the current line. Leave only 1 space."
(interactive)
(end-of-line 1)
(delete-char 1)
(just-one-space))
(defun copy-and-notify ()
(interactive)
(copy-region-as-kill (point) (mark))
(message "region copied"))
(defun line-column ()
"Print line and column numbers"
(interactive)
(let ( (col (current-column)) )
(save-restriction
(widen)
(save-excursion
(beginning-of-line)
(message "Line: %d Column: %d"
(1+ (count-lines 1 (point)))
col)))))
;; Enscript the region with two columns and font Courier7 to ps3
(defun enscript-region (enscript-title)
(interactive "sTitle: ")
(shell-command-on-region
(region-beginning)
(region-end)
(concat "nenscript \'-b" enscript-title
"\' -fCourier7 -2rG -L64 -p- | lpr")))
;; Enscript the buffer with two columns and font Courier7 to ps3
(defun enscript-buffer (enscript-title)
(interactive "sTitle: ")
(shell-command-on-region
(point-min)
(point-max)
(concat "nenscript \'-b" enscript-title
"\' -fCourier7 -2rG -L64 -p- | lpr")))
;; Vgrind the buffer:
(defun vgrind-buffer ()
(interactive)
(shell-command-on-region
(point-min)
(point-max)
(concat "vgrind -t | lpr")))
; Fill paragraphs in an entire file
(defun fill-buffer ()
(interactive)
(fill-region (point-min) (point-max)))
(defun half-up ()
(interactive)
(scroll-up (/ (window-height) 2)))
(defun half-down ()
(interactive)
(scroll-down (/ (window-height) 2)))
(defun show-my-keys ()
(interactive)
(browse-file-other-window "~/elisp/dot-emacs.el")
(re-search-forward "^; --------Keyboard Customization-------")
(beginning-of-line)
(next-line 1)
(set-window-start (selected-window) (point)))
(defun browse-help ()
(interactive)
(pop-to-buffer "*Help*")
(browse-mode))
; --------Keyboard Customization-------
;=======================================
(global-set-key "\C-h" 'backward-delete-char)
(define-key global-map "\C-h" 'backward-delete-char)
(define-key global-map "\C-xd" 'insert-date)
; in lieu of C-arrow
(define-key global-map "\C-f" 'forward-word)
(define-key global-map "\C-b" 'backward-word)
; MicroEMACSisms:
(define-key global-map "\C-k" 'kill-line-twice)
(define-key global-map "\ez" 'save-buffer)
(define-key global-map "\e " 'set-mark-command)
;; F-Keys:
;(define-key global-map [prior] 'scroll-down) ;Page Up
;(define-key global-map [next] 'scroll-up) ;Page Down
;(define-key global-map [C-prior] 'top-buf) ;Ctl Page Down
;(define-key global-map [C-next] 'bot-buf) ;Ctl Page Up
;(define-key global-map [home] 'beginning-of-line) ;Home
;(define-key global-map [end] 'end-of-line) ;End
;(define-key global-map [f1] 'save-buffer) ;F1
;(define-key global-map [f2] 'write-region) ;F2
;(define-key global-map [f3] 'mark-here-to-end) ;F3
;(define-key global-map [f4] 'compile) ;F4
;(define-key global-map [f5] 'help-for-help) ;F5
;(define-key global-map [f6] 'imenu) ;F6
; ;f7 = research ;F7 = research
;(define-key global-map [f8] 'compile) ;F8
;(define-key global-map [C-up]
; '(lambda () (interactive)
; (goto-char (window-start))))
;(define-key global-map [C-down]
; '(lambda () (interactive)
; (goto-char (1- (window-end)))))
;; S-F-Keys: ...
;(define-key global-map [S-f1] 'rmail) ;S-F1
;(define-key global-map [S-f2] 'gnus) ;S-F2
;(define-key global-map [S-f3] 'fetch-link-under-point) ;S-F3
;; C-F-Keys:
;(define-key global-map [C-f1] 'rmail-input) ;C-F1
;(define-key global-map [C-f2] '(rmail-input "~/News")) ;C-F2
;(define-key global-map [C-f3] 'todo-list) ;C-F3
; C-x
(define-key ctl-x-map "\C-k" 'kill-buffers)
(define-key global-map "\C-x\C-b" 'jh-buf-menu)
(define-key global-map "\C-xx" 'exchange-point-and-mark)
(define-key global-map "\C-x*" 'browse-mode)
(define-key global-map "\C-x\C-l" 'goto-line)
(define-key global-map "\C-xK" 'kill-buffer-and-window)
(define-key global-map "\C-xn" 'find-alternate-file)
(define-key global-map "\C-xR" 'rmail-input)
(define-key global-map "\C-xv" 'browse-file)
; C-x4
(define-key global-map "\C-x4*" 'browse-file-other-window)
(define-key global-map "\C-x4K" 'kill-other-buffer-and-window)
(define-key global-map "\C-x4k" 'kill-other-buffer-and-window)
(define-key global-map "\C-x4v" 'browse-file-other-window)
; M-
(define-key global-map "\eQ" 'fill-buffer)
(define-key global-map "\ew" 'copy-and-notify)
(define-key global-map "\e<" 'top-buf)
(define-key global-map "\e>" 'bot-buf)
(define-key global-map "\ek" 'kill-to-beg)
(define-key global-map "\e&" 'query-replace-regexp)
; C-c
(define-key global-map "\C-cd" 'half-up)
(define-key global-map "\C-cu" 'half-down)
(define-key global-map "\C-c*" 'Info-elisp-ref)
(define-key global-map "\C-ca" 'ep-mode)
(define-key global-map "\C-cB" 'byte-compile-this-one)
(define-key global-map "\C-ce" 'enscript-buffer)
(define-key global-map "\C-cv" 'vgrind-buffer)
(define-key global-map "\C-ch" 'browse-help)
(define-key global-map "\C-ci" 'insert-auto-insert-type)
(define-key global-map "\C-cj" 'join)
(define-key global-map "\C-ck" 'kill-whole-line)
(define-key global-map "\C-cn" 'insert-n++)
(define-key global-map "\C-cs" 'insert-stardate)
(define-key global-map "\C-ct" 'todo-list)
;(define-key global-map "\C-ct" 'thesaurus-lookup-word-in-text)
(define-key global-map "\C-cy" 'copy-line)
;(define-key global-map "\C-c;" 'yic-comment-region)
;(define-key global-map "\C-c:" 'yic-uncomment-region)
(define-key global-map "\C-cp" 'put-func-in-h-file)
(define-key global-map "\e$" 'ispell-word)
;--------Mode enhancements:
(define-key Buffer-menu-mode-map "w" 'kill-buffer-and-window)
; ------ Terminal Interface:
;(display-time)
(setq term-setup-hook
(function
(lambda ()
(cond (window-system-version
; X-Windows
;; mouse:
(setq x-pointer-shape x-pointer-trek)
; (set-mouse-color "white")
; (require 'paren)
;colors
; (set-face-foreground 'modeline "White")
; (set-face-background 'modeline "Red")
; (set-face-foreground 'region "Black")
; (set-face-background 'region "Green")
; DEC station:
(define-key global-map "\eOP" [?\e]) ; F1
(define-key function-key-map [f1] [?\e]) ; F1 -> ESC
; Sun station:
(define-key global-map [f29] 'scroll-down)
(define-key global-map [f35] 'scroll-up)
(define-key global-map [C-f29] 'top-buf)
(define-key global-map [C-f35] 'bot-buf)
(if (string-match "artemis.cop.uop.edu" (or (getenv "HOST") ""))
(progn
(setq hilit-background-mode 'dark)
(load-library '"hilit19")
(set-face-background 'modeline "RoyalBlue")
(set-face-foreground 'modeline "Yellow")))
(if (string-match "xterm" (or (getenv "TERM") ""))
(progn
(setq hilit-background-mode 'dark)
(load-library '"hilit19")
(set-face-background 'modeline "RoyalBlue")
(set-face-foreground 'modeline "Yellow") ))
(if (string-match ":0" (or (getenv "DISPLAY") ""))
(progn
(setq hilit-background-mode 'dark)
(load-library '"hilit19")
(set-face-background 'modeline "Purple")
(set-face-foreground 'modeline "Yellow") ""))
) ;end of X-windows hook
; VT-100
((string-match "\\`vt100" (or (getenv "TERM") ""))
; (load-library '"vt100")
; arrows
(define-key global-map "\e[i" 'forward-word)
(define-key global-map "\e[j" 'backward-word)
(define-key global-map "\e[A" 'previous-line)
(define-key global-map "\e[B" 'next-line)
(define-key global-map "\e[C" 'forward-char)
(define-key global-map "\e[D" 'backward-char)
; (define-key global-map "\eOP" 'save-buffer) ; F1
(define-key global-map "\eOQ" 'write-region) ; F2
; (define-key global-map "\e[N" 'write-region) ; F2
(define-key global-map "\eOR" 'mark-here-to-end) ; F3
; (define-key global-map "\e[O" 'mark-here-to-end) ; F3
(define-key global-map "\eOS" 'compile) ; F4
; (define-key global-map "\e[t" 'quoted-insert) ; F5
(define-key global-map "\e[Q" 'quoted-insert) ; F5
; (define-key global-map "\eOu" 'imenu) ; F6
; (define-key global-map "\e[R" 'imenu) ; F6
(define-key global-map "\eOx" 'imenu) ; F6
;proc (rsearch-define-key "\eOq" "\eOs") ;F7/S-F7 to rsearch
;pcvt (rsearch-define-key "\e[S" "\e[e") ;F7/S-F7 to rsearch
(rsearch-define-key "\eOy" "\eOp") ;F7/S-F7 to rsearch
; (define-key global-map "\eOr" 'compile) ; F8
; (define-key global-map "\e[T" 'compile) ; F8
(define-key global-map "\eOm" 'compile) ; F8
(define-key global-map "\eOv" 'rmail) ; S-F1
; (define-key global-map "\eOS" 'gnus) ; S-F2
; (define-key global-map "\eOy" 'fetch-link-under-point); S-F3
; (define-key global-map "\eOm" 'shrink-to-fit) ; S-F4
; (define-key global-map "\eOv" 'eval-buffer) ; S-F5
; (define-key global-map "\eOl" 'quoted-insert) ; S-F6
; (define-key global-map "\e[" nil) ;undefine M-bracket
; (define-key global-map "\e[H\e[2J" 'scroll-up) ;C-PgUP
; (define-key global-map "\e[M" 'scroll-down) ;C-PgDn
; (set-input-mode nil nil t)
; poor man's xbiff
(defvar mail-pending nil "True if mail is already waiting.")
; (add-hook 'display-time-hook 'beep-when-mail-arrives)
(defun beep-when-mail-arrives ()
(cond ((string-match "Mail" display-time-string)
(cond ((not mail-pending)
(beep) (beep) (beep)
(setq mail-pending t))))
(t
(setq mail-pending nil))))
))
)))