;;; start-opt.el --- Some 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-2007, Drew Adams, all rights reserved. ;; Created: Thu Dec 28 09:15:00 1995 ;; Version: 21.0 ;; Last-Updated: Fri Jan 19 21:26:21 2007 (-28800 Pacific Standard Time) ;; By: dradams ;; Update #: 1724 ;; URL: http://www.emacswiki.org/cgi-bin/wiki/start-opt.el ;; Keywords: local, init ;; Compatibility: GNU Emacs 20.x, GNU Emacs 21.x, GNU Emacs 22.x ;; ;; Features that might be required by this library: ;; ;; `autofit-frame', `avoid', `chistory', `cl', `color-theme', ;; `cus-face', `doremi', `doremi-cmd', `doremi-frm', `easymenu', ;; `eyedropper', `faces', `faces+', `fit-frame', `frame-cmds', ;; `frame-fns', `header2', `help+', `hexrgb', `highlight', `info', ;; `info+', `isearch+', `iso-transl', `lib-requires', `loadhist', ;; `misc-cmds', `misc-fns', `mouse', `mouse+', `mwheel', `pp', ;; `pp+', `replace+', `ring', `ring+', `setup-keys', `simple+', ;; `strings', `thingatpt', `thingatpt+', `unaccent', `wid-edit', ;; `widget', `wimpy-del'. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Commentary: ;; ;; Some customizations to be done at the end of startup. ;; ;; This library replaces some key bindings that might have been made ;; when other libraries were loaded. It also sets some mode hooks and ;; makes some parameter (variable settings. ;; ;; 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: ;; ;; 2006/12/11 dadams ;; No longer (undefine-killer-commands compilation-mode-map (current-global-map)). ;; 2006/09/15 dadams ;; Don't require tool-bar.el here. ;; Protect call to tooltip-mode. ;; 2006/08/22 dadams ;; Replaced sub-remove-window by sub-delete-windows-for. ;; 2006/08/18 dadams ;; Don't use speedbar anymore. ;; 2006/05/26 dadams ;; Moved here from setup.el: show-paren-match-face. ;; 2006/04/01 dadams ;; Add speedbar hack for Emacs 22, to fit the frame after the buffer has been filled. ;; 2006/01/28 dadams ;; Multiplied (regexp-)search-ring-max by 100. ;; (setq isearch-resume-in-command-history t). ;; 2006/01/20 dadams ;; Make tooltips use the echo area. ;; 2006/01/01 dadams ;; isearch face. ;; 2005/12/30 dadams ;; Redefine list-matching-lines-face here (previously done in replace+.el). ;; Set Info-fontify-maximum-menu-size here (previously done in setup-info.el). ;; Removed require of def-face-const.el. ;; Removed definitions of red and blue foreground faces. ;; 2005/11/22 dadams ;; Moved mode-line coloring to oneonone.el. ;; 2005/10/23 dadams ;; Doubled font-lock-maximum-size. ;; 2005/10/21 dadams ;; Protected add-hook of auto-make-header with fboundp. ;; 2005/07/17 dadams ;; Explicitly set mode-line-inactive. ;; 2005/07/07 dadams ;; Added ls-lisp stuff. ;; 2005/05/17 dadams ;; Don't use images for speedbar. ;; Updated to work with Emacs 22.x. ;; 2005/05/15 dadams ;; Set frame-title-format here. ;; 2005/05/10 dadams ;; No longer turn on customize-toggle-outside-change-updates - do it in .emacs. ;; 2005/01/25 dadams ;; Turn on automatic updating of Customize, so it takes into account ;; changes made outside Customize. ;; Use speedbar. ;; 2005/01/20 dadams ;; Removed: References to exit-with-confirmation and sub-exit-with-confirmation. ;; 2004/12/18 dadams ;; Moved here from setup.el: (add-hook 'after-make-frame-functions 'fit-frame) ;; 2004/11/?? dadams ;; Require tool-bar+.el and use tool-bar-pop-up-mode. ;; Set display-buffer-reuse-frames, display-buffer-reuse-frame, and ;; view-remove-frame-by-deleting. ;; 2004/09/21 dadams ;; Added (icomplete-mode 99). ;; 2000/11/01 dadams ;; Added add-hooks for idl-mode-hook. ;; 2000/09/27 dadams ;; Added fit-frame-if-one-window as temp-buffer-show-hook. ;; 1999/09/03 dadams ;; Define red- and blue-face-foreground via define-face-const. ;; 1999/09/02 dadams ;; Protected substitute-key-definition with fboundp and global vars. ;; Added substitute-key-definition for query-replace-w-options, buffer-menu. ;; 1999/08/30 dadams ;; Added more c++-mode suffixes (lxx, ixx, gxx, pxx to auto-mode-alist. ;; 1999/08/30 dadams ;; Added: c-mode-common-hook. ;; 1999/08/25 dadams ;; Removed F option from dired-listing-switches when Windows NT. ;; 1999/04/02 dadams ;; Added standard face redefinitions, new faces: red & blue foreground. ;; 1999/04/01 dadams ;; Added: eval-after-load "ediff" -> set faces. ;; 1999/04/01 dadams ;; Added global-font-lock-mode. ;; 1999/03/17 dadams ;; 1. Added: ediff-grab-mouse. ;; 2. gc-cons-threshold: 10 x -> 4 x the default. ;; 1996/06/25 dadams ;; Assigned hook outline-mode-hook. ;; 1996/06/20 dadams ;; Turn on auto-fill for slitex-mode-hook. ;; 1996/04/23 dadams ;; Do undefine-killer-commands. ;; 1996/04/12 dadams ;; 1. Increased list-command-history-max. ;; 2. Bound keys in command-history-hook. ;; 3. Globally bound repeat-matching-complex-command. ;; 1996/02/06 dadams ;; 1. Put variable-interactive property on some user variables. ;; 2. Added font-lock-fontify-buffer to list-options-hook. ;; 1996/01/30 dadams ;; Turn on font lock for makefile and sh-mode modes (hooks). ;; 1996/01/09 dadams ;; Do again, here: substitute-key-def of kill-buffer, save-buffers-kill-emacs. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; 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., 51 Franklin Street, Fifth ;; Floor, Boston, MA 02110-1301, USA. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;;; Code: (and (< emacs-major-version 20) (eval-when-compile (require 'cl))) ;; when, unless (require 'chistory) ;; command-history-map (require 'header2 nil t) ;; (no error if not found): auto-make-header (require 'misc-cmds nil t) ;; (no error if not found): 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-kill-buffer-and-its-windows, ;; sub-pp-evals, sub-query-replace-w-options, sub-delete-windows-for (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 'autofit-frame nil t) ;; (no error if not found): fit-frame-if-one-window ;;;;;;;;;;;;;;;;;;;;;;;; ;;; Some standard faces redefined, and two simple faces defined. (condition-case nil (progn (set-face-background 'highlight "Cyan") ; Highlight face. (set-face-foreground 'modeline "Black") ; Mode-line (Netscape/X: 000000). (set-face-background 'region "MediumAquamarine") (set-face-background list-matching-lines-face "SkyBlue") ; Defined in `replace.el' (set-face-background 'secondary-selection "White") ; Secondary sel. (set-face-foreground 'secondary-selection "Black") ; (Netscape/X: 000000). (set-face-background 'show-paren-match-face "Aquamarine")) ; in `paren.el' (error nil)) (global-font-lock-mode t) ; Turn on font-lock-mode, generally. (setq font-lock-verbose 50000) ; "Fontifying...done" only if big buffer. (setq font-lock-maximum-size 512000) ; Double the default size. (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 "#00006DE06DE0") (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") ;;;;; ;;; EDIFF stuff. ;;;;; (setq ediff-control-frame-position-function 'my-ediff-control-frame-position) ;;;;; ;;; Replacement for `ediff-make-position'. ;;;;; (defun my-ediff-control-frame-position (ctl-buffer ctl-frame-width ctl-frame-height)) ;;;;; (defun set-ediff-control-position () ;;;;; "@@@@@@@@@@" ;;;;; (modify-frame-parameters ediff-control-frame '((name . "TEST Ediff") (top . 0))) ;;;;; ) ;;; 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. ;;;;;; (setq ediff-after-setup-control-frame-hook 'set-ediff-control-position) '(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) (when (featurep 'icomplete+) (icomplete-mode 99)) ;;; 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" ; Defined in `apropos.el'. (setq apropos-do-all t)) ; Set it to nil for 2-3 times faster. ;;; Info stuff: (setq Info-fontify-maximum-menu-size 500000) ;;; Search and replace stuff: (copy-face 'secondary-selection 'query-replace) ; For replacement highlighting. (setq query-replace-highlight t) ; Defined in `replace.el'. (if (facep 'isearch) (set-face-attribute 'isearch nil :foreground "Black" :background "Green" :inverse-video nil) (defface isearch '((t (:foreground "Black" :background "Green"))) "Face for highlighting Isearch matches." :group 'isearch)) (setq search-highlight t) ; Defined in `isearch.el'. (setq-default case-fold-search nil) ; Case sensitive by default. (setq search-ring-max 5000) ; Defined in `isearch.el'. (put 'search-ring-max 'variable-interactive "nMax number of search strings in ring: ") (setq regexp-search-ring-max 5000) ; Defined in `isearch.el'. (put 'regexp-search-ring-max 'variable-interactive "nMax number of regexp search strings in ring: ") (when (boundp 'isearch-resume-in-command-history) ; Defined in `isearch.el'. (setq isearch-resume-in-command-history t)) ; Be able to repeat searches as commands. ;; Use `tool-bar-pop-up-mode'. (when (and (>= emacs-major-version 22) (fboundp 'tool-bar-pop-up-mode)) (tool-bar-pop-up-mode 99)) ;; Automatically fit one-window frames containing "temporary" buffers (e.g. *Help*). (when (fboundp 'fit-frame-if-one-window) ; Defined in `autofit-frame.el'. (add-hook 'temp-buffer-show-hook 'fit-frame-if-one-window 'append)) ;; Automatically fit newly created frames. (when (fboundp 'fit-frame) ; Defined in `fit-frame.el'. (add-hook 'after-make-frame-functions 'fit-frame)) (when (fboundp 'tooltip-mode) ; Make tooltips use echo area. (condition-case nil (tooltip-mode -1) (error nil))) ;; 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. (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 (eq system-type 'windows-nt) "-al" "-alF")) (put 'dired-listing-switches 'variable-interactive "sSwitches passed to `ls' for dired. MUST contain the `l' option: ") ;; The defcustom's in Francis Wright's `ls-lisp.el' can't take effect, ;; because `ls-lisp.el' is a standard library, preloaded. So, make the ;; assignments by hand. (when (featurep 'ls-lisp) (setq ls-lisp-emulation (cond ((memq system-type '(windows-nt ms-dos emx)) 'Microsoft) ;; FJW: not sure about how to handle emx! ((memq system-type '(hpux dgux usg-unix-v unisoft-unix rtu irix berkeley-unix)) 'UNIX))) (setq ls-lisp-ignore-case ;; Name change for consistency with other option names. (or (eq ls-lisp-emulation 'Microsoft) (and (boundp 'ls-lisp-dired-ignore-case) ls-lisp-dired-ignore-case))) (setq ls-lisp-dirs-first (eq ls-lisp-emulation 'Microsoft)) (setq ls-lisp-verbosity (cond ((eq ls-lisp-emulation 'Microsoft) (if (getenv "SystemRoot") '(links))) ; distinguish NT/2K from 9x ((eq ls-lisp-emulation 'UNIX) '(links uid)) ; UNIX ls (t '(links uid gid))))) ; GNU ls (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) '("\\.sql\\'" . sql-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'. (when (>= emacs-major-version 21) (setq display-buffer-reuse-frames t) (setq display-buffer-reuse-frame t) ; Is this obsolete? (setq view-remove-frame-by-deleting t)) ;; Frame title: buffer name. (setq frame-title-format '(multiple-frames "%b" "%b")) ;; 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'. ;; ;; Use speedbar, but without images ;; (setq speedbar-use-images nil) ;; (require 'speedbar) ;; (speedbar-frame-mode 99) ;; This is a hack because in Emacs 22 speedbar creates the speedbar frame before it fills ;; the buffer, and speedbar provides no appropriate hook for doing this at the right time. ;; Bug filed. (when (fboundp 'fit-frame) ; Defined in `fit-frame.el'. (let ((win (get-buffer-window " SPEEDBAR" t))) (when win (save-window-excursion (select-window win) (fit-frame))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;; ****** 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-delete-windows-for) sub-delete-windows-for (fboundp 'delete-windows-for)) (substitute-key-definition 'delete-window ; Defined in `frame-cmds.el'. 'delete-windows-for 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-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)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Do things this way because there is no `fundamental-mode-hook'. ;; `auto-make-header' is defined in `header2.el'. (when (fboundp 'auto-make-header) (add-hook 'emacs-lisp-mode-hook 'auto-make-header) (add-hook 'ccl-mode-hook 'auto-make-header) (add-hook 'lisp-mode-hook 'auto-make-header) (add-hook 'cmulisp-mode-hook 'auto-make-header) (add-hook 'c-mode-hook 'auto-make-header) (add-hook 'c++-mode-hook 'auto-make-header) (add-hook 'c-mode-common-hook 'auto-make-header) (add-hook 'idl-mode-hook 'auto-make-header) (add-hook 'fortran-mode-hook 'auto-make-header)) (add-hook 'emacs-lisp-mode-hook (function (lambda () (require 'lisp-mnt)))) (add-hook 'emacs-lisp-mode-hook 'turn-on-font-lock) (add-hook 'ccl-mode-hook 'turn-on-font-lock) (add-hook 'lisp-mode-hook 'turn-on-font-lock) (add-hook 'cmulisp-mode-hook 'turn-on-font-lock) (add-hook 'c-mode-hook 'turn-on-font-lock) (add-hook 'c++-mode-hook 'turn-on-font-lock) (add-hook 'c-mode-common-hook 'turn-on-font-lock) (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 'dired-after-readin-hook 'turn-on-font-lock) (add-hook 'list-options-hook 'font-lock-fontify-buffer) (add-hook 'outline-mode-hook 'turn-on-font-lock) (add-hook 'sql-mode-hook 'turn-on-font-lock) ;;;@@@Emacs19 (add-hook 'compilation-mode-hook 'font-lock-fontify-buffer) ;;;@@@Emacs19 (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) ; 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 *********** ;;;;;;;;;;;;;;;;;;;;;;; (provide 'start-opt) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; start-opt.el ends here