gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

start-opt.el - miscellaneous customizations


From: Drew Adams
Subject: start-opt.el - miscellaneous customizations
Date: Tue, 16 Jan 2001 21:35:20 -0500

;;; start-opt.el --- Customizations to be done at the end of startup.
;; 
;; Filename: start-opt.el
;; Description: Customizations to be done at the end of startup.
;; Author: Drew Adams
;; Maintainer: Drew Adams
;; Copyright (C) 1995-2001, Drew Adams, all rights reserved.
;; Created: Thu Dec 28 09:15:00 1995
;; Version: $Id: start-opt.el,v 1.8 2001/01/09 22:26:42 dadams Exp $
;; Last-Updated: Tue Jan  9 14:26:17 2001
;;           By: dadams
;;     Update #: 1459
;; Keywords: local
;; Compatibility: GNU Emacs 20.x
;; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 
;;; Commentary:
;;
;;     Customizations to be done at the end of startup.
;;
;;  The following bindings are made here for `command-history-map':
;;
;;    `e'        `electric-command-history'
;;    `m'        `repeat-matching-complex-command'
;;
;;  Bindings for the following commands are optionally replaced here
;;  by bindings to substitute commands:
;;
;;    `clipboard-kill-region', `delete-window', `eval-expression',
;;    `eval-last-sexp', `kill-buffer', `kill-region', `list-buffers',
;;    `query-replace', `save-buffers-kill-emacs',
;;
;;  Bindings that would try to modify buffers in these modes have been
;;  removed: Dired, Buffer-menu, Compilation.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 
;;; Change log:
;; 
;; RCS $Log: start-opt.el,v $
;; RCS Revision 1.8  2001/01/09 22:26:42  dadams
;; RCS Adapted file header for Emacs Lisp Archive.
;; RCS
;; RCS Revision 1.7  2001/01/03 17:46:58  dadams
;; RCS *** empty log message ***
;; RCS
;; RCS Revision 1.6  2001/01/03 01:19:28  dadams
;; RCS *** empty log message ***
;; RCS
;; RCS Revision 1.5  2000/12/07 19:56:53  dadams
;; RCS Added require of shrink-fit-all.el.
;; RCS
;; RCS Revision 1.4  2000/11/28 20:38:04  dadams
;; RCS Optional require's via 3rd arg=t now.
;; RCS
;; RCS Revision 1.3  2000/11/01 15:43:48  dadams
;; RCS Added add-hooks for idl-mode-hook.
;; RCS
;; RCS Revision 1.2  2000/09/27 22:23:26  dadams
;; RCS 1. Require frame-cmds.el.
;; RCS 2. Removed: drews-lisp-dir.
;; RCS 3. Added: add-hook temp-buffer-show-hook fit-frame-if-one-window.
;; RCS
;; RCS Revision 1.1  2000/09/14 17:24:13  dadams
;; RCS Initial revision
;; RCS
; Revision 1.15  1999/09/03  09:01:43  dadams
; 1. Require def-face-const.el when compile.
; 2. Define red- and blue-face-foreground via define-face-const.
; 3. comparison-map: defconst -> defvar.
;
; Revision 1.14  1999/09/02  08:00:45  dadams
; Protected substitute-key-definition's with fboundp and global vars.
; Added substitute-key-definition's for delete/iconify-window,
;       query-replace-w-options, buffer-menu.
;
; Revision 1.13  1999/08/30  13:14:50  dadams
; Added more c++-mode suffixes (lxx, ixx, gxx, pxx to auto-mode-alist.
;
; Revision 1.12  1999/08/30  11:50:52  dadams
; Added: c-mode-common-hook.
;
; Revision 1.11  1999/08/26  09:36:14  dadams
; Removed add-hook buffer-menu-mode-hook (done in buff-menu.el).
;
; Revision 1.10  1999/08/25  13:01:51  dadams
; 1. Removed F option from dired-listing-switches when Windows NT.
; 2. Added suffix htm to auto-mode-alist (for Windows).
; 3. Removed header-copyright-notice assignment.
; 4. Changed from [print] key to [pause] key (because of Windows).
; 5. Removed key bindings for *declp* commands.
;
; Revision 1.9  1999/04/09  13:49:44  dadams
; compilation-mode-hook: turn-on-font-lock -> font-lock-fontify-buffer.
;
; Revision 1.8  1999/04/02  14:50:31  dadams
; 1. (require 'faces) -> (require 'faces+).
; 2. Don't bother protecting set-face-* & make-face, since required.
;
; Revision 1.7  1999/04/02  14:40:28  dadams
; Added: (require 'faces).
;
; Revision 1.6  1999/04/02  08:38:37  dadams
; Added standard face redefinitions, new faces: red & blue foreground.
;
; Revision 1.5  1999/04/01  16:00:27  dadams
; Added: eval-after-load "ediff" -> set faces.
;
; Revision 1.4  1999/04/01  14:01:13  dadams
; Put back add-hook...turn-on-font-lock (global-font-lock-mode not enough).
;
; Revision 1.3  1999/04/01  13:08:43  dadams
; global-font-lock-mode instead of add-hook turn-on-font-lock.
;
; Revision 1.2  1999/03/17  16:38:01  dadams
; 1. Removed require: std-faces, help, misc-fns, pp.
; 2. Removed require (compile): chistory,font-lock+,frame-cmds,shell,ediff+.
; 3. Removed: setq rcs-default-co-switches, gnus-window-configuration.
; 4. Temp removed: ediff faces & hooks & ediff-split-window-function.
; 5. Added: ediff-grab-mouse.
; 6. Removed: hilit stuff, Hiding & ISO-Acc in minor-mode-alist, html-helper*
;    stuff, yow & haiku stuff, abbrev-file-name stuff, save-abbrevs,
;    display-time-day-and-date, dired-latex-unclean..., tex* stuff, hexl-iso,
;    comint & shell stuff, word completion, setup-for-fortran-comments,
;    define-shell-completion-keys.
; 7. gc-cons-threshold: 10 x -> 4 x the default.
; 8. Removed from auto-mode-alist: *.tex, [Mm]akefile, *.temp, *.TEMP.
; 9. Don't turn on line-number-mode.
; 10. Don't put dired-virtual-mode in auto-mode-alist.
; 11. Added require (compile only): chistory.
; 12. Removed keys: delete-compare-window-overlays, complete, highlight, yank
;    as [C-insert], insert-register, kill-region as [C-delete],
;    backward-kill-sexp,  [*prior], [*previous], [*next], [*home], [*end],
;    no-longer s-region-bind, no-longer pp-rebind-eval-keys, no longer
;    substitute execute-extended-command-and-check-for-bindings.
; 13. Moved insert-file to [C-M-S-insert] from [S-insert]; kill-paragraph from
;     [S-delete] to [C-delete]; backward-kill-paragraph from [S-backspace] to
;     [C-backspace].
; 14. Added require: iso-transl. Autoload help-iso-prefix., misc-fns.
; 15. hooks: turn-on-font-lock-if-not-too-big -> turn-on-font-lock; removed:
;     gnus hooks, rmail hooks, outline-minor-mode hooks.
;
; Revision 1.1  1997/03/19  10:05:03  dadams
; Initial revision
;
; Revision 1.41  1997/03/18  09:52:34  dadams
; add-hook html-helper-mode-hook -> turn-on-font-lock-if-not-too-big
; add-hook html-helper-load-hook -> require html-font
; turn-on-font-lock-mode -> turn-on-font-lock-if-not-too-big (global)
;
; Revision 1.40  1996/08/02  14:19:27  dadams
; HTML: 1. html-helper-mode to auto-mode-alist.
;       2. Set html-helper-do-write-file-hooks, html-helper-build-new-buffer,
;          html-helper-address-string.
;
; Revision 1.39  1996/07/11  14:28:49  dadams
; Removed outline-minor-mode from latex-mode-hook (since it now does its own
; font-locking).
;
; Revision 1.38  1996/07/04  12:44:54  dadams
; No longer add-hook imenu-add-defs-to-search-menu for hide-ifdef-mode here.
; (Done in start-opt.el.)
;
; Revision 1.37  1996/07/03  15:12:35  dadams
; auto-mode-alist: *.TEMP treated as *.temp.
;
; Revision 1.36  1996/07/03  12:17:06  dadams
; Make [print] be a synonym for `C-x 8', so can search for ISO chars.
;
; Revision 1.35  1996/07/01  07:58:12  dadams
; (trivial)
;
; Revision 1.34  1996/06/25  13:49:35  dadams
; 1. Require font-lock+.el when compile.
; 2. Commented out assignment to highlight-nonselected-windows.
; 3. Assigned hooks: outline-mode-hook, outline-minor-mode(-exit)-hook.
;
; Revision 1.33  1996/06/20  12:10:48  dadams
; 1. Require help.el (for help-iso-prefix).
; 2. Updated file dependency comments.
; 3. Renamed to lower case: plain-TeX-mode-hook, (La)TeX-mode-hook.
; 4. Turn on auto-fill for slitex-mode-hook.
;
; Revision 1.32  1996/06/12  13:05:34  dadams
; 1. Added comparison-map as new global prefix key: `C-='.  Use it to bind
;    ediff-buffers, diff, ediff-files, compare-windows,
;    delete-compare-window-overlays.
; 2. Bound compare-windows to C-M-= (instead of diff).
; 3. No longer (substitute-key-definition vc-diff vc-ediff).
;
; Revision 1.31  1996/06/06  14:56:18  dadams
; 1. Require pp.el and std-faces.el. (pp-rebind-eval-keys is a defsubst)
; 2. Update of file dependency comments (e.g. "Autoloaded from...").
;
; Revision 1.30  1996/04/25  09:32:20  dadams
; 1. Require cl.el.  2. (trivial): M-C- -> C-M-.
;
; Revision 1.29  1996/04/23  12:39:30  dadams
; 1. Do undefine-killer-commands, so require misc-fns.el.
; 2. More bindings for up, down, left, right keys.
;
; Revision 1.28  1996/04/23  11:25:34  dadams
; 1. Bound goto-previous(-global)-mark.
; 2. Require chistory.el when compile, to quiet byte compiler.
;
; Revision 1.27  1996/04/18  09:29:40  dadams
; (trivial)
;
; Revision 1.26  1996/04/16  14:12:27  dadams
; Bound shrink-frame-to-fit (trivial).
;
; Revision 1.25  1996/04/16  08:14:11  dadams
; Added bindings for declp-buffer-w-switches, declp-region-w-switches.
;
; Revision 1.24  1996/04/12  13:56:25  dadams
; (trivial: Moved define-key's to first column so imenu picks them up.
;
; Revision 1.23  1996/04/12  10:56:11  dadams
; 1. Increased list-command-history-max.
; 2. Bound keys in command-history-hook.
; 3. Globally bound repeat-matching-complex-command.
;
; Revision 1.22  1996/04/04  16:44:15  dadams
; Escaped `;' in comment-region binding.  Was upsetting update-file-autoloads.
;
; Revision 1.21  1996/04/04  14:23:36  dadams
; 1. Require ediff+.el when compile to quiet compiler.
; 2. Changed binding of unaccent-word.  Bound unaccent-region, comment-region.
;
; Revision 1.20  1996/03/19  10:21:45  dadams
; Bound font-lock-mode here (as well as in font-lock+.el).
;
; Revision 1.19  1996/03/15  15:18:29  dadams
; 1. Require when compile: frame-cmds.el, shell.el, fortran.el.
; 2. Bound vc-diff.
;
; Revision 1.18  1996/03/12  16:14:11  dadams
; 1. Set ediff-split-window-function  to ediff-use-separate-frames.
; 2. Bound diff.
;
; Revision 1.17  1996/03/08  14:14:54  dadams
; display-quotation-cycle -> quotation-cycle.
; Use yow-file and haiku-file (autoloaded defvars).
;
; Revision 1.16  1996/03/06  14:05:42  dadams
; 1. Copyright.
; 2. drew-faces.el -> std-faces.el, drew-menu-bar.el -> menu-bar+.el,
;    drew-misc-19.el -> misc-cmds.el plus frame-cmds.el.
; 3. Require frame-cmds.el for rename-frame when compile (else autoloaded).
;
; Revision 1.15  1996/02/27  17:02:46  dadams
; Bound compare-windows to C-= and delete-compare-window-overlays to C-x C-=.
;
; Revision 1.14  1996/02/27  10:35:54  dadams
; 1. Require drew-faces.el (forgot).
; 2. Added mouse-face-each-line to gnus-group-prepare-hook and
;    gnus-summary-prepare-hook.
;
; Revision 1.13  1996/02/26  14:08:04  dadams
; 1. Moved require-final-newline to setup.el, and made buffer-local.
; 2. Set rmail-show-message-hook and rmail-summary-mode-hook to
;    font-lock-fontify-buffer.
;
; Revision 1.12  1996/02/22  16:49:58  dadams
; GNUS: 1) Set gnus-window-configuration for separate frames.
;       2) Hooks to fontify buffer.
;
; Revision 1.11  1996/02/15  16:13:18  dadams
; Setup stuff (assignments) moved here from files vc+.el and ediff+.el.
;
; Revision 1.10  1996/02/12  10:07:29  dadams
; Updated header keywords (for finder).
;
; Revision 1.9  1996/02/09  07:28:27  dadams
; Provide help for print and C-x8 prefixes (help-iso-prefix).
;
; Revision 1.8  1996/02/06  16:37:18  dadams
; 1. Put variable-interactive property on some user variables.
; 2. minor-mode-alist, abbrev-file-name, save-abbrevs, dired-listing-switches,
;    display-time-day-and-date, list-directory-verbose-switches,
;    auto-mode-alist:
;    setq-default -> setq (not buffer-local)
; 3. comint-prompt-regexp: setq -> setq-default (buffer-local)
; 4. Uncommented undo-limit and undo-strong-limit assignments.
; 5. Removed lpr-command.
; 6. Added font-lock-fontify-buffer to list-options-hook.
;
; Revision 1.7  1996/01/30  14:36:02  dadams
; Added (add-hook 'occur-mode-hook 'turn-on-font-lock-mode).
;
; Revision 1.6  1996/01/30  10:46:38  dadams
; 1. show-*Help*-buffer -> raise-*Help*-buffer.
; 2. Turn on font lock for makefile and sh-mode modes (hooks).
; 3. Remove imenu-add-defs-to-search-menu from makefile-mode-hook.
;
; Revision 1.5  1996/01/25  16:36:47  dadams
; 1. Added yow- and haiku-interval's.  Only do quotations if these are non-nil.
; 2. auto-mode-alist: setq-default -> setq.
; 3. Bound modified [print] key to new declp commands.
; 4. Removed dired-x as dired-load-hook, for now.
; 5. Removed C-h a as apropos.
;
; Revision 1.4  1996/01/12  16:48:01  dadams
; Bindings: [f1], [insert], [delete], [backspace] & [print] stuff, C-x C-a.
;
; Revision 1.3  1996/01/09  16:58:09  dadams
; Added bindings for C- and M- delete, backspace etc.
; Call s-region-bind here on (C-,M-)prior.
; Do again, here: substitute-key-def of kill-buffer, save-buffers-kill-emacs.
;
; Revision 1.2  1996/01/09  09:23:28  dadams
; Added yow-interval and haiku-interval.
;
; Revision 1.1  1996/01/02  16:50:56  dadams
; Initial revision
;; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING.  If not, write to the
;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
;; Boston, MA 02111-1307, USA.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 
;;; Code: 

(eval-when-compile (require 'cl)) ;; when, unless
(eval-when-compile (require 'chistory)) ;; command-history-map

;; Get macro `define-face-const' when this is compiled,
;; or run interpreted, but not when the compiled code is loaded.
(eval-when-compile (require 'def-face-const))


(require 'header2 nil t) ;; (no error if not found): auto-make-header
(require 'misc-cmds nil t) ;; (no error if not found):
                           ;; exit-with-confirmation, 
kill-buffer-and-its-windows
(require 'wimpy-del nil t) ;; (no error if not found): kill-region-wimpy
(require 'setup-keys nil t) ;; (no error if not found): 
sub-exit-with-confirmation,
                            ;; sub-kill-buffer-and-its-windows, sub-pp-evals,
                            ;; sub-query-replace-w-options, sub-remove-window, 
(require 'misc-fns nil t) ;; (no error if not found):
                          ;; undefine-killer-commands (defsubst)
(require 'faces+ nil t) ;; (no error if not found): make-face
                        ;; `faces+.el' requires `faces.el': set-face-foreground
(require 'frame-cmds nil t) ;; (no error if not found): remove-frame
(require 'shrink-fit-all nil t) ;; (no error if not found): 
fit-frame-if-one-window


(provide 'start-opt)

;;;;;;;;;;;;;;;;;;;;;;;;


;;; Some standard faces redefined, and two simple faces defined.
(condition-case nil
    (progn
      (set-face-background 'highlight "Aquamarine") ; Highlight face.
      (set-face-foreground 'modeline "Black") ; Mode-line (Netscape/X: 000000).
      (set-face-background 'modeline "PaleGoldenrod")
      (set-face-background 'region "MediumAquamarine")
      (set-face-background 'secondary-selection "White") ; Secondary sel.
      (set-face-foreground 'secondary-selection "Black") ; (Netscape/X: 000000).
      )
  (error nil))

(unless (facep 'font-lock-string-face) (make-face 'font-lock-string-face))
(set-face-foreground 'font-lock-string-face "Magenta4")
(unless (facep 'font-lock-constant-face) (make-face 'font-lock-constant-face))
(set-face-foreground 'font-lock-constant-face "DarkCyan")
(unless (facep 'font-lock-warning-face) (make-face 'font-lock-warning-face))
(set-face-foreground 'font-lock-warning-face "Yellow")
(unless (facep 'font-lock-function-name-face) (make-face 
'font-lock-function-name-face))
(set-face-foreground 'font-lock-function-name-face "Red")
(unless (facep 'font-lock-keyword-face) (make-face 'font-lock-keyword-face))
(set-face-foreground 'font-lock-keyword-face "Blue3")

(unless (and (boundp 'red-foreground-face) red-foreground-face)
  (define-face-const "Red" nil))
(unless (and (boundp 'blue-foreground-face) blue-foreground-face)
  (define-face-const "Blue" nil))


;;; EDIFF stuff.  These variables and functions are defined in `ediff.el'.
(eval-after-load "ediff"
  (progn
    (setq-default ediff-ignore-similar-regions t)
    (setq-default ediff-auto-refine-limit 10000)
    (setq ediff-grab-mouse 'maybe)      ; Nil -> no grab, t -> grab.
    '(when (fboundp 'ediff-set-face)
       (ediff-set-face 'foreground ediff-even-diff-face-A "White")
       (ediff-set-face 'foreground ediff-even-diff-face-B "White")
       (ediff-set-face 'foreground ediff-even-diff-face-C "White")
       (ediff-set-face 'foreground ediff-even-diff-face-Ancestor "White")
       (ediff-set-face 'background ediff-even-diff-face-A "Gray")
       (ediff-set-face 'background ediff-even-diff-face-B "Gray")
       (ediff-set-face 'background ediff-even-diff-face-C "Gray")
       (ediff-set-face 'background ediff-even-diff-face-Ancestor "Gray")
     
       (ediff-set-face 'foreground ediff-odd-diff-face-A "Black")
       (ediff-set-face 'foreground ediff-odd-diff-face-B "Black")
       (ediff-set-face 'foreground ediff-odd-diff-face-C "Black")
       (ediff-set-face 'foreground ediff-odd-diff-face-Ancestor "Black")
       (ediff-set-face 'background ediff-odd-diff-face-A "LightGray")
       (ediff-set-face 'background ediff-odd-diff-face-B "LightGray")
       (ediff-set-face 'background ediff-odd-diff-face-C "LightGray")
       (ediff-set-face 'background ediff-odd-diff-face-Ancestor "LightGray")

       (ediff-set-face 'foreground ediff-current-diff-face-A "Black")
       (ediff-set-face 'foreground ediff-current-diff-face-B "Black")
       (ediff-set-face 'foreground ediff-current-diff-face-C "Black")
       (ediff-set-face 'foreground ediff-current-diff-face-Ancestor "Black")
       (ediff-set-face 'background ediff-current-diff-face-A "SkyBlue")
       (ediff-set-face 'background ediff-current-diff-face-B "SkyBlue")
       (ediff-set-face 'background ediff-current-diff-face-C "SkyBlue")
       (ediff-set-face 'background ediff-current-diff-face-Ancestor "SkyBlue")

       (ediff-set-face 'foreground ediff-fine-diff-face-A "Black")
       (ediff-set-face 'foreground ediff-fine-diff-face-B "Black")
       (ediff-set-face 'foreground ediff-fine-diff-face-C "Black")
       (ediff-set-face 'foreground ediff-fine-diff-face-Ancestor "Black")
       (ediff-set-face 'background ediff-fine-diff-face-A "Cyan")
       (ediff-set-face 'background ediff-fine-diff-face-B "Cyan")
       (ediff-set-face 'background ediff-fine-diff-face-C "Cyan")
       (ediff-set-face 'background ediff-fine-diff-face-Ancestor "Cyan")
       )))
;; `ediff+.el' requires `ediff.el', which defines ediff-control-buffer.
;(eval-when-compile (require 'ediff+))  
;(progn ;; Must be in this order.
;  (add-hook 'ediff-quit-hook 'ediff-default-quit-hook)
;  (add-hook 'ediff-quit-hook
;            (function (lambda ()        ; EDIFF-CONTROL-BUFFER is free here.
;                        (delete-1-window-frames-on ediff-control-buffer)))))
;(setq ediff-split-window-function 'ediff-use-separate-frames)

;;; VC stuff.  Defined in `vc.el'.
(eval-after-load "vc"
  (progn
    (setq vc-initial-comment t)         ; VC asks for file purpose comment.
    (setq vc-command-messages t)))      ; VC mentions shell commands it runs.

;;; GNUS stuff.  Defined in `gnus.el'.
;(setq gnus-window-configuration '((summary (0 1 0)) (newsgroups (1 0 0))
;                                  (article (0 0 1))))

;;; Help stuff:
(eval-after-load "apropos"
  (setq apropos-do-all t))              ; Defined in `apropos.el'.
                                        ; Set it to nil for 2-3 times faster.

;;; Search and replace stuff:
(copy-face 'secondary-selection 'query-replace) ; For replacement highlighting.
(setq query-replace-highlight t)        ; Defined in `replace.el'.
(copy-face 'secondary-selection 'isearch) ; For search highlighting.
(setq search-highlight t)               ; Defined in `isearch.el'.
(setq-default case-fold-search nil)     ; Case sensitive by default.
(setq search-ring-max 50)               ; Defined in `isearch.el'.
(put 'search-ring-max 'variable-interactive
     "nMax number of search strings in ring: ")
(setq regexp-search-ring-max 50)        ; Defined in `isearch.el'.
(put 'regexp-search-ring-max 'variable-interactive
     "nMax number of regexp search strings in ring: ")

;; Automatically resize one-window frame containing "temporary" buffers (e.g. 
*Help*).
(when (fboundp 'fit-frame-if-one-window) ; Defined in `shrink-fit-all.el'.
  (add-hook 'temp-buffer-show-hook 'fit-frame-if-one-window 'append))

;; Use TAGS file for Drew's Lisp library.
;; (`drews-lisp-dir' should be defined in your init file: `~/.emacs'.
;; It should point to the directory containing this file, `start-opt.el'.)
(and (boundp 'drews-lisp-dir) drews-lisp-dir (setq tags-file-name 
drews-lisp-dir))

;;; Save bookmarks whenever modified.
(eval-after-load "bookmark" (setq bookmark-save-flag 1))

;;; Hilit stuff.  Defined in `hilit19.el'.
;(setq hilit-auto-highlight nil)         ; Don't hilit when `find-file'.
;(setq hilit-face-check nil)             ; To hilit faster.
;(setq hilit-inhibit-rebinding nil)      ; Don't rebind recenter, yank, yank-pop

;; Indicate hiding minor mode in mode line.  Defined in `hide-ifdef.el'.
;(push '(hiding " Hiding") minor-mode-alist)

;; Indicate `iso-accents-minor-mode' in mode line.  Defined in `iso-acc.el'.
;(or (assq 'iso-accents-minor-mode minor-mode-map-alist)
;    (setq minor-mode-alist
;          (append minor-mode-alist '((iso-accents-minor-mode " ISO-Acc")))))

;; HTML -- `html-helper-mode'.
(eval-after-load "html-helper-mode"
  (add-hook 'html-mode-hook 'imenu-add-menubar-index))
;(add-hook 'html-helper-mode-hook 'turn-on-font-lock)
;(add-hook 'html-helper-load-hook '(lambda () (require 'html-font)))
;(setq html-helper-do-write-file-hooks t) ; `local-write-file-hooks' timestamp.
;(setq html-helper-build-new-buffer t)   ; Add `html-helper-new-buffer-strings'.
;(setq html-helper-address-string (user-full-name)) ; Default author string.

;; DEL and self-insert to kill region.
(eval-after-load "delsel"
  (delete-selection-mode t))            ; Defined in `delsel.el'.
;;;;; Be able to use the mark even if it is inactive.
;;;;; (setq mark-even-if-inactive t)    ; Defined in `simple.el'.
;;;;; (setq highlight-nonselected-windows t)  ; Highlight region everywhere.


(global-font-lock-mode t)               ; Turn on font-lock-mode, generally.
(setq font-lock-verbose 50000)          ; "Fontifying...done" only if big 
buffer.

(setq undo-limit 80000)                 ; 4 X the std default.
(setq undo-strong-limit 120000)         ; 4 X the std default.
(setq gc-cons-threshold 1600000)        ; 4 X the std default (400000).
(put 'gc-cons-threshold 'variable-interactive
     "nNumber of bytes of consing between garbage collections: ")


;(setq abbrev-file-name (substitute-in-file-name "~/.abbrev-defs")) ; `paths.el'
;(put 'abbrev-file-name 'variable-interactive "FFile to read abbrevs from: ")

; Save word abbrevs when files saved.
;(setq save-abbrevs t)                   ; Defined in `files.el'.
;(setq display-time-day-and-date nil)    ; No date in modeline.  In `time.el'.
(setq-default indent-tabs-mode nil)     ; SPCs only (no TABs), when indenting.
(setq list-directory-verbose-switches "-Ails") ; Defined in `files.el'.
(put 'list-directory-verbose-switches 'variable-interactive
     "sSwitches for `list-directory' to pass to `ls' for verbose listing: ")

;;; OPTION "F" DOESN'T WORK ON Windows NT
;;; IT CAUSES DIR NAMES TO BE TRUNCATED WHEN TRYING TO OPEN THEM
(setq dired-listing-switches            ; Defined in `dired.el'.
      (if (string-match "i386" system-configuration)
          "-al"
        "-alF"))
(put 'dired-listing-switches 'variable-interactive
     "sSwitches passed to `ls' for dired.  MUST contain the `l' option: ")

(setq default-major-mode 'indented-text-mode)
(setq auto-mode-alist                   ; Defined in `files.el'.
      (append (list
               '("\\.te?xt\\'" . indented-text-mode)
               '("\\.elc\\'" . emacs-lisp-mode)
               '("\\.tex\\'" . LaTeX-mode)
               '("\\.aux\\'" . LaTeX-mode)
               '("\\.glo\\'" . LaTeX-mode)
               '("\\.lof\\'" . LaTeX-mode)
               '("\\.log\\'" . LaTeX-mode)
               '("\\.lot\\'" . LaTeX-mode)
               '("\\.toc\\'" . LaTeX-mode)
               ;; '("\\.ftex\\'" . LaTeX-mode)
               '("\\.lxx\\'" . c++-mode)
               '("\\.ixx\\'" . c++-mode)
               '("\\.gxx\\'" . c++-mode)
               '("\\.pxx\\'" . c++-mode)
               )
              auto-mode-alist 
              ))

(add-hook 'tex-mode-hook 'imenu-add-menubar-index)
;; Auto-fill by default for text modes.
(add-hook 'text-mode-hook 'turn-on-auto-fill t)
(add-hook 'latex-mode-hook 'turn-on-auto-fill t) ; In `tex-mode.el'.
(add-hook 'plain-tex-mode-hook 'turn-on-auto-fill t) ; In `tex-mode.el'.
(add-hook 'tex-mode-hook 'turn-on-auto-fill t) ; In `tex-mode.el'.
(add-hook 'slitex-mode-hook 'turn-on-auto-fill t) ; In `tex-mode.el'.

;; Mode line.
;; Make `display-time' use a 24 hour clock.
(eval-after-load "time"
  (progn
    (setq display-time-24hr-format t)   ; Defined in `time.el'.
    ;; Put time in mode-line.  
    (display-time)))                    ; Defined in `time.el'.
;; Put line # in mode-line.
;(line-number-mode 9999)                        ; Defined in `simple.el'.


;(setq dired-latex-unclean-extensions    ; Defined in `dired-x.el'.
;      '(".idx" ".lof" ".lot" ".glo"     ; Std default.
;        ".errefs" ".ind" ".ilg"))       ; Extras added here.

;; The following variables are all defined in `tex-mode.el'.
;(setq tex-default-mode 'latex-mode)
;(setq tex-dvi-print-command "dvips -f -t a4 * | declp -D p -M p -K 2")
;(put 'tex-dvi-print-command 'variable-interactive
;     "sCommand used by `tex-print' to print a *.dvi file: ")
;(setq tex-alt-dvi-print-command "dvips -f -t a4 * | declp -D p -M p")
;(put 'tex-alt-dvi-print-command 'variable-interactive
;     "sCommand used by `tex-print' with a prefix arg to print a *.dvi file: ")
;(setq tex-dvi-view-command
;      (if (eq window-system 'x) "xdvi" "dvi2tty * | cat -s"))
;(put 'tex-dvi-view-command 'variable-interactive
;     "sCommand used by `tex-view' to display a *.dvi file: ")
;(setq tex-show-queue-command "declpstat|more")
;(put 'tex-show-queue-command 'variable-interactive
;     "sCommand used by `tex-show-print-queue' to show the print queue: ")

;; Use virtual Dired mode by default.  Defined in `dired-x.el'.
;(setq auto-mode-alist (cons '("[^/]\\.dired\\'" . dired-virtual-mode)
;                            auto-mode-alist))

;; Hexl to display ISO chars too.
;(setq hexl-iso "-iso")                  ; Defined in `hexl.el'.

;(setq-default comint-prompt-regexp shell-prompt-pattern) ; In `comint.el'.
;(put 'comint-prompt-regexp 'variable-interactive
;     "sRegexp to recognise prompts in the inferior process: ")
;(setq shell-popd-regexp "\\(popd\\|o\\)") ; Defined in `cmushell.el'.
;(put 'shell-popd-regexp 'variable-interactive
;     "sRegexp to match subshell commands equivalent to `popd': ")
;(setq shell-pushd-regexp "\\(pushd\\|u\\)") ; Defined in `cmushell.el'.
;(put 'shell-pushd-regexp 'variable-interactive
;     "sRegexp to match subshell commands equivalent to `pushd': ")

;; Word completion.  These variables are defined in `completion.el'.
;(setq completion-on-separator-character t) ; Makes separators save words.
;(setq cmpl-case-fold-search t)          ; Case-sensitive completion.
;;; Use cdabbrev completion if no other (slower)
;;; (setq completion-cdabbrev-prompt-flag t)

;; COMMENT-LINE-START and COMMENT-LINE-START-SKIP are free variables here.
;(eval-when-compile (require 'fortran)) ; comment-line-start(-skip)
;(defun setup-for-fortran-comments ()    ; Make useful for file headers etc.
;  (setq comment-line-start "C")         ; Upper case C. Defined in `fortran.el'
;  (put 'comment-line-start 'variable-interactive
;       "sString inserted to start new full-line comment: ") 
;  (setq comment-start comment-line-start) ; Defined in `simple.el'. (local var)
;  (setq comment-start-skip comment-line-start-skip)) ; Defined in `fortran.el'.
;(add-hook 'fortran-mode-hook 'setup-for-fortran-comments)

;; SHELL-MODE-MAP is a free variable here.  Defined in `shell.el'.
;(eval-when-compile (require 'shell)) ;; shell-mode-map
;(defun define-shell-completion-keys ()
;(define-key shell-mode-map "\C-c\C-i" 'my-shell-complete)
;(define-key shell-mode-map "\C-c\?" 'my-shell-completion-help))
;;; (add-hook 'shell-mode-hook 'define-shell-completion-keys)


(setq list-command-history-max 1000)    ; 32 is the default. In `chistory.el'.
(add-hook 'command-history-hook         ; Defined in `chistory.el'.
          (function (lambda ()
                      (when (fboundp 'electric-command-history)
                        (define-key command-history-map "e"
                          'electric-command-history)) ; In `echistory.el'.
                      (define-key command-history-map "m"
                        'repeat-matching-complex-command)))) ; `chistory.el'.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;; ****** Begin stuff to do at the end ***********

;;;-----------REPLACEMENT BINDINGS------------------------------------

(when (fboundp 'kill-region-wimpy)      ; In `wimpy-del.el'.
  (substitute-key-definition 'kill-region
                             'kill-region-wimpy global-map)
  (substitute-key-definition 'clipboard-kill-region
                             'clipboard-kill-region-wimpy global-map))

;(eval-and-compile (require 'pp)) ;; pp-rebind-eval-keys (defsubst)
;(pp-rebind-eval-keys)                  ; `eval-expression', `eval-last-sexp'
                                        ; Defined as defsubst in `pp.el'.
;(substitute-key-definition              ; Replace `execute-extended-command'.
; 'execute-extended-command              ; Defined in `show-bind.el'.
; 'execute-extended-command-and-check-for-bindings global-map)


;; These have already been done once in `setup-keys.el'.
;; Repeat here in case someone has made some more of these bindings.
;; Do this *after* load `menu-bar+.el', since that sets original bindings.
(when (and (boundp 'sub-remove-window)
           sub-remove-window
           (fboundp 'remove-window))
  (substitute-key-definition 'delete-window ; Defined in `frame-cmds.el'.
                             'remove-window global-map))
(when (and (boundp 'sub-query-replace-w-options)
           sub-query-replace-w-options
           (fboundp 'query-replace-w-options))
  (substitute-key-definition 'query-replace ; Defined in `replace+.el'.
                             'query-replace-w-options global-map))
(when (and (boundp 'sub-kill-buffer-and-its-windows)
           sub-kill-buffer-and-its-windows
           (fboundp 'kill-buffer-and-its-windows))
  (substitute-key-definition 'kill-buffer ; Defined in `misc-cmds.el'.
                             'kill-buffer-and-its-windows global-map))
(when (and (boundp 'sub-exit-with-confirmation)
           sub-exit-with-confirmation
           (fboundp 'exit-with-confirmation))
  (substitute-key-definition 'save-buffers-kill-emacs ; In `misc-cmds.el'.
                             'exit-with-confirmation global-map)) ; (defsubst)
(when (and (boundp 'sub-pp-evals)
           sub-pp-evals)
  (when (fboundp 'pp-eval-last-sexp)
    (substitute-key-definition 'eval-last-sexp
                               'pp-eval-last-sexp global-map)) ; In `pp.el'.
  (when (fboundp 'pp-eval-expression)
    (substitute-key-definition 'eval-expression
                               'pp-eval-expression global-map))) ; In `pp+.el'.
(when (fboundp 'buffer-menu)
  (substitute-key-definition 'list-buffers ; Redefined in `buff-menu+.el'.
                             'buffer-menu global-map))

;; Undefine some bindings that would try to modify buffers like Dired.
;; Their key sequences will then appear to the user as available for
;; local definition.  This may have been done before, in `dired+.el' etc.,
;; but it may help to do it again, since we have defined more bindings here.
(when (fboundp 'undefine-killer-commands) ; Defined in `misc-fns.el'.
  (when (boundp 'dired-mode-map)
    (undefine-killer-commands dired-mode-map (current-global-map)))
  (when (boundp 'Buffer-menu-mode-map)
    (undefine-killer-commands Buffer-menu-mode-map (current-global-map)))
  (when (boundp 'compilation-mode-map)  ; Defined in `compile.el'.
    (undefine-killer-commands compilation-mode-map (current-global-map))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; Do things this way because there is no `fundamental-mode-hook'.

;; `auto-make-header' is defined in `header2.el'.
;; `toggle-outline-minor-mode-font-lock' is defined in `outline+.el'.
(add-hook 'emacs-lisp-mode-hook       'turn-on-font-lock)
(add-hook 'emacs-lisp-mode-hook       'auto-make-header) ; In `header2.el'.
(add-hook 'emacs-lisp-mode-hook (function (lambda () (require 'lisp-mnt))))
(add-hook 'ccl-mode-hook              'turn-on-font-lock)
(add-hook 'ccl-mode-hook              'auto-make-header)
(add-hook 'lisp-mode-hook             'turn-on-font-lock)
(add-hook 'lisp-mode-hook             'auto-make-header)
(add-hook 'cmulisp-mode-hook          'turn-on-font-lock)
(add-hook 'cmulisp-mode-hook          'auto-make-header)
(add-hook 'c-mode-hook                'turn-on-font-lock)
(add-hook 'c-mode-hook                'auto-make-header)
(add-hook 'c++-mode-hook              'turn-on-font-lock)
(add-hook 'c++-mode-hook              'auto-make-header)
(add-hook 'c-mode-common-hook         'turn-on-font-lock)
(add-hook 'c-mode-common-hook         'auto-make-header)
(add-hook 'idl-mode-hook              'auto-make-header)
(add-hook 'idl-mode-hook              'turn-on-font-lock)
(add-hook 'makefile-mode-hook         'turn-on-font-lock)
(add-hook 'sh-mode-hook               'turn-on-font-lock)
(add-hook 'fortran-mode-hook          'turn-on-font-lock)
(add-hook 'fortran-mode-hook          'auto-make-header)
(add-hook 'dired-after-readin-hook    'turn-on-font-lock)
;;;@@@Emacs20 (add-hook 'compilation-mode-hook      'font-lock-fontify-buffer)
;;;@@@Emacs20 (add-hook 'occur-mode-hook            'turn-on-font-lock)
;(add-hook 'gnus-group-prepare-hook    'turn-on-font-lock)
;(add-hook 'gnus-group-prepare-hook    'mouse-face-each-line) ; `highlight.el'.
;(add-hook 'gnus-summary-prepare-hook  'turn-on-font-lock)
;(add-hook 'gnus-summary-prepare-hook  'mouse-face-each-line) ; `highlight.el'.
;(add-hook 'gnus-article-prepare-hook  'font-lock-fontify-buffer);`font-lock.el'
;(add-hook 'rmail-show-message-hook    'font-lock-fontify-buffer)
;(add-hook 'rmail-summary-mode-hook    'font-lock-fontify-buffer)
(add-hook 'list-options-hook          'font-lock-fontify-buffer)
(add-hook 'outline-mode-hook          'turn-on-font-lock)
                                        ; Defined in `outline+.el':
;(add-hook 'outline-minor-mode-hook    'toggle-outline-minor-mode-font-lock)
;(add-hook 'outline-minor-mode-exit-hook 'toggle-outline-minor-mode-font-lock)

;;; ****** End stuff to do at the end ***********

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; `start-opt.el' ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]