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

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

compile-.el - extensions to GNU `compile.el'


From: Drew Adams
Subject: compile-.el - extensions to GNU `compile.el'
Date: Wed, 17 Jan 2001 16:42:05 -0500

;;; compile-.el --- Extensions to `compile.el'.
;; 
;; Emacs Lisp Archive Entry
;; Filename: compile-.el
;; Description: Extensions to `compile.el'
;; Author: Drew Adams
;; Maintainer: Drew Adams
;; Copyright (C) 1999-2001, Drew Adams, all rights reserved.
;; Created: Thu Sep  2 13:39:51 1999
;; Version: $Id: compile-.el,v 1.9 2001/01/08 22:31:57 dadams Exp $
;; Last-Updated: Mon Jan  8 14:31:40 2001
;;           By: dadams
;;     Update #: 76
;; Keywords: tools, processes
;; Compatibility: GNU Emacs 20.x
;; 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 
;;; Commentary: 
;; 
;;    Extensions to `compile.el'.
;;
;;  See also the companion file `compile+.el'.
;;        `compile-.el' should be loaded before `compile.el'.
;;        `compile+.el' should be loaded after `compile.el'.
;;
;;
;;  New function defined here: `compile-mode-summary'.
;;
;;
;;  ***** NOTE: The following variables defined in `compile.el'
;;              have been REDEFINED HERE:
;;
;;  `compile-auto-highlight' - Set to t, instead of nil.
;;  `compilation-minor-mode-map' - 
;;    1. Full key map.  Unused keys bound to `compile-mode-summary'.
;;    2. Additional keys defined here: \r, \^?, ?, a, A, c, C, 
;;       f, F, g, G, h, H, k, K, m, M, n, N, p, P, r, R, {, }.
;; 
;;  The function `shrink-wrap-1-window-frames-on' (defined in
;;  `shrink-fit.el') is added here to `compilation-finish-functions'.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; 
;;; Change log:
;; 
;; RCS $Log: compile-.el,v $
;; RCS Revision 1.9  2001/01/08 22:31:57  dadams
;; RCS Adapted file header for Emacs Lisp Archive.
;; RCS
;; RCS Revision 1.8  2001/01/03 17:32:19  dadams
;; RCS *** empty log message ***
;; RCS
;; RCS Revision 1.7  2001/01/03 00:34:14  dadams
;; RCS *** empty log message ***
;; RCS
;; RCS Revision 1.6  2001/01/02 23:41:04  dadams
;; RCS *** empty log message ***
;; RCS
;; RCS Revision 1.5  2001/01/02 23:39:53  dadams
;; RCS Removed shrink-wrap-1-window-frames-on to shrink-fit.el.
;; RCS
;; RCS Revision 1.4  2000/12/07 19:35:07  dadams
;; RCS Require: frame-cmds.el -> shrink-fit.el.
;; RCS
;; RCS Revision 1.3  2000/11/28 19:23:20  dadams
;; RCS Optional require's via 3rd arg=t now.
;; RCS
;; RCS Revision 1.2  2000/09/27 21:48:23  dadams
;; RCS Updated for Emacs 20.7:
;; RCS 1. Require cl.el, frame-cmds.el.
;; RCS 2. Added: compile-auto-highlight, shrink-wrap-1-window-frames-on.
;; RCS 3. add-hook compilation-finish-functions shrink-wrap-1-window-frames-on.
;; RCS
;; RCS Revision 1.1  2000/09/14 14:55:50  dadams
;; RCS Initial revision
;; RCS
; Revision 1.2  1999/09/02  15:11:43  dadams
; Moved here from compile-.el: compile-mode-summary.
;
; Revision 1.1  1999/09/02  14:50:37  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:


(require 'cl) ;; dolist, when

(require 'shrink-fit nil t) ;; (no error if not found): 
                            ;; shrink-wrap-1-window-frames-on

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

;;;###autoload
(defvar compile-auto-highlight t)

(when (fboundp 'shrink-wrap-1-window-frames-on)
  (add-hook 'compilation-finish-functions
            'shrink-wrap-1-window-frames-on)) ; Defined in `shrink-fit.el'


;;;###autoload
(defun compile-mode-summary ()
  "Display brief help message for Compile Mode."
  (interactive)
  (message
   (concat
    (substitute-command-keys
     "\\[describe-mode]= help,  \\[compile-goto-error] & \
\\[compile-mouse-goto-error]= this error,  \\[next-error]= next error,  \
\\[kill-compilation]= kill,  \\[grep]= grep,  \\[compile]= compile,  \
\\[recompile]= recompile"))))



;; REPLACES ORIGINAL in `compile.el':
;; 1. Full key map (not sparse), with "unused" keys bound
;;    to `compile-mode-summary'.
;; 2. Additional keys defined here: \r, \^?, ?, a, A, c, C, 
;;    f, F, g, G, h, H, k, K, m, M, n, N, p, P, r, R, {, }.
(defvar compilation-minor-mode-map
  (let ((map (make-keymap)))
    (suppress-keymap map)
    (define-key map "\r" 'compile-goto-error) ; RET
    (define-key map " " 'scroll-up)     ; SPC
    (define-key map "\^?" 'scroll-down) ; DEL
    (define-key map "?" 'describe-mode) ; Defined in `help.el'.
    (define-key map "a" 'first-error)
    (define-key map "b" 'compile-mode-summary)
    (define-key map "c" 'compile)
    (define-key map "d" 'compile-mode-summary)
    (define-key map "e" 'compile-mode-summary)
    (define-key map "f" 'compile-goto-error)
    (define-key map "g" 'grep)
    (define-key map "h" 'describe-mode) ; Defined in `help.el'.
    (define-key map "i" 'compile-mode-summary)
    (define-key map "j" 'compile-mode-summary)
    (define-key map "k" 'kill-compilation)
    (define-key map "l" 'compile-mode-summary)
    (define-key map "m" 'compile)       ; Make.
    (define-key map "n" 'next-error)
    (define-key map "o" 'compile-mode-summary)
    (define-key map "p" 'previous-error)
    (define-key map "q" 'compile-mode-summary)
    (define-key map "r" 'recompile)
    (define-key map "s" 'compile-mode-summary)
    (define-key map "t" 'compile-mode-summary)
    (define-key map "u" 'compile-mode-summary)
    (define-key map "v" 'compile-mode-summary)
    (define-key map "w" 'compile-mode-summary)
    (define-key map "x" 'compile-mode-summary)
    (define-key map "y" 'compile-mode-summary)
    (define-key map "z" 'compile-mode-summary)
    (define-key map "A" 'first-error)
    (define-key map "B" 'compile-mode-summary)
    (define-key map "C" 'compile)
    (define-key map "D" 'compile-mode-summary)
    (define-key map "E" 'compile-mode-summary)
    (define-key map "F" 'compile-goto-error)
    (define-key map "G" 'grep)
    (define-key map "H" 'describe-mode) ; Defined in `help.el'.
    (define-key map "I" 'compile-mode-summary)
    (define-key map "J" 'compile-mode-summary)
    (define-key map "K" 'kill-compilation)
    (define-key map "L" 'compile-mode-summary)
    (define-key map "M" 'compile)       ; Make
    (define-key map "N" 'next-error)
    (define-key map "O" 'compile-mode-summary)
    (define-key map "P" 'previous-error)
    (define-key map "Q" 'compile-mode-summary)
    (define-key map "R" 'recompile)
    (define-key map "S" 'compile-mode-summary)
    (define-key map "T" 'compile-mode-summary)
    (define-key map "U" 'compile-mode-summary)
    (define-key map "V" 'compile-mode-summary)
    (define-key map "W" 'compile-mode-summary)
    (define-key map "X" 'compile-mode-summary)
    (define-key map "Y" 'compile-mode-summary)
    (define-key map "Z" 'compile-mode-summary)
    (define-key map [mouse-2] 'compile-mouse-goto-error)
    (define-key map "\C-c\C-c" 'compile-goto-error)
    (define-key map "\C-m" 'compile-goto-error)
    (define-key map "\C-c\C-k" 'kill-compilation)
    (define-key map "\M-n" 'compilation-next-error)
    (define-key map "\M-p" 'compilation-previous-error)
    (define-key map "\M-{" 'compilation-previous-file)
    (define-key map "\M-}" 'compilation-next-file)
    (define-key map "{" 'compilation-previous-file)
    (define-key map "}" 'compilation-next-file)
    map)
  "Keymap for `compilation-minor-mode'.")


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

(provide 'compile-)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; `compile-.el' ends here



reply via email to

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